Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jozan/new-static-site
A boilerplate for a new static site project
https://github.com/jozan/new-static-site
Last synced: 25 days ago
JSON representation
A boilerplate for a new static site project
- Host: GitHub
- URL: https://github.com/jozan/new-static-site
- Owner: jozan
- Created: 2014-12-23T14:42:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-22T23:15:26.000Z (almost 10 years ago)
- Last Synced: 2024-11-14T11:17:09.298Z (3 months ago)
- Language: CSS
- Size: 191 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [New Static Site](http://latehours.net)
A simple template for starting to develop static websites such as portfolio, landing page etc. This project utilizes customized [HTML5 Boilerplate](https://github.com/h5bp/html5-boilerplate) and handful of build scripts that ensure fast and iterative development and easy deployment.
## Project plans
Gulp will replace grunt in the future. Until that happens there will be no updates so don't hold your breath.## Quick start
1. Make sure you have latest Node.js and nginx installed in your machine
2. Clone repository: ```git clone https://github.com/jozan/new-static-site.git my-cat-pics```
3. Follow build instructions below
4. Configure nginx with the settings below#### Build
npm install -g grunt-cli bower
npm install && bower install
grunt1. Use node package manager ```npm``` to install ```grunt-cli``` and ```bower``` globally ```-g``` in your machine
2. Install required scripts and their dependecies decleared in ```package.json``` and ```bower.json```
3. Run ```grunt``` to build your site from source and deploy to ```public``` directory in the project rootWhen everything is ready to be published use ```grunt dist``` to minify HTML, CSS, JS, and images.
### Tips
- For continious development and to avoid running ```grunt``` separately after each save use ```grunt watch```. It detects modified files in ```src/``` and runs ```grunt``` automatically.
- Use [LiveReload](http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-) extension and forget constantly pressing refresh and enjoy the full benefits of ```grunt watch```.
- To have clean git history remove ```.git/``` in the project root and run ```git init``` to initialize new git repository.
- Build script compiles Jinja2 templates by default. Example of usage can be found in ```src/layout.html``` and ```src/index.html```. Albeit this project is meant to be used for static sites only, having templates is handy in many cases.### Project structure
After running ```npm install```, ```bower install```, and ```grunt``` your project structure looks like the following:
/new-static-site
|-- Gruntfile.js (Grunt configuration)
|-- README.md
|-- bower.json (Bower configuration)
|-- bower_components/
| `-- [ installed components by bower ]
|-- node_modules/
| `-- [ installed modules by npm ]
|-- package.json
|-- public/
| `-- [ files generated by grunt tasks, ready to be released ]
|-- src/
| `-- [ your working directory ]
`-- temp/
`-- [ temporary folder for grunt tasks, do not edit ]### Using with backend frameworks
Configure output path of ```copy:after``` in ```Gruntfile.js``` to match your framework's public path. Create views normally and configure ```hashres``` to check those files.
------------------------------
#### Nginx dev config
server {
listen 8089;
server_name new-project.tunk.io;
root /path/to/public;location = / {
rewrite ^ /index.html last;
}location / {
try_files $uri $uri.html =404;
}
}#### Nginx production config
#
# New Static Site (new-project.tunk.io)
#server {
listen 80;
server_name new-project.tunk.io;
return 301 $scheme://new-project.tunk.io$request_uri;
}server {
listen 80;root /var/www/new-static-site/public;
#index index.html;server_name new-project.tunk.io;
client_max_body_size 5M;
location = / {
rewrite ^ /index.html last;
}location / {
try_files $uri $uri.html =404;
}error_page 404 /404.html;
}## License
Copyright (c) 2014 Johan Ruokangas
License is yet to be decided.