Skip to content
Permalink
Browse files

Initial commit

  • Loading branch information...
chrisdmacrae committed Nov 28, 2017
0 parents commit b5a83ba30d40ef88934d3d5ee9658262441ac987
@@ -0,0 +1,7 @@
{
"presets": ["env"],
"plugins": [
"syntax-object-rest-spread",
"transform-object-rest-spread"
]
}
@@ -0,0 +1,101 @@
env:
browser: true

parser: babel-eslint

plugins: [ "import" ]

# enable ECMAScript features
ecmaFeatures:
arrowFunctions: true
binaryLiterals: true
blockBindings: true
classes: true
defaultParams: true
destructuring: true
forOf: true
generators: true
jsx: true
modules: true
objectLiteralShorthandMethods: true
objectLiteralShorthandProperties: true
octalLiterals: true
spread: true
templateStrings: true

rules:
# Possible Errors
# https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors
no-control-regex: 2
no-console: 0
no-debugger: 2
no-dupe-args: 2
no-dupe-keys: 2
no-duplicate-case: 2
no-empty-character-class: 2
no-ex-assign: 2
no-extra-boolean-cast : 2
no-extra-semi: 2
no-invalid-regexp: 2
no-irregular-whitespace: 1
no-proto: 2
no-unexpected-multiline: 2
no-unreachable: 2
valid-typeof: 2

# Best Practices
# https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
no-fallthrough: 2
no-redeclare: 2

# Stylistic Issues
# https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
comma-spacing: 2
eol-last: 2
eqeqeq: ["error", "smart"]
indent: [2, 2, {SwitchCase: 1}]
keyword-spacing: 2
max-len: [1, 160, 2]
new-parens: 2
no-mixed-spaces-and-tabs: 2
no-multiple-empty-lines: [2, {max: 2}]
no-trailing-spaces: 2
object-curly-spacing: [2, "never"]
quotes: [2, "double", "avoid-escape"]
semi: 0
space-before-blocks: [2, "always"]
space-before-function-paren: [2, "never"]
space-in-parens: [2, "never"]
space-infix-ops: 2
space-unary-ops: 2

# ECMAScript 6
# http://eslint.org/docs/rules/#ecmascript-6
arrow-parens: [2, "always"]
arrow-spacing: [2, {"before": true, "after": true}]
no-confusing-arrow: 2
prefer-const: 2

# JSX
jsx-quotes: [2, "prefer-double"]

# Import
import/no-unresolved: [1, {"commonjs": true, "amd": true}]
import/export: 2

# Strict Mode
# https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
strict: [2, "global"]

# Variables
# https://github.com/eslint/eslint/tree/master/docs/rules#variables
no-undef: 2
no-unused-vars: [2, {"args": "none"}]

# Global scoped method and vars
globals:
__dirname: true
require: true
process: true
ENV: true
module: true
@@ -0,0 +1,9 @@
# Don't commit system files or dependencies
*.DS_Store
node_modules/

# Ensure Jekyll builds aren't committed to Git
_site/
site/_site/
dist/
.tmp/
@@ -0,0 +1,15 @@
extends: stylelint-config-standard
rules:
string-quotes: double
no-duplicate-selectors: true
color-hex-case: lower
color-hex-length: long
selector-attribute-quotes: always
declaration-colon-space-before: never
property-no-vendor-prefix: true
value-no-vendor-prefix: true
number-leading-zero: always
function-url-quotes: always
at-rule-no-vendor-prefix: true
selector-no-vendor-prefix: true
media-feature-name-no-vendor-prefix: true
23 LICENSE
@@ -0,0 +1,23 @@
Copyright (c) 2017 Forestry <contact@forestry.io>

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

121 README.md
@@ -0,0 +1,121 @@
# Jekyll Boilerplate
**A Jekyll boilerplate for building modern websites 🌲**

This boilerplate wraps [Hugo](gohugo.io) with [Gulp](https://gulpjs.com/) & [Webpack](https://webpack.js.org/) as your asset pipeline.

[PostCSS](http://postcss.org/) and [Babel](https://babeljs.io/) are used for CSS and JS compiling & transpiling.

[BrowserSync](https://www.browsersync.io/) is used for providing a modern local development experience, allowing you to preview your site on multiple devices in sync.

# Installation

## Prerequisites
To use Gulp, you must have [Node](https://nodejs.org/en/download/) and [NPM](https://www.npmjs.com/get-npm) installed.

## Setup

Once the prerequisites are installed, clone the repository to your local machine, and then run:

```
npm install
```

This will install Hugo as well as all of the Node dependencies needed to run your Hugo environment. This may take a little while!

# Development
All development tasks are performed using npm run. See `"scripts"` in [package.json](/package.json) for a full list of commands.

## Local Development

Local development is powered by BrowserSync, you will be able to develop sites rapidly through:

- A local development server at `http://localhost:3000/`.
- Automatic CSS & JS updates without reloading the page
- Automatic page reloads when content is changed

Running the local development server is as simple as running:

```
npm start
```

*This will display all draft, future-dated, or expired content, which is not included in your production build.*

If you'd like to develop with the site as it will appear in production, run:

```
npm run preview
```

## Production Build

To generate a final production build on your local machine you can run:

```
npm run build
```
*The fresh production build of your site will end up in the `dist/` directory.*

# Project Structure
```
.
├── .tmp/ // Temporary directory for development server
├── dist/ // The production build
├── hugo/ // The Hugo project, with all content and static files
| ├── .forestry/ // Contains Forestry.io configuration files
| ├── data/ // TOML, YAML or JSON files containing site data
| ├── layouts/ // Your site's layouts
| ├──── partials/ // Your site's partials
| ├──── shortcodes/ // Your site's shortcodes
| ├── static/ // Where all static files live
| ├──── css/ // Where compiled CSS files live
| ├──── js/ // Where compiled JS files live
| ├──── uploads/ // Where user uploads are stored
| ├── config.toml // The Hugo configuration file
├── src/
| ├── css // CSS source files to be compiled to /css/
| ├── js // JS source files to be compiled to /js/
```

# Testing
This boilerplate comes with standard [ESLint](https://eslint.org/) and [StyleLint](https://github.com/stylelint/stylelint) configurations that will lint your CSS and JS for errors or common style issues, which work with most popular IDEs.

The tests can also be run from the command line:

- **JS:** `npm run eslint`
- **CSS:** `npm run stylelint`

If you want to automatically fix lint errors, you can do this from the command line as well:

- **JS:** `npm run eslint:fix`
- **CSS:** `npm run stylelint:fix`

# Cleanup

This boilerplate is self-cleaning, and will remove the production `dist/` and development `.tmp/` folders every time a command is run to ensure that their contents are always up to date.

# Tips & Resources

- To learn about how to develop with Hugo, see [Hugo's documentation](http://gohugo.io/getting-started/directory-structure/)
- To learn how to use Hugo's templating system, see the [documentation](http://gohugo.io/templates/introduction/)
- Static files should be stored in the `hugo/static/` folder as they should appear in the built site
*E.g, a CNAME file should be stored at `hugo/static/CNAME` to become `/CNAME`*
- Javascript files are compiled from the root of `src/js/` to `js/{filename}.js`
- Javascript can be written using ES6, supporting `require()` and `import` statements from npm run packages and local JS files
- CSS files are compiled from the root of `src/css/` to `css/{filename}.css`
- Import statements are resolved and included in the compiled CSS files
- For compatibility with Forestry or other CMSs, ensure that compiled CSS and JS files in the `hugo/` folder are always committed
- Environment variables are provided to your templates, which can be accessed in templates as follows: `{{ getenv "HUGO_ENV" }}`
- For development pipelines, this is equal to `development`
- For production pipelines, this is equal to `production`
- For Forestry's in-app preview feature, this is equal to `staging`

# Using with Forestry
This repository comes with basic example content pre-configured to work with Forestry, which you can use to start building your site.

- Fork this repository to your account
- [Sign up for a Forestry account](https://app.forestry.io/signup), and import this repository as an "Existing Site"
- When prompted for the "Project root", enter `hugo`

## Licensing
This boilerplate project is released under the [MIT license](/LICENSE).

0 comments on commit b5a83ba

Please sign in to comment.
You can’t perform that action at this time.