• Stars
    star
    135
  • Rank 269,297 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Create static websites with no build configuration.

lerna All Contributors

Create Static Site

Create static websites with no build configuration.

Overview

npx create-static-site my-site --template hugo
cd my-site
npm start

(npx comes with npm 5.2+ and higher)

Then open http://localhost:3000/ to see your app.

Creating a Static Site

Youโ€™ll need to have Node >= 6 on your local development machine. You can use nvm (macOS/Linux) or nvm-windows to easily switch Node versions between different projects.

To create a new app, run:

npx create-static-site my-site --template [template]

Replace [template] with either hugo or jekyll.

It will create a directory called my-site inside the current folder.
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

my-site
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ node_modules
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ static-scripts.config.js
โ”œโ”€โ”€ .browserslistrc
โ”œโ”€โ”€ .eslintrc.yml
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ .postcssrc.js
โ”œโ”€โ”€ .stylelintrc.yml
โ”œโ”€โ”€ site/ # Depends on the static site generator
โ””โ”€โ”€ src/
    โ”œโ”€โ”€ css/
    โ”‚   โ”œโ”€โ”€ styles.css
    โ”‚   โ””โ”€โ”€ imports
    โ”‚       โ””โ”€โ”€ resets.css
    โ”œโ”€โ”€ img/
    โ”‚   โ””โ”€โ”€ svg/
    โ”‚       โ”œโ”€โ”€ bitbucket.svg
    โ”‚       โ”œโ”€โ”€ github.svg
    โ”‚       โ””โ”€โ”€ gitlab.svg
    โ””โ”€โ”€ js/
        โ”œโ”€โ”€ scripts.js
        โ””โ”€โ”€ imports/
            โ””โ”€โ”€ index.js

No configuration or complicated folder structures, just the files you need to build your site.
Once the installation is done, you can open your project folder:

cd my-site

Inside the newly created project, you can run some built-in commands:

npm start or yarn start

Jekyll users will need to run bundle install first

Runs the app in development mode.
Open http://localhost:3000 to view it in the browser.

The page will automatically reload if you make changes to the code.

npm build or yarn build

Builds the site for production to the dist folder.

Philosophy

  • One Dependency: There is just one build dependency. It uses Webpack, Babel, ESLint, PostCSS, and other amazing projects, but provides a cohesive curated experience on top of them.

  • No Configuration Required: You don't need to configure anything. Reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.

  • No Lock-In: You can โ€œejectโ€ to a custom setup at any time. Run a single command, and all the configuration and build dependencies will be moved directly into your project, so you can pick up right where you left off.

What's Included?

Your environment will have everything you need to build a modern static website:

  • A Static Site Generator (Jekyll or Hugo)
  • Language extras beyond ES6, like object spread operator.
  • Autoprefixed CSS
  • Hassle-free updates for the above tools with a single dependency.

The tradeoff is that these tools are preconfigured to work in a specific way. If your project needs more customization, you can "eject" and customize it, but then you will need to maintain this configuration.

Static Sites

Static sites are websites built using static, unchanging files. Because the content is static, delivering it to users requires no server processing time. This feature makes static sites incredibly fast and performant.

Static site generators are the modern way of building static sites. They convert simple, text-based content files in static files ready for the web.

Theyโ€™re fantastic for developers because they are extremely fast, are built to work with version-control, and require little-to-no setup compared to existing monolithic CMS solutions like Wordpress.

Currently, create-static-site supports two static site generators:

  • Jekyll is the static site generator written in Ruby and created by GitHub founder, Tom Preston Werner.
  • Hugo is the static site generator written in GoLang and created by Steve Francia.

Contributing

We'd love to have your helping hand on create-static-site! See CONTRIBUTING.md for more information on what we're looking for and how to get started.

Contributors

Thanks goes to these wonderful people (emoji key):


chrisdmacrae

๐Ÿ’ฌ ๐Ÿ’ป ๐ŸŽจ ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿ‘€ ๐Ÿ“ข ๐Ÿ”ง โœ…

ncphillips

๐Ÿ’ฌ ๐Ÿ› ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿš‡ ๐Ÿ‘€ ๐Ÿ“ข โš ๏ธ ๐Ÿ”ง

Bryan Klein

๐Ÿ› ๐Ÿ“– ๐Ÿค”

Scott Gallant

๐Ÿ› ๐Ÿ“– ๐Ÿค”

DJ

๐Ÿ’ป ๐Ÿ› ๐Ÿ“

Sebastian Engels

๐Ÿ› ๐Ÿค” ๐Ÿ’ป ๐Ÿ“–

Adam

๐Ÿ›

This project follows the all-contributors specification. Contributions of any kind welcome!

Acknowledgements

This project is greatly inspired by the wonderful create-react-app project.

More Repositories

1

hugo-theme-novela

Novela, the simplest way to start publishing with Hugo and Forestry.
SCSS
361
star
2

forestry.io

Forestry.io website
HTML
279
star
3

ubuild-jekyll

A Jekyll theme designed to work with Forestry Blocks
HTML
273
star
4

portfolio-vuepress

Vuepress portfolio
Vue
193
star
5

jekyll-menus

A menus (site navigation) plugin for your Jekyll website that also works with https://forestry.io (Jekyll CMS)
Ruby
134
star
6

novela-hugo-starter

Novela, the simplest way to start publishing with Hugo and Forestry.
63
star
7

sawmill

A Hugo theme built for Forestry.io blocks
HTML
38
star
8

gatsby-starter-forestry

A gatsby starter site pre-configured for Forestry
JavaScript
29
star
9

cloudformation-templates

JAMStack templates for AWS CloudFormation
26
star
10

forestry-vscode

A Visual Studio Code extension for developing projects managed with Forestry.io
TypeScript
18
star
11

ubuild-hugo

HTML
12
star
12

hydeout-jekyll-starter

A starter using @FongAndrew's updated Hyde Theme called Hydeout for Jekyll and Forestry as a Content Manager. Demo Site:
HTML
11
star
13

next-blog-forestry

NextJS Blog Starter for Forestry
JavaScript
11
star
14

hyde-hugo-starter

A starter using @SPF13's ported Hyde Theme for Hugo and Forestry as a Content Manager. Demo Site:
10
star
15

markdown-it-kramdown-attrs

Kramdown style attributes for Common.js (Markdown-it)
JavaScript
8
star
16

ubuild-hugo-starter

8
star
17

ubuild-blocks

uBuild is a CSS toolkit for creating modular page components.
CSS
7
star
18

kross-hugo-starter

A portfolio template editable in Forestry
7
star
19

gatsby-theme-novela

TypeScript
4
star
20

demo-portfolio

A Jekyll version of the "Phantom" theme by HTML5 UP with the help of Andrew Banchich https://andrewbanchich.gitlab.io/Phantom-Jekyll-Theme
CSS
4
star
21

eleventy-base-forestry

Eleventy base blog starter for Forestry
HTML
4
star
22

create-observable-thunk

Provides a H.O.F. that wraps any function returning an Rx.Observable in a Thunk
TypeScript
3
star
23

hugo-parsa-forestry

Hugo Parsa Forestry Starter
3
star
24

markdown-it-preserve-newline

Preserve newlines on certain inline elements (like images.)
JavaScript
2
star
25

hugo-ananke-forestry

Hugo Ananke starter for Forestry
2
star
26

demo-site

This is a modified version Brian Rinaldi's Hugo site from https://github.com/remotesynth/Static-Site-Samples. Using it for testing forestry.io.
CSS
2
star
27

markdown-it-codeblock-type

Add `data-md-type` to your codeblocks for `md<->html`
JavaScript
2
star
28

hugo-northendlab-forestry

Hugo starter for Forestry CMS with Northelab theme
1
star
29

onprem-cloudformation-sample

Sample AWS CloudFormation for Forestry on-premise resources
1
star
30

casper3-hugo-starter

Hugo Casper 3 starter pre-configured for Forestry CMS
1
star
31

react-patterns-article

Code samples behind the React Patterns article.
TypeScript
1
star