Commit a5c7dc29 authored by Nichlas W. Andersen's avatar Nichlas W. Andersen
Browse files

first commit

parents
# Configures browser support for
# Webpack and PostCSS
# https://github.com/ai/browserslist
[production]
> 2%
last 2 major versions
ie >= 11
android >= 4.3.3
[development]
last 1 major versions
\ No newline at end of file
# Configures JS linting
# https://eslint.org/
# Add third-party configs
extends:
- eslint:recommended
- plugin:import/errors
- plugin:import/warnings
# Add third-party plugins
plugins:
- import
- compat
# Set target environment
env:
browser: true
# Add support for babel (ES6)
parser: babel-eslint
rules:
# Best Practices
# https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
no-fallthrough: 2
no-redeclare: 2
# Browser compatibility
compat/compat: error
# Webpack import support
import/default: 0
# 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: never
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
# 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"}]
# Browser compatibility
compat/compat: error
# Global scoped method and vars
globals:
__dirname: true
require: true
process: true
ENV: true
module: true
\ No newline at end of file
# Don't commit system files or dependencies
*.DS_Store
node_modules/
# Ensure Hugo builds aren't committed to Git
public/
site/public/
dist/
.tmp/
// Learn more about PostCSS:
// https://github.com/postcss/postcss
module.exports = function(ctx = {}) {
const file = ctx.file
const opts = ctx.options || {}
const isProduction = (opts.env === "production") || (process.env.NODE_ENV === "production")
return {
parser: "postcss-scss",
plugins: {
"precss": {},
"postcss-cssnext": {},
"cssnano": (isProduction) ? {autoprefixer: false} : false,
"laggard": {},
"postcss-reporter": {},
"postcss-browser-reporter": (isProduction) ? {} : false
}
}
}
\ No newline at end of file
# Configures CSS Linting
# https://stylelint.io/
extends:
- stylelint-config-standard
- stylelint-config-sass-guidelines
plugins:
- stylelint-scss
- stylelint-no-unsupported-browser-features
defaultSeverity: warning
rules:
plugin/no-unsupported-browser-features:
- true
- ignore: []
severity: warning
scss/at-extend-no-missing-placeholder: true
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.6.0"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
gem "jekyll-menus"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
ffi (1.9.18)
forwardable-extended (2.6.0)
jekyll (3.6.0)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 3)
safe_yaml (~> 1.0)
jekyll-feed (0.9.2)
jekyll (~> 3.3)
jekyll-menus (0.6.0)
jekyll (~> 3.1)
jekyll-sass-converter (1.5.0)
sass (~> 3.4)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
kramdown (1.15.0)
liquid (4.0.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
mercenary (0.3.6)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
public_suffix (3.0.0)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (2.2.1)
safe_yaml (1.0.4)
sass (3.5.1)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
PLATFORMS
ruby
DEPENDENCIES
jekyll (~> 3.6.0)
jekyll-feed (~> 0.6)
jekyll-menus
tzinfo-data
BUNDLED WITH
1.15.4
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.
# Jekyll Boilerplate
**A Jekyll boilerplate for building modern websites 🌲**
This boilerplate wraps [Jekyll](https://jekyllrb.com) with [Gulp](https://gulpjs.com/) as your local development build pipeline.
[PostCSS](http://postcss.org/) and [Webpack](https://webpack.js.org/) + [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.
[BrowsersList](https://github.com/ai/browserslist) is used for configuring Browser support.
[SVG Sprite](https://github.com/jkphl/svg-sprite) is used to generate an SVG Sprite.
# 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 Jekyll as well as all of the Node dependencies needed to run your Jekyll 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 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
├── site/ // The Jekyll project, with all content and static files
| ├── .forestry/ // Contains Forestry.io configuration files
| ├── _data/ // YAML files containing site data
| ├── _posts/ // Jekyll's built-in blogging content type
| ├── _layouts/ // Your theme layouts
| ├── _includes/ // Your theme partials
| ├── css/ // Where compiled CSS files live
| ├── js/ // Where compiled JS files live
| ├── img/ // Where theme images live
| ├── uploads/ // Where user uploads are stored
| ├── _config.yml // Production configuration settings
| ├── _development.yml // Settings for local development only
| ├── 404.md // Error page for your site
| └── index.md // Homepage of your site
└─── src/
├── css // CSS/SCSS source files to be compiled to /css/
└── js // JS source files to be compiled to /js/
```
# Inline SVG
Any SVGs found in `src/img/` will be combined into a single SVG Sprite at `site/svg/sprite.symbol.svg`.
This boilerplate comes with a simple include for using SVGs in your layouts. You can select an svg by passing in its ID.
```
{% comment %}
Using a logo stored at src/img/github.svg
{% endcomment %}
{% include svg.html id="github" class="optional-class" width="32" height="32" %}
```
**Note: the `class`, `width`, and `height` params are optional**
# 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.
If you wish to manually cleanup, run:
```
npm run clean
```
# Configuration
All build tasks are handled by Gulp and are located in `gulpfile.babel.js`. All parts of the build are configurable in discrete files to make management easy.
## Paths
All build source and destination paths can be configured from `static-scripts.config.js`.
## Jekyll
The build commands for Jekyll can be configured from `stat-cscripts.config.js`. Build commands are set based on the `NODE_ENV` environment variable. You can optionally load different args using the `GENERATOR_ARGS` environment variable.
Four options are available:
- `default`: the default build commands that are always run
- `development`: additional build commands for the development server
- `preview`: additional build commands for a production development server
- `production`: additional build commands for production builds
## BrowserSync Development Server
The configuration for BrowserSync is found in `.browsersyncrc.js`
## CSS/SASS
The configuration for PostCSS is found in `.postcssrc.js`
## Browser support
Both PostCSS and Webpack use `.browserslistrc` to decide on browser support when compiling.
# Tips & Resources
- To learn about how to develop with Jekyll, see [Jekyll's documentation](https://jekyllrb.com/docs/structure/)
- To learn how to use Jekyll's templating system, see the [documentation](https://jekyllrb.com/docs/templates/)
- Static files are any files stored in the `site/` directory *without* front matter.
- Static files should be stored in the `site/` folder as they should appear in the built site
*E.g, a CNAME file should be stored at `site/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 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 `site/` 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 `jekyll`
# Contributing
All contributions are welcome! Please see our [Code of Conduct](/.git/CODE_OF_CONDUCT.md) & [Support][/.github/SUPPORT.md] guidelines.
## Licensing
This boilerplate project is released under the [MIT license](/LICENSE).
This diff is collapsed.
{
"name": "blocks",
"version": "0.1.0",
"devDependencies": {
"static-scripts": "0.1.3-3"
},
"dependencies": {
"static-scripts": "0.1.3-3",
"gulp": "^3.9.1"
},
"scripts": {
"start": "static-scripts start",
"preview": "static-scripts preview",
"build": "static-scripts build",
"eject": "static-scripts eject"
}
}
\ No newline at end of file
---
hide_body: false
fields:
- name: layout
label: Layout
type: text
hidden: false
default: default
---
hide_body: false
fields:
- type: text
label: Title
name: title
config:
required: true
- type: datetime
label: Publish Date
name: date
description: Pages with a future publish date will not be published
---
hide_body: false
fields:
- type: text
name: title
label: Title
config:
required: true
- type: datetime
name: date
label: Publish Date
description: Posts with a future publish date will not be published
---
upload_path: "/uploads/:year:/:month:/:day:"
frontmatter_file_url_template: "/uploads/:year:/:month:/:day:"
body_file_url_template: "/uploads/:year:/:month:/:day:"
new_page_extension: md
auto_deploy: false
admin_path:
webhook_url:
collections:
---
layout: default
title: Page not found
---
## Page not found
[Go to the homepage](/ "Back to homepage")
\ No newline at end of file
title: My New Jekyll Site
author: Your Name
email: your-email@example.com
description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
keywords: # Keywords describing your site
- jekyll
- forestry.io
- static site
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # your site's origin, e.g. https://forestry.io
# Build settings
defaults:
- scope:
path: "" # an empty string here means all files in the project
values:
layout: "default" # this ensures all content renders with layouts/default.html
markdown: kramdown
gems:
- jekyll-feed
- jekyll-menus
# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
# exclude:
# - Gemfile
# - Gemfile.lock
# - node_modules
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/
# Development server config
# This config is only used for the development server
# No settings provided here will affect production builds
url: http://localhost:3000
host: localhost
port: 3000
\ No newline at end of file
---
main:
- identifier: home
url: "/"
weight: 1
title: Home
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment