mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
2 Commits
v4.2.1
...
url-drop-o
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed2d30dc88 | ||
|
|
3088032128 |
@@ -1,53 +1,33 @@
|
||||
version: "2"
|
||||
checks:
|
||||
argument-count:
|
||||
enabled: true
|
||||
config:
|
||||
threshold: 5
|
||||
file-lines:
|
||||
enabled: true
|
||||
config:
|
||||
threshold: 300
|
||||
method-complexity:
|
||||
enabled: true
|
||||
config:
|
||||
threshold: 15
|
||||
method-count:
|
||||
enabled: true
|
||||
config:
|
||||
threshold: 50
|
||||
method-lines:
|
||||
enabled: true
|
||||
config:
|
||||
threshold: 30
|
||||
plugins:
|
||||
engines:
|
||||
fixme:
|
||||
enabled: false
|
||||
rubocop:
|
||||
enabled: true
|
||||
channel: rubocop-0-60
|
||||
|
||||
exclude_patterns:
|
||||
- "*.*"
|
||||
- ".*"
|
||||
exclude_paths:
|
||||
- .codeclimate.yml
|
||||
- .gitignore
|
||||
- .rspec
|
||||
- .rubocop.yml
|
||||
- .travis.yml
|
||||
|
||||
- Gemfile
|
||||
- Gemfile.lock
|
||||
- CHANGELOG.{md,markdown,txt,textile}
|
||||
- CONTRIBUTING.{md,markdown,txt,textile}
|
||||
- readme.{md,markdown,txt,textile}
|
||||
- README.{md,markdown,txt,textile}
|
||||
- Readme.{md,markdown,txt,textile}
|
||||
- ReadMe.{md,markdown,txt,textile}
|
||||
- COPYING
|
||||
- LICENSE
|
||||
- Rakefile
|
||||
|
||||
- benchmark/
|
||||
- docs/
|
||||
- exe/
|
||||
- features/
|
||||
- rake/
|
||||
- rubocop/
|
||||
- script/
|
||||
- spec/
|
||||
- test/
|
||||
- vendor/
|
||||
- features/**/*
|
||||
- script/**/*
|
||||
- docs/**/*
|
||||
- spec/**/*
|
||||
- test/**/*
|
||||
- vendor/**/*
|
||||
|
||||
- lib/blank_template/
|
||||
- lib/site_template/
|
||||
- lib/theme_template/
|
||||
- lib/jekyll/mime.types
|
||||
- lib/jekyll/commands/serve/livereload_assets/livereload.js
|
||||
ratings:
|
||||
paths:
|
||||
- lib/**/*.rb
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
FROM ruby:2
|
||||
|
||||
# Avoid warnings by switching to noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
|
||||
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
|
||||
# will be updated to match your local UID/GID (when using the dockerFile property).
|
||||
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
# Configure apt and install packages
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install --no-install-recommends apt-utils dialog locales 2>&1 \
|
||||
# Verify git, process tools installed
|
||||
&& apt-get -y install git openssh-client iproute2 procps lsb-release \
|
||||
#
|
||||
# Install ruby-debug-ide and debase
|
||||
&& gem install ruby-debug-ide \
|
||||
&& gem install debase \
|
||||
#
|
||||
# Install node.js
|
||||
&& apt-get -y install curl software-properties-common \
|
||||
&& curl -sL https://deb.nodesource.com/setup_13.x | bash - \
|
||||
&& apt-get -y install nodejs \
|
||||
#
|
||||
# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
|
||||
&& groupadd --gid $USER_GID $USERNAME \
|
||||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
||||
# [Optional] Add sudo support for the non-root user
|
||||
&& apt-get install -y sudo \
|
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME \
|
||||
#
|
||||
# Clean up
|
||||
&& apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set the locale
|
||||
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
|
||||
dpkg-reconfigure --frontend=noninteractive locales && \
|
||||
update-locale LANG=en_US.UTF-8
|
||||
|
||||
ENV LANG en_US.UTF-8
|
||||
|
||||
# Switch back to dialog for any ad-hoc use of apt-get
|
||||
ENV DEBIAN_FRONTEND=dialog
|
||||
@@ -1,26 +0,0 @@
|
||||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.101.1/containers/ruby-2
|
||||
{
|
||||
"name": "Ruby 2",
|
||||
"dockerFile": "Dockerfile",
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"rebornix.Ruby"
|
||||
]
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
"postCreateCommand": "bundle install",
|
||||
|
||||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
|
||||
// "remoteUser": "vscode"
|
||||
|
||||
}
|
||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1 +0,0 @@
|
||||
* text=auto
|
||||
86
.github/CODEOWNERS
vendored
86
.github/CODEOWNERS
vendored
@@ -1,86 +0,0 @@
|
||||
# The Jekyll project has 6 affinity teams, shown here: https://teams.jekyllrb.com/
|
||||
# They are as follows:
|
||||
#
|
||||
# 1. @jekyll/build
|
||||
# 2. @jekyll/documentation
|
||||
# 3. @jekyll/ecosystem
|
||||
# 4. @jekyll/performance
|
||||
# 5. @jekyll/stability
|
||||
# 6. @jekyll/windows
|
||||
#
|
||||
# Each of these teams has a mission. Wherever possible, GitHub should
|
||||
# automatically require review from these teams on the pieces of the
|
||||
# repository they maintain.
|
||||
|
||||
# @jekyll/documentation
|
||||
/docs/ @jekyll/documentation
|
||||
|
||||
# @jekyll/build
|
||||
/exe/ @jekyll/build
|
||||
/lib/jekyll.rb @jekyll/build
|
||||
/lib/jekyll/cleaner.rb @jekyll/build
|
||||
/lib/jekyll/collection.rb @jekyll/build
|
||||
/lib/jekyll/command.rb @jekyll/build
|
||||
/lib/jekyll/commands/ @jekyll/build
|
||||
/lib/jekyll/converter.rb @jekyll/build
|
||||
/lib/jekyll/converters/ @jekyll/build
|
||||
/lib/jekyll/convertible.rb @jekyll/build
|
||||
/lib/jekyll/document.rb @jekyll/build
|
||||
/lib/jekyll/drops/ @jekyll/build
|
||||
/lib/jekyll/entry_filter.rb @jekyll/build
|
||||
/lib/jekyll/errors.rb @jekyll/build
|
||||
/lib/jekyll/excerpt.rb @jekyll/build
|
||||
/lib/jekyll/filters/ @jekyll/build
|
||||
/lib/jekyll/filters.rb @jekyll/build
|
||||
/lib/jekyll/layout.rb @jekyll/build
|
||||
/lib/jekyll/liquid_extensions.rb @jekyll/build
|
||||
/lib/jekyll/liquid_renderer/ @jekyll/build
|
||||
/lib/jekyll/liquid_renderer.rb @jekyll/build
|
||||
/lib/jekyll/log_adapter.rb @jekyll/build
|
||||
/lib/jekyll/mime.types @jekyll/build
|
||||
/lib/jekyll/page.rb @jekyll/build
|
||||
/lib/jekyll/publisher.rb @jekyll/build
|
||||
/lib/jekyll/reader.rb @jekyll/build
|
||||
/lib/jekyll/readers/ @jekyll/build
|
||||
/lib/jekyll/regenerator.rb @jekyll/build
|
||||
/lib/jekyll/related_posts.rb @jekyll/build
|
||||
/lib/jekyll/renderer.rb @jekyll/build
|
||||
/lib/jekyll/site.rb @jekyll/build
|
||||
/lib/jekyll/static_file.rb @jekyll/build
|
||||
/lib/jekyll/stevenson.rb @jekyll/build
|
||||
/lib/jekyll/tags/ @jekyll/build
|
||||
/lib/jekyll/url.rb @jekyll/build
|
||||
/lib/jekyll/utils/ @jekyll/build
|
||||
/lib/jekyll/utils.rb @jekyll/build
|
||||
|
||||
# @jekyll/ecosystem
|
||||
/lib/jekyll/external.rb @jekyll/ecosystem
|
||||
/lib/jekyll/generator.rb @jekyll/ecosystem
|
||||
/lib/jekyll/hooks.rb @jekyll/ecosystem
|
||||
/lib/jekyll/plugin.rb @jekyll/ecosystem
|
||||
/lib/jekyll/plugin_manager.rb @jekyll/ecosystem
|
||||
/lib/jekyll/theme.rb @jekyll/ecosystem
|
||||
/lib/jekyll/theme_builder.rb @jekyll/ecosystem
|
||||
|
||||
# @jekyll/stability
|
||||
Gemfile @jekyll/stability
|
||||
*.gemspec @jekyll/stability
|
||||
.travis.yml @jekyll/stability
|
||||
appveyor.yml @jekyll/stability
|
||||
/lib/jekyll/configuration.rb @jekyll/stability
|
||||
/lib/jekyll/deprecator.rb @jekyll/stability
|
||||
/lib/jekyll/frontmatter_defaults.rb @jekyll/stability
|
||||
/lib/site_template @jekyll/stability
|
||||
/lib/theme_template @jekyll/stability
|
||||
/features/ @jekyll/stability
|
||||
/test/ @jekyll/stability
|
||||
|
||||
# Special cases
|
||||
.github/ @jekyll/affinity-team-captains
|
||||
CODE_OF_CONDUCT.markdown @jekyll/affinity-team-captains
|
||||
History.markdown @jekyll/affinity-team-captains
|
||||
LICENSE @jekyll/affinity-team-captains # This file should never change.
|
||||
README.markdown @jekyll/affinity-team-captains
|
||||
/lib/jekyll/version.rb @jekyll/affinity-team-captains
|
||||
/rake/ @jekyll/affinity-team-captains
|
||||
/script/ @jekyll/affinity-team-captains
|
||||
72
.github/CONTRIBUTING.markdown
vendored
72
.github/CONTRIBUTING.markdown
vendored
@@ -4,30 +4,33 @@ Hi there! Interested in contributing to Jekyll? We'd love your help. Jekyll is a
|
||||
|
||||
## Where to get help or report a problem
|
||||
|
||||
See the [support guidelines](https://jekyllrb.com/docs/support/)
|
||||
* If you have a question about using Jekyll, start a discussion on [Jekyll Talk](https://talk.jekyllrb.com).
|
||||
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
|
||||
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
|
||||
* More resources are listed on our [Help page](https://jekyllrb.com/help/).
|
||||
|
||||
## Ways to contribute
|
||||
|
||||
Whether you're a developer, a designer, or just a Jekyll devotee, there are lots of ways to contribute. Here's a few ideas:
|
||||
|
||||
- [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know.
|
||||
- Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better?
|
||||
- Read through the [documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved.
|
||||
- Browse through the [Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing.
|
||||
- Find an [open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions.
|
||||
- Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed.
|
||||
* [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know.
|
||||
* Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better?
|
||||
* Read through [the documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved.
|
||||
* Browse through [the Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing.
|
||||
* Find [an open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions.
|
||||
* Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed.
|
||||
|
||||
## Submitting a pull request
|
||||
|
||||
### Pull requests generally
|
||||
|
||||
- The smaller the proposed change, the better. If you'd like to propose two unrelated changes, submit two pull requests.
|
||||
* The smaller the proposed change, the better. If you'd like to propose two unrelated changes, submit two pull requests.
|
||||
|
||||
- The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
|
||||
* The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
|
||||
|
||||
- If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
|
||||
* Pull requests are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
|
||||
|
||||
- If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
|
||||
* If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
|
||||
|
||||
### Submitting a pull request via github.com
|
||||
|
||||
@@ -49,7 +52,7 @@ That's it! You'll be automatically subscribed to receive updates as others revie
|
||||
2. Clone the repository locally `git clone https://github.com/<you-username>/jekyll`.
|
||||
3. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
|
||||
4. Hack away, add tests. Not necessarily in that order.
|
||||
5. Make sure everything still passes by running `script/cibuild` (see the [tests section](#running-tests-locally) below)
|
||||
5. Make sure everything still passes by running `script/cibuild` (see [the tests section](#running-tests-locally) below)
|
||||
6. Push the branch up ( `git push origin my-awesome-feature` ).
|
||||
7. Create a pull request by visiting `https://github.com/<your-username>/jekyll` and following the instructions at the top of the screen.
|
||||
|
||||
@@ -76,12 +79,11 @@ If you ever need to update our documentation with an icon that is not already av
|
||||
5. Click `Generate Font` on the bottom-horizontal-bar.
|
||||
6. Inspect the included icons and proceed by clicking `Download`.
|
||||
7. Extract the font files and adapt the CSS to the paths we use in Jekyll:
|
||||
|
||||
- Copy the entire `fonts` directory over and overwrite existing ones at `<jekyll>/docs/`.
|
||||
- Copy the contents of `selection.json` and overwrite existing content inside `<jekyll>/docs/icomoon-selection.json`.
|
||||
- Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the
|
||||
- Copy the entire `fonts` directory over and overwrite existing ones at `<jekyll>/docs/`.
|
||||
- Copy the contents of `selection.json` and overwrite existing content inside `<jekyll>/docs/icomoon-selection.json`.
|
||||
- Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the
|
||||
`<jekyll>/docs/_sass/_font-awesome.scss` sass partial.
|
||||
- Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so:
|
||||
- Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so:
|
||||
`('../fonts/Fontawesome.woff?9h6hxj')`.
|
||||
|
||||
### Adding plugins
|
||||
@@ -90,7 +92,7 @@ If you want to add your plugin to the [list of plugins](https://jekyllrb.com/doc
|
||||
|
||||
## Code Contributions
|
||||
|
||||
Interested in submitting a pull request? Awesome. Read on. There's a few common gotchas that we'd love to help you avoid.
|
||||
Interesting in submitting a pull request? Awesome. Read on. There's a few common gotchas that we'd love to help you avoid.
|
||||
|
||||
### Tests and documentation
|
||||
|
||||
@@ -102,21 +104,15 @@ If your contribution changes any Jekyll behavior, make sure to update the docume
|
||||
|
||||
#### Tests
|
||||
|
||||
- If you're creating a small fix or patch to an existing feature, a simple test is more than enough. You can usually copy/paste from an existing example in the `tests` folder, but if you need you can find out about our tests suites [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and [RSpec-Mocks](https://github.com/rspec/rspec-mocks).
|
||||
* If you're creating a small fix or patch to an existing feature, a simple test is more than enough. You can usually copy/paste from an existing example in the `tests` folder, but if you need you can find out about our tests suites [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and [RSpec-Mocks](https://github.com/rspec/rspec-mocks).
|
||||
|
||||
- If it's a brand new feature, create a new [Cucumber](https://github.com/cucumber/cucumber/) feature, reusing existing steps where appropriate.
|
||||
* If it's a brand new feature, create a new [Cucumber](https://github.com/cucumber/cucumber/) feature, reusing existing steps where appropriate.
|
||||
|
||||
### Code contributions generally
|
||||
|
||||
- Jekyll uses the [Rubocop](https://github.com/bbatsov/rubocop) static analyzer to ensure that contributions follow the [GitHub Ruby Styleguide](https://github.com/styleguide/ruby). Please check your code using `script/fmt` and resolve any errors before pushing your branch.
|
||||
* Jekyll uses the [Rubocop](https://github.com/bbatsov/rubocop) static analyzer to ensure that contributions follow the [GitHub Ruby Styleguide](https://github.com/styleguide/ruby). Please check your code using `script/fmt` and resolve any errors before pushing your branch.
|
||||
|
||||
- Don't bump the Gem version in your pull request (if you don't know what that means, you probably didn't).
|
||||
|
||||
- You can use the command `script/console` to start a REPL to explore the result of
|
||||
Jekyll's methods. It also provides you with helpful methods to quickly create a
|
||||
site or configuration. [Feel free to check it out!](https://github.com/jekyll/jekyll/blob/master/script/console)
|
||||
|
||||
- Previously, we've used the WIP Probot app to help contributors determine whether their pull request is ready for review. Please use a [draft pull request](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests) instead. When you're ready, [mark the pull request as ready for review](https://help.github.com/en/articles/changing-the-stage-of-a-pull-request)
|
||||
* Don't bump the Gem version in your pull request (if you don't know what that means, you probably didn't).
|
||||
|
||||
## Running tests locally
|
||||
|
||||
@@ -124,35 +120,23 @@ If your contribution changes any Jekyll behavior, make sure to update the docume
|
||||
|
||||
To run the test suite and build the gem you'll need to install Jekyll's dependencies by running the following command:
|
||||
|
||||
```sh
|
||||
script/bootstrap
|
||||
```
|
||||
<pre class="highlight"><code>$ script/bootstrap</code></pre>
|
||||
|
||||
Before you make any changes, run the tests and make sure that they pass (to confirm your environment is configured properly):
|
||||
|
||||
```sh
|
||||
script/cibuild
|
||||
```
|
||||
<pre class="highlight"><code>$ script/cibuild</code></pre>
|
||||
|
||||
If you are only updating a file in `test/`, you can use the command:
|
||||
|
||||
```sh
|
||||
script/test test/blah_test.rb
|
||||
```
|
||||
<pre class="highlight"><code>$ script/test test/blah_test.rb</code></pre>
|
||||
|
||||
If you are only updating a `.feature` file, you can use the command:
|
||||
|
||||
```sh
|
||||
script/cucumber features/blah.feature
|
||||
```
|
||||
<pre class="highlight"><code>$ script/cucumber features/blah.feature</code></pre>
|
||||
|
||||
Both `script/test` and `script/cucumber` can be run without arguments to
|
||||
run its entire respective suite.
|
||||
|
||||
## Visual Studio Code Development Container
|
||||
|
||||
If you've got [Visual Studio Code](https://code.visualstudio.com/) with the [Remote Development Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) installed then simply opening this repository in Visual Studio Code and following the prompts to "Re-open In A Development Container" will get you setup and ready to go with a fresh environment with all the requirements installed.
|
||||
|
||||
## A thank you
|
||||
|
||||
Thanks! Hacking on Jekyll should be fun. If you find any of this hard to figure out, let us know so we can improve our process or documentation!
|
||||
|
||||
5
.github/FUNDING.yml
vendored
5
.github/FUNDING.yml
vendored
@@ -1,5 +0,0 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
# github: jekyll
|
||||
open_collective: jekyll
|
||||
tidelift: rubygems/jekyll
|
||||
83
.github/ISSUE_TEMPLATE.md
vendored
Normal file
83
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
<!--
|
||||
Hi! Thanks for considering to file a bug with Jekyll. Please take the time to
|
||||
answer the basic questions. You can convert `[ ]` into `[x]` to check boxes (or submit
|
||||
and check.) If there is no need for certain fields like output and redirection, please delete
|
||||
those headers before submitting. We know not all tickets require those steps.
|
||||
Otherwise, please try to be as detailed as possible.
|
||||
|
||||
If you are unsure this is a bug in Jekyll, or this is a bug caused
|
||||
by a plugin that isn't directly related to Jekyll, or if this is just
|
||||
a generic usage question, please consider asking your question at
|
||||
https://talk.jekyllrb.com where non-bug questions go.
|
||||
|
||||
Please make sure to mention an affinity team whose responsibilities
|
||||
most closely align with your issue.
|
||||
|
||||
Thanks!
|
||||
-->
|
||||
|
||||
- [ ] I believe this to be a bug, not a question about using Jekyll.
|
||||
- [ ] I updated to the latest Jekyll (or) if on GitHub Pages to the latest `github-pages`
|
||||
- [ ] I ran `jekyll doctor` to check my configuration
|
||||
- [ ] I read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/
|
||||
- [ ] This is a feature request.
|
||||
|
||||
---
|
||||
|
||||
- [ ] I am on (or have tested on) ***macOS*** 10+
|
||||
- [ ] I am on (or have tested on) ***Debian/Ubuntu*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Fedora*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Arch*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Other*** GNU/Linux
|
||||
- [ ] I am on (or have tested on) ***Windows*** 10+
|
||||
|
||||
<!--
|
||||
Other GNU/Linux includes Scientific GNU/Linux, CentOS GNU/Linux, and others.
|
||||
If you are on a minor sub-distro (such as ElementaryOS which does not diverge from
|
||||
Ubuntu much, please check the parent distro. Kubuntu, Edubuntu, Lubuntu should
|
||||
also be flagged as Ubuntu as their packages come from upstream Ubuntu.
|
||||
-->
|
||||
|
||||
---
|
||||
|
||||
- [ ] I was trying to install.
|
||||
- [ ] There is a broken Plugin API.
|
||||
- [ ] I had an error on GitHub Pages, and I have reproduced it locally.
|
||||
- [ ] I had an error on GitHub Pages, and GitHub Support said it was a Jekyll Bug.
|
||||
- [ ] I had an error on GitHub Pages and I did not test it locally.
|
||||
- [ ] I was trying to build.
|
||||
- [ ] It was another bug.
|
||||
|
||||
## My Reproduction Steps
|
||||
|
||||
<!--
|
||||
If this error occured on GitHub Pages, please try to provide us with logs,
|
||||
and look at them yourself, to determine if this is an actual Jekyll bug. In
|
||||
the event you are unsure, file a ticket, however, when you do please provide
|
||||
the logs (strip them of personal information.)
|
||||
|
||||
If you have trouble finding your logs, please email support@github.com and
|
||||
they will happily help you. If you cannot find logs, please try your best to
|
||||
replicate it locally because we cannot fix a problem if we do not know
|
||||
exactly what caused it, or within a relatively close distance.
|
||||
-->
|
||||
|
||||
<!--
|
||||
Insert the steps you took to for this problem to exist. Such as the
|
||||
directories you created and, the full command you ran, and include any
|
||||
plugins you have installed, this is very important.
|
||||
|
||||
If your steps are complicated, you can also submit a GitHub
|
||||
repository (please no zips, they will be removed and rejected by maintainers,)
|
||||
and just supply a command for us to reproduce it ourselves.
|
||||
-->
|
||||
|
||||
## The Output I Wanted
|
||||
|
||||
<!--
|
||||
Insert the output from the command. Alter it as little as you can.
|
||||
The minimum should be personal information. Though we normally don't log
|
||||
anything like that so there should be no need to alter it.
|
||||
-->
|
||||
|
||||
/cc include any Jekyll affinity teams here (see https://teams.jekyllrb.com/ for more info)
|
||||
71
.github/ISSUE_TEMPLATE/bug_report.md
vendored
71
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,71 +0,0 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Is something not working as expected?
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Hi! Thanks for considering to file a bug with Jekyll. Please take the time to
|
||||
answer the basic questions. Please try to be as detailed as possible.
|
||||
|
||||
If you are unsure this is a bug in Jekyll, or this is a bug caused
|
||||
by a plugin that isn't directly related to Jekyll, or if this is just
|
||||
a generic usage question, please consider asking your question at
|
||||
https://talk.jekyllrb.com where non-bug questions go.
|
||||
|
||||
Thanks!
|
||||
-->
|
||||
|
||||
<!--
|
||||
Make sure that you've done all of these. If you're sure that the bug you're
|
||||
reporting is only apparent in a previous version of Jekyll, please say so explicitly
|
||||
in your description.
|
||||
|
||||
- I updated to the latest Jekyll (or) if on GitHub Pages to the latest `github-pages`
|
||||
- I ran `jekyll doctor` to check my configuration
|
||||
- I read the contributing document at https://jekyllrb.com/docs/contributing/
|
||||
-->
|
||||
|
||||
## My Environment
|
||||
|
||||
<!--
|
||||
Replace the values in the Version(s) column with the ones in your build. If you're not
|
||||
using `github-pages`, just replace it with "No".
|
||||
-->
|
||||
|
||||
| Software | Version(s) |
|
||||
| ---------------- | ---------- |
|
||||
| Operating System | |
|
||||
| `jekyll` | Latest |
|
||||
| `github-pages` | Latest |
|
||||
|
||||
---
|
||||
|
||||
## Expected Behaviour
|
||||
|
||||
<!--
|
||||
What is it you expected to happen? This should be a description of how the
|
||||
functionality you tried to use is supposed to work.
|
||||
-->
|
||||
|
||||
## Current Behavior
|
||||
|
||||
<!--
|
||||
Describe the details of the bug. Be sure to include any steps you took for the
|
||||
problem to exist, such as the directories you created and the full command
|
||||
you ran. Include any plugins you have installed (this is very important!).
|
||||
|
||||
You can include any logs you think relevant here. If you're using GitHub pages
|
||||
and you're not sure where your logs are, please email support@github.com and
|
||||
they will happily help you.
|
||||
-->
|
||||
|
||||
## Code Sample
|
||||
|
||||
<!--
|
||||
Please provide a code repository, gist, code snippet or sample files to
|
||||
reproduce the issue.
|
||||
-->
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Jekyll Community Forum
|
||||
url: https://talk.jekyllrb.com/
|
||||
about: Please ask and answer questions here.
|
||||
24
.github/ISSUE_TEMPLATE/documentation.md
vendored
24
.github/ISSUE_TEMPLATE/documentation.md
vendored
@@ -1,24 +0,0 @@
|
||||
---
|
||||
name: Documentation
|
||||
about: Found a typo or something that isn't crystal clear in our docs?
|
||||
title: 'docs: '
|
||||
labels: documentation
|
||||
assignees: DirtyF
|
||||
|
||||
---
|
||||
|
||||
<!-- Thanks for taking the time to open an issue and help us make Jekyll better! -->
|
||||
|
||||
## Motivation
|
||||
|
||||
<!-- Why should we update our docs? -->
|
||||
|
||||
|
||||
|
||||
## Suggestion
|
||||
|
||||
<!-- What should we do instead? -->
|
||||
|
||||
|
||||
|
||||
<!-- Thanks for taking the time to open an issue and help us make Jekyll better! -->
|
||||
73
.github/ISSUE_TEMPLATE/feature_request.md
vendored
73
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,73 +0,0 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Want us to add any features to Jekyll?
|
||||
title: 'feat: '
|
||||
labels: feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Hi! Thanks for considering to file a feature request with Jekyll. Please take the time to
|
||||
answer the basic questions. Please try to be as detailed as possible.
|
||||
|
||||
Thanks!
|
||||
-->
|
||||
|
||||
## Summary
|
||||
|
||||
<!--
|
||||
A one-paragraph explanation of the feature.
|
||||
-->
|
||||
|
||||
## Motivation
|
||||
|
||||
<!--
|
||||
Why do you want to see this feature in Jekyll? What makes you sure that it should not be
|
||||
implemented at the plugin level, but in Jekyll core? What use cases does it support?
|
||||
|
||||
NOTE: Please be mindful of the Jekyll philosophy (https://jekyllrb.com/philosophy/),
|
||||
particularily Section 5. Think about if 90% of the users would benefit from your
|
||||
feature request, and whether your feature would be better off in a plugin.
|
||||
-->
|
||||
|
||||
## Guide-level explanation
|
||||
|
||||
<!--
|
||||
Explain the proposal as if it was already included in the project and you
|
||||
were teaching it to another programmer. That generally means:
|
||||
|
||||
- Introducing new named concepts.
|
||||
- Explaining the feature largely in terms of examples.
|
||||
- If applicable, provide sample error messages, deprecation warnings, or
|
||||
migration guidance.
|
||||
|
||||
If this is a small feature, you may omit this section.
|
||||
-->
|
||||
|
||||
## Reference-level explanation
|
||||
|
||||
<!--
|
||||
This is the technical portion of the feature request. Explain the design in
|
||||
sufficient detail that:
|
||||
|
||||
- Its interaction with other features is clear.
|
||||
- It is reasonably clear how the feature would be implemented.
|
||||
- Corner cases are dissected by example.
|
||||
|
||||
If you do not know how to answer this, you can omit it. No worries!
|
||||
-->
|
||||
|
||||
## Drawbacks
|
||||
|
||||
<!--
|
||||
Why should we *not* do this?
|
||||
-->
|
||||
|
||||
## Unresolved Questions
|
||||
|
||||
<!--
|
||||
What related issues do you consider out of scope for this feature that could be
|
||||
addressed in the future independently of the solution that comes out of this
|
||||
feature?
|
||||
-->
|
||||
46
.github/PULL_REQUEST_TEMPLATE.md
vendored
46
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,46 +0,0 @@
|
||||
<!--
|
||||
Thanks for creating a Pull Request! Before you submit, please make sure
|
||||
you've done the following:
|
||||
|
||||
- I read the contributing document at https://jekyllrb.com/docs/contributing/
|
||||
-->
|
||||
|
||||
<!--
|
||||
Make our lives easier! Choose one of the following by uncommenting it:
|
||||
-->
|
||||
|
||||
<!-- This is a 🐛 bug fix. -->
|
||||
<!-- This is a 🙋 feature or enhancement. -->
|
||||
<!-- This is a 🔦 documentation change. -->
|
||||
<!-- This is a 🔨 code refactoring. -->
|
||||
|
||||
<!--
|
||||
Before you submit this pull request, make sure to have a look at the following
|
||||
checklist. If you don't know how to do some of these, that's fine! Submit
|
||||
your pull request and we will help you out on the way.
|
||||
|
||||
- I've added tests (if it's a bug, feature or enhancement)
|
||||
- I've adjusted the documentation (if it's a feature or enhancement)
|
||||
- The test suite passes locally (run `script/cibuild` to verify this)
|
||||
-->
|
||||
|
||||
## Summary
|
||||
|
||||
<!--
|
||||
Provide a description of what your pull request changes.
|
||||
-->
|
||||
|
||||
## Context
|
||||
|
||||
<!--
|
||||
Is this related to any GitHub issue(s)?
|
||||
|
||||
You can use keywords to automatically close the related issue.
|
||||
For example, (all of) the following will close issue #4567 when your PR is merged.
|
||||
|
||||
Closes #4567
|
||||
Fixes #4567
|
||||
Resolves #4567
|
||||
|
||||
Use any one of the above as applicable.
|
||||
-->
|
||||
20
.github/SUPPORT.markdown
vendored
20
.github/SUPPORT.markdown
vendored
@@ -1,20 +0,0 @@
|
||||
# Jekyll Support
|
||||
|
||||
## Getting Help
|
||||
|
||||
**Jekyll's issue tracker is not a support forum.**
|
||||
|
||||
If you're looking for support for Jekyll, there are a lot of options:
|
||||
|
||||
* Read [Jekyll Documentation](https://jekyllrb.com/docs/home/)
|
||||
* If you have a question about using Jekyll, start a discussion on [Jekyll Forum](https://talk.jekyllrb.com/) or [StackOverflow](https://stackoverflow.com/questions/tagged/jekyll)
|
||||
* Chat with Jekyllers — Join [our Gitter channel](https://gitter.im/jekyll/jekyll) or [our IRC channel on Freenode](irc:irc.freenode.net/jekyll)
|
||||
|
||||
There are a bunch of helpful community members on these services that should be willing to point you in the right direction.
|
||||
|
||||
## Report a bug
|
||||
|
||||
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository — First [look for the plugin on rubygems](https://rubygems.org/) then click on the `Homepage` link to access the plugin repository.
|
||||
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
|
||||
|
||||
Happy Jekyllin'!
|
||||
15
.github/config.yml
vendored
15
.github/config.yml
vendored
@@ -1,15 +0,0 @@
|
||||
updateDocsComment: >
|
||||
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update some of our documentation based on your changes.
|
||||
|
||||
updateDocsWhiteList:
|
||||
- bug
|
||||
- fix
|
||||
- Backport
|
||||
- dev
|
||||
- Update
|
||||
- WIP
|
||||
- chore
|
||||
|
||||
updateDocsTargetFiles:
|
||||
- README
|
||||
- docs/
|
||||
44
.github/first-timers-issue-template.md
vendored
44
.github/first-timers-issue-template.md
vendored
@@ -1,44 +0,0 @@
|
||||
### 🆕🐥☝ First Timers Only.
|
||||
|
||||
This issue is reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝
|
||||
|
||||
[About First Timers Only](http://www.firsttimersonly.com/).
|
||||
|
||||
### 🤔 What you will need to know.
|
||||
|
||||
Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.
|
||||
|
||||
### 📋 Step by Step
|
||||
|
||||
- [ ] 👌 **Join the team**: Add yourself to a Jekyll affinity team.
|
||||
|
||||
Go to [teams.jekyllrb.com](https://teams.jekyllrb.com/) and join a team that best fits your interests. Once you click the link to join a team, you will soon receive an email inviting you to join the Jekyll organization.
|
||||
|
||||
- [ ] 🙋 **Claim this issue**: Comment below.
|
||||
|
||||
Leave a comment that you have claimed this issue.
|
||||
|
||||
- [ ] 📝 **Update** the file [$FILENAME]($BRANCH_URL) in the `$REPO` repository (press the little pen Icon) and edit the line as shown below.
|
||||
|
||||
|
||||
```diff
|
||||
$DIFF
|
||||
```
|
||||
|
||||
|
||||
- [ ] 💾 **Commit** your changes
|
||||
|
||||
- [ ] 🔀 **Start a Pull Request**. There are two ways how you can start a pull request:
|
||||
|
||||
1. If you are familiar with the terminal or would like to learn it, [here is a great tutorial](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github) on how to send a pull request using the terminal.
|
||||
|
||||
2. You can [edit files directly in your browser](https://help.github.com/articles/editing-files-in-your-repository/)
|
||||
|
||||
- [ ] 🏁 **Done** Ask in comments for a review :)
|
||||
|
||||
### 🤔❓ Questions
|
||||
|
||||
Leave a comment below!
|
||||
|
||||
|
||||
This issue was created by [First-Timers-Bot](https://github.com/hoodiehq/first-timers-bot).
|
||||
6
.github/first-timers.yml
vendored
6
.github/first-timers.yml
vendored
@@ -1,6 +0,0 @@
|
||||
repository: jekyll
|
||||
labels:
|
||||
- good first issue
|
||||
- help-wanted
|
||||
- first-time-only
|
||||
template: .github/first-timers-issue-template.md
|
||||
14
.github/workflows/actions/memprof.rb
vendored
14
.github/workflows/actions/memprof.rb
vendored
@@ -1,14 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'jekyll'
|
||||
require 'memory_profiler'
|
||||
|
||||
MemoryProfiler.report(allow_files: ['lib/jekyll/', 'lib/jekyll.rb']) do
|
||||
Jekyll::PluginManager.require_from_bundler
|
||||
Jekyll::Commands::Build.process({
|
||||
"source" => File.expand_path(ARGV[0]),
|
||||
"destination" => File.expand_path("#{ARGV[0]}/_site"),
|
||||
"disable_disk_cache" => true,
|
||||
})
|
||||
puts ''
|
||||
end.pretty_print(scale_bytes: true, normalize_paths: true)
|
||||
85
.github/workflows/ci.yml
vendored
85
.github/workflows/ci.yml
vendored
@@ -1,85 +0,0 @@
|
||||
name: Continuous Integration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 4.2-stable
|
||||
pull_request:
|
||||
branches:
|
||||
- 4.2-stable
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
||||
name: 'Ruby ${{ matrix.ruby_version }}'
|
||||
runs-on: 'ubuntu-latest'
|
||||
env:
|
||||
CI: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby_version:
|
||||
- 2.5
|
||||
- 2.7
|
||||
- jruby-9.2.11.1
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 5
|
||||
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby_version }}
|
||||
bundler-cache: true
|
||||
- name: Run Unit Tests
|
||||
run: bash script/test
|
||||
- name: Run Cucumber Features
|
||||
run: bash script/cucumber
|
||||
- name: Sanity Check
|
||||
run: bash script/default-site
|
||||
|
||||
style_check:
|
||||
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
||||
name: 'Code Style Check (Ruby ${{ matrix.ruby_version }})'
|
||||
runs-on: 'ubuntu-latest'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby_version:
|
||||
- 2.5
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 5
|
||||
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby_version }}
|
||||
bundler-cache: true
|
||||
- name: Run RuboCop
|
||||
run: bash script/fmt
|
||||
|
||||
profile_docs:
|
||||
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
||||
name: 'Profile Docs Site (Ruby ${{ matrix.ruby_version }})'
|
||||
runs-on: 'ubuntu-latest'
|
||||
env:
|
||||
CI: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
ruby_version:
|
||||
- 2.5
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 5
|
||||
- name: "Set up Ruby ${{ matrix.ruby_version }}"
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby_version }}
|
||||
bundler-cache: true
|
||||
- name: Build Docs site with --profile
|
||||
run: bash script/profile-docs
|
||||
- name: Profile memory usage of building Docs site
|
||||
run: bash script/memprof
|
||||
59
.github/workflows/docs.yml
vendored
59
.github/workflows/docs.yml
vendored
@@ -1,59 +0,0 @@
|
||||
name: Build and deploy Jekyll documentation site
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
RUBY_VERSION: 2.7
|
||||
|
||||
jobs:
|
||||
deploy_docs:
|
||||
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
||||
runs-on: 'ubuntu-latest'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ env.RUBY_VERSION }}
|
||||
- name: Setup cache for Bundler
|
||||
id: cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gems-
|
||||
- name: Set up dependencies
|
||||
run: |
|
||||
bundle install --path=vendor/bundle --jobs 4 --retry 3
|
||||
bundle clean
|
||||
- name: Clone target branch
|
||||
run: |
|
||||
REMOTE_BRANCH="${REMOTE_BRANCH:-gh-pages}"
|
||||
REMOTE_REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
|
||||
|
||||
echo "Publishing to ${GITHUB_REPOSITORY} on branch ${REMOTE_BRANCH}"
|
||||
rm -rf docs/_site/
|
||||
git clone --depth=1 --branch="${REMOTE_BRANCH}" --single-branch --no-checkout \
|
||||
"${REMOTE_REPO}" docs/_site/
|
||||
- name: Build site
|
||||
run: bundle exec jekyll build --source docs --destination docs/_site --verbose --trace
|
||||
env:
|
||||
# For jekyll-github-metadata
|
||||
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Deploy to GitHub Pages
|
||||
run: |
|
||||
SOURCE_COMMIT="$(git log -1 --pretty="%an: %B" "$GITHUB_SHA")"
|
||||
pushd docs/_site &>/dev/null
|
||||
: > .nojekyll
|
||||
|
||||
git add --all
|
||||
git -c user.name="${GITHUB_ACTOR}" -c user.email="${GITHUB_ACTOR}@users.noreply.github.com" \
|
||||
commit --quiet \
|
||||
--message "Deploy docs from ${GITHUB_SHA}" \
|
||||
--message "$SOURCE_COMMIT"
|
||||
git push
|
||||
|
||||
popd &>/dev/null
|
||||
42
.github/workflows/third-party.yml
vendored
42
.github/workflows/third-party.yml
vendored
@@ -1,42 +0,0 @@
|
||||
name: Third-Party Repository Profiling
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 4.2-stable
|
||||
pull_request:
|
||||
branches:
|
||||
- 4.2-stable
|
||||
jobs:
|
||||
build_n_profile:
|
||||
if: "!contains(github.event.commits[0].message, '[ci skip]')"
|
||||
runs-on: 'ubuntu-latest'
|
||||
env:
|
||||
BUNDLE_GEMFILE: "sandbox/Gemfile"
|
||||
BUNDLE_PATH: "vendor/bundle"
|
||||
BUNDLE_JOBS: 4
|
||||
BUNDLE_RETRY: 3
|
||||
CI: true
|
||||
steps:
|
||||
- name: Checkout Jekyll
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 5
|
||||
path: jekyll
|
||||
- name: Checkout Third-Party Repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: ashmaroli/tomjoht.github.io
|
||||
path: sandbox
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.7
|
||||
bundler-cache: true
|
||||
- name: Run Jekyll Build 3 times
|
||||
run: |
|
||||
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
|
||||
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
|
||||
bundle exec jekyll build -s sandbox -d sandbox/_site --trace
|
||||
- name: Memory Analysis of Jekyll Build
|
||||
run: bundle exec ruby jekyll/.github/workflows/actions/memprof.rb sandbox
|
||||
31
.gitignore
vendored
31
.gitignore
vendored
@@ -1,28 +1,23 @@
|
||||
# Jekyll
|
||||
_site/
|
||||
*-cache/
|
||||
.jekyll-metadata
|
||||
|
||||
# Ruby
|
||||
.bundle/
|
||||
.byebug_history
|
||||
.ruby-gemset
|
||||
.ruby-version
|
||||
*.gem
|
||||
Gemfile.lock
|
||||
|
||||
# Files
|
||||
.analysis
|
||||
.DS_Store
|
||||
*.swp
|
||||
*~
|
||||
|
||||
# Folders
|
||||
.DS_Store
|
||||
.analysis
|
||||
.bundle/
|
||||
.byebug_history
|
||||
.jekyll-metadata
|
||||
.ruby-gemset
|
||||
.ruby-version
|
||||
.sass-cache
|
||||
/test/source/file_name.txt
|
||||
/vendor
|
||||
bbin/
|
||||
Gemfile.lock
|
||||
_site/
|
||||
bin/
|
||||
bbin/
|
||||
coverage
|
||||
gh-pages/
|
||||
pkg/
|
||||
site/_site/
|
||||
test/dest
|
||||
tmp/*
|
||||
|
||||
311
.rubocop.yml
311
.rubocop.yml
@@ -1,213 +1,86 @@
|
||||
---
|
||||
inherit_from: .rubocop_todo.yml
|
||||
|
||||
require:
|
||||
- rubocop-performance
|
||||
- ./rubocop/jekyll
|
||||
|
||||
Jekyll/NoPutsAllowed:
|
||||
Exclude:
|
||||
- rake/*.rake
|
||||
|
||||
AllCops:
|
||||
SuggestExtensions: false
|
||||
TargetRubyVersion: 2.4
|
||||
TargetRubyVersion: 2.0
|
||||
Include:
|
||||
- lib/**/*.rb
|
||||
- test/**/*.rb
|
||||
Exclude:
|
||||
- bin/**/*
|
||||
- exe/**/*
|
||||
- benchmark/**/*
|
||||
- script/**/*
|
||||
- vendor/**/*
|
||||
- tmp/**/*
|
||||
|
||||
Layout/BeginEndAlignment:
|
||||
Enabled: true
|
||||
Layout/EmptyComment:
|
||||
Layout/AlignArray:
|
||||
Enabled: false
|
||||
Layout/EmptyLinesAroundAttributeAccessor:
|
||||
Enabled: true
|
||||
Layout/EndAlignment:
|
||||
Severity: error
|
||||
Layout/HashAlignment:
|
||||
Layout/AlignHash:
|
||||
EnforcedHashRocketStyle: table
|
||||
Layout/AlignParameters:
|
||||
Enabled: false
|
||||
Layout/EmptyLinesAroundAccessModifier:
|
||||
Enabled: false
|
||||
Layout/EmptyLinesAroundModuleBody:
|
||||
Enabled: false
|
||||
Layout/EndOfLine:
|
||||
EnforcedStyle: lf
|
||||
Layout/ExtraSpacing:
|
||||
AllowForAlignment: true
|
||||
Layout/FirstParameterIndentation:
|
||||
EnforcedStyle: consistent
|
||||
Layout/IndentationWidth:
|
||||
Severity: error
|
||||
Layout/FirstArrayElementIndentation:
|
||||
Layout/IndentArray:
|
||||
EnforcedStyle: consistent
|
||||
Layout/FirstHashElementIndentation:
|
||||
Layout/IndentHash:
|
||||
EnforcedStyle: consistent
|
||||
Layout/LineLength:
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb/
|
||||
- Rakefile
|
||||
- rake/*.rake
|
||||
- Gemfile
|
||||
Max: 100
|
||||
Severity: warning
|
||||
Layout/IndentHeredoc:
|
||||
Enabled: false
|
||||
Layout/MultilineMethodCallIndentation:
|
||||
EnforcedStyle: indented
|
||||
Layout/MultilineOperationIndentation:
|
||||
EnforcedStyle: indented
|
||||
Layout/SpaceAroundMethodCallOperator:
|
||||
Layout/SpaceAroundOperators:
|
||||
Enabled: true
|
||||
Layout/SpaceInsideHashLiteralBraces:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
- test/**/*.rb
|
||||
|
||||
Lint/BinaryOperatorWithIdenticalOperands:
|
||||
Enabled: true
|
||||
Lint/ConstantDefinitionInBlock:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
- test/**/*.rb
|
||||
Lint/DeprecatedOpenSSLConstant:
|
||||
Enabled: true
|
||||
Lint/DuplicateBranch:
|
||||
Enabled: true
|
||||
Lint/DuplicateElsifCondition:
|
||||
Enabled: true
|
||||
Lint/DuplicateRegexpCharacterClassElement:
|
||||
Enabled: true
|
||||
Lint/DuplicateRescueException:
|
||||
Enabled: true
|
||||
Lint/DuplicateRequire:
|
||||
Enabled: true
|
||||
Lint/EmptyBlock:
|
||||
Enabled: true
|
||||
Lint/EmptyClass:
|
||||
Enabled: true
|
||||
Lint/EmptyConditionalBody:
|
||||
Enabled: true
|
||||
Lint/EmptyFile:
|
||||
Enabled: true
|
||||
Lint/FloatComparison:
|
||||
Enabled: true
|
||||
Lint/HashCompareByIdentity:
|
||||
Enabled: true
|
||||
Lint/IdentityComparison:
|
||||
Enabled: true
|
||||
Lint/MissingSuper:
|
||||
Layout/SpaceInsideBrackets:
|
||||
Enabled: false
|
||||
Lint/MixedRegexpCaptureTypes:
|
||||
Enabled: false
|
||||
Lint/NestedPercentLiteral:
|
||||
Exclude:
|
||||
- test/test_site.rb
|
||||
Lint/NoReturnInBeginEndBlocks:
|
||||
Enabled: true
|
||||
Lint/OutOfRangeRegexpRef:
|
||||
Enabled: true
|
||||
Lint/RaiseException:
|
||||
Enabled: true
|
||||
Lint/RedundantSafeNavigation:
|
||||
Enabled: true
|
||||
Lint/SelfAssignment:
|
||||
Enabled: true
|
||||
Lint/StructNewOverride:
|
||||
Enabled: true
|
||||
Lint/ToEnumArguments:
|
||||
Enabled: false
|
||||
Lint/TopLevelReturnWithArgument:
|
||||
Enabled: true
|
||||
Lint/TrailingCommaInAttributeDeclaration:
|
||||
Enabled: true
|
||||
Lint/UnmodifiedReduceAccumulator:
|
||||
Enabled: true
|
||||
Lint/EndAlignment:
|
||||
Severity: error
|
||||
Lint/UnreachableCode:
|
||||
Severity: error
|
||||
Lint/UnreachableLoop:
|
||||
Enabled: true
|
||||
Lint/UselessMethodDefinition:
|
||||
Enabled: true
|
||||
Lint/UselessTimes:
|
||||
Enabled: true
|
||||
Lint/Void:
|
||||
Exclude:
|
||||
- lib/jekyll/site.rb
|
||||
|
||||
Lint/UselessAccessModifier:
|
||||
Enabled: false
|
||||
Metrics/AbcSize:
|
||||
Max: 23
|
||||
Max: 21
|
||||
Metrics/BlockLength:
|
||||
Exclude:
|
||||
- test/**/*.rb
|
||||
- lib/jekyll/configuration.rb
|
||||
- rake/*.rake
|
||||
- jekyll.gemspec
|
||||
Metrics/ClassLength:
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb$/
|
||||
- !ruby/regexp /test\/.*.rb$/
|
||||
- lib/jekyll/document.rb
|
||||
- lib/jekyll/site.rb
|
||||
- lib/jekyll/commands/serve.rb
|
||||
- lib/jekyll/configuration.rb
|
||||
Max: 240
|
||||
Max: 300
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 9
|
||||
Metrics/LineLength:
|
||||
Exclude:
|
||||
- lib/jekyll/utils.rb
|
||||
- lib/jekyll/commands/serve.rb
|
||||
Max: 11
|
||||
- !ruby/regexp /features\/.*.rb/
|
||||
- Rakefile
|
||||
- rake/*.rake
|
||||
- Gemfile
|
||||
- jekyll.gemspec
|
||||
Max: 90
|
||||
Severity: warning
|
||||
Metrics/MethodLength:
|
||||
CountComments: false
|
||||
Max: 20
|
||||
Severity: error
|
||||
Metrics/ModuleLength:
|
||||
Max: 240
|
||||
Exclude:
|
||||
- lib/jekyll/filters.rb
|
||||
Metrics/ParameterLists:
|
||||
Max: 4
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 13
|
||||
|
||||
Naming/FileName:
|
||||
Enabled: false
|
||||
Naming/HeredocDelimiterNaming:
|
||||
Exclude:
|
||||
- test/**/*.rb
|
||||
Naming/MemoizedInstanceVariableName:
|
||||
Exclude:
|
||||
- lib/jekyll/convertible.rb
|
||||
- lib/jekyll/drops/site_drop.rb
|
||||
- lib/jekyll/drops/unified_payload_drop.rb
|
||||
- lib/jekyll/page_without_a_file.rb
|
||||
|
||||
Performance/AncestorsInclude:
|
||||
Enabled: false
|
||||
Performance/ArraySemiInfiniteRangeSlice:
|
||||
Enabled: true
|
||||
Performance/BigDecimalWithNumericArgument:
|
||||
Enabled: true
|
||||
Performance/BlockGivenWithExplicitBlock:
|
||||
Enabled: true
|
||||
Performance/ChainArrayAllocation:
|
||||
Enabled: true
|
||||
Performance/CollectionLiteralInLoop:
|
||||
Enabled: true
|
||||
Performance/ConstantRegexp:
|
||||
Enabled: true
|
||||
Performance/MethodObjectAsBlock:
|
||||
Enabled: true
|
||||
Performance/RedundantSortBlock:
|
||||
Enabled: true
|
||||
Performance/RedundantStringChars:
|
||||
Enabled: true
|
||||
Performance/ReverseFirst:
|
||||
Enabled: true
|
||||
Performance/SortReverse:
|
||||
Enabled: false
|
||||
Performance/Squeeze:
|
||||
Enabled: true
|
||||
Performance/StringInclude:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
- lib/jekyll/utils/platforms.rb
|
||||
Performance/Sum:
|
||||
Enabled: true
|
||||
|
||||
Max: 8
|
||||
Security/MarshalLoad:
|
||||
Exclude:
|
||||
- !ruby/regexp /test\/.*.rb$/
|
||||
@@ -216,81 +89,37 @@ Security/YAMLLoad:
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb/
|
||||
- !ruby/regexp /test\/.*.rb$/
|
||||
|
||||
Style/ArgumentsForwarding:
|
||||
Enabled: false
|
||||
Style/ArrayCoercion:
|
||||
Enabled: true
|
||||
Style/AccessModifierDeclarations:
|
||||
Enabled: false
|
||||
Style/AccessorGrouping:
|
||||
Enabled: false
|
||||
Style/Alias:
|
||||
EnforcedStyle: prefer_alias_method
|
||||
Enabled: false
|
||||
Style/AndOr:
|
||||
Severity: error
|
||||
Style/BisectedAttrAccessor:
|
||||
Enabled: true
|
||||
Style/CaseLikeIf:
|
||||
Enabled: true
|
||||
Style/Attr:
|
||||
Enabled: false
|
||||
Style/BracesAroundHashParameters:
|
||||
Enabled: false
|
||||
Style/ClassAndModuleChildren:
|
||||
Exclude:
|
||||
- test/**/*.rb
|
||||
Style/ClassEqualityComparison:
|
||||
Enabled: true
|
||||
Style/CollectionCompact:
|
||||
Enabled: true
|
||||
Style/CombinableLoops:
|
||||
Enabled: true
|
||||
Enabled: false
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
Style/DocumentDynamicEvalDefinition:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb$/
|
||||
Style/DoubleNegation:
|
||||
Enabled: false
|
||||
Style/ExponentialNotation:
|
||||
Enabled: true
|
||||
Style/ExplicitBlockArgument:
|
||||
Style/FileName:
|
||||
Enabled: false
|
||||
Style/FormatStringToken:
|
||||
Exclude:
|
||||
- lib/jekyll/utils/ansi.rb
|
||||
- lib/jekyll/liquid_renderer/table.rb
|
||||
- lib/jekyll/profiler.rb
|
||||
Style/FrozenStringLiteralComment:
|
||||
EnforcedStyle: always
|
||||
Style/GlobalStdStream:
|
||||
Enabled: true
|
||||
Style/GuardClause:
|
||||
Enabled: false
|
||||
Style/HashAsLastArrayItem:
|
||||
Enabled: true
|
||||
Style/HashEachMethods:
|
||||
Enabled: true
|
||||
Style/HashLikeCase:
|
||||
Enabled: true
|
||||
Style/HashSyntax:
|
||||
EnforcedStyle: hash_rockets
|
||||
Severity: error
|
||||
Style/HashTransformKeys:
|
||||
Style/IfUnlessModifier:
|
||||
Enabled: false
|
||||
Style/InverseMethods:
|
||||
Enabled: false
|
||||
Style/HashTransformValues:
|
||||
Enabled: true
|
||||
Style/KeywordParametersOrder:
|
||||
Enabled: true
|
||||
Style/MixinUsage:
|
||||
Exclude:
|
||||
- test/helper.rb
|
||||
Style/ModuleFunction:
|
||||
Enabled: false
|
||||
Style/MultilineTernaryOperator:
|
||||
Severity: error
|
||||
Style/NegatedIfElseCondition:
|
||||
Enabled: true
|
||||
Style/NilLambda:
|
||||
Enabled: true
|
||||
Style/OptionalBooleanParameter:
|
||||
Enabled: true
|
||||
Style/PercentLiteralDelimiters:
|
||||
PreferredDelimiters:
|
||||
"%q": "{}"
|
||||
@@ -300,51 +129,25 @@ Style/PercentLiteralDelimiters:
|
||||
"%w": "()"
|
||||
"%W": "()"
|
||||
"%x": "()"
|
||||
Style/RedundantArgument:
|
||||
Enabled: true
|
||||
Style/RedundantAssignment:
|
||||
Enabled: true
|
||||
Style/RedundantBegin:
|
||||
Style/RedundantReturn:
|
||||
Enabled: false
|
||||
Style/RedundantFetchBlock:
|
||||
Style/RedundantSelf:
|
||||
Enabled: false
|
||||
Style/RedundantFileExtensionInRequire:
|
||||
Enabled: true
|
||||
Style/RedundantRegexpCharacterClass:
|
||||
Enabled: true
|
||||
Style/RedundantRegexpEscape:
|
||||
Enabled: true
|
||||
Style/RedundantSelfAssignment:
|
||||
Enabled: true
|
||||
Style/RegexpLiteral:
|
||||
EnforcedStyle: percent_r
|
||||
Style/RescueModifier:
|
||||
Enabled: false
|
||||
Style/SafeNavigation:
|
||||
Exclude:
|
||||
- lib/jekyll/document.rb
|
||||
Style/SignalException:
|
||||
EnforcedStyle: only_raise
|
||||
Style/SingleArgumentDig:
|
||||
Enabled: true
|
||||
Style/SlicingWithRange:
|
||||
Style/SingleLineMethods:
|
||||
Enabled: false
|
||||
Style/SoleNestedConditional:
|
||||
Enabled: true
|
||||
Style/StringLiterals:
|
||||
EnforcedStyle: double_quotes
|
||||
Style/StringConcatenation:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
- lib/jekyll/commands/*.rb
|
||||
- test/**/*.rb
|
||||
Style/StringLiteralsInInterpolation:
|
||||
EnforcedStyle: double_quotes
|
||||
Style/SwapValues:
|
||||
Enabled: true
|
||||
Style/SymbolArray:
|
||||
EnforcedStyle: brackets
|
||||
Style/TrailingCommaInArrayLiteral:
|
||||
EnforcedStyleForMultiline: consistent_comma
|
||||
Style/TrailingCommaInHashLiteral:
|
||||
Enabled: false
|
||||
Style/TrailingCommaInLiteral:
|
||||
EnforcedStyleForMultiline: consistent_comma
|
||||
Style/UnneededCapitalW:
|
||||
Enabled: false
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config --auto-gen-only-exclude`
|
||||
# on 2020-11-23 15:56:48 UTC using RuboCop version 1.4.0.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
# versions of RuboCop, may require this file to be generated again.
|
||||
|
||||
# Offense count: 1
|
||||
Style/CombinableLoops:
|
||||
Exclude:
|
||||
- 'lib/jekyll/tags/post_url.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: AllowedMethods.
|
||||
# AllowedMethods: respond_to_missing?
|
||||
Style/OptionalBooleanParameter:
|
||||
Exclude:
|
||||
- 'lib/jekyll/log_adapter.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: Methods.
|
||||
Style/RedundantArgument:
|
||||
Exclude:
|
||||
- 'lib/jekyll/tags/link.rb'
|
||||
57
.travis.yml
Normal file
57
.travis.yml
Normal file
@@ -0,0 +1,57 @@
|
||||
bundler_args: --without benchmark:site:development
|
||||
script: script/cibuild
|
||||
cache: bundler
|
||||
language: ruby
|
||||
sudo: false
|
||||
|
||||
rvm:
|
||||
- &ruby1 2.4.1
|
||||
- &ruby2 2.3.4
|
||||
- &ruby3 2.2.7
|
||||
- &ruby4 2.1.10
|
||||
- &jruby jruby-9.1.7.0
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- rvm: *ruby1
|
||||
env: TEST_SUITE=fmt
|
||||
- rvm: *ruby1
|
||||
env: TEST_SUITE=default-site
|
||||
- rvm: *ruby1
|
||||
env: ROUGE_VERSION=1.11.1 # runs everything with this version
|
||||
exclude:
|
||||
- rvm: *jruby
|
||||
env: TEST_SUITE=cucumber
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- TEST_SUITE=test
|
||||
- TEST_SUITE=cucumber
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- themes
|
||||
- /*-stable/
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
secure: "\
|
||||
dNdKk6nahNURIUbO3ULhA09/vTEQjK0fNbgjVjeYPEvROHgQBP1cIP3AJy8aWs8rl5Yyow4Y\
|
||||
GEilNRzKPz18AsFptVXofpwyqcBxaCfmHP809NX5PHBaadydveLm+TNVao2XeLXSWu+HUNAY\
|
||||
O1AanCUbJSEyJTju347xCBGzESU=\
|
||||
"
|
||||
|
||||
addons:
|
||||
code_climate:
|
||||
repo_token:
|
||||
secure: "\
|
||||
mAuvDu+nrzB8dOaLqsublDGt423mGRyZYM3vsrXh4Tf1sT+L1PxsRzU4gLmcV27HtX2Oq9\
|
||||
DA4vsRURfABU0fIhwYkQuZqEcA3d8TL36BZcGEshG6MQ2AmnYsmFiTcxqV5bmlElHEqQuT\
|
||||
5SUFXLafgZPBnL0qDwujQcHukID41sE=\
|
||||
"
|
||||
# regular test configuration
|
||||
after_success:
|
||||
- bundle exec codeclimate-test-reporter
|
||||
|
||||
before_install:
|
||||
- gem update --system
|
||||
@@ -1,76 +0,0 @@
|
||||
# Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [olivia@jekyllrb.com](mailto:olivia@jekyllrb.com). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html)
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq)
|
||||
49
CONDUCT.markdown
Normal file
49
CONDUCT.markdown
Normal file
@@ -0,0 +1,49 @@
|
||||
# Code of Conduct
|
||||
|
||||
As contributors and maintainers of this project, and in the interest of
|
||||
fostering an open and welcoming community, we pledge to respect all people who
|
||||
contribute through reporting issues, posting feature requests, updating
|
||||
documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free
|
||||
experience for everyone, regardless of level of experience, gender, gender
|
||||
identity and expression, sexual orientation, disability, personal appearance,
|
||||
body size, race, ethnicity, age, religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery
|
||||
* Personal attacks
|
||||
* Trolling or insulting/derogatory comments
|
||||
* Public or private harassment
|
||||
* Publishing other's private information, such as physical or electronic
|
||||
addresses, without explicit permission
|
||||
* Other unethical or unprofessional conduct
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
By adopting this Code of Conduct, project maintainers commit themselves to
|
||||
fairly and consistently applying these principles to every aspect of managing
|
||||
this project. Project maintainers who do not follow or enforce the Code of
|
||||
Conduct may be permanently removed from the project team.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by opening an issue or contacting a project maintainer. All complaints
|
||||
will be reviewed and investigated and will result in a response that is deemed
|
||||
necessary and appropriate to the circumstances. Maintainers are obligated to
|
||||
maintain confidentiality with regard to the reporter of an incident.
|
||||
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 1.3.0, available at
|
||||
[http://contributor-covenant.org/version/1/3/0/][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/3/0/
|
||||
60
Gemfile
60
Gemfile
@@ -1,34 +1,34 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
source "https://rubygems.org"
|
||||
gemspec :name => "jekyll"
|
||||
|
||||
gem "rake", "~> 13.0"
|
||||
gem "rake", "~> 12.0"
|
||||
|
||||
# Dependency of jekyll-mentions. RubyGems in Ruby 2.1 doesn't shield us from this.
|
||||
gem "activesupport", "~> 4.2", :groups => [:test_legacy, :site] if RUBY_VERSION < "2.2.2"
|
||||
|
||||
group :development do
|
||||
gem "launchy", "~> 2.3"
|
||||
gem "pry"
|
||||
|
||||
gem "pry-byebug" unless RUBY_ENGINE == "jruby"
|
||||
unless RUBY_ENGINE == "jruby"
|
||||
gem "pry-byebug"
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
group :test do
|
||||
gem "cucumber", RUBY_VERSION >= "2.5" ? "~> 5.1.2" : "~> 4.1"
|
||||
gem "httpclient"
|
||||
gem "codeclimate-test-reporter", "~> 1.0.5"
|
||||
gem "cucumber", "~> 2.1"
|
||||
gem "jekyll_test_plugin"
|
||||
gem "jekyll_test_plugin_malicious"
|
||||
gem "memory_profiler"
|
||||
gem "nokogiri", "~> 1.7"
|
||||
# nokogiri v1.8 does not work with ruby 2.1 and below
|
||||
gem "nokogiri", RUBY_VERSION >= "2.2" ? "~> 1.7" : "~> 1.7.0"
|
||||
gem "rspec"
|
||||
gem "rspec-mocks"
|
||||
gem "rubocop", "~> 1.12.0"
|
||||
gem "rubocop-performance"
|
||||
gem "rubocop", "~> 0.49.1"
|
||||
gem "test-dependency-theme", :path => File.expand_path("test/fixtures/test-dependency-theme", __dir__)
|
||||
gem "test-theme", :path => File.expand_path("test/fixtures/test-theme", __dir__)
|
||||
gem "test-theme-skinny", :path => File.expand_path("test/fixtures/test-theme-skinny", __dir__)
|
||||
gem "test-theme-symlink", :path => File.expand_path("test/fixtures/test-theme-symlink", __dir__)
|
||||
|
||||
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
|
||||
end
|
||||
@@ -36,11 +36,14 @@ end
|
||||
#
|
||||
|
||||
group :test_legacy do
|
||||
gem "test-unit" if RUBY_PLATFORM =~ %r!cygwin!
|
||||
if RUBY_PLATFORM =~ %r!cygwin! || RUBY_VERSION.start_with?("2.2")
|
||||
gem "test-unit"
|
||||
end
|
||||
|
||||
gem "minitest"
|
||||
gem "minitest-profile"
|
||||
gem "minitest-reporters"
|
||||
gem "redgreen"
|
||||
gem "shoulda"
|
||||
gem "simplecov"
|
||||
end
|
||||
@@ -50,6 +53,7 @@ end
|
||||
group :benchmark do
|
||||
if ENV["BENCHMARK"]
|
||||
gem "benchmark-ips"
|
||||
gem "benchmark-memory"
|
||||
gem "rbtrace"
|
||||
gem "ruby-prof"
|
||||
gem "stackprof"
|
||||
@@ -59,35 +63,37 @@ end
|
||||
#
|
||||
|
||||
group :jekyll_optional_dependencies do
|
||||
gem "coderay", "~> 1.1.0"
|
||||
gem "jekyll-coffeescript"
|
||||
gem "jekyll-docs", :path => "../docs" if Dir.exist?("../docs") && ENV["JEKYLL_VERSION"]
|
||||
gem "jekyll-feed", "~> 0.9"
|
||||
gem "jekyll-gist"
|
||||
gem "jekyll-paginate"
|
||||
gem "jekyll-redirect-from"
|
||||
gem "kramdown-syntax-coderay"
|
||||
gem "kramdown", "~> 1.9"
|
||||
gem "mime-types", "~> 3.0"
|
||||
gem "rdoc", "~> 6.0"
|
||||
gem "tomlrb"
|
||||
gem "rdoc", "~> 5.0"
|
||||
gem "toml", "~> 0.1.0"
|
||||
|
||||
platforms :ruby, :mswin, :mingw, :x64_mingw do
|
||||
gem "classifier-reborn", "~> 2.2"
|
||||
gem "liquid-c", "~> 4.0"
|
||||
gem "yajl-ruby", "~> 1.4"
|
||||
platform :ruby, :mswin, :mingw, :x64_mingw do
|
||||
gem "classifier-reborn", "~> 2.1.0"
|
||||
gem "liquid-c", "~> 3.0"
|
||||
gem "pygments.rb", "~> 0.6.0"
|
||||
gem "rdiscount", "~> 2.0"
|
||||
gem "redcarpet", "~> 3.2", ">= 3.2.3"
|
||||
gem "yajl-ruby", "~> 1.2"
|
||||
end
|
||||
|
||||
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
# and associated library
|
||||
platforms :jruby, :mswin, :mingw, :x64_mingw do
|
||||
gem "tzinfo", "~> 1.2"
|
||||
gem "tzinfo-data"
|
||||
end
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem "tzinfo-data", :platforms => [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
group :site do
|
||||
gem "html-proofer", "~> 3.4" if ENV["PROOF"]
|
||||
if ENV["PROOF"]
|
||||
gem "html-proofer", "~> 3.4"
|
||||
end
|
||||
|
||||
gem "jekyll-avatar"
|
||||
gem "jekyll-mentions"
|
||||
|
||||
1083
History.markdown
1083
History.markdown
File diff suppressed because it is too large
Load Diff
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2008-present Tom Preston-Werner and Jekyll contributors
|
||||
Copyright (c) 2008-2017 Tom Preston-Werner and Jekyll contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
# [Jekyll](https://jekyllrb.com/)
|
||||
|
||||
[][ruby-gems]
|
||||
[][ci-workflow]
|
||||
[][travis]
|
||||
[][appveyor]
|
||||
[][coverage]
|
||||
[][codeclimate]
|
||||
[][gemnasium]
|
||||
[][hakiri]
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
[ruby-gems]: https://rubygems.org/gems/jekyll
|
||||
[gemnasium]: https://gemnasium.com/jekyll/jekyll
|
||||
[codeclimate]: https://codeclimate.com/github/jekyll/jekyll
|
||||
[coverage]: https://codeclimate.com/github/jekyll/jekyll/coverage
|
||||
[hakiri]: https://hakiri.io/github/jekyll/jekyll/master
|
||||
[ci-workflow]: https://github.com/jekyll/jekyll/actions?query=workflow%3A%22Continuous+Integration%22+branch%3Amaster
|
||||
[travis]: https://travis-ci.org/jekyll/jekyll
|
||||
[appveyor]: https://ci.appveyor.com/project/jekyll/jekyll/branch/master
|
||||
|
||||
Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind [GitHub Pages](https://pages.github.com), which you can use to host sites right from your GitHub repositories.
|
||||
@@ -18,68 +22,37 @@ Jekyll is a simple, blog-aware, static site generator perfect for personal, proj
|
||||
|
||||
Jekyll does what you tell it to do — no more, no less. It doesn't try to outsmart users by making bold assumptions, nor does it burden them with needless complexity and configuration. Put simply, Jekyll gets out of your way and allows you to concentrate on what truly matters: your content.
|
||||
|
||||
See: https://jekyllrb.com/philosophy
|
||||
## Having trouble with OS X/macOS?
|
||||
|
||||
See: https://jekyllrb.com/docs/troubleshooting/
|
||||
|
||||
## Getting Started
|
||||
|
||||
* [Install](https://jekyllrb.com/docs/installation/) the gem
|
||||
* Read up about its [Usage](https://jekyllrb.com/docs/usage/) and [Configuration](https://jekyllrb.com/docs/configuration/)
|
||||
* Take a gander at some existing [Sites](https://github.com/jekyll/jekyll/wiki/sites)
|
||||
* Take a gander at some existing [Sites](https://wiki.github.com/jekyll/jekyll/sites)
|
||||
* [Fork](https://github.com/jekyll/jekyll/fork) and [Contribute](https://jekyllrb.com/docs/contributing/) your own modifications
|
||||
* Have questions? Check out our official forum community [Jekyll Talk](https://talk.jekyllrb.com/) or [`#jekyll` on irc.freenode.net](https://botbot.me/freenode/jekyll/)
|
||||
|
||||
## Diving In
|
||||
|
||||
* [Migrate](http://import.jekyllrb.com/docs/home/) from your previous system
|
||||
* Learn how [Front Matter](https://jekyllrb.com/docs/front-matter/) works
|
||||
* Put information on your site with [Variables](https://jekyllrb.com/docs/variables/)
|
||||
* Customize the [Permalinks](https://jekyllrb.com/docs/permalinks/) your posts are generated with
|
||||
* Use the built-in [Liquid Extensions](https://jekyllrb.com/docs/templates/) to make your life easier
|
||||
* Use custom [Plugins](https://jekyllrb.com/docs/plugins/) to generate content specific to your site
|
||||
* Watch [video tutorials from Giraffe Academy](https://jekyllrb.com/tutorials/video-walkthroughs/)
|
||||
|
||||
## Need help?
|
||||
|
||||
If you don't find the answer to your problem in our [docs](https://jekyllrb.com/docs/), or in the [troubleshooting section](https://jekyllrb.com/docs/troubleshooting/), ask the [community](https://jekyllrb.com/docs/community/) for help.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to have a more open and welcoming community, Jekyll adheres to a
|
||||
[code of conduct](CODE_OF_CONDUCT.markdown) adapted from the Ruby on Rails code of
|
||||
[code of conduct](CONDUCT.markdown) adapted from the Ruby on Rails code of
|
||||
conduct.
|
||||
|
||||
Please adhere to this code of conduct in any interactions you have in the
|
||||
Jekyll community. It is strictly enforced on all official Jekyll
|
||||
repositories, websites, and resources. If you encounter someone violating
|
||||
these terms, please let one of our [core team members](https://jekyllrb.com/team/#core-team) know and we will address it as soon as possible.
|
||||
these terms, please let a maintainer ([@parkr](https://github.com/parkr), [@envygeeks](https://github.com/envygeeks), [@mattr-](https://github.com/mattr-), or [@alfredxing](https://github.com/alfredxing)) know and we will address it as soon as possible.
|
||||
|
||||
## Credits
|
||||
## Diving In
|
||||
|
||||
### Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up in this README with a link to your website. [Become a sponsor!](https://opencollective.com/jekyll#sponsor)
|
||||
|
||||
<a href="https://opencollective.com/jekyll/sponsor/0/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/0/avatar.svg" /></a>
|
||||
<a href="https://opencollective.com/jekyll/sponsor/1/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/1/avatar.svg" /></a>
|
||||
<a href="https://opencollective.com/jekyll/sponsor/2/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/2/avatar.svg" /></a>
|
||||
<a href="https://opencollective.com/jekyll/sponsor/3/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/3/avatar.svg" /></a>
|
||||
<a href="https://opencollective.com/jekyll/sponsor/4/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/4/avatar.svg" /></a>
|
||||
<a href="https://opencollective.com/jekyll/sponsor/5/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/5/avatar.svg" /></a>
|
||||
<a href="https://opencollective.com/jekyll/sponsor/6/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/6/avatar.svg" /></a>
|
||||
<a href="https://opencollective.com/jekyll/sponsor/7/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/7/avatar.svg" /></a>
|
||||
<a href="https://opencollective.com/jekyll/sponsor/8/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/8/avatar.svg" /></a>
|
||||
<a href="https://opencollective.com/jekyll/sponsor/9/website" target="_blank"><img src="https://opencollective.com/jekyll/sponsor/9/avatar.svg" /></a>
|
||||
|
||||
### Contributors
|
||||
|
||||
This project exists thanks to all the people who contribute.
|
||||
<a href="../../graphs/contributors"><img src="https://opencollective.com/jekyll/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
### Backers
|
||||
|
||||
Thank you to all our backers! 🙏 [Become a backer](https://opencollective.com/jekyll#backer)
|
||||
|
||||
<a href="https://opencollective.com/jekyll#backers" target="_blank"><img src="https://opencollective.com/jekyll/backers.svg?width=890" /></a>
|
||||
* [Migrate](http://import.jekyllrb.com/docs/home/) from your previous system
|
||||
* Learn how the [YAML Front Matter](https://jekyllrb.com/docs/frontmatter/) works
|
||||
* Put information on your site with [Variables](https://jekyllrb.com/docs/variables/)
|
||||
* Customize the [Permalinks](https://jekyllrb.com/docs/permalinks/) your posts are generated with
|
||||
* Use the built-in [Liquid Extensions](https://jekyllrb.com/docs/templates/) to make your life easier
|
||||
* Use custom [Plugins](https://jekyllrb.com/docs/plugins/) to generate content specific to your site
|
||||
|
||||
## License
|
||||
|
||||
|
||||
20
Rakefile
20
Rakefile
@@ -1,5 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rubygems"
|
||||
require "rake"
|
||||
require "rdoc"
|
||||
@@ -46,13 +44,19 @@ def normalize_bullets(markdown)
|
||||
end
|
||||
|
||||
def linkify_prs(markdown)
|
||||
markdown.gsub(%r!(?<\!&)#(\d+)!) do |word|
|
||||
markdown.gsub(%r!#(\d+)!) do |word|
|
||||
"[#{word}]({{ site.repository }}/issues/#{word.delete("#")})"
|
||||
end
|
||||
end
|
||||
|
||||
def linkify_users(markdown)
|
||||
markdown.gsub(%r!(@\w+)!) do |username|
|
||||
"[#{username}](https://github.com/#{username.delete("@")})"
|
||||
end
|
||||
end
|
||||
|
||||
def linkify(markdown)
|
||||
linkify_prs(markdown)
|
||||
linkify_users(linkify_prs(markdown))
|
||||
end
|
||||
|
||||
def liquid_escape(markdown)
|
||||
@@ -66,11 +70,11 @@ def custom_release_header_anchors(markdown)
|
||||
_, major, minor, patch = *release_notes.match(header_regexp)
|
||||
release_notes
|
||||
.gsub(header_regexp, "\\0\n{: #v\\1-\\2-\\3}")
|
||||
.gsub(section_regexp) { |section| "#{section}\n{: ##{slugify(section)}-v#{major}-#{minor}-#{patch}}" }
|
||||
.gsub(section_regexp) { |section| "#{section}\n{: ##{sluffigy(section)}-v#{major}-#{minor}-#{patch}}" }
|
||||
end.join("\n## ")
|
||||
end
|
||||
|
||||
def slugify(header)
|
||||
def sluffigy(header)
|
||||
header.delete("#").strip.downcase.gsub(%r!\s+!, "-")
|
||||
end
|
||||
|
||||
@@ -95,7 +99,7 @@ def siteify_file(file, overrides_front_matter = {})
|
||||
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exist?(file)
|
||||
title = begin
|
||||
File.read(file).match(%r!\A# (.*)$!)[1]
|
||||
rescue NoMethodError
|
||||
rescue
|
||||
File.basename(file, ".*").downcase.capitalize
|
||||
end
|
||||
slug = File.basename(file, ".markdown").downcase
|
||||
@@ -159,5 +163,5 @@ end
|
||||
|
||||
desc "Open an irb session preloaded with this library"
|
||||
task :console do
|
||||
sh "irb -r ./lib/#{name}.rb"
|
||||
sh "irb -rubygems -r ./lib/#{name}.rb"
|
||||
end
|
||||
|
||||
39
appveyor.yml
39
appveyor.yml
@@ -1,33 +1,36 @@
|
||||
version: "{build}"
|
||||
|
||||
clone_depth: 5
|
||||
clone_depth: 10
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- themes
|
||||
- /.*-stable/
|
||||
|
||||
build: off
|
||||
|
||||
environment:
|
||||
BUNDLE_WITHOUT: "benchmark:development"
|
||||
matrix:
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TEST_SUITE: "default-site"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TEST_SUITE: "profile-docs"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TEST_SUITE: "memprof"
|
||||
- RUBY_FOLDER_VER: "26"
|
||||
TEST_SUITE: "cucumber"
|
||||
|
||||
install:
|
||||
- SET PATH=C:\Ruby%RUBY_FOLDER_VER%-x64\bin;%PATH%
|
||||
- SET PATH=C:\Ruby%RUBY_FOLDER_VER%\bin;%PATH%
|
||||
- bundle install --retry 5 --jobs=%NUMBER_OF_PROCESSORS% --clean --path vendor\bundle
|
||||
|
||||
environment:
|
||||
BUNDLE_WITHOUT: "benchmark:site:development"
|
||||
matrix:
|
||||
- RUBY_FOLDER_VER: "24"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "24"
|
||||
TEST_SUITE: "cucumber"
|
||||
- RUBY_FOLDER_VER: "24"
|
||||
TEST_SUITE: "default-site"
|
||||
- RUBY_FOLDER_VER: "24-x64"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "23"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "22"
|
||||
TEST_SUITE: "test"
|
||||
- RUBY_FOLDER_VER: "21"
|
||||
TEST_SUITE: "test"
|
||||
|
||||
test_script:
|
||||
- ruby --version
|
||||
- gem --version
|
||||
@@ -35,5 +38,5 @@ test_script:
|
||||
- bash ./script/cibuild
|
||||
|
||||
cache:
|
||||
# If one of the files after the right arrow changes, cache will be invalidated
|
||||
# If one of the files after the right arrow changes, cache will be skipped
|
||||
- 'vendor\bundle -> appveyor.yml,Gemfile,jekyll.gemspec'
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "liquid"
|
||||
require "benchmark/ips"
|
||||
|
||||
# Test if processing content string without any Liquid constructs, via Liquid,
|
||||
# is slower than checking whether constructs exist ( using `String#include?` )
|
||||
# and return-ing the "plaintext" content string as is..
|
||||
#
|
||||
# Ref: https://github.com/jekyll/jekyll/pull/6735
|
||||
|
||||
# Sample contents
|
||||
WITHOUT_LIQUID = <<-TEXT.freeze
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor libero at
|
||||
pharetra tempus. Etiam bibendum magna et metus fermentum, eu cursus lorem
|
||||
mattis. Curabitur vel dui et lacus rutrum suscipit et eget neque.
|
||||
|
||||
Nullam luctus fermentum est id blandit. Phasellus consectetur ullamcorper
|
||||
ligula, at finibus eros laoreet id. Etiam sit amet est in libero efficitur
|
||||
tristique. Ut nec magna augue. Quisque ut fringilla lacus, ac dictum enim.
|
||||
Aliquam vel ornare mauris. Suspendisse ornare diam tempor nulla facilisis
|
||||
aliquet. Sed ultrices placerat ultricies.
|
||||
TEXT
|
||||
|
||||
WITH_LIQUID = <<-LIQUID.freeze
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor libero at
|
||||
pharetra tempus. {{ author }} et metus fermentum, eu cursus lorem
|
||||
mattis. Curabitur vel dui et lacus rutrum suscipit et eget neque.
|
||||
|
||||
Nullam luctus fermentum est id blandit. Phasellus consectetur ullamcorper
|
||||
ligula, {% if author == "Jane Doe" %} at finibus eros laoreet id. {% else %}
|
||||
Etiam sit amet est in libero efficitur.{% endif %}
|
||||
tristique. Ut nec magna augue. Quisque ut fringilla lacus, ac dictum enim.
|
||||
Aliquam vel ornare mauris. Suspendisse ornare diam tempor nulla facilisis
|
||||
aliquet. Sed ultrices placerat ultricies.
|
||||
LIQUID
|
||||
|
||||
WITH_JUST_LIQUID_VAR = <<-LIQUID.freeze
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce auctor libero at
|
||||
pharetra tempus. et metus fermentum, eu cursus lorem, ac dictum enim.
|
||||
mattis. Curabitur vel dui et lacus rutrum suscipit et {{ title }} neque.
|
||||
|
||||
Nullam luctus fermentum est id blandit. Phasellus consectetur ullamcorper
|
||||
ligula, at finibus eros laoreet id. Etiam sit amet est in libero efficitur.
|
||||
tristique. Ut nec magna augue. {{ author }} Quisque ut fringilla lacus
|
||||
Aliquam vel ornare mauris. Suspendisse ornare diam tempor nulla facilisis
|
||||
aliquet. Sed ultrices placerat ultricies.
|
||||
LIQUID
|
||||
|
||||
SUITE = {
|
||||
:"plain text" => WITHOUT_LIQUID,
|
||||
:"tags n vars" => WITH_LIQUID,
|
||||
:"just vars" => WITH_JUST_LIQUID_VAR,
|
||||
}.freeze
|
||||
|
||||
# Mimic how Jekyll's LiquidRenderer would process a non-static file, with
|
||||
# some dummy payload
|
||||
def always_liquid(content)
|
||||
Liquid::Template.error_mode = :warn
|
||||
Liquid::Template.parse(content, :line_numbers => true).render(
|
||||
"author" => "John Doe",
|
||||
"title" => "FooBar"
|
||||
)
|
||||
end
|
||||
|
||||
# Mimic how the proposed change would first execute a couple of checks and
|
||||
# proceed to process with Liquid if necessary
|
||||
def conditional_liquid(content)
|
||||
return content if content.nil? || content.empty?
|
||||
return content unless content.include?("{%") || content.include?("{{")
|
||||
always_liquid(content)
|
||||
end
|
||||
|
||||
# Test https://github.com/jekyll/jekyll/pull/6735#discussion_r165499868
|
||||
# ------------------------------------------------------------------------
|
||||
def check_with_regex(content)
|
||||
!content.to_s.match?(%r!{[{%]!)
|
||||
end
|
||||
|
||||
def check_with_builtin(content)
|
||||
content.include?("{%") || content.include?("{{")
|
||||
end
|
||||
|
||||
SUITE.each do |key, text|
|
||||
Benchmark.ips do |x|
|
||||
x.report("regex-check - #{key}") { check_with_regex(text) }
|
||||
x.report("builtin-check - #{key}") { check_with_builtin(text) }
|
||||
x.compare!
|
||||
end
|
||||
end
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
# Let's roll!
|
||||
SUITE.each do |key, text|
|
||||
Benchmark.ips do |x|
|
||||
x.report("always thru liquid - #{key}") { always_liquid(text) }
|
||||
x.report("conditional liquid - #{key}") { conditional_liquid(text) }
|
||||
x.compare!
|
||||
end
|
||||
end
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'benchmark/ips'
|
||||
require_relative '../lib/jekyll'
|
||||
|
||||
puts ''
|
||||
print 'Setting up... '
|
||||
|
||||
SITE = Jekyll::Site.new(
|
||||
Jekyll.configuration({
|
||||
"source" => File.expand_path("../docs", __dir__),
|
||||
"destination" => File.expand_path("../docs/_site", __dir__),
|
||||
"disable_disk_cache" => true,
|
||||
"quiet" => true,
|
||||
})
|
||||
)
|
||||
|
||||
TEMPLATE_1 = Liquid::Template.parse(<<~HTML)
|
||||
{%- assign doc = site.documents | where: 'url', '/docs/assets/' | first -%}
|
||||
{{- doc.title -}}
|
||||
HTML
|
||||
|
||||
TEMPLATE_2 = Liquid::Template.parse(<<~HTML)
|
||||
{%- assign doc = site.documents | find: 'url', '/docs/assets/' -%}
|
||||
{{- doc.title -}}
|
||||
HTML
|
||||
|
||||
[:reset, :read, :generate].each { |phase| SITE.send(phase) }
|
||||
|
||||
puts 'done.'
|
||||
puts 'Testing... '
|
||||
puts " #{'where + first'.cyan} results in #{TEMPLATE_1.render(SITE.site_payload).inspect.green}"
|
||||
puts " #{'find'.cyan} results in #{TEMPLATE_2.render(SITE.site_payload).inspect.green}"
|
||||
|
||||
if TEMPLATE_1.render(SITE.site_payload) == TEMPLATE_2.render(SITE.site_payload)
|
||||
puts 'Success! Procceding to run benchmarks.'.green
|
||||
puts ''
|
||||
else
|
||||
puts 'Something went wrong. Aborting.'.magenta
|
||||
puts ''
|
||||
return
|
||||
end
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report('where + first') { TEMPLATE_1.render(SITE.site_payload) }
|
||||
x.report('find') { TEMPLATE_2.render(SITE.site_payload) }
|
||||
x.compare!
|
||||
end
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'benchmark/ips'
|
||||
require 'jekyll'
|
||||
require 'json'
|
||||
|
||||
DATA = {"foo"=>"bar", "alpha"=>{"beta"=>"gamma"}, "lipsum"=>["lorem", "ipsum", "dolor"]}
|
||||
|
||||
def local_require
|
||||
require 'json'
|
||||
JSON.pretty_generate(DATA)
|
||||
end
|
||||
|
||||
def global_require
|
||||
JSON.pretty_generate(DATA)
|
||||
end
|
||||
|
||||
def graceful_require
|
||||
Jekyll::External.require_with_graceful_fail("json")
|
||||
JSON.pretty_generate(DATA)
|
||||
end
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report("local-require") { local_require }
|
||||
x.report("global-require") { global_require }
|
||||
x.report("graceful-require") { graceful_require }
|
||||
x.compare!
|
||||
end
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# Benchmarking changes in https://github.com/jekyll/jekyll/pull/6767
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
require 'benchmark/ips'
|
||||
require 'pathutil'
|
||||
|
||||
DOC_PATH = File.join(File.expand_path(__dir__), "_puppies", "rover.md")
|
||||
COL_PATH = File.join(File.expand_path(__dir__), "_puppies")
|
||||
|
||||
|
||||
def pathutil_relative
|
||||
Pathutil.new(DOC_PATH).relative_path_from(COL_PATH).to_s
|
||||
end
|
||||
|
||||
def native_relative
|
||||
DOC_PATH.sub("#{COL_PATH}/", "")
|
||||
end
|
||||
|
||||
if pathutil_relative == native_relative
|
||||
Benchmark.ips do |x|
|
||||
x.report("pathutil") { pathutil_relative }
|
||||
x.report("native") { native_relative }
|
||||
x.compare!
|
||||
end
|
||||
else
|
||||
print "PATHUTIL: "
|
||||
puts pathutil_relative
|
||||
print "NATIVE: "
|
||||
puts native_relative
|
||||
end
|
||||
@@ -1,91 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
# For pull request: https://github.com/jekyll/jekyll/pull/8192
|
||||
|
||||
require 'benchmark/ips'
|
||||
require 'bundler/setup'
|
||||
require 'memory_profiler'
|
||||
require 'jekyll'
|
||||
|
||||
CONTEXT = {"bar"=>"The quick brown fox"}
|
||||
MARKUP_1 = %Q(foo=bar lorem="ipsum \\"dolor\\"" alpha='beta \\'gamma\\'').freeze
|
||||
MARKUP_2 = %Q(foo=bar lorem="ipsum 'dolor'" alpha='beta "gamma"').freeze
|
||||
|
||||
#
|
||||
|
||||
def old_parse_params(markup)
|
||||
params = {}
|
||||
|
||||
while (match = Jekyll::Tags::IncludeTag::VALID_SYNTAX.match(markup))
|
||||
markup = markup[match.end(0)..-1]
|
||||
|
||||
value = if match[2]
|
||||
match[2].gsub('\\"', '"')
|
||||
elsif match[3]
|
||||
match[3].gsub("\\'", "'")
|
||||
elsif match[4]
|
||||
CONTEXT[match[4]]
|
||||
end
|
||||
|
||||
params[match[1]] = value
|
||||
end
|
||||
params
|
||||
end
|
||||
|
||||
def new_parse_params(markup)
|
||||
params = {}
|
||||
markup.scan(Jekyll::Tags::IncludeTag::VALID_SYNTAX) do |key, d_quoted, s_quoted, variable|
|
||||
value = if d_quoted
|
||||
d_quoted.include?('\\"') ? d_quoted.gsub('\\"', '"') : d_quoted
|
||||
elsif s_quoted
|
||||
s_quoted.include?("\\'") ? s_quoted.gsub("\\'", "'") : s_quoted
|
||||
elsif variable
|
||||
CONTEXT[variable]
|
||||
end
|
||||
|
||||
params[key] = value
|
||||
end
|
||||
params
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
def report(label, markup, color)
|
||||
prof_report = MemoryProfiler.report { yield }
|
||||
|
||||
allocated_memory = prof_report.scale_bytes(prof_report.total_allocated_memsize)
|
||||
allocated_objects = prof_report.total_allocated
|
||||
retained_memory = prof_report.scale_bytes(prof_report.total_retained_memsize)
|
||||
retained_objects = prof_report.total_retained
|
||||
|
||||
puts <<~MSG.send(color)
|
||||
#{(label + " ").ljust(49, "-")}
|
||||
|
||||
MARKUP: #{markup}
|
||||
RESULT: #{yield}
|
||||
|
||||
Total allocated: #{allocated_memory} (#{allocated_objects} objects)
|
||||
Total retained: #{retained_memory} (#{retained_objects} objects)
|
||||
MSG
|
||||
end
|
||||
|
||||
report('old w/ escaping', MARKUP_1, :magenta) { old_parse_params(MARKUP_1) }
|
||||
report('new w/ escaping', MARKUP_1, :cyan) { new_parse_params(MARKUP_1) }
|
||||
|
||||
report('old no escaping', MARKUP_2, :green) { old_parse_params(MARKUP_2) }
|
||||
report('new no escaping', MARKUP_2, :yellow) { new_parse_params(MARKUP_2) }
|
||||
|
||||
#
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report("old + esc".magenta) { old_parse_params(MARKUP_1) }
|
||||
x.report("new + esc".cyan) { new_parse_params(MARKUP_1) }
|
||||
x.compare!
|
||||
end
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report("old - esc".green) { old_parse_params(MARKUP_2) }
|
||||
x.report("new - esc".yellow) { new_parse_params(MARKUP_2) }
|
||||
x.compare!
|
||||
end
|
||||
@@ -1,65 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'benchmark/ips'
|
||||
require 'jekyll'
|
||||
|
||||
class FooPage
|
||||
def initialize(dir:, name:)
|
||||
@dir = dir
|
||||
@name = name
|
||||
end
|
||||
|
||||
def slow_path
|
||||
File.join(*[@dir, @name].map(&:to_s).reject(&:empty?)).sub(%r!\A/!, "")
|
||||
end
|
||||
|
||||
def fast_path
|
||||
Jekyll::PathManager.join(@dir, @name).sub(%r!\A/!, "")
|
||||
end
|
||||
end
|
||||
|
||||
nil_page = FooPage.new(:dir => nil, :name => nil)
|
||||
empty_page = FooPage.new(:dir => "", :name => "")
|
||||
root_page = FooPage.new(:dir => "", :name => "ipsum.md")
|
||||
nested_page = FooPage.new(:dir => "lorem", :name => "ipsum.md")
|
||||
slashed_page = FooPage.new(:dir => "/lorem/", :name => "/ipsum.md")
|
||||
|
||||
if nil_page.slow_path == nil_page.fast_path
|
||||
Benchmark.ips do |x|
|
||||
x.report('nil_page slow') { nil_page.slow_path }
|
||||
x.report('nil_page fast') { nil_page.fast_path }
|
||||
x.compare!
|
||||
end
|
||||
end
|
||||
|
||||
if empty_page.slow_path == empty_page.fast_path
|
||||
Benchmark.ips do |x|
|
||||
x.report('empty_page slow') { empty_page.slow_path }
|
||||
x.report('empty_page fast') { empty_page.fast_path }
|
||||
x.compare!
|
||||
end
|
||||
end
|
||||
|
||||
if root_page.slow_path == root_page.fast_path
|
||||
Benchmark.ips do |x|
|
||||
x.report('root_page slow') { root_page.slow_path }
|
||||
x.report('root_page fast') { root_page.fast_path }
|
||||
x.compare!
|
||||
end
|
||||
end
|
||||
|
||||
if nested_page.slow_path == nested_page.fast_path
|
||||
Benchmark.ips do |x|
|
||||
x.report('nested_page slow') { nested_page.slow_path }
|
||||
x.report('nested_page fast') { nested_page.fast_path }
|
||||
x.compare!
|
||||
end
|
||||
end
|
||||
|
||||
if slashed_page.slow_path == slashed_page.fast_path
|
||||
Benchmark.ips do |x|
|
||||
x.report('slashed_page slow') { slashed_page.slow_path }
|
||||
x.report('slashed_page fast') { slashed_page.fast_path }
|
||||
x.compare!
|
||||
end
|
||||
end
|
||||
36
benchmark/reduce-vs-each-with-object
Executable file
36
benchmark/reduce-vs-each-with-object
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "benchmark/ips"
|
||||
require "benchmark/memory"
|
||||
|
||||
GC.disable
|
||||
|
||||
PERIOD = "."
|
||||
PROPERTY_AS_HASH = ["hello", "there_oh", "friends"]
|
||||
property = "hello.there_oh.friends"
|
||||
item = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
|
||||
|
||||
def candidate(property, item)
|
||||
property.to_s.split(".".freeze).each_with_object(item) do |attribute, memo|
|
||||
memo = memo[attribute]
|
||||
end
|
||||
end
|
||||
|
||||
def control(property, item)
|
||||
property.to_s.split(".").reduce(item) do |subvalue, attribute|
|
||||
subvalue[attribute]
|
||||
end
|
||||
end
|
||||
|
||||
Benchmark.ips do |x|
|
||||
x.report("candidate") { candidate(property, item) }
|
||||
x.report("control") { control(property, item) }
|
||||
x.compare!
|
||||
end
|
||||
|
||||
Benchmark.memory do |x|
|
||||
x.report("candidate") { candidate(property, item) }
|
||||
x.report("control") { control(property, item) }
|
||||
x.compare!
|
||||
end
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require "benchmark/ips"
|
||||
|
||||
PATH = "/../../..../...//.....//lorem/ipsum//dolor///sit.xyz"
|
||||
|
||||
def sanitize_with_regex
|
||||
"/" + PATH.gsub(%r!/{2,}!, "/").gsub(%r!\.+/|\A/+!, "")
|
||||
end
|
||||
|
||||
def sanitize_with_builtin
|
||||
"/#{PATH}".gsub("..", "/").gsub("./", "").squeeze("/")
|
||||
end
|
||||
|
||||
if sanitize_with_regex == sanitize_with_builtin
|
||||
Benchmark.ips do |x|
|
||||
x.report("sanitize w/ regexes") { sanitize_with_regex }
|
||||
x.report("sanitize w/ builtin") { sanitize_with_builtin }
|
||||
x.compare!
|
||||
end
|
||||
else
|
||||
puts "w/ regexes: #{sanitize_with_regex}"
|
||||
puts "w/ builtin: #{sanitize_with_builtin}"
|
||||
puts ""
|
||||
puts "Thank you. Do try again :("
|
||||
end
|
||||
@@ -1,110 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
#
|
||||
# The Ruby documentation for #sort_by describes what's called a Schwartzian transform:
|
||||
#
|
||||
# > A more efficient technique is to cache the sort keys (modification times in this case)
|
||||
# > before the sort. Perl users often call this approach a Schwartzian transform, after
|
||||
# > Randal Schwartz. We construct a temporary array, where each element is an array
|
||||
# > containing our sort key along with the filename. We sort this array, and then extract
|
||||
# > the filename from the result.
|
||||
# > This is exactly what sort_by does internally.
|
||||
#
|
||||
# The well-documented efficiency of sort_by is a good reason to use it. However, when a property
|
||||
# does not exist on an item being sorted, it can cause issues (no nil's allowed!)
|
||||
# In Jekyll::Filters#sort_input, we extract the property in each iteration of #sort,
|
||||
# which is quite inefficient! How inefficient? This benchmark will tell you just how, and how much
|
||||
# it can be improved by using the Schwartzian transform. Thanks, Randall!
|
||||
|
||||
require 'benchmark/ips'
|
||||
require 'minitest'
|
||||
require File.expand_path("../lib/jekyll", __dir__)
|
||||
|
||||
def site
|
||||
@site ||= Jekyll::Site.new(
|
||||
Jekyll.configuration("source" => File.expand_path("../docs", __dir__))
|
||||
).tap(&:reset).tap(&:read)
|
||||
end
|
||||
|
||||
def site_docs
|
||||
site.collections["docs"].docs.dup
|
||||
end
|
||||
|
||||
def sort_by_property_directly(docs, meta_key)
|
||||
docs.sort! do |apple, orange|
|
||||
apple_property = apple[meta_key]
|
||||
orange_property = orange[meta_key]
|
||||
|
||||
if !apple_property.nil? && !orange_property.nil?
|
||||
apple_property <=> orange_property
|
||||
elsif !apple_property.nil? && orange_property.nil?
|
||||
-1
|
||||
elsif apple_property.nil? && !orange_property.nil?
|
||||
1
|
||||
else
|
||||
apple <=> orange
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def schwartzian_transform(docs, meta_key)
|
||||
docs.collect! { |d|
|
||||
[d[meta_key], d]
|
||||
}.sort! { |apple, orange|
|
||||
if !apple[0].nil? && !orange[0].nil?
|
||||
apple.first <=> orange.first
|
||||
elsif !apple[0].nil? && orange[0].nil?
|
||||
-1
|
||||
elsif apple[0].nil? && !orange[0].nil?
|
||||
1
|
||||
else
|
||||
apple[-1] <=> orange[-1]
|
||||
end
|
||||
}.collect! { |d| d[-1] }
|
||||
end
|
||||
|
||||
# Before we test efficiency, do they produce the same output?
|
||||
class Correctness
|
||||
include Minitest::Assertions
|
||||
|
||||
require "pp"
|
||||
define_method :mu_pp, &:pretty_inspect
|
||||
|
||||
attr_accessor :assertions
|
||||
|
||||
def initialize(docs, property)
|
||||
@assertions = 0
|
||||
@docs = docs
|
||||
@property = property
|
||||
end
|
||||
|
||||
def assert!
|
||||
assert sort_by_property_directly(@docs, @property).is_a?(Array), "sort_by_property_directly must return an array"
|
||||
assert schwartzian_transform(@docs, @property).is_a?(Array), "schwartzian_transform must return an array"
|
||||
assert_equal sort_by_property_directly(@docs, @property),
|
||||
schwartzian_transform(@docs, @property)
|
||||
puts "Yeah, ok, correctness all checks out for property #{@property.inspect}"
|
||||
end
|
||||
end
|
||||
|
||||
Correctness.new(site_docs, "redirect_from".freeze).assert!
|
||||
Correctness.new(site_docs, "title".freeze).assert!
|
||||
|
||||
def test_property(property, meta_key)
|
||||
Benchmark.ips do |x|
|
||||
x.config(time: 10, warmup: 5)
|
||||
x.report("sort_by_property_directly with #{property} property") do
|
||||
sort_by_property_directly(site_docs, meta_key)
|
||||
end
|
||||
x.report("schwartzian_transform with #{property} property") do
|
||||
schwartzian_transform(site_docs, meta_key)
|
||||
end
|
||||
x.compare!
|
||||
end
|
||||
end
|
||||
|
||||
# First, test with a property only a handful of documents have.
|
||||
test_property('sparse', 'redirect_from')
|
||||
|
||||
# Next, test with a property they all have.
|
||||
test_property('non-sparse', 'title')
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "forwardable"
|
||||
require "colorator"
|
||||
require "liquid"
|
||||
require "benchmark/ips"
|
||||
require "memory_profiler"
|
||||
|
||||
# Set up (memory) profiler
|
||||
|
||||
class Profiler
|
||||
def self.run
|
||||
yield new(ARGV[0] || 10_000)
|
||||
end
|
||||
|
||||
def initialize(count)
|
||||
@count = count.to_i
|
||||
end
|
||||
|
||||
def report(label, color, &block)
|
||||
prof_report = MemoryProfiler.report { @count.to_i.times(&block) }
|
||||
|
||||
allocated_memory = prof_report.scale_bytes(prof_report.total_allocated_memsize)
|
||||
allocated_objects = prof_report.total_allocated
|
||||
retained_memory = prof_report.scale_bytes(prof_report.total_retained_memsize)
|
||||
retained_objects = prof_report.total_retained
|
||||
|
||||
puts <<~MSG.send(color)
|
||||
With #{label} calls
|
||||
|
||||
Total allocated: #{allocated_memory} (#{allocated_objects} objects)
|
||||
Total retained: #{retained_memory} (#{retained_objects} objects)
|
||||
MSG
|
||||
end
|
||||
end
|
||||
|
||||
# Set up stage
|
||||
|
||||
class Drop < Liquid::Drop
|
||||
def initialize(obj)
|
||||
@obj = obj
|
||||
end
|
||||
end
|
||||
|
||||
class ForwardDrop < Drop
|
||||
extend Forwardable
|
||||
def_delegators :@obj, :name
|
||||
end
|
||||
|
||||
class StaticDrop < Drop
|
||||
def name
|
||||
@obj.name
|
||||
end
|
||||
end
|
||||
|
||||
class Document
|
||||
def name
|
||||
"lipsum"
|
||||
end
|
||||
end
|
||||
|
||||
# Set up actors
|
||||
|
||||
document = Document.new
|
||||
alpha = ForwardDrop.new(document)
|
||||
beta = StaticDrop.new(document)
|
||||
count = ARGV[0] || 10_000
|
||||
|
||||
# Run profilers
|
||||
puts "\nMemory profiles for #{count} calls to invoke drop key:"
|
||||
Profiler.run do |x|
|
||||
x.report("forwarded", :cyan) { alpha["name"] }
|
||||
x.report("static", :green) { beta["name"] }
|
||||
end
|
||||
|
||||
# Benchmark
|
||||
puts "\nBenchmarking the two scenarios..."
|
||||
Benchmark.ips do |x|
|
||||
x.report("forwarded".cyan) { alpha["name"] }
|
||||
x.report("static".green) { beta["name"] }
|
||||
x.compare!
|
||||
end
|
||||
2
docs/.gitignore
vendored
2
docs/.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
_site/
|
||||
.idea/
|
||||
*.swp
|
||||
pkg/
|
||||
test/
|
||||
.idea/
|
||||
@@ -18,10 +18,21 @@ sitemap: false
|
||||
<p>The resource you requested was not found. Here are some links to help you find your way:</p>
|
||||
<nav class="main-nav">
|
||||
<ul>
|
||||
<li><a href="{{ '/' | relative_url }}">Home</a></li>
|
||||
<li><a href="{{ '/docs/home/' | relative_url }}">Documentation</a></li>
|
||||
<li><a href="{{ '/news/' | relative_url }}">News</a></li>
|
||||
<li><a href="{{ '/help/' | relative_url }}">Help</a></li>
|
||||
<li>
|
||||
<a href="/">Home</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/docs/home/">Documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/news/">News</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/community/">Community</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/help/">Help</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
112
docs/_config.yml
112
docs/_config.yml
@@ -1,64 +1,60 @@
|
||||
---
|
||||
version: 4.2.0
|
||||
markdown: kramdown
|
||||
highlighter: rouge
|
||||
sass:
|
||||
style: compressed
|
||||
|
||||
gauges_id: 503c5af6613f5d0f19000027
|
||||
google_analytics_id: UA-50755011-1
|
||||
google_site_verification: onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY
|
||||
|
||||
repository: https://github.com/jekyll/jekyll
|
||||
help_url: https://github.com/jekyll/jekyll-help
|
||||
|
||||
timezone: America/Los_Angeles
|
||||
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "_docs"
|
||||
type: "docs"
|
||||
values:
|
||||
layout: "docs"
|
||||
-
|
||||
scope:
|
||||
path: "_posts"
|
||||
type: "posts"
|
||||
values:
|
||||
layout: "news_item"
|
||||
|
||||
|
||||
collections:
|
||||
docs:
|
||||
permalink: /:collection/:path/
|
||||
output: true
|
||||
posts:
|
||||
permalink: /news/:year/:month/:day/:title/
|
||||
output: true
|
||||
tutorials:
|
||||
output: true
|
||||
|
||||
name: Jekyll • Simple, blog-aware, static sites
|
||||
description: Transform your plain text into static websites and blogs
|
||||
url: https://jekyllrb.com
|
||||
repository: https://github.com/jekyll/jekyll
|
||||
timezone: America/Los_Angeles
|
||||
|
||||
twitter:
|
||||
username: jekyllrb
|
||||
logo: "/img/logo-2x.png"
|
||||
google_analytics_id: UA-50755011-1
|
||||
google_site_verification: onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY
|
||||
cloudinary_url: https://res.cloudinary.com/jekyll/image/upload/f_auto,q_auto,w_404
|
||||
collections:
|
||||
docs:
|
||||
permalink: "/:collection/:path/"
|
||||
output: true
|
||||
posts:
|
||||
permalink: "/news/:year/:month/:day/:title/"
|
||||
output: true
|
||||
tutorials:
|
||||
permalink: "/:collection/:path/"
|
||||
output: true
|
||||
defaults:
|
||||
- scope:
|
||||
path: _docs
|
||||
type: docs
|
||||
values:
|
||||
layout: docs
|
||||
- scope:
|
||||
path: _posts
|
||||
type: posts
|
||||
values:
|
||||
layout: news_item
|
||||
- scope:
|
||||
path: _tutorials
|
||||
type: tutorials
|
||||
values:
|
||||
layout: tutorials
|
||||
- scope:
|
||||
path: ''
|
||||
values:
|
||||
image: "/img/jekyll-og.png"
|
||||
future: true
|
||||
plugins:
|
||||
- jekyll-avatar
|
||||
- jekyll-feed
|
||||
- jekyll-mentions
|
||||
- jekyll-redirect-from
|
||||
- jekyll-seo-tag
|
||||
- jekyll-sitemap
|
||||
- jemoji
|
||||
feed:
|
||||
categories:
|
||||
- release
|
||||
kramdown:
|
||||
syntax_highlighter_opts:
|
||||
default_lang: plaintext
|
||||
sass:
|
||||
style: compressed
|
||||
strict_front_matter: true
|
||||
|
||||
logo: /img/logo-2x.png
|
||||
|
||||
gems:
|
||||
- jekyll-avatar
|
||||
- jekyll-feed
|
||||
- jekyll-mentions
|
||||
- jekyll-redirect-from
|
||||
- jekyll-seo-tag
|
||||
- jekyll-sitemap
|
||||
- jemoji
|
||||
|
||||
exclude:
|
||||
- icomoon-selection.json
|
||||
- readme.md
|
||||
- .gitignore
|
||||
- README.md
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
- name: Regeneration
|
||||
description: Enable auto-regeneration of the site when files are modified.
|
||||
flag: "-w, --[no-]watch"
|
||||
|
||||
|
||||
- name: Configuration
|
||||
description: >-
|
||||
Specify config files instead of using <code>_config.yml</code> automatically.
|
||||
Settings in later files override settings in earlier files.
|
||||
flag: "--config FILE1[,FILE2,...]"
|
||||
|
||||
|
||||
- name: Plugins
|
||||
description: >-
|
||||
Specify plugin directories instead of using <code>_plugins/</code> automatically.
|
||||
option: "plugins_dir: [ DIR1,... ]"
|
||||
flag: "-p, --plugins DIR1[,DIR2,...]"
|
||||
|
||||
|
||||
- name: Layouts
|
||||
description: >-
|
||||
Specify layout directory instead of using <code>_layouts/</code> automatically.
|
||||
option: "layout_dir: DIR"
|
||||
flag: --layouts DIR
|
||||
|
||||
|
||||
- name: Drafts
|
||||
description: Process and render draft posts.
|
||||
option: "show_drafts: BOOL"
|
||||
flag: -D, --drafts
|
||||
|
||||
|
||||
- name: Environment
|
||||
description: Use a specific environment value in the build.
|
||||
flag: JEKYLL_ENV=production
|
||||
|
||||
|
||||
- name: Future
|
||||
description: Publish posts or collection documents with a future date.
|
||||
option: "future: BOOL"
|
||||
flag: --future
|
||||
|
||||
|
||||
- name: Unpublished
|
||||
description: Render posts that were marked as unpublished.
|
||||
option: "unpublished: BOOL"
|
||||
flag: --unpublished
|
||||
|
||||
|
||||
- name: LSI
|
||||
description: >-
|
||||
Produce an index for related posts. Requires the
|
||||
<a href="https://jekyll.github.io/classifier-reborn/">classifier-reborn</a> plugin.
|
||||
option: "lsi: BOOL"
|
||||
flag: --lsi
|
||||
|
||||
|
||||
- name: Limit Posts
|
||||
description: Limit the number of posts to parse and publish.
|
||||
option: "limit_posts: NUM"
|
||||
flag: --limit_posts NUM
|
||||
|
||||
|
||||
- name: Force polling
|
||||
description: Force watch to use polling.
|
||||
option: "force_polling: BOOL"
|
||||
flag: --force_polling
|
||||
|
||||
|
||||
- name: Verbose output
|
||||
description: Print verbose output.
|
||||
flag: -V, --verbose
|
||||
|
||||
|
||||
- name: Silence Output
|
||||
description: Silence the normal output from Jekyll during a build.
|
||||
flag: -q, --quiet
|
||||
|
||||
|
||||
- name: Incremental build
|
||||
description: >-
|
||||
Enable the experimental incremental build feature. Incremental build only
|
||||
re-builds posts and pages that have changed, resulting in significant performance
|
||||
improvements for large sites, but may also break site generation in certain
|
||||
cases.
|
||||
option: "incremental: BOOL"
|
||||
flag: -I, --incremental
|
||||
|
||||
|
||||
- name: Liquid profiler
|
||||
description: Generate a Liquid rendering profile to help you identify performance bottlenecks.
|
||||
option: "profile: BOOL"
|
||||
flag: --profile
|
||||
|
||||
|
||||
- name: Strict Front Matter
|
||||
description: Cause a build to fail if there is a YAML syntax error in a page's front matter.
|
||||
option: "strict_front_matter: BOOL"
|
||||
flag: --strict_front_matter
|
||||
|
||||
|
||||
- name: Base URL
|
||||
description: Serve the website from the given base URL.
|
||||
option: "baseurl: URL"
|
||||
flag: -b, --baseurl URL
|
||||
|
||||
|
||||
- name: Trace
|
||||
description: Show the full backtrace when an error occurs.
|
||||
flag: -t, --trace
|
||||
@@ -1,77 +0,0 @@
|
||||
- name: Site Source
|
||||
description: Change the directory where Jekyll will read files
|
||||
option: "source: DIR"
|
||||
flag: -s, --source DIR
|
||||
|
||||
|
||||
- name: Site Destination
|
||||
description: Change the directory where Jekyll will write files
|
||||
option: "destination: DIR"
|
||||
flag: -d, --destination DIR
|
||||
|
||||
|
||||
- name: Safe
|
||||
description: >-
|
||||
Disable <a href="/docs/plugins/">non-whitelisted plugins</a>, caching to disk, and ignore symbolic links.
|
||||
option: "safe: BOOL"
|
||||
flag: --safe
|
||||
|
||||
|
||||
- name: Disable Disk Cache
|
||||
version-badge: 4.1.0
|
||||
description: >-
|
||||
Disable caching of content to disk in order to skip creating a <code>.jekyll-cache</code> or similar directory at
|
||||
the source to avoid interference with virtual environments and third-party directory watchers. Caching to disk is
|
||||
always disabled in <code>safe</code> mode.
|
||||
option: "disable_disk_cache: BOOL"
|
||||
flag: --disable-disk-cache
|
||||
|
||||
|
||||
- name: Ignore theme configuration
|
||||
version-badge: 4.1.0
|
||||
description: >-
|
||||
Jekyll 4.0 started allowing themes to bundle a <code>_config.yml</code> to simplify theme-onboarding for new users.
|
||||
In the unfortunate situation that importing a bundled theme configuration messes up the merged site-configuration,
|
||||
the user can configure Jekyll to not import the theme-config entirely.
|
||||
option: "ignore_theme_config: BOOL"
|
||||
|
||||
|
||||
- name: Exclude
|
||||
description: >-
|
||||
Exclude directories and/or files from the conversion. These exclusions are relative to the site's source directory
|
||||
and cannot be outside the source directory.
|
||||
option: "exclude: [DIR, FILE, ...]"
|
||||
|
||||
|
||||
- name: Include
|
||||
description: >-
|
||||
Force inclusion of directories and/or files in the conversion. <code>.htaccess</code> is a good example since
|
||||
dotfiles are excluded by default.
|
||||
option: "include: [DIR, FILE, ...]"
|
||||
|
||||
|
||||
- name: Keep files
|
||||
description: >-
|
||||
When clobbering the site destination, keep the selected files. Useful for files that are not generated by jekyll;
|
||||
e.g. files or assets that are generated by your build tool. The paths are relative to the <code>destination</code>.
|
||||
option: "keep_files: [DIR, FILE, ...]"
|
||||
|
||||
|
||||
- name: Time Zone
|
||||
description: >-
|
||||
Set the time zone for site generation. This sets the <code>TZ</code> environment variable, which Ruby uses to handle
|
||||
time and date creation and manipulation. Any entry from the
|
||||
<a href="https://en.wikipedia.org/wiki/Tz_database">IANA Time Zone Database</a>
|
||||
is valid, e.g. <code>America/New_York</code>. A list of all available values can be found
|
||||
<a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones"> here</a>.
|
||||
When serving on a local machine, the default time zone is set by your operating system. But when served on a remote
|
||||
host/server, the default time zone depends on the server's setting or location.
|
||||
option: "timezone: TIMEZONE"
|
||||
|
||||
|
||||
- name: Encoding
|
||||
description: >-
|
||||
Set the encoding of files by name (only available for Ruby 1.9 or later). The default value is <code>utf-8</code>
|
||||
starting in 2.0.0, and <code>nil</code> before 2.0.0, which will yield the Ruby default of <code>ASCII-8BIT</code>.
|
||||
Available encodings can be shown by the command <code>ruby -e 'puts Encoding::list.join("\n")'</code>.
|
||||
option: "encoding: ENCODING"
|
||||
@@ -1,71 +0,0 @@
|
||||
- name: Local Server Port
|
||||
description: Listen on the given port.
|
||||
option: "port: PORT"
|
||||
flag: "-P, --port PORT"
|
||||
|
||||
|
||||
- name: Local Server Hostname
|
||||
description: Listen at the given hostname.
|
||||
option: "host: HOSTNAME"
|
||||
flag: "-H, --host HOSTNAME"
|
||||
|
||||
|
||||
- name: Live Reload
|
||||
description: Reload a page automatically on the browser when its content is edited.
|
||||
option: "livereload: BOOL"
|
||||
flag: "-l, --livereload"
|
||||
|
||||
|
||||
- name: Live Reload Ignore
|
||||
description: File glob patterns for LiveReload to ignore.
|
||||
option: "livereload_ignore: [ GLOB1,... ]"
|
||||
flag: "--livereload-ignore GLOB1[,GLOB2,...]"
|
||||
|
||||
|
||||
- name: Live Reload Min/Max Delay
|
||||
description: Minimum/Maximum delay before automatically reloading page.
|
||||
options:
|
||||
- "livereload_min_delay: SECONDS"
|
||||
- "livereload_max_delay: SECONDS"
|
||||
flags:
|
||||
- "--livereload-min-delay SECONDS"
|
||||
- "--livereload-max-delay SECONDS"
|
||||
|
||||
|
||||
- name: Live Reload Port
|
||||
description: Port for LiveReload to listen on.
|
||||
flag: "--livereload-port PORT"
|
||||
|
||||
|
||||
- name: Open URL
|
||||
description: Open the site's URL in the browser.
|
||||
option: "open_url: BOOL"
|
||||
flag: "-o, --open-url"
|
||||
|
||||
|
||||
- name: Detach
|
||||
description: Detach the server from the terminal.
|
||||
option: "detach: BOOL"
|
||||
flag: "-B, --detach"
|
||||
|
||||
|
||||
- name: Skips the initial site build
|
||||
description: Skips the initial site build which occurs before the server is started.
|
||||
option: "skip_initial_build: BOOL"
|
||||
flag: "--skip-initial-build"
|
||||
|
||||
|
||||
- name: Show Directory Listing
|
||||
description: Show a directory listing instead of loading your index file.
|
||||
option: "show_dir_listing: BOOL"
|
||||
flag: "--show-dir-listing"
|
||||
|
||||
|
||||
- name: X.509 (SSL) Private Key
|
||||
description: "SSL Private Key, stored or symlinked in the site source."
|
||||
flag: "--ssl-key"
|
||||
|
||||
|
||||
- name: X.509 (SSL) Certificate
|
||||
description: "SSL Public certificate, stored or symlinked in the site source."
|
||||
flag: "--ssl-cert"
|
||||
53
docs/_data/docs.yml
Normal file
53
docs/_data/docs.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
- title: Getting Started
|
||||
docs:
|
||||
- home
|
||||
- quickstart
|
||||
- installation
|
||||
- windows
|
||||
- usage
|
||||
- structure
|
||||
- configuration
|
||||
|
||||
- title: Your Content
|
||||
docs:
|
||||
- frontmatter
|
||||
- posts
|
||||
- drafts
|
||||
- pages
|
||||
- static-files
|
||||
- variables
|
||||
- collections
|
||||
- datafiles
|
||||
- assets
|
||||
- migrations
|
||||
|
||||
- title: Customization
|
||||
docs:
|
||||
- templates
|
||||
- includes
|
||||
- permalinks
|
||||
- pagination
|
||||
- plugins
|
||||
- themes
|
||||
- extras
|
||||
|
||||
- title: Deployment
|
||||
docs:
|
||||
- github-pages
|
||||
- deployment-methods
|
||||
- continuous-integration
|
||||
|
||||
- title: Miscellaneous
|
||||
docs:
|
||||
- troubleshooting
|
||||
- sites
|
||||
- resources
|
||||
- upgrading/0-to-2
|
||||
- upgrading/2-to-3
|
||||
|
||||
- title: Meta
|
||||
docs:
|
||||
- contributing
|
||||
- maintaining
|
||||
- conduct
|
||||
- history
|
||||
@@ -1,37 +0,0 @@
|
||||
- title: Getting Started
|
||||
docs:
|
||||
- link: /docs/
|
||||
- link: /docs/installation/
|
||||
- link: /docs/ruby-101/
|
||||
- link: /docs/community/
|
||||
- link: /docs/step-by-step/01-setup/
|
||||
- title: Build
|
||||
docs:
|
||||
- link: /docs/usage/
|
||||
- link: /docs/configuration/
|
||||
- link: /docs/rendering-process/
|
||||
- title: Content
|
||||
docs:
|
||||
- link: /docs/pages/
|
||||
- link: /docs/posts/
|
||||
- link: /docs/front-matter/
|
||||
- link: /docs/collections/
|
||||
- link: /docs/datafiles/
|
||||
- link: /docs/assets/
|
||||
- link: /docs/static-files/
|
||||
- title: Site Structure
|
||||
docs:
|
||||
- link: /docs/structure/
|
||||
- link: /docs/liquid/
|
||||
- link: /docs/variables/
|
||||
- link: /docs/includes/
|
||||
- link: /docs/layouts/
|
||||
- link: /docs/permalinks/
|
||||
- link: /docs/themes/
|
||||
- link: /docs/pagination/
|
||||
- title: Guides
|
||||
docs:
|
||||
- link: /docs/plugins/
|
||||
- link: /docs/migrations/
|
||||
- link: /docs/upgrading/
|
||||
- link: /docs/deployment/
|
||||
@@ -1,347 +0,0 @@
|
||||
#
|
||||
# ---------------------------------------------------------------------------------------
|
||||
# List of Liquid Filters provided by Jekyll Core that will be utilized for their
|
||||
# documentation.
|
||||
#
|
||||
# To document a new filter, create a new "list-item" below with the following keys:
|
||||
# name: : [REQUIRED] A string label that identifies the filter
|
||||
# description: : [REQUIRED] A short description of what to expect from the filter
|
||||
# version_badge: : [OPTIONAL] Jekyll version that introduced the filter
|
||||
# examples: : [REQUIRED] A 'nested list' comprised of inputs and outputs
|
||||
# input: : [REQUIRED] The filter syntax and usage
|
||||
# output: : [OPTIONAL] The output from the filter
|
||||
#
|
||||
# Tip: Use YAML Block notations to "fold" a long string, or to "break" a long string
|
||||
# to the following line. Block notations can also be used to avoid having to use
|
||||
# backslashes to escape quotes.
|
||||
# ---------------------------------------------------------------------------------------
|
||||
#
|
||||
- name: Relative URL
|
||||
description: >-
|
||||
Prepend the <code>baseurl</code> value to the input. Useful if
|
||||
your site is hosted at a subpath rather than the root of the domain.
|
||||
examples:
|
||||
- input: '{{ "/assets/style.css" | relative_url }}'
|
||||
output: '/my-baseurl/assets/style.css'
|
||||
|
||||
#
|
||||
|
||||
- name: Absolute URL
|
||||
description: Prepend the <code>url</code> and <code>baseurl</code> value to the input.
|
||||
examples:
|
||||
- input: '{{ "/assets/style.css" | absolute_url }}'
|
||||
output: 'http://example.com/my-baseurl/assets/style.css'
|
||||
|
||||
#
|
||||
|
||||
- name: Date to XML Schema
|
||||
description: Convert a Date into XML Schema (ISO 8601) format.
|
||||
examples:
|
||||
- input: '{{ site.time | date_to_xmlschema }}'
|
||||
output: '2008-11-07T13:07:54-08:00'
|
||||
|
||||
#
|
||||
|
||||
- name: Date to RFC-822 Format
|
||||
description: Convert a Date into the RFC-822 format used for RSS feeds.
|
||||
examples:
|
||||
- input: '{{ site.time | date_to_rfc822 }}'
|
||||
output: 'Mon, 07 Nov 2008 13:07:54 -0800'
|
||||
|
||||
#
|
||||
|
||||
- name: Date to String
|
||||
description: Convert a date to short format.
|
||||
examples:
|
||||
- input: '{{ site.time | date_to_string }}'
|
||||
output: '07 Nov 2008'
|
||||
|
||||
#
|
||||
|
||||
- name: Date to String in ordinal US style
|
||||
description: 'Format a date to ordinal, US, short format.'
|
||||
version_badge: 3.8.0
|
||||
examples:
|
||||
- input: '{{ site.time | date_to_string: "ordinal", "US" }}'
|
||||
output: 'Nov 7th, 2008'
|
||||
|
||||
#
|
||||
|
||||
- name: Date to Long String
|
||||
description: Format a date to long format.
|
||||
examples:
|
||||
- input: '{{ site.time | date_to_long_string }}'
|
||||
output: '07 November 2008'
|
||||
|
||||
#
|
||||
|
||||
- name: Date to Long String in ordinal UK style
|
||||
description: 'Format a date to ordinal, UK, long format.'
|
||||
version_badge: 3.8.0
|
||||
examples:
|
||||
- input: '{{ site.time | date_to_long_string: "ordinal" }}'
|
||||
output: '7th November 2008'
|
||||
|
||||
#
|
||||
|
||||
- name: Where
|
||||
description: Select all the objects in an array where the key has the given value.
|
||||
examples:
|
||||
- input: '{{ site.members | where:"graduation_year","2014" }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Where Expression
|
||||
description: Select all the objects in an array where the expression is true.
|
||||
version_badge: 3.2.0
|
||||
examples:
|
||||
- input: |-
|
||||
{{ site.members | where_exp:"item",
|
||||
"item.graduation_year == 2014" }}
|
||||
output:
|
||||
- input: |-
|
||||
{{ site.members | where_exp:"item",
|
||||
"item.graduation_year < 2014" }}
|
||||
output:
|
||||
- input: |-
|
||||
{{ site.members | where_exp:"item",
|
||||
"item.projects contains 'foo'" }}
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Find
|
||||
description: >-
|
||||
Return <strong>the first object</strong> in an array for which the queried
|
||||
attribute has the given value or return <code>nil</code> if no item in
|
||||
the array satisfies the given criteria.
|
||||
version_badge: 4.1.0
|
||||
examples:
|
||||
- input: '{{ site.members | find: "graduation_year", "2014" }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Find Expression
|
||||
description: >-
|
||||
Return <strong>the first object</strong> in an array for which the given
|
||||
expression evaluates to true or return <code>nil</code> if no item in
|
||||
the array satisfies the evaluated expression.
|
||||
version_badge: 4.1.0
|
||||
examples:
|
||||
- input: |-
|
||||
{{ site.members | find_exp:"item",
|
||||
"item.graduation_year == 2014" }}
|
||||
output:
|
||||
- input: |-
|
||||
{{ site.members | find_exp:"item",
|
||||
"item.graduation_year < 2014" }}
|
||||
output:
|
||||
- input: |-
|
||||
{{ site.members | find_exp:"item",
|
||||
"item.projects contains 'foo'" }}
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Group By
|
||||
description: Group an array's items by a given property.
|
||||
examples:
|
||||
- input: '{{ site.members | group_by:"graduation_year" }}'
|
||||
output: |-
|
||||
[{"name"=>"2013", "items"=>[...]},
|
||||
{"name"=>"2014", "items"=>[...]}]
|
||||
|
||||
#
|
||||
|
||||
- name: Group By Expression
|
||||
description: Group an array's items using a Liquid expression.
|
||||
version_badge: 3.4.0
|
||||
examples:
|
||||
- input: |-
|
||||
{{ site.members | group_by_exp: "item",
|
||||
"item.graduation_year | truncate: 3, ''" }}
|
||||
output: |-
|
||||
[{"name"=>"201", "items"=>[...]},
|
||||
{"name"=>"200", "items"=>[...]}]
|
||||
|
||||
#
|
||||
|
||||
- name: XML Escape
|
||||
description: Escape some text for use in XML.
|
||||
examples:
|
||||
- input: '{{ page.content | xml_escape }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: CGI Escape
|
||||
description: >-
|
||||
CGI escape a string for use in a URL. Replaces any special characters
|
||||
with appropriate <code>%XX</code> replacements. CGI escape normally
|
||||
replaces a space with a plus <code>+</code> sign.
|
||||
examples:
|
||||
- input: '{{ "foo, bar; baz?" | cgi_escape }}'
|
||||
output: 'foo%2C+bar%3B+baz%3F'
|
||||
|
||||
#
|
||||
|
||||
- name: URI Escape
|
||||
description: >-
|
||||
Percent encodes any special characters in a URI.
|
||||
URI escape normally replaces a space with <code>%20</code>.
|
||||
<a href="https://en.wikipedia.org/wiki/Percent-encoding#Types_of_URI_characters">Reserved characters</a>
|
||||
will not be escaped.
|
||||
examples:
|
||||
- input: '{{ "http://foo.com/?q=foo, \bar?" | uri_escape }}'
|
||||
output: 'http://foo.com/?q=foo,%20%5Cbar?'
|
||||
|
||||
#
|
||||
|
||||
- name: Number of Words
|
||||
description: >-
|
||||
Count the number of words in some text.<br/>
|
||||
From <span class="version-badge">v4.1.0</span>, this filter takes an optional
|
||||
argument to control the handling of Chinese-Japanese-Korean (CJK) characters
|
||||
in the <code>input</code> string.<br/>
|
||||
Passing <code>'cjk'</code> as the argument will count every CJK character
|
||||
detected as one word irrespective of being separated by whitespace.<br/>
|
||||
Passing <code>'auto'</code> (auto-detect) works similar to <code>'cjk'</code>
|
||||
but is more performant if the filter is used on a variable string that may
|
||||
or may not contain CJK chars.
|
||||
examples:
|
||||
- input: '{{ "Hello world!" | number_of_words }}'
|
||||
output: 2
|
||||
- input: '{{ "你好hello世界world" | number_of_words }}'
|
||||
output: 1
|
||||
- input: '{{ "你好hello世界world" | number_of_words: "cjk" }}'
|
||||
output: 6
|
||||
- input: '{{ "你好hello世界world" | number_of_words: "auto" }}'
|
||||
output: 6
|
||||
|
||||
#
|
||||
|
||||
- name: Array to Sentence
|
||||
description: >-
|
||||
Convert an array into a sentence. Useful for listing tags.
|
||||
Optional argument for connector.
|
||||
examples:
|
||||
- input: '{{ page.tags | array_to_sentence_string }}'
|
||||
output: 'foo, bar, and baz'
|
||||
- input: '{{ page.tags | array_to_sentence_string: "or" }}'
|
||||
output: 'foo, bar, or baz'
|
||||
|
||||
#
|
||||
|
||||
- name: Markdownify
|
||||
description: Convert a Markdown-formatted string into HTML.
|
||||
examples:
|
||||
- input: '{{ page.excerpt | markdownify }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Smartify
|
||||
description: 'Convert "quotes" into “smart quotes.”'
|
||||
examples:
|
||||
- input: '{{ page.title | smartify }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Converting Sass/SCSS
|
||||
description: Convert a Sass- or SCSS-formatted string into CSS.
|
||||
examples:
|
||||
- input: '{{ some_sass | sassify }}'
|
||||
output:
|
||||
- input: '{{ some_scss | scssify }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Slugify
|
||||
description: Convert a string into a lowercase URL "slug". See below for options.
|
||||
examples:
|
||||
- input: '{{ "The _config.yml file" | slugify }}'
|
||||
output: 'the-config-yml-file'
|
||||
- input: '{{ "The _config.yml file" | slugify: "pretty" }}'
|
||||
output: 'the-_config.yml-file'
|
||||
- input: '{{ "The _cönfig.yml file" | slugify: "ascii" }}'
|
||||
output: 'the-c-nfig-yml-file'
|
||||
- input: '{{ "The cönfig.yml file" | slugify: "latin" }}'
|
||||
output: 'the-config-yml-file'
|
||||
|
||||
#
|
||||
|
||||
- name: Data To JSON
|
||||
description: Convert Hash or Array to JSON.
|
||||
examples:
|
||||
- input: '{{ site.data.projects | jsonify }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Normalize Whitespace
|
||||
description: Replace any occurrence of whitespace with a single space.
|
||||
examples:
|
||||
- input: '{{ "a \n b" | normalize_whitespace }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Sort
|
||||
description: >-
|
||||
Sort an array. Optional arguments for hashes
|
||||
1. property name
|
||||
2. nils order (<em>first</em> or <em>last</em>).
|
||||
examples:
|
||||
- input: '{{ page.tags | sort }}'
|
||||
output:
|
||||
- input: '{{ site.posts | sort: "author" }}'
|
||||
output:
|
||||
- input: '{{ site.pages | sort: "title", "last" }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Sample
|
||||
description: 'Pick a random value from an array. Optionally, pick multiple values.'
|
||||
examples:
|
||||
- input: '{{ site.pages | sample }}'
|
||||
output:
|
||||
- input: '{{ site.pages | sample: 2 }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: To Integer
|
||||
description: Convert a string or boolean to integer.
|
||||
examples:
|
||||
- input: '{{ some_var | to_integer }}'
|
||||
output:
|
||||
|
||||
#
|
||||
|
||||
- name: Array Filters
|
||||
description: >-
|
||||
Push, pop, shift, and unshift elements from an Array.
|
||||
These are <strong>NON-DESTRUCTIVE</strong>, i.e. they do not mutate the array,
|
||||
but rather make a copy and mutate that.
|
||||
examples:
|
||||
- input: '{{ page.tags | push: "Spokane" }}'
|
||||
output: '["Seattle", "Tacoma", "Spokane"]'
|
||||
- input: '{{ page.tags | pop }}'
|
||||
output: '["Seattle"]'
|
||||
- input: '{{ page.tags | shift }}'
|
||||
output: '["Tacoma"]'
|
||||
- input: '{{ page.tags | unshift: "Olympia" }}'
|
||||
output: '["Olympia", "Seattle", "Tacoma"]'
|
||||
|
||||
#
|
||||
|
||||
- name: Inspect
|
||||
description: Convert an object into its String representation for debugging.
|
||||
examples:
|
||||
- input: '{{ some_var | inspect }}'
|
||||
output:
|
||||
@@ -1,175 +0,0 @@
|
||||
# Variables provided by Jekyll core
|
||||
#
|
||||
# name: : name of the variable
|
||||
# description: : content returned by the varialble
|
||||
|
||||
global:
|
||||
- name: site
|
||||
description: >-
|
||||
Site wide information + configuration settings from <code>_config.yml</code>.
|
||||
See below for details.
|
||||
- name: page
|
||||
description: >-
|
||||
Page specific information + the <a href="/docs/front-matter/">front matter</a>.
|
||||
Custom variables set via the front matter will be available here. See below for details.
|
||||
- name: layout
|
||||
description: >-
|
||||
Layout specific information + the <a href="/docs/front-matter/">front matter</a>.
|
||||
Custom variables set via front matter in layouts will be available here.
|
||||
- name: content
|
||||
description: >-
|
||||
In layout files, the rendered content of the Post or Page being wrapped.
|
||||
Not defined in Post or Page files.
|
||||
- name: paginator
|
||||
description: >-
|
||||
When the <code>paginate</code> configuration option is set, this variable becomes available
|
||||
for use. See <a href="../pagination/">Pagination</a> for details.
|
||||
|
||||
site:
|
||||
- name: site.time
|
||||
description: >-
|
||||
The current time (when you run the <code>jekyll</code> command).
|
||||
- name: site.pages
|
||||
description: >-
|
||||
A list of all Pages.
|
||||
- name: site.posts
|
||||
description: >-
|
||||
A reverse chronological list of all Posts.
|
||||
- name: site.related_posts
|
||||
description: >-
|
||||
If the page being processed is a Post, this contains a list of up to ten related Posts.
|
||||
By default, these are the ten most recent posts. For high quality but slow to compute
|
||||
results, run the <code>jekyll</code> command with the <code>--lsi</code>
|
||||
(<a href="https://en.wikipedia.org/wiki/Latent_semantic_analysis#Latent_semantic_indexing">latent semantic indexing</a>)
|
||||
option. Also note GitHub Pages does not support the
|
||||
<code>lsi</code> option when generating sites.
|
||||
- name: site.static_files
|
||||
description: >-
|
||||
A list of all <a href="/docs/static-files/">static files</a> (i.e.
|
||||
files not processed by Jekyll's converters or the Liquid renderer).
|
||||
Each file has five properties: <code>path</code>, <code>modified_time</code>,
|
||||
<code>name</code>, <code>basename</code> and <code>extname</code>.
|
||||
- name: site.html_pages
|
||||
description: >-
|
||||
A subset of <code>site.pages</code> listing those which end in <code>.html</code>.
|
||||
- name: site.html_files
|
||||
description: >-
|
||||
A subset of <code>site.static_files</code> listing those which end in <code>.html</code>.
|
||||
- name: site.collections
|
||||
description: >-
|
||||
A list of all the collections (including posts).
|
||||
- name: site.data
|
||||
description: >-
|
||||
A list containing the data loaded from the YAML files located in the <code>_data</code>
|
||||
directory.
|
||||
- name: site.documents
|
||||
description: >-
|
||||
A list of all the documents in every collection.
|
||||
- name: site.categories.CATEGORY
|
||||
description: >-
|
||||
The list of all Posts in category <code>CATEGORY</code>.
|
||||
- name: site.tags.TAG
|
||||
description: >-
|
||||
The list of all Posts with tag <code>TAG</code>.
|
||||
- name: site.url
|
||||
description: >-
|
||||
Contains the url of your site as it is configured in the <code>_config.yml</code>.
|
||||
For example, if you have <code>url: http://mysite.com</code> in your configuration file,
|
||||
then it will be accessible in Liquid as <code>site.url</code>. For the development
|
||||
environment there is <a href="/news/#3-siteurl-is-set-by-the-development-server">an
|
||||
exception</a>, if you are running <code>jekyll serve</code> in a development environment
|
||||
<code>site.url</code> will be set to the value of <code>host</code>, <code>port</code>,
|
||||
and SSL-related options. This defaults to <code>url: http://localhost:4000</code>.
|
||||
- name: "site.[CONFIGURATION_DATA]"
|
||||
description: >-
|
||||
All the variables set via the command line and your <code>_config.yml</code> are available
|
||||
through the <code>site</code> variable. For example, if you have <code>foo: bar</code> in
|
||||
your configuration file, then it will be accessible in Liquid as <code>site.foo</code>.
|
||||
Jekyll does not parse changes to <code>_config.yml</code> in
|
||||
<code>watch</code> mode, you must restart Jekyll to see changes to variables.
|
||||
|
||||
page:
|
||||
- name: page.content
|
||||
description: >-
|
||||
The content of the Page, rendered or un-rendered depending upon
|
||||
what Liquid is being processed and what <code>page</code> is.
|
||||
- name: page.title
|
||||
description: >-
|
||||
The title of the Page.
|
||||
- name: page.excerpt
|
||||
description: >-
|
||||
The un-rendered excerpt of a document.
|
||||
- name: page.url
|
||||
description: >-
|
||||
The URL of the Post without the domain, but with a leading slash, e.g.
|
||||
<code>/2008/12/14/my-post.html</code>
|
||||
- name: page.date
|
||||
description: >-
|
||||
The Date assigned to the Post. This can be overridden in a Post’s front matter by specifying
|
||||
a new date/time in the format <code>YYYY-MM-DD HH:MM:SS</code> (assuming UTC), or
|
||||
<code>YYYY-MM-DD HH:MM:SS +/-TTTT</code> (to specify a time zone using an offset from UTC.
|
||||
e.g. <code>2008-12-14 10:30:00 +0900</code>).
|
||||
- name: page.id
|
||||
description: >-
|
||||
An identifier unique to a document in a Collection or a Post (useful in RSS feeds). e.g.
|
||||
<code>/2008/12/14/my-post</code><code>/my-collection/my-document</code>
|
||||
- name: page.categories
|
||||
description: >-
|
||||
The list of categories to which this post belongs. Categories are derived from the directory
|
||||
structure above the <code>_posts</code> directory. For example, a post at
|
||||
<code>/work/code/_posts/2008-12-24-closures.md</code> would have this field set to
|
||||
<code>['work', 'code']</code>. These can also be specified in the
|
||||
<a href="/docs/front-matter/">front matter</a>.
|
||||
- name: page.collection
|
||||
description: >-
|
||||
The label of the collection to which this document belongs. e.g. <code>posts</code> for a post, or
|
||||
<code>puppies</code> for a document at path <code>_puppies/rover.md</code>. If not part of a
|
||||
collection, an empty string is returned.
|
||||
- name: page.tags
|
||||
description: >-
|
||||
The list of tags to which this post belongs. These can be specified in the
|
||||
<a href="/docs/front-matter/">front matter</a>.
|
||||
- name: page.dir
|
||||
description: >-
|
||||
The path between the source directory and the file of the post or page, e.g.
|
||||
<code>/pages/</code>.
|
||||
This can be overridden by <code>permalink</code> in the <a href="/docs/front-matter/">front matter</a>.
|
||||
- name: page.name
|
||||
description: >-
|
||||
The filename of the post or page, e.g. <code>about.md</code>
|
||||
- name: page.path
|
||||
description: >-
|
||||
The path to the raw post or page. Example usage: Linking back to the page or post’s source
|
||||
on GitHub. This can be overridden in the <a href="/docs/front-matter/">front matter</a>.
|
||||
- name: page.next
|
||||
description: >-
|
||||
The next post relative to the position of the current post in <code>site.posts</code>.
|
||||
Returns <code>nil</code> for the last entry.
|
||||
- name: page.previous
|
||||
description: >-
|
||||
The previous post relative to the position of the current post in <code>site.posts</code>.
|
||||
Returns <code>nil</code> for the first entry.
|
||||
|
||||
paginator:
|
||||
- name: paginator.page
|
||||
description: The number of the current page
|
||||
- name: paginator.per_page
|
||||
description: Number of posts per page
|
||||
- name: paginator.posts
|
||||
description: Posts available for the current page
|
||||
- name: paginator.total_posts
|
||||
description: Total number of posts
|
||||
- name: paginator.total_pages
|
||||
description: Total number of pages
|
||||
- name: paginator.previous_page
|
||||
description: >-
|
||||
The number of the previous page, or <code>nil</code> if no previous page exists
|
||||
- name: paginator.previous_page_path
|
||||
description: >-
|
||||
The path to the previous page, or <code>nil</code> if no previous page exists
|
||||
- name: paginator.next_page
|
||||
description: >-
|
||||
The number of the next page, or <code>nil</code> if no subsequent page exists
|
||||
- name: paginator.next_page_path
|
||||
description: >-
|
||||
The path to the next page, or <code>nil</code> if no subsequent page exists
|
||||
@@ -53,7 +53,7 @@
|
||||
year: 2016
|
||||
|
||||
- speaker: Amy Johnston
|
||||
twitter_handle: AmyJohnstonXL
|
||||
twitter_handle: amybeukenex
|
||||
youtube_id: HR12JiUI2Zc
|
||||
topic: Jekyll for Technical Documentation
|
||||
year: 2016
|
||||
@@ -83,7 +83,7 @@
|
||||
year: 2016
|
||||
|
||||
- speaker: Julio Faerman
|
||||
twitter_handle: juliodevrel
|
||||
twitter_handle: jmfaerman
|
||||
youtube_id: SOMonG8Iqak
|
||||
topic: Jekyll on AWS
|
||||
year: 2016
|
||||
@@ -131,7 +131,7 @@
|
||||
year: 2016
|
||||
|
||||
- speaker: Nils Borchers
|
||||
twitter_handle: nilsbo
|
||||
twitter_handle: nilsborchers
|
||||
youtube_id: DtNMjuv6Rbo
|
||||
topic: Building a living brand guide with Jekyll and Hologram
|
||||
year: 2016
|
||||
@@ -165,45 +165,3 @@
|
||||
youtube_id: nq1AUB72GCQ
|
||||
topic: Overcoming challenges in using Jekyll for documentation projects
|
||||
year: 2016
|
||||
|
||||
- speaker: Pieter Roozen
|
||||
twitter_handle: Pieter_Roozen
|
||||
youtube_id: moQP0SqEPsw
|
||||
topic: Jekyll As An API Endpoint
|
||||
year: 2019
|
||||
|
||||
- speaker: Chen Hui Jing
|
||||
twitter_handle: hj_chen
|
||||
youtube_id: CERXESTZ5w4
|
||||
topic: Why I love Jekyll Data Files
|
||||
year: 2019
|
||||
|
||||
- speaker: Chris Ferdinandi
|
||||
twitter_handle: ChrisFerdinandi
|
||||
youtube_id: vR1aI_kQ4-A
|
||||
topic: The Lean Web
|
||||
year: 2019
|
||||
|
||||
- speaker: Catherine Roebuck
|
||||
twitter_handle:
|
||||
youtube_id: zTAP1m1BaDM
|
||||
topic: Jekyll For City Government
|
||||
year: 2019
|
||||
|
||||
- speaker: Joost van der Schee
|
||||
twitter_handle: jhvanderschee
|
||||
youtube_id: ztJJ1GSlYgI
|
||||
topic: "Jekyll Codex - Jekyll for front-end developers"
|
||||
year: 2019
|
||||
|
||||
- speaker: Matthew Loberg
|
||||
twitter_handle: mloberg
|
||||
youtube_id: 6eiAjAtSGqw
|
||||
topic: Leverage AWS S3 And CloudFront To Deploy Blazing Fast Jekyll Sites
|
||||
year: 2019
|
||||
|
||||
- speaker: George Phillips
|
||||
twitter_handle: gphillips_nz
|
||||
youtube_id: nEvdOwFJBVc
|
||||
topic: Structuring Jekyll Sites For Enterprise Design Systems
|
||||
year: 2019
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
- title: Home
|
||||
link: /
|
||||
show_on_mobile: true
|
||||
- title: Docs
|
||||
link: /docs/
|
||||
show_on_mobile: true
|
||||
- title: Resources
|
||||
link: /resources/
|
||||
show_on_mobile: true
|
||||
- title: Showcase
|
||||
link: /showcase/
|
||||
show_on_mobile: false
|
||||
- title: News
|
||||
link: /news/
|
||||
show_on_mobile: true
|
||||
@@ -1,3 +0,0 @@
|
||||
min_version: 2.5.0
|
||||
current_version: 2.7.2
|
||||
current_version_output: ruby 2.7.2p137 (2020-10-01 revision 5445e04352)
|
||||
@@ -1,329 +0,0 @@
|
||||
- name: Tom Preston Werner Blog
|
||||
url: http://tom.preston-werner.com/
|
||||
image: tom-preston-werner.png
|
||||
categories:
|
||||
- personal
|
||||
- blog
|
||||
|
||||
# - name: White House Social and Behavioral Sciences Team
|
||||
# url: https://sbst.gov/
|
||||
# image: sbst.png
|
||||
# categories:
|
||||
# - government
|
||||
|
||||
- name: SiteLeaf
|
||||
url: https://siteleaf.com
|
||||
image: siteleaf.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: CloudCannon
|
||||
url: https://cloudcannon.com/
|
||||
image: cloudcannon.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: Vesterheim Norwegian-American Museum
|
||||
url: http://vesterheim.org/
|
||||
image: vesterheim.png
|
||||
categories:
|
||||
- marketing-site
|
||||
|
||||
- name: KOTN
|
||||
url: https://kotn.com/
|
||||
image: kotn.png
|
||||
categories:
|
||||
- marketing-site
|
||||
|
||||
- name: MvvmCross
|
||||
url: https://www.mvvmcross.com/
|
||||
image: mvvm.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: Vidgrid
|
||||
url: https://www.vidgrid.com/
|
||||
image: vidgrid.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: Bitcoin
|
||||
url: https://bitcoin.org/en/
|
||||
image: bitcoin.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: Mapwize
|
||||
url: https://www.mapwize.io/
|
||||
image: mapwize.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: Auth0 Blog
|
||||
url: https://auth0.com/blog/
|
||||
image: auth0-blog.png
|
||||
categories:
|
||||
- software
|
||||
- blog
|
||||
|
||||
- name: AWS Amplify
|
||||
url: https://aws-amplify.github.io/
|
||||
image: amplify-framework.png
|
||||
categories:
|
||||
- open-source
|
||||
- marketing-site
|
||||
|
||||
- name: Freedom of Information Act
|
||||
url: https://www.foia.gov/
|
||||
image: foia-gov.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: "Art & About Sydney"
|
||||
url: https://www.artandabout.com.au/
|
||||
image: art-sydney.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: Passbolt Help
|
||||
url: https://help.passbolt.com/
|
||||
image: passbolt-help.png
|
||||
categories:
|
||||
- knowledgebase
|
||||
|
||||
- name: We are COLLINS
|
||||
url: https://www.wearecollins.com/
|
||||
image: collins.png
|
||||
categories:
|
||||
- agency
|
||||
|
||||
- name: Lightburn
|
||||
url: https://lightburn.co/
|
||||
image: lightburn.png
|
||||
categories:
|
||||
- agency
|
||||
|
||||
- name: italia.it
|
||||
url: https://developers.italia.it/
|
||||
image: italia-it.png
|
||||
categories:
|
||||
- community
|
||||
|
||||
- name: Sydney New Years Eve
|
||||
url: https://www.sydneynewyearseve.com/
|
||||
image: nsw.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: Login.gov
|
||||
url: https://login.gov/
|
||||
image: login-gov.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: plainlanguage.gov
|
||||
url: https://plainlanguage.gov/
|
||||
image: plainlanguage-gov.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: U.S. Web Design Standards
|
||||
url: https://standards.usa.gov/
|
||||
image: uswds.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: Grantmaker Search
|
||||
url: https://www.grantmakers.io/
|
||||
image: grantmakers.png
|
||||
categories:
|
||||
- marketing-site
|
||||
|
||||
- name: Rehan Butt
|
||||
url: http://rehanbutt.com/
|
||||
image: rehn.png
|
||||
categories:
|
||||
- personal
|
||||
- portfolio
|
||||
|
||||
- name: The Markdown Guide
|
||||
url: https://www.markdownguide.org/
|
||||
image: markdown-guide.png
|
||||
categories:
|
||||
- knowledgebase
|
||||
|
||||
- name: Probot
|
||||
url: https://probot.github.io/
|
||||
image: probot.png
|
||||
categories:
|
||||
- documentation
|
||||
|
||||
- name: Matt Grey
|
||||
url: https://himatt.com/
|
||||
image: matt-grey.png
|
||||
categories:
|
||||
- personal
|
||||
- portfolio
|
||||
|
||||
- name: Lattice
|
||||
url: https://latticehq.com/
|
||||
image: lattice.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: MailTape
|
||||
url: https://www.mailta.pe/
|
||||
image: mailtape.png
|
||||
categories:
|
||||
- other
|
||||
|
||||
- name: Digital Democracy
|
||||
url: http://www.digital-democracy.org/
|
||||
image: digital-democracy.png
|
||||
categories:
|
||||
- other
|
||||
|
||||
- name: HTML Reference
|
||||
url: http://htmlreference.io/
|
||||
image: htmlreference.png
|
||||
categories:
|
||||
- documentation
|
||||
|
||||
- name: CSS Reference
|
||||
url: http://cssreference.io/
|
||||
image: cssreference.png
|
||||
categories:
|
||||
- documentation
|
||||
|
||||
- name: Chain
|
||||
url: https://chain.com/
|
||||
image: chain.png
|
||||
categories:
|
||||
- marketing-site
|
||||
|
||||
- name: IBM MobileFirst Foundation
|
||||
url: https://mobilefirstplatform.ibmcloud.com/
|
||||
image: ibm-mobile-foundation.png
|
||||
categories:
|
||||
- documentation
|
||||
|
||||
- name: "18F"
|
||||
url: https://18f.gsa.gov/
|
||||
image: 18f.png
|
||||
categories:
|
||||
- agency
|
||||
- government
|
||||
|
||||
- name: Development Seed
|
||||
url: https://developmentseed.org/
|
||||
image: development-seed.png
|
||||
categories:
|
||||
- agency
|
||||
|
||||
- name: Isomer - Singapore Government Static Websites
|
||||
url: https://isomer.gov.sg/
|
||||
image: isomer.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: French Government Digital Services
|
||||
url: https://beta.gouv.fr/
|
||||
image: beta-gouv-fr.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: Paris Call for Trust and Security in Cyberspace
|
||||
url: https://pariscall.international/
|
||||
image: appel-de-paris.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: GitHub On Demand Training
|
||||
url: https://services.github.com/on-demand/
|
||||
image: github-learning-lab.png
|
||||
categories:
|
||||
- software
|
||||
- knowledgebase
|
||||
|
||||
- name: TwitchCon
|
||||
url: https://www.twitchcon.com/
|
||||
image: twitchcon.png
|
||||
categories:
|
||||
- marketing-site
|
||||
- conference
|
||||
|
||||
- name: UN World Statistics
|
||||
url: https://worldstatisticsday.org
|
||||
image: world-statistics-day.png
|
||||
categories:
|
||||
- government
|
||||
|
||||
- name: Netflix Devices
|
||||
url: https://devices.netflix.com/en/
|
||||
image: netflix.png
|
||||
categories:
|
||||
- marketing-site
|
||||
|
||||
- name: Twitch Developer Documentation
|
||||
url: https://dev.twitch.tv/
|
||||
image: twitch-developers.png
|
||||
categories:
|
||||
- marketing-site
|
||||
- documentation
|
||||
|
||||
- name: Yeoman
|
||||
url: http://yeoman.io/
|
||||
image: yeoman.png
|
||||
categories:
|
||||
- open-source
|
||||
- marketing-site
|
||||
|
||||
- name: Release Management Blog
|
||||
url: https://release.mozilla.org/
|
||||
image: mozilla-release-blog.png
|
||||
categories:
|
||||
- software
|
||||
- blog
|
||||
|
||||
- name: frame.ai
|
||||
url: https://frame.ai/
|
||||
image: frame-ai.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: Ionic Framwork
|
||||
url: https://ionicframework.com/
|
||||
image: ionic-framework.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: Spotify for Developers
|
||||
url: https://developer.spotify.com
|
||||
image: spotify-developers.png
|
||||
categories:
|
||||
- marketing-site
|
||||
- documentation
|
||||
- software
|
||||
|
||||
- name: Sketch
|
||||
url: https://sketch.com/
|
||||
image: sketch.png
|
||||
categories:
|
||||
- software
|
||||
- marketing-site
|
||||
|
||||
- name: Ruby on Rails
|
||||
url: http://rubyonrails.org/
|
||||
image: ruby-on-rails.png
|
||||
categories:
|
||||
- marketing-site
|
||||
- documentation
|
||||
@@ -1,13 +1,10 @@
|
||||
- title: Tutorials
|
||||
tutorials:
|
||||
- home
|
||||
- video-walkthroughs
|
||||
- navigation
|
||||
- orderofinterpretation
|
||||
- custom-404-page
|
||||
- convert-site-to-jekyll
|
||||
- using-jekyll-with-bundler
|
||||
- csv-to-table
|
||||
|
||||
#- title: Another section
|
||||
# tutorials:
|
||||
|
||||
@@ -3,11 +3,10 @@ title: Assets
|
||||
permalink: /docs/assets/
|
||||
---
|
||||
|
||||
Jekyll provides built-in support for [Sass](https://sass-lang.com/)
|
||||
and can work with [CoffeeScript](https://coffeescript.org/) via a Ruby gem.
|
||||
In order to use them, you must first create a file with the proper extension
|
||||
name (one of `.sass`, `.scss`, or `.coffee`) and
|
||||
***start the file with two lines of triple dashes***, like this:
|
||||
Jekyll provides built-in support for Sass and can work with CoffeeScript via
|
||||
a Ruby gem. In order to use them, you must first create a file with the
|
||||
proper extension name (one of `.sass`, `.scss`, or `.coffee`) and ***start the
|
||||
file with two lines of triple dashes***, like this:
|
||||
|
||||
```sass
|
||||
---
|
||||
@@ -28,7 +27,7 @@ will process it and put it in your site's destination folder under
|
||||
<h5>Jekyll processes all Liquid filters and tags in asset files</h5>
|
||||
<p>If you are using <a href="https://mustache.github.io">Mustache</a>
|
||||
or another JavaScript templating language that conflicts with
|
||||
the <a href="{{ '/docs/templates/' | relative_url }}">Liquid template syntax</a>, you
|
||||
the <a href="/docs/templates/">Liquid template syntax</a>, you
|
||||
will need to place <code>{% raw %}</code> and
|
||||
<code>{% endraw %}</code> tags around your code.</p>
|
||||
</div>
|
||||
@@ -43,7 +42,8 @@ them to be in the output file, such as `<source>/css`. For an example, take
|
||||
a look at [this example site using Sass support in Jekyll][example-sass].
|
||||
|
||||
If you are using Sass `@import` statements, you'll need to ensure that your
|
||||
`sass_dir` is set to the base directory that contains your Sass files:
|
||||
`sass_dir` is set to the base directory that contains your Sass files. You
|
||||
can do that thusly:
|
||||
|
||||
```yaml
|
||||
sass:
|
||||
@@ -53,7 +53,7 @@ sass:
|
||||
The Sass converter will default the `sass_dir` configuration option to
|
||||
`_sass`.
|
||||
|
||||
[example-sass]: https://github.com/jekyll/jekyll-sass-converter/tree/master/docs
|
||||
[example-sass]: https://github.com/jekyll/jekyll-sass-converter/tree/master/example
|
||||
|
||||
<div class="note info">
|
||||
<h5>The <code>sass_dir</code> is only used by Sass</h5>
|
||||
@@ -61,8 +61,8 @@ The Sass converter will default the `sass_dir` configuration option to
|
||||
|
||||
Note that the <code>sass_dir</code> becomes the load path for Sass imports,
|
||||
nothing more. This means that Jekyll does not know about these files
|
||||
directly. Any files here should not contain the empty front matter as
|
||||
described above. If they do, they'll not be transformed as described above. This
|
||||
directly, so any files here should not contain the YAML Front Matter as
|
||||
described above nor will they be transformed as described above. This
|
||||
folder should only contain imports.
|
||||
|
||||
</p>
|
||||
@@ -79,6 +79,7 @@ sass:
|
||||
These are passed to Sass, so any output style options Sass supports are valid
|
||||
here, too.
|
||||
|
||||
|
||||
## Coffeescript
|
||||
|
||||
To enable Coffeescript in Jekyll 3.0 and up you must
|
||||
@@ -88,5 +89,5 @@ To enable Coffeescript in Jekyll 3.0 and up you must
|
||||
|
||||
```yaml
|
||||
plugins:
|
||||
- jekyll-coffeescript
|
||||
- jekyll-coffeescript
|
||||
```
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
---
|
||||
title: Code of Conduct
|
||||
permalink: "/docs/code_of_conduct/"
|
||||
note: This file is autogenerated. Edit /CODE_OF_CONDUCT.markdown instead.
|
||||
redirect_from: "/conduct/index.html"
|
||||
editable: false
|
||||
---
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [olivia@jekyllrb.com](mailto:olivia@jekyllrb.com). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html)
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq)
|
||||
@@ -3,78 +3,55 @@ title: Collections
|
||||
permalink: /docs/collections/
|
||||
---
|
||||
|
||||
Collections are a great way to group related content like members of a team or
|
||||
talks at a conference.
|
||||
Not everything is a post or a page. Maybe you want to document the various
|
||||
methods in your open source project, members of a team, or talks at a
|
||||
conference. Collections allow you to define a new type of document that behave
|
||||
like Pages or Posts do normally, but also have their own unique properties and
|
||||
namespace.
|
||||
|
||||
## Setup
|
||||
## Using Collections
|
||||
|
||||
To use a Collection you first need to define it in your `_config.yml`. For
|
||||
example here's a collection of staff members:
|
||||
To start using collections, follow these 3 steps:
|
||||
|
||||
* [Step 1: Tell Jekyll to read in your collection](#step1)
|
||||
* [Step 2: Add your content](#step2)
|
||||
* [Step 3: Optionally render your collection's documents into independent files](#step3)
|
||||
|
||||
### Step 1: Tell Jekyll to read in your collection {#step1}
|
||||
|
||||
Add the following to your site's `_config.yml` file, replacing `my_collection`
|
||||
with the name of your collection:
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
- staff_members
|
||||
- my_collection
|
||||
```
|
||||
|
||||
In this case `collections` is defined as a sequence (i.e array) with no additional metadata defined for each collection.
|
||||
You can optionally specify metadata for your collection by defining `collections` as a mapping (i.e hashmap) instead of sequence, and then defining additional fields in it:
|
||||
You can optionally specify metadata for your collection in the configuration:
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
staff_members:
|
||||
people: true
|
||||
my_collection:
|
||||
foo: bar
|
||||
```
|
||||
|
||||
{: .note .info}
|
||||
When defining a collection as a sequence, its pages will not be rendered by
|
||||
default. To enable this, <code>output: true</code> must be specified on the
|
||||
collection, which requires defining the collection as a mapping. For more
|
||||
information, see the section <a href="#output">Output</a>.
|
||||
Default attributes can also be set for a collection:
|
||||
|
||||
<div class="note">
|
||||
<h5>Gather your collections {%- include docs_version_badge.html version="3.7.0" -%}</h5>
|
||||
|
||||
<p>You can optionally specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>.</p>
|
||||
|
||||
<p>Then Jekyll will look in <code>my_collections/_books</code> for the <code>books</code> collection, and
|
||||
in <code>my_collections/_recipes</code> for the <code>recipes</code> collection.</p>
|
||||
</div>
|
||||
|
||||
<div class="note warning">
|
||||
<h5>Be sure to move drafts and posts into custom collections directory</h5>
|
||||
|
||||
<p>If you specify a directory to store all your collections in the same place with <code>collections_dir: my_collections</code>, then you will need to move your <code>_drafts</code> and <code>_posts</code> directory to <code>my_collections/_drafts</code> and <code>my_collections/_posts</code>. Note that, the name of your collections directory cannot start with an underscore (`_`).</p>
|
||||
</div>
|
||||
|
||||
## Add content
|
||||
|
||||
Create a corresponding folder (e.g. `<source>/_staff_members`) and add
|
||||
documents. Front matter is processed if the front matter exists, and everything
|
||||
after the front matter is pushed into the document's `content` attribute. If no front
|
||||
matter is provided, Jekyll will consider it to be a [static file]({{ '/docs/static-files/' | relative_url }})
|
||||
and the contents will not undergo further processing. If front matter is provided,
|
||||
Jekyll will process the file contents into the expected output.
|
||||
|
||||
Regardless of whether front matter exists or not, Jekyll will write to the destination
|
||||
directory (e.g. `_site`) only if `output: true` has been set in the collection's
|
||||
metadata.
|
||||
|
||||
For example here's how you would add a staff member to the collection set above.
|
||||
The filename is `./_staff_members/jane.md` with the following content:
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: Jane Doe
|
||||
position: Developer
|
||||
---
|
||||
Jane has worked on Jekyll for the past *five years*.
|
||||
```yaml
|
||||
defaults:
|
||||
- scope:
|
||||
path: ""
|
||||
type: my_collection
|
||||
values:
|
||||
layout: page
|
||||
```
|
||||
|
||||
<em>
|
||||
Do note that in spite of being considered as a collection internally, the above
|
||||
doesn't apply to [posts](/docs/posts/). Posts with a valid filename format will be
|
||||
marked for processing even if they do not contain front matter.
|
||||
</em>
|
||||
### Step 2: Add your content {#step2}
|
||||
|
||||
Create a corresponding folder (e.g. `<source>/_my_collection`) and add
|
||||
documents. YAML front matter is processed if the front matter exists, and everything
|
||||
after the front matter is pushed into the document's `content` attribute. If no YAML front
|
||||
matter is provided, Jekyll will not generate the file in your collection.
|
||||
|
||||
<div class="note info">
|
||||
<h5>Be sure to name your directories correctly</h5>
|
||||
@@ -84,108 +61,170 @@ your <code>_config.yml</code> file, with the addition of the preceding <code>_</
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Output
|
||||
### Step 3: Optionally render your collection's documents into independent files {#step3}
|
||||
|
||||
Now you can iterate over `site.staff_members` on a page and output the content
|
||||
for each staff member. Similar to posts, the body of the document is accessed
|
||||
using the `content` variable:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% for staff_member in site.staff_members %}
|
||||
<h2>{{ staff_member.name }} - {{ staff_member.position }}</h2>
|
||||
<p>{{ staff_member.content | markdownify }}</p>
|
||||
{% endfor %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
If you'd like Jekyll to create a rendered page for each document in your
|
||||
collection, you can set the `output` key to `true` in your collection
|
||||
metadata in `_config.yml`:
|
||||
If you'd like Jekyll to create a public-facing, rendered version of each
|
||||
document in your collection, set the `output` key to `true` in your collection
|
||||
metadata in your `_config.yml`:
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
staff_members:
|
||||
my_collection:
|
||||
output: true
|
||||
```
|
||||
|
||||
You can link to the generated page using the `url` attribute:
|
||||
This will produce a file for each document in the collection.
|
||||
For example, if you have `_my_collection/some_subdir/some_doc.md`,
|
||||
it will be rendered using Liquid and the Markdown converter of your
|
||||
choice and written out to `<dest>/my_collection/some_subdir/some_doc.html`.
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% for staff_member in site.staff_members %}
|
||||
<h2>
|
||||
<a href="{{ staff_member.url }}">
|
||||
{{ staff_member.name }} - {{ staff_member.position }}
|
||||
</a>
|
||||
</h2>
|
||||
<p>{{ staff_member.content | markdownify }}</p>
|
||||
{% endfor %}
|
||||
```
|
||||
{% endraw %}
|
||||
<div class="note info">
|
||||
<h5>Don't forget to add YAML for processing</h5>
|
||||
<p>
|
||||
Files in collections that do not have front matter are treated as
|
||||
<a href="/docs/static-files">static files</a> and simply copied to their
|
||||
output location without processing.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Permalinks
|
||||
## Configuring permalinks for collections {#permalinks}
|
||||
|
||||
There are special [permalink variables for collections]({{ '/docs/permalinks/#collections' | relative_url }}) to
|
||||
help you control the output url for the entire collection.
|
||||
|
||||
## Custom Sorting of Documents {%- include docs_version_badge.html version="4.0" -%}
|
||||
{: #custom-sorting-of-documents}
|
||||
|
||||
By default, two documents in a collection are sorted by their `date` attribute when both of them have the `date` key in their front matter. However, if either or both documents do not have the `date` key in their front matter, they are sorted by their respective paths.
|
||||
|
||||
You can control this sorting via the collection's metadata.
|
||||
|
||||
### Sort By Front Matter Key
|
||||
|
||||
Documents can be sorted based on a front matter key by setting a `sort_by` metadata to the front matter key string. For example,
|
||||
to sort a collection of tutorials based on key `lesson`, the configuration would be:
|
||||
If you wish to specify a custom pattern for the URLs where your Collection pages
|
||||
will reside, you may do so with the [`permalink` property](../permalinks/):
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
tutorials:
|
||||
sort_by: lesson
|
||||
my_collection:
|
||||
output: true
|
||||
permalink: /:collection/:name
|
||||
```
|
||||
|
||||
The documents are arranged in the increasing order of the key's value. If a document does not have the front matter key defined
|
||||
then that document is placed immediately after sorted documents. When multiple documents do not have the front matter key defined,
|
||||
those documents are sorted by their dates or paths and then placed immediately after the sorted documents.
|
||||
### Examples
|
||||
|
||||
### Manually Ordering Documents
|
||||
For a collection with the following source file structure,
|
||||
|
||||
You can also manually order the documents by setting an `order` metadata with **the filenames listed** in the desired order.
|
||||
For example, a collection of tutorials would be configured as:
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
tutorials:
|
||||
order:
|
||||
- hello-world.md
|
||||
- introduction.md
|
||||
- basic-concepts.md
|
||||
- advanced-concepts.md
|
||||
```
|
||||
_my_collection/
|
||||
└── some_subdir
|
||||
└── some_doc.md
|
||||
```
|
||||
|
||||
Any documents with filenames that do not match the list entry simply gets placed after the rearranged documents. If a document is
|
||||
nested under subdirectories, include them in entries as well:
|
||||
each of the following `permalink` configurations will produce the document structure shown below it.
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
tutorials:
|
||||
order:
|
||||
- hello-world.md
|
||||
- introduction.md
|
||||
- concepts/basics.md
|
||||
- concepts/advanced.md
|
||||
```
|
||||
* **Default**
|
||||
Same as `permalink: /:collection/:path`.
|
||||
|
||||
If both metadata keys have been defined properly, `order` list takes precedence.
|
||||
```
|
||||
_site/
|
||||
├── my_collection
|
||||
│ └── some_subdir
|
||||
│ └── some_doc.html
|
||||
...
|
||||
```
|
||||
* `permalink: pretty`
|
||||
Same as `permalink: /:collection/:path/`.
|
||||
|
||||
```
|
||||
_site/
|
||||
├── my_collection
|
||||
│ └── some_subdir
|
||||
│ └── some_doc
|
||||
│ └── index.html
|
||||
...
|
||||
```
|
||||
* `permalink: /doc/:path`
|
||||
|
||||
```
|
||||
_site/
|
||||
├── doc
|
||||
│ └── some_subdir
|
||||
│ └── some_doc.html
|
||||
...
|
||||
```
|
||||
* `permalink: /doc/:name`
|
||||
|
||||
```
|
||||
_site/
|
||||
├── doc
|
||||
│ └── some_doc.html
|
||||
...
|
||||
```
|
||||
* `permalink: /:name`
|
||||
|
||||
```
|
||||
_site/
|
||||
├── some_doc.html
|
||||
...
|
||||
```
|
||||
|
||||
### Template Variables
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Variable</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>:collection</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Label of the containing collection.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>:path</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Path to the document relative to the collection's directory.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>:name</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>The document's base filename, with every sequence of spaces
|
||||
and non-alphanumeric characters replaced by a hyphen.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>:title</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>The document's lowercase title (as defined in its <a href="/docs/frontmatter/">front matter</a>), with every sequence of spaces and non-alphanumeric characters replaced by a hyphen. If the document does not define a title in its <a href="/docs/frontmatter/">front matter</a>, this is equivalent to <code>name</code>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>:output_ext</code></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Extension of the output file. (Included by default and usually unnecessary.)</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
## Liquid Attributes
|
||||
|
||||
### Collections
|
||||
|
||||
Collections are also available under `site.collections`, with the metadata
|
||||
Each collection is accessible as a field on the `site` variable. For example, if
|
||||
you want to access the `albums` collection found in `_albums`, you'd use
|
||||
`site.albums`.
|
||||
|
||||
Each collection is itself an array of documents (e.g., `site.albums` is an array of documents, much like `site.pages` and
|
||||
`site.posts`). See the table below for how to access attributes of those documents.
|
||||
|
||||
The collections are also available under `site.collections`, with the metadata
|
||||
you specified in your `_config.yml` (if present) and the following information:
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
@@ -265,32 +304,19 @@ you specified in your `_config.yml` (if present) and the following information:
|
||||
|
||||
<div class="note info">
|
||||
<h5>A Hard-Coded Collection</h5>
|
||||
<p>In addition to any collections you create yourself, the
|
||||
<code>posts</code> collection is hard-coded into Jekyll. It exists whether
|
||||
you have a <code>_posts</code> directory or not. This is something to note
|
||||
when iterating through <code>site.collections</code> as you may need to
|
||||
<p>In addition to any collections you create yourself, the
|
||||
<code>posts</code> collection is hard-coded into Jekyll. It exists whether
|
||||
you have a <code>_posts</code> directory or not. This is something to note
|
||||
when iterating through <code>site.collections</code> as you may need to
|
||||
filter it out.</p>
|
||||
<p>You may wish to use filters to find your collection:
|
||||
<code>{% raw %}{{ site.collections | where: "label", "myCollection" | first }}{% endraw %}</code></p>
|
||||
</div>
|
||||
|
||||
<div class="note info">
|
||||
<h5>Collections and Time</h5>
|
||||
<p>Except for documents in hard-coded default collection <code>posts</code>, all documents in collections
|
||||
you create, are accessible via Liquid irrespective of their assigned date, if any, and therefore renderable.
|
||||
</p>
|
||||
<p>Documents are attempted to be written to disk only if the concerned collection
|
||||
metadata has <code>output: true</code>. Additionally, future-dated documents are only written if
|
||||
<code>site.future</code> <em>is also true</em>.
|
||||
</p>
|
||||
<p>More fine-grained control over documents being written to disk can be exercised by setting
|
||||
<code>published: false</code> (<em><code>true</code> by default</em>) in the document's front matter.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
### Documents
|
||||
|
||||
In addition to any front matter provided in the document's corresponding
|
||||
In addition to any YAML Front Matter provided in the document's corresponding
|
||||
file, each document has the following attributes:
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
@@ -308,9 +334,9 @@ file, each document has the following attributes:
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
The (unrendered) content of the document. If no front matter is
|
||||
The (unrendered) content of the document. If no YAML Front Matter is
|
||||
provided, Jekyll will not generate the file in your collection. If
|
||||
front matter is used, then this is all the contents of the file
|
||||
YAML Front Matter is used, then this is all the contents of the file
|
||||
after the terminating
|
||||
`---` of the front matter.
|
||||
</p>
|
||||
@@ -380,3 +406,51 @@ file, each document has the following attributes:
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
## Accessing Collection Attributes
|
||||
|
||||
Attributes from the YAML front matter can be accessed as data anywhere in the
|
||||
site. Using the above example for configuring a collection as `site.albums`,
|
||||
you might have front matter in an individual file structured as follows (which
|
||||
must use a supported markup format, and cannot be saved with a `.yaml`
|
||||
extension):
|
||||
|
||||
```yaml
|
||||
title: "Josquin: Missa De beata virgine and Missa Ave maris stella"
|
||||
artist: "The Tallis Scholars"
|
||||
director: "Peter Phillips"
|
||||
works:
|
||||
- title: "Missa De beata virgine"
|
||||
composer: "Josquin des Prez"
|
||||
tracks:
|
||||
- title: "Kyrie"
|
||||
duration: "4:25"
|
||||
- title: "Gloria"
|
||||
duration: "9:53"
|
||||
- title: "Credo"
|
||||
duration: "9:09"
|
||||
- title: "Sanctus & Benedictus"
|
||||
duration: "7:47"
|
||||
- title: "Agnus Dei I, II & III"
|
||||
duration: "6:49"
|
||||
```
|
||||
|
||||
Every album in the collection could be listed on a single page with a template:
|
||||
|
||||
```html
|
||||
{% raw %}
|
||||
{% for album in site.albums %}
|
||||
<h2>{{ album.title }}</h2>
|
||||
<p>Performed by {{ album.artist }}{% if album.director %}, directed by {{ album.director }}{% endif %}</p>
|
||||
{% for work in album.works %}
|
||||
<h3>{{ work.title }}</h3>
|
||||
<p>Composed by {{ work.composer }}</p>
|
||||
<ul>
|
||||
{% for track in work.tracks %}
|
||||
<li>{{ track.title }} ({{ track.duration }})</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: Report a bug
|
||||
permalink: "/docs/community/bug/"
|
||||
---
|
||||
|
||||
If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository — First [look for the plugin on rubygems](https://rubygems.org/) then click on the `Homepage` link to access the plugin repository.
|
||||
|
||||
If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
|
||||
@@ -1,37 +0,0 @@
|
||||
---
|
||||
title: Community
|
||||
permalink: /docs/community/
|
||||
redirect_from: "/help/index.html"
|
||||
---
|
||||
|
||||
## Jekyll Contributor Code of Conduct
|
||||
|
||||
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
Read the full [code of conduct]({{ '/docs/conduct/' | relative_url }})
|
||||
|
||||
## Where to get support
|
||||
|
||||
If you're looking for support for Jekyll, there are a lot of options:
|
||||
|
||||
* Read the [Jekyll Documentation]({{ '/docs/' | relative_url }})
|
||||
* If you have a question about using Jekyll, start a discussion on the [Jekyll Forum](https://talk.jekyllrb.com/) or [StackOverflow](https://stackoverflow.com/questions/tagged/jekyll)
|
||||
* Chat with Jekyllers — Join our [Gitter channel](https://gitter.im/jekyll/jekyll) or our [IRC channel on Freenode](irc:irc.freenode.net/jekyll)
|
||||
|
||||
There are a bunch of helpful community members on these services who are willing to point you in the right direction.
|
||||
|
||||
**Reminder: Jekyll's issue tracker is not a support forum.**
|
||||
|
||||
## Ways to contribute
|
||||
|
||||
* [How to Contribute]({{ '/docs/contributing/' | relative_url }})
|
||||
* [How to file a bug]({{ '/docs/community/bug/' | relative_url }})
|
||||
* [Guide for maintaining Jekyll]({{ '/docs/maintaining/' | relative_url }})
|
||||
|
||||
## Jekyllconf
|
||||
|
||||
[Watch videos]({{ '/jekyllconf/' | relative_url }}) from members of the Jekyll community speak about interesting use cases, tricks they’ve learned or meta Jekyll topics.
|
||||
|
||||
## Jekyll on Twitter
|
||||
|
||||
The [official Jekyll Twitter account](https://twitter.com/jekyllrb).
|
||||
@@ -6,42 +6,25 @@ redirect_from: "/conduct/index.html"
|
||||
editable: false
|
||||
---
|
||||
|
||||
## Our Pledge
|
||||
As contributors and maintainers of this project, and in the interest of
|
||||
fostering an open and welcoming community, we pledge to respect all people who
|
||||
contribute through reporting issues, posting feature requests, updating
|
||||
documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
We are committed to making participation in this project a harassment-free
|
||||
experience for everyone, regardless of level of experience, gender, gender
|
||||
identity and expression, sexual orientation, disability, personal appearance,
|
||||
body size, race, ethnicity, age, religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* The use of sexualized language or imagery
|
||||
* Personal attacks
|
||||
* Trolling or insulting/derogatory comments
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
* Publishing other's private information, such as physical or electronic
|
||||
addresses, without explicit permission
|
||||
* Other unethical or unprofessional conduct
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
@@ -49,34 +32,24 @@ that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
By adopting this Code of Conduct, project maintainers commit themselves to
|
||||
fairly and consistently applying these principles to every aspect of managing
|
||||
this project. Project maintainers who do not follow or enforce the Code of
|
||||
Conduct may be permanently removed from the project team.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [olivia@jekyllrb.com](mailto:olivia@jekyllrb.com). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
reported by opening an issue or contacting a project maintainer. All complaints
|
||||
will be reviewed and investigated and will result in a response that is deemed
|
||||
necessary and appropriate to the circumstances. Maintainers are obligated to
|
||||
maintain confidentiality with regard to the reporter of an incident.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 1.3.0, available at
|
||||
[http://contributor-covenant.org/version/1/3/0/][version]
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct.html](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html)
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq)
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/3/0/
|
||||
|
||||
@@ -3,16 +3,791 @@ title: Configuration
|
||||
permalink: /docs/configuration/
|
||||
---
|
||||
|
||||
Jekyll gives you a lot of flexibility to customize how it builds your site. These
|
||||
options can either be specified in a `_config.yml` or `_config.toml` file placed
|
||||
in your site’s root directory, or can be specified as flags for the `jekyll`
|
||||
executable in the terminal.
|
||||
Jekyll allows you to concoct your sites in any way you can dream up, and it’s
|
||||
thanks to the powerful and flexible configuration options that this is possible.
|
||||
These options can either be specified in a `_config.yml` file placed in your
|
||||
site’s root directory, or can be specified as flags for the `jekyll` executable
|
||||
in the terminal.
|
||||
|
||||
* [Configuration Options]({{ '/docs/configuration/options/' | relative_url }})
|
||||
* [Default Configuration]({{ '/docs/configuration/default/' | relative_url }})
|
||||
* [Front Matter Defaults]({{ '/docs/configuration/front-matter-defaults/' | relative_url }})
|
||||
* [Environments]({{ '/docs/configuration/environments/' | relative_url }})
|
||||
* [Markdown Options]({{ '/docs/configuration/markdown/' | relative_url }})
|
||||
* [Liquid Options]({{ '/docs/configuration/liquid/' | relative_url }})
|
||||
* [Webrick Options]({{ '/docs/configuration/webrick/' | relative_url }})
|
||||
* [Incremental Regeneration]({{ '/docs/configuration/incremental-regeneration/' | relative_url }})
|
||||
## Configuration Settings
|
||||
|
||||
### Global Configuration
|
||||
|
||||
The table below lists the available settings for Jekyll, and the various <code
|
||||
class="option">options</code> (specified in the configuration file) and <code
|
||||
class="flag">flags</code> (specified on the command-line) that control them.
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th>
|
||||
<span class="option">Options</span> and <span class="flag">Flags</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Site Source</strong></p>
|
||||
<p class="description">Change the directory where Jekyll will read files</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">source: DIR</code></p>
|
||||
<p><code class="flag">-s, --source DIR</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Site Destination</strong></p>
|
||||
<p class="description">Change the directory where Jekyll will write files</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">destination: DIR</code></p>
|
||||
<p><code class="flag">-d, --destination DIR</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Safe</strong></p>
|
||||
<p class="description">Disable <a href="../plugins/">custom plugins, and ignore symbolic links</a>.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">safe: BOOL</code></p>
|
||||
<p><code class="flag">--safe</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Exclude</strong></p>
|
||||
<p class="description">
|
||||
Exclude directories and/or files from the
|
||||
conversion. These exclusions are relative to the site's
|
||||
source directory and cannot be outside the source directory.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">exclude: [DIR, FILE, ...]</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Include</strong></p>
|
||||
<p class="description">
|
||||
Force inclusion of directories and/or files in the conversion.
|
||||
<code>.htaccess</code> is a good example since dotfiles are excluded
|
||||
by default.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">include: [DIR, FILE, ...]</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Keep files</strong></p>
|
||||
<p class="description">
|
||||
When clobbering the site destination, keep the selected files.
|
||||
Useful for files that are not generated by jekyll; e.g. files or
|
||||
assets that are generated by your build tool.
|
||||
The paths are relative to the <code>destination</code>.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">keep_files: [DIR, FILE, ...]</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Time Zone</strong></p>
|
||||
<p class="description">
|
||||
Set the time zone for site generation. This sets the <code>TZ</code>
|
||||
environment variable, which Ruby uses to handle time and date
|
||||
creation and manipulation. Any entry from the
|
||||
<a href="https://en.wikipedia.org/wiki/Tz_database">IANA Time Zone
|
||||
Database</a> is valid, e.g. <code>America/New_York</code>. A list of all
|
||||
available values can be found <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">
|
||||
here</a>. The default is the local time zone, as set by your operating system.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">timezone: TIMEZONE</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Encoding</strong></p>
|
||||
<p class="description">
|
||||
Set the encoding of files by name (only available for Ruby
|
||||
1.9 or later).
|
||||
The default value is <code>utf-8</code> starting in 2.0.0,
|
||||
and <code>nil</code> before 2.0.0, which will yield the Ruby
|
||||
default of <code>ASCII-8BIT</code>.
|
||||
Available encodings can be shown by the
|
||||
command <code>ruby -e 'puts Encoding::list.join("\n")'</code>.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">encoding: ENCODING</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p class='name'><strong>Defaults</strong></p>
|
||||
<p class='description'>
|
||||
Set defaults for <a href="../frontmatter/" title="YAML Front Matter">YAML Front Matter</a>
|
||||
variables.
|
||||
</p>
|
||||
</td>
|
||||
<td class='align-center'>
|
||||
<p>see <a href="#front-matter-defaults" title="details">below</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="note warning">
|
||||
<h5>Destination folders are cleaned on site builds</h5>
|
||||
<p>
|
||||
The contents of <code><destination></code> are automatically
|
||||
cleaned, by default, when the site is built. Files or folders that are not
|
||||
created by your site will be removed. Some files could be retained
|
||||
by specifying them within the <code><keep_files></code> configuration directive.
|
||||
</p>
|
||||
<p>
|
||||
Do not use an important location for <code><destination></code>; instead, use it as
|
||||
a staging area and copy files from there to your web server.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
### Build Command Options
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th><span class="option">Options</span> and <span class="flag">Flags</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Regeneration</strong></p>
|
||||
<p class="description">Enable auto-regeneration of the site when files are modified.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">-w, --[no-]watch</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Configuration</strong></p>
|
||||
<p class="description">Specify config files instead of using <code>_config.yml</code> automatically. Settings in later files override settings in earlier files.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">--config FILE1[,FILE2,...]</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Drafts</strong></p>
|
||||
<p class="description">Process and render draft posts.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">show_drafts: BOOL</code></p>
|
||||
<p><code class="flag">--drafts</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Environment</strong></p>
|
||||
<p class="description">Use a specific environment value in the build.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">JEKYLL_ENV=production</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Future</strong></p>
|
||||
<p class="description">Publish posts or collection documents with a future date.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">future: BOOL</code></p>
|
||||
<p><code class="flag">--future</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Unpublished</strong></p>
|
||||
<p class="description">Render posts that were marked as unpublished.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">unpublished: BOOL</code></p>
|
||||
<p><code class="flag">--unpublished</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>LSI</strong></p>
|
||||
<p class="description">Produce an index for related posts. Requires the <a href="http://www.classifier-reborn.com/">classifier-reborn</a> plugin.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">lsi: BOOL</code></p>
|
||||
<p><code class="flag">--lsi</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Limit Posts</strong></p>
|
||||
<p class="description">Limit the number of posts to parse and publish.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">limit_posts: NUM</code></p>
|
||||
<p><code class="flag">--limit_posts NUM</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Force polling</strong></p>
|
||||
<p class="description">Force watch to use polling.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">--force_polling</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Verbose output</strong></p>
|
||||
<p class="description">Print verbose output.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">-V, --verbose</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Silence Output</strong></p>
|
||||
<p class="description">Silence the normal output from Jekyll
|
||||
during a build</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">-q, --quiet</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Incremental build</strong></p>
|
||||
<p class="description">
|
||||
Enable the experimental incremental build feature. Incremental build only
|
||||
re-builds posts and pages that have changed, resulting in significant performance
|
||||
improvements for large sites, but may also break site generation in certain
|
||||
cases.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">incremental: BOOL</code></p>
|
||||
<p><code class="flag">-I, --incremental</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Liquid profiler</strong></p>
|
||||
<p class="description">
|
||||
Generate a Liquid rendering profile to help you identify performance bottlenecks.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">profile: BOOL</code></p>
|
||||
<p><code class="flag">--profile</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Strict Front Matter</strong></p>
|
||||
<p class="description">
|
||||
Cause a build to fail if there is a YAML syntax error in a page's front matter.
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">strict_front_matter: BOOL</code></p>
|
||||
<p><code class="flag">--strict_front_matter</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
### Serve Command Options
|
||||
|
||||
In addition to the options below, the `serve` sub-command can accept any of the options
|
||||
for the `build` sub-command, which are then applied to the site build which occurs right
|
||||
before your site is served.
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th><span class="option">Options</span> and <span class="flag">Flags</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Local Server Port</strong></p>
|
||||
<p class="description">Listen on the given port.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">port: PORT</code></p>
|
||||
<p><code class="flag">--port PORT</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Local Server Hostname</strong></p>
|
||||
<p class="description">Listen at the given hostname.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">host: HOSTNAME</code></p>
|
||||
<p><code class="flag">--host HOSTNAME</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Base URL</strong></p>
|
||||
<p class="description">Serve the website from the given base URL</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">baseurl: URL</code></p>
|
||||
<p><code class="flag">--baseurl URL</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Detach</strong></p>
|
||||
<p class="description">Detach the server from the terminal</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">detach: BOOL</code></p>
|
||||
<p><code class="flag">-B, --detach</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>Skips the initial site build.</strong></p>
|
||||
<p class="description">Skips the initial site build which occurs before the server is started.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">--skip-initial-build</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>X.509 (SSL) Private Key</strong></p>
|
||||
<p class="description">SSL Private Key.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">--ssl-key</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name"><strong>X.509 (SSL) Certificate</strong></p>
|
||||
<p class="description">SSL Public certificate.</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="flag">--ssl-cert</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="note warning">
|
||||
<h5>Do not use tabs in configuration files</h5>
|
||||
<p>
|
||||
This will either lead to parsing errors, or Jekyll will revert to the
|
||||
default settings. Use spaces instead.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Custom WEBrick Headers
|
||||
|
||||
You can provide custom headers for your site by adding them to `_config.yml`
|
||||
|
||||
```yaml
|
||||
# File: _config.yml
|
||||
webrick:
|
||||
headers:
|
||||
My-Header: My-Value
|
||||
My-Other-Header: My-Other-Value
|
||||
```
|
||||
|
||||
### Defaults
|
||||
|
||||
We provide by default `Content-Type` and `Cache-Control` response headers: one
|
||||
dynamic in order to specify the nature of the data being served, the other
|
||||
static in order to disable caching so that you don't have to fight with Chrome's
|
||||
aggressive caching when you are in development mode.
|
||||
|
||||
## Specifying a Jekyll environment at build time
|
||||
|
||||
In the build (or serve) arguments, you can specify a Jekyll environment and value. The build will then apply this value in any conditional statements in your content.
|
||||
|
||||
For example, suppose you set this conditional statement in your code:
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% if jekyll.environment == "production" %}
|
||||
{% include disqus.html %}
|
||||
{% endif %}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
When you build your Jekyll site, the content inside the `if` statement won't be run unless you also specify a `production` environment in the build command, like this:
|
||||
|
||||
```sh
|
||||
JEKYLL_ENV=production jekyll build
|
||||
```
|
||||
|
||||
Specifying an environment value allows you to make certain content available only within specific environments.
|
||||
|
||||
The default value for `JEKYLL_ENV` is `development`. Therefore if you omit `JEKYLL_ENV` from the build arguments, the default value will be `JEKYLL_ENV=development`. Any content inside `{% raw %}{% if jekyll.environment == "development" %}{% endraw %}` tags will automatically appear in the build.
|
||||
|
||||
Your environment values can be anything you want (not just `development` or `production`). Some elements you might want to hide in development environments include Disqus comment forms or Google Analytics. Conversely, you might want to expose an "Edit me in GitHub" button in a development environment but not include it in production environments.
|
||||
|
||||
By specifying the option in the build command, you avoid having to change values in your configuration files when moving from one environment to another.
|
||||
|
||||
## Front Matter defaults
|
||||
|
||||
Using [YAML Front Matter](../frontmatter/) is one way that you can specify configuration in the pages and posts for your site. Setting things like a default layout, or customizing the title, or specifying a more precise date/time for the post can all be added to your page or post front matter.
|
||||
|
||||
Often times, you will find that you are repeating a lot of configuration options. Setting the same layout in each file, adding the same category - or categories - to a post, etc. You can even add custom variables like author names, which might be the same for the majority of posts on your blog.
|
||||
|
||||
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your project's root directory.
|
||||
|
||||
The `defaults` key holds an array of scope/values pairs that define what defaults should be set for a particular file path, and optionally, a file type in that path.
|
||||
|
||||
Let's say that you want to add a default layout to all pages and posts in your site. You would add this to your `_config.yml` file:
|
||||
|
||||
```yaml
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "" # an empty string here means all files in the project
|
||||
values:
|
||||
layout: "default"
|
||||
```
|
||||
|
||||
<div class="note info">
|
||||
<h5>Please stop and rerun `jekyll serve` command.</h5>
|
||||
<p>
|
||||
The <code>_config.yml</code> master configuration file contains global configurations
|
||||
and variable definitions that are read once at execution time. Changes made to <code>_config.yml</code>
|
||||
during automatic regeneration are not loaded until the next execution.
|
||||
</p>
|
||||
<p>
|
||||
Note <a href="../datafiles">Data Files</a> are included and reloaded during automatic regeneration.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Here, we are scoping the `values` to any file that exists in the path `scope`. Since the path is set as an empty string, it will apply to **all files** in your project. You probably don't want to set a layout on every file in your project - like css files, for example - so you can also specify a `type` value under the `scope` key.
|
||||
|
||||
```yaml
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "" # an empty string here means all files in the project
|
||||
type: "posts" # previously `post` in Jekyll 2.2.
|
||||
values:
|
||||
layout: "default"
|
||||
```
|
||||
|
||||
Now, this will only set the layout for files where the type is `posts`.
|
||||
The different types that are available to you are `pages`, `posts`, `drafts` or any collection in your site. While `type` is optional, you must specify a value for `path` when creating a `scope/values` pair.
|
||||
|
||||
As mentioned earlier, you can set multiple scope/values pairs for `defaults`.
|
||||
|
||||
```yaml
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
type: "posts"
|
||||
values:
|
||||
layout: "my-site"
|
||||
-
|
||||
scope:
|
||||
path: "projects"
|
||||
type: "pages" # previously `page` in Jekyll 2.2.
|
||||
values:
|
||||
layout: "project" # overrides previous default layout
|
||||
author: "Mr. Hyde"
|
||||
```
|
||||
|
||||
With these defaults, all posts would use the `my-site` layout. Any html files that exist in the `projects/` folder will use the `project` layout, if it exists. Those files will also have the `page.author` [liquid variable](../variables/) set to `Mr. Hyde`.
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
my_collection:
|
||||
output: true
|
||||
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
type: "my_collection" # a collection in your site, in plural form
|
||||
values:
|
||||
layout: "default"
|
||||
```
|
||||
|
||||
In this example, the `layout` is set to `default` inside the
|
||||
[collection](../collections/) with the name `my_collection`.
|
||||
|
||||
### Precedence
|
||||
|
||||
Jekyll will apply all of the configuration settings you specify in the `defaults` section of your `_config.yml` file. However, you can choose to override settings from other scope/values pair by specifying a more specific path for the scope.
|
||||
|
||||
You can see that in the second to last example above. First, we set the default layout to `my-site`. Then, using a more specific path, we set the default layout for files in the `projects/` path to `project`. This can be done with any value that you would set in the page or post front matter.
|
||||
|
||||
Finally, if you set defaults in the site configuration by adding a `defaults` section to your `_config.yml` file, you can override those settings in a post or page file. All you need to do is specify the settings in the post or page front matter. For example:
|
||||
|
||||
```yaml
|
||||
# In _config.yml
|
||||
...
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "projects"
|
||||
type: "pages"
|
||||
values:
|
||||
layout: "project"
|
||||
author: "Mr. Hyde"
|
||||
category: "project"
|
||||
...
|
||||
```
|
||||
|
||||
```yaml
|
||||
# In projects/foo_project.md
|
||||
---
|
||||
author: "John Smith"
|
||||
layout: "foobar"
|
||||
---
|
||||
The post text goes here...
|
||||
```
|
||||
|
||||
The `projects/foo_project.md` would have the `layout` set to `foobar` instead
|
||||
of `project` and the `author` set to `John Smith` instead of `Mr. Hyde` when
|
||||
the site is built.
|
||||
|
||||
## Default Configuration
|
||||
|
||||
Jekyll runs with the following configuration options by default. Alternative
|
||||
settings for these options can be explicitly specified in the configuration
|
||||
file or on the command-line.
|
||||
|
||||
<div class="note warning">
|
||||
<h5>There are two unsupported kramdown options</h5>
|
||||
<p>
|
||||
Please note that both <code>remove_block_html_tags</code> and
|
||||
<code>remove_span_html_tags</code> are currently unsupported in Jekyll due
|
||||
to the fact that they are not included within the kramdown HTML converter.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
```yaml
|
||||
# Where things are
|
||||
source: .
|
||||
destination: ./_site
|
||||
plugins_dir: _plugins
|
||||
layouts_dir: _layouts
|
||||
data_dir: _data
|
||||
includes_dir: _includes
|
||||
collections:
|
||||
posts:
|
||||
output: true
|
||||
|
||||
# Handling Reading
|
||||
safe: false
|
||||
include: [".htaccess"]
|
||||
exclude: ["Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"]
|
||||
keep_files: [".git", ".svn"]
|
||||
encoding: "utf-8"
|
||||
markdown_ext: "markdown,mkdown,mkdn,mkd,md"
|
||||
strict_front_matter: false
|
||||
|
||||
# Filtering Content
|
||||
show_drafts: null
|
||||
limit_posts: 0
|
||||
future: false
|
||||
unpublished: false
|
||||
|
||||
# Plugins
|
||||
whitelist: []
|
||||
plugins: []
|
||||
|
||||
# Conversion
|
||||
markdown: kramdown
|
||||
highlighter: rouge
|
||||
lsi: false
|
||||
excerpt_separator: "\n\n"
|
||||
incremental: false
|
||||
|
||||
# Serving
|
||||
detach: false
|
||||
port: 4000
|
||||
host: 127.0.0.1
|
||||
baseurl: "" # does not include hostname
|
||||
show_dir_listing: false
|
||||
|
||||
# Outputting
|
||||
permalink: date
|
||||
paginate_path: /page:num
|
||||
timezone: null
|
||||
|
||||
quiet: false
|
||||
verbose: false
|
||||
defaults: []
|
||||
|
||||
liquid:
|
||||
error_mode: warn
|
||||
|
||||
# Markdown Processors
|
||||
rdiscount:
|
||||
extensions: []
|
||||
|
||||
redcarpet:
|
||||
extensions: []
|
||||
|
||||
kramdown:
|
||||
auto_ids: true
|
||||
entity_output: as_char
|
||||
toc_levels: 1..6
|
||||
smart_quotes: lsquo,rsquo,ldquo,rdquo
|
||||
input: GFM
|
||||
hard_wrap: false
|
||||
footnote_nr: 1
|
||||
```
|
||||
|
||||
## Liquid Options
|
||||
|
||||
Liquid's response to errors can be configured by setting `error_mode`. The
|
||||
options are
|
||||
|
||||
- `lax` --- Ignore all errors.
|
||||
- `warn` --- Output a warning on the console for each error.
|
||||
- `strict` --- Output an error message and stop the build.
|
||||
|
||||
## Markdown Options
|
||||
|
||||
The various Markdown renderers supported by Jekyll sometimes have extra options
|
||||
available.
|
||||
|
||||
### Redcarpet
|
||||
|
||||
Redcarpet can be configured by providing an `extensions` sub-setting, whose
|
||||
value should be an array of strings. Each string should be the name of one of
|
||||
the `Redcarpet::Markdown` class's extensions; if present in the array, it will
|
||||
set the corresponding extension to `true`.
|
||||
|
||||
Jekyll handles two special Redcarpet extensions:
|
||||
|
||||
- `no_fenced_code_blocks` --- By default, Jekyll sets the `fenced_code_blocks`
|
||||
extension (for delimiting code blocks with triple tildes or triple backticks)
|
||||
to `true`, probably because GitHub's eager adoption of them is starting to make
|
||||
them inescapable. Redcarpet's normal `fenced_code_blocks` extension is inert
|
||||
when used with Jekyll; instead, you can use this inverted version of the
|
||||
extension for disabling fenced code.
|
||||
|
||||
Note that you can also specify a language for highlighting after the first
|
||||
delimiter:
|
||||
|
||||
```ruby
|
||||
# ...ruby code
|
||||
```
|
||||
|
||||
With both fenced code blocks and highlighter enabled, this will statically
|
||||
highlight the code; without any syntax highlighter, it will add a
|
||||
`class="LANGUAGE"` attribute to the `<code>` element, which can be used as a
|
||||
hint by various JavaScript code highlighting libraries.
|
||||
|
||||
- `smart` --- This pseudo-extension turns on SmartyPants, which converts
|
||||
straight quotes to curly quotes and runs of hyphens to em (`---`) and en (`--`) dashes.
|
||||
|
||||
All other extensions retain their usual names from Redcarpet, and no renderer
|
||||
options aside from `smart` can be specified in Jekyll. [A list of available
|
||||
extensions can be found in the Redcarpet README file.][redcarpet_extensions]
|
||||
Make sure you're looking at the README for the right version of
|
||||
Redcarpet: Jekyll currently uses v3.2.x. The most commonly used
|
||||
extensions are:
|
||||
|
||||
- `tables`
|
||||
- `no_intra_emphasis`
|
||||
- `autolink`
|
||||
|
||||
[redcarpet_extensions]: https://github.com/vmg/redcarpet/blob/v3.2.2/README.markdown#and-its-like-really-simple-to-use
|
||||
|
||||
### Custom Markdown Processors
|
||||
|
||||
If you're interested in creating a custom markdown processor, you're in luck! Create a new class in the `Jekyll::Converters::Markdown` namespace:
|
||||
|
||||
```ruby
|
||||
class Jekyll::Converters::Markdown::MyCustomProcessor
|
||||
def initialize(config)
|
||||
require 'funky_markdown'
|
||||
@config = config
|
||||
rescue LoadError
|
||||
STDERR.puts 'You are missing a library required for Markdown. Please run:'
|
||||
STDERR.puts ' $ [sudo] gem install funky_markdown'
|
||||
raise FatalException.new("Missing dependency: funky_markdown")
|
||||
end
|
||||
|
||||
def convert(content)
|
||||
::FunkyMarkdown.new(content).convert
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
Once you've created your class and have it properly set up either as a plugin
|
||||
in the `_plugins` folder or as a gem, specify it in your `_config.yml`:
|
||||
|
||||
```yaml
|
||||
markdown: MyCustomProcessor
|
||||
```
|
||||
|
||||
## Incremental Regeneration
|
||||
<div class="note warning">
|
||||
<h5>Incremental regeneration is still an experimental feature</h5>
|
||||
<p>
|
||||
While incremental regeneration will work for the most common cases, it will
|
||||
not work correctly in every scenario. Please be extremely cautious when
|
||||
using the feature, and report any problems not listed below by
|
||||
<a href="https://github.com/jekyll/jekyll/issues/new">opening an issue on GitHub</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Incremental regeneration helps shorten build times by only generating documents
|
||||
and pages that were updated since the previous build. It does this by keeping
|
||||
track of both file modification times and inter-document dependencies in the
|
||||
`.jekyll-metadata` file.
|
||||
|
||||
Under the current implementation, incremental regeneration will only generate a
|
||||
document or page if either it, or one of its dependencies, is modified. Currently,
|
||||
the only types of dependencies tracked are includes (using the
|
||||
{% raw %}`{% include %}`{% endraw %} tag) and layouts. This means that plain
|
||||
references to other documents (for example, the common case of iterating over
|
||||
`site.posts` in a post listings page) will not be detected as a dependency.
|
||||
|
||||
To remedy some of these shortfalls, putting `regenerate: true` in the front-matter
|
||||
of a document will force Jekyll to regenerate it regardless of whether it has been
|
||||
modified. Note that this will generate the specified document only; references
|
||||
to other documents' contents will not work since they won't be re-rendered.
|
||||
|
||||
Incremental regeneration can be enabled via the `--incremental` flag (`-I` for
|
||||
short) from the command-line or by setting `incremental: true` in your
|
||||
configuration file.
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
---
|
||||
title: Default Configuration
|
||||
permalink: "/docs/configuration/default/"
|
||||
---
|
||||
|
||||
Jekyll runs with the following configuration options by default. Alternative
|
||||
settings for these options can be explicitly specified in the configuration
|
||||
file or on the command-line.
|
||||
|
||||
<div class="note info">
|
||||
<h5>Be aware of directory paths</h5>
|
||||
<p>
|
||||
Make directory path values in configuration keys like `plugins_dir` relative to the current working directory, not the site source.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
```yaml
|
||||
# Where things are
|
||||
source : .
|
||||
destination : ./_site
|
||||
collections_dir : .
|
||||
plugins_dir : _plugins # takes an array of strings and loads plugins in that order
|
||||
layouts_dir : _layouts
|
||||
data_dir : _data
|
||||
includes_dir : _includes
|
||||
sass:
|
||||
sass_dir: _sass
|
||||
collections:
|
||||
posts:
|
||||
output : true
|
||||
|
||||
# Handling Reading
|
||||
safe : false
|
||||
include : [".htaccess"]
|
||||
exclude : ["Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"]
|
||||
keep_files : [".git", ".svn"]
|
||||
encoding : "utf-8"
|
||||
markdown_ext : "markdown,mkdown,mkdn,mkd,md"
|
||||
strict_front_matter : false
|
||||
|
||||
# Filtering Content
|
||||
show_drafts : null
|
||||
limit_posts : 0
|
||||
future : false
|
||||
unpublished : false
|
||||
|
||||
# Plugins
|
||||
whitelist : []
|
||||
plugins : []
|
||||
|
||||
# Conversion
|
||||
markdown : kramdown
|
||||
highlighter : rouge
|
||||
lsi : false
|
||||
excerpt_separator : "\n\n"
|
||||
incremental : false
|
||||
|
||||
# Serving
|
||||
detach : false
|
||||
port : 4000
|
||||
host : 127.0.0.1
|
||||
baseurl : "" # does not include hostname
|
||||
show_dir_listing : false
|
||||
|
||||
# Outputting
|
||||
permalink : date
|
||||
paginate_path : /page:num
|
||||
timezone : null
|
||||
|
||||
quiet : false
|
||||
verbose : false
|
||||
defaults : []
|
||||
|
||||
liquid:
|
||||
error_mode : warn
|
||||
strict_filters : false
|
||||
strict_variables : false
|
||||
|
||||
# Markdown Processors
|
||||
kramdown:
|
||||
auto_ids : true
|
||||
entity_output : as_char
|
||||
toc_levels : [1, 2, 3, 4, 5, 6]
|
||||
smart_quotes : lsquo,rsquo,ldquo,rdquo
|
||||
input : GFM
|
||||
hard_wrap : false
|
||||
footnote_nr : 1
|
||||
show_warnings : false
|
||||
```
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
title: Environments
|
||||
permalink: "/docs/configuration/environments/"
|
||||
---
|
||||
In the `build` (or `serve`) arguments, you can specify a Jekyll environment
|
||||
and value. The build will then apply this value in any conditional statements
|
||||
in your content.
|
||||
|
||||
For example, suppose you set this conditional statement in your code:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% if jekyll.environment == "production" %}
|
||||
{% include disqus.html %}
|
||||
{% endif %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
When you build your Jekyll site, the content inside the `if` statement won't be
|
||||
run unless you also specify a `production` environment in the build command,
|
||||
like this:
|
||||
|
||||
```sh
|
||||
JEKYLL_ENV=production jekyll build
|
||||
```
|
||||
|
||||
Specifying an environment value allows you to make certain content available
|
||||
only within specific environments.
|
||||
|
||||
The default value for `JEKYLL_ENV` is `development`. Therefore if you omit
|
||||
`JEKYLL_ENV` from the build arguments, the default value will be
|
||||
`JEKYLL_ENV=development`. Any content inside
|
||||
{% raw %}`{% if jekyll.environment == "development" %}`{% endraw %} tags will
|
||||
automatically appear in the build.
|
||||
|
||||
Your environment values can be anything you want (not just `development` or
|
||||
`production`). Some elements you might want to hide in development
|
||||
environments include Disqus comment forms or Google Analytics. Conversely,
|
||||
you might want to expose an "Edit me in GitHub" button in a development
|
||||
environment but not include it in production environments.
|
||||
|
||||
By specifying the option in the build command, you avoid having to change
|
||||
values in your configuration files when moving from one environment to another.
|
||||
|
||||
{: .note}
|
||||
To switch part of your config settings depending on the environment, use the
|
||||
<a href="{{ '/docs/configuration/options/#build-command-options' | relative_url }}">build command option</a>,
|
||||
for example <code>--config _config.yml,_config_development.yml</code>. Settings
|
||||
in later files override settings in earlier files.
|
||||
@@ -1,153 +0,0 @@
|
||||
---
|
||||
title: Front Matter Defaults
|
||||
permalink: "/docs/configuration/front-matter-defaults/"
|
||||
---
|
||||
|
||||
Using [front matter](/docs/front-matter/) is one way that you can specify configuration in the pages and posts for your site. Setting things like a default layout, or customizing the title, or specifying a more precise date/time for the post can all be added to your page or post front matter.
|
||||
|
||||
Often times, you will find that you are repeating a lot of configuration options. Setting the same layout in each file, adding the same category - or categories - to a post, etc. You can even add custom variables like author names, which might be the same for the majority of posts on your blog.
|
||||
|
||||
Instead of repeating this configuration each time you create a new post or page, Jekyll provides a way to set these defaults in the site configuration. To do this, you can specify site-wide defaults using the `defaults` key in the `_config.yml` file in your project's root directory.
|
||||
|
||||
The `defaults` key holds an array of scope/values pairs that define what defaults should be set for a particular file path, and optionally, a file type in that path.
|
||||
|
||||
Let's say that you want to add a default layout to all pages and posts in your site. You would add this to your `_config.yml` file:
|
||||
|
||||
```yaml
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "" # an empty string here means all files in the project
|
||||
values:
|
||||
layout: "default"
|
||||
```
|
||||
|
||||
<div class="note info">
|
||||
<h5>Stop and rerun `jekyll serve` command.</h5>
|
||||
<p>
|
||||
The <code>_config.yml</code> master configuration file contains global configurations
|
||||
and variable definitions that are read once at execution time. Changes made to <code>_config.yml</code>
|
||||
during automatic regeneration are not loaded until the next execution.
|
||||
</p>
|
||||
<p>
|
||||
Note <a href="{{ '/docs/datafiles' | relative_url }}">Data Files</a> are included and reloaded during automatic regeneration.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Here, we are scoping the `values` to any file that exists in the path `scope`. Since the path is set as an empty string, it will apply to **all files** in your project. You probably don't want to set a layout on every file in your project - like css files, for example - so you can also specify a `type` value under the `scope` key.
|
||||
|
||||
```yaml
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "" # an empty string here means all files in the project
|
||||
type: "posts" # previously `post` in Jekyll 2.2.
|
||||
values:
|
||||
layout: "default"
|
||||
```
|
||||
|
||||
Now, this will only set the layout for files where the type is `posts`.
|
||||
The different types that are available to you are `pages`, `posts`, `drafts` or any collection in your site. While `type` is optional, you must specify a value for `path` when creating a `scope/values` pair.
|
||||
|
||||
As mentioned earlier, you can set multiple scope/values pairs for `defaults`.
|
||||
|
||||
```yaml
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
type: "pages"
|
||||
values:
|
||||
layout: "my-site"
|
||||
-
|
||||
scope:
|
||||
path: "projects"
|
||||
type: "pages" # previously `page` in Jekyll 2.2.
|
||||
values:
|
||||
layout: "project" # overrides previous default layout
|
||||
author: "Mr. Hyde"
|
||||
```
|
||||
|
||||
With these defaults, all pages would use the `my-site` layout. Any html files that exist in the `projects/`
|
||||
folder will use the `project` layout, if it exists. Those files will also have the `page.author`
|
||||
[liquid variable]({{ '/docs/variables/' | relative_url }}) set to `Mr. Hyde`.
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
my_collection:
|
||||
output: true
|
||||
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: ""
|
||||
type: "my_collection" # a collection in your site, in plural form
|
||||
values:
|
||||
layout: "default"
|
||||
```
|
||||
|
||||
In this example, the `layout` is set to `default` inside the
|
||||
[collection]({{ '/docs/collections/' | relative_url }}) with the name `my_collection`.
|
||||
|
||||
### Glob patterns in Front Matter defaults
|
||||
|
||||
It is also possible to use glob patterns (currently limited to patterns that contain `*`) when matching defaults. For example, it is possible to set specific layout for each `special-page.html` in any subfolder of `section` folder. {%- include docs_version_badge.html version="3.7.0" -%}
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
my_collection:
|
||||
output: true
|
||||
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "section/*/special-page.html"
|
||||
values:
|
||||
layout: "specific-layout"
|
||||
```
|
||||
|
||||
<div class="note warning">
|
||||
<h5>Globbing and Performance</h5>
|
||||
<p>
|
||||
Please note that globbing a path is known to have a negative effect on
|
||||
performance and is currently not optimized, especially on Windows.
|
||||
Globbing a path will increase your build times in proportion to the size
|
||||
of the associated collection directory.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
### Precedence
|
||||
|
||||
Jekyll will apply all of the configuration settings you specify in the `defaults` section of your `_config.yml` file. You can choose to override settings from other scope/values pair by specifying a more specific path for the scope.
|
||||
|
||||
You can see that in the second to last example above. First, we set the default page layout to `my-site`. Then, using a more specific path, we set the default layout for pages in the `projects/` path to `project`. This can be done with any value that you would set in the page or post front matter.
|
||||
|
||||
Finally, if you set defaults in the site configuration by adding a `defaults` section to your `_config.yml` file, you can override those settings in a post or page file. All you need to do is specify the settings in the post or page front matter. For example:
|
||||
|
||||
```yaml
|
||||
# In _config.yml
|
||||
...
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "projects"
|
||||
type: "pages"
|
||||
values:
|
||||
layout: "project"
|
||||
author: "Mr. Hyde"
|
||||
category: "project"
|
||||
...
|
||||
```
|
||||
|
||||
```yaml
|
||||
# In projects/foo_project.md
|
||||
---
|
||||
author: "John Smith"
|
||||
layout: "foobar"
|
||||
---
|
||||
The post text goes here...
|
||||
```
|
||||
|
||||
The `projects/foo_project.md` would have the `layout` set to `foobar` instead
|
||||
of `project` and the `author` set to `John Smith` instead of `Mr. Hyde` when
|
||||
the site is built.
|
||||
@@ -1,36 +0,0 @@
|
||||
---
|
||||
title: Default Configuration
|
||||
permalink: "/docs/configuration/incremental-regeneration/"
|
||||
---
|
||||
|
||||
## Incremental Regeneration
|
||||
<div class="note warning">
|
||||
<h5>Incremental regeneration is still an experimental feature</h5>
|
||||
<p>
|
||||
While incremental regeneration will work for the most common cases, it will
|
||||
not work correctly in every scenario. Please be extremely cautious when
|
||||
using the feature, and report any problems not listed below by
|
||||
<a href="https://github.com/jekyll/jekyll/issues/new">opening an issue on GitHub</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Incremental regeneration helps shorten build times by only generating documents
|
||||
and pages that were updated since the previous build. It does this by keeping
|
||||
track of both file modification times and inter-document dependencies in the
|
||||
`.jekyll-metadata` file.
|
||||
|
||||
Under the current implementation, incremental regeneration will only generate a
|
||||
document or page if either it, or one of its dependencies, is modified. Currently,
|
||||
the only types of dependencies tracked are includes (using the
|
||||
{% raw %}`{% include %}`{% endraw %} tag) and layouts. This means that plain
|
||||
references to other documents (for example, the common case of iterating over
|
||||
`site.posts` in a post listings page) will not be detected as a dependency.
|
||||
|
||||
To remedy some of these shortfalls, putting `regenerate: true` in the front-matter
|
||||
of a document will force Jekyll to regenerate it regardless of whether it has been
|
||||
modified. Note that this will generate the specified document only; references
|
||||
to other documents' contents will not work since they won't be re-rendered.
|
||||
|
||||
Incremental regeneration can be enabled via the `--incremental` flag (`-I` for
|
||||
short) from the command-line or by setting `incremental: true` in your
|
||||
configuration file.
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
title: Liquid Options
|
||||
permalink: "/docs/configuration/liquid/"
|
||||
---
|
||||
Liquid's response to errors can be configured by setting `error_mode`. The
|
||||
options are
|
||||
|
||||
- `lax` --- Ignore all errors.
|
||||
- `warn` --- Output a warning on the console for each error. (default)
|
||||
- `strict` --- Output an error message and stop the build.
|
||||
|
||||
Within _config.yml, the default configuration is as follows:
|
||||
|
||||
```yaml
|
||||
liquid:
|
||||
error_mode: warn
|
||||
```
|
||||
|
||||
The above example depicts the "warn" value, which is already set by default- `error_mode: warn`. This results in any issues being called out during the build process however will continue to build if possible.
|
||||
|
||||
You can also configure Liquid's renderer to catch non-assigned variables and
|
||||
non-existing filters by setting `strict_variables` and / or `strict_filters`
|
||||
to `true` respectively. {% include docs_version_badge.html version="3.8.0" %}
|
||||
|
||||
Do note that while `error_mode` configures Liquid's parser, the `strict_variables`
|
||||
and `strict_filters` options configure Liquid's renderer and are consequently,
|
||||
mutually exclusive.
|
||||
|
||||
An example of setting these variables within _config.yml is as follows:
|
||||
|
||||
```yaml
|
||||
liquid:
|
||||
error_mode: strict
|
||||
strict_variables: true
|
||||
strict_filters: true
|
||||
```
|
||||
|
||||
Configuring as described above will stop your build/serve from happening and call out the offending error and halt. This is helpful when desiring to catch liquid-related issues by stopping the build or serve process and allowing you to deal with any issues.
|
||||
@@ -1,94 +0,0 @@
|
||||
---
|
||||
title: Markdown Options
|
||||
permalink: "/docs/configuration/markdown/"
|
||||
---
|
||||
The various Markdown renderers supported by Jekyll sometimes have extra options
|
||||
available.
|
||||
|
||||
### Kramdown
|
||||
|
||||
Kramdown is the default Markdown renderer for Jekyll. Below is a list of the
|
||||
currently supported options:
|
||||
|
||||
* **auto_id_prefix** - Prefix used for automatically generated header IDs
|
||||
* **auto_id_stripping** - Strip all formatting from header text for automatic ID generation
|
||||
* **auto_ids** - Use automatic header ID generation
|
||||
* **coderay_bold_every** - Defines how often a line number should be made bold
|
||||
* **coderay_css** - Defines how the highlighted code gets styled
|
||||
* **coderay_default_lang** - Sets the default language for highlighting code blocks
|
||||
* **coderay_line_number_start** - The start value for the line numbers
|
||||
* **coderay_line_numbers** - Defines how and if line numbers should be shown
|
||||
* **coderay_tab_width** - The tab width used in highlighted code
|
||||
* **coderay_wrap** - Defines how the highlighted code should be wrapped
|
||||
* **enable_coderay** - Use coderay for syntax highlighting
|
||||
* **entity_output** - Defines how entities are output
|
||||
* **footnote_backlink** - Defines the text that should be used for the footnote backlinks
|
||||
* **footnote_backlink_inline** - Specifies whether the footnote backlink should always be inline
|
||||
* **footnote_nr** - The number of the first footnote
|
||||
* **gfm_quirks** - Enables a set of GFM specific quirks
|
||||
* **hard_wrap** - Interprets line breaks literally
|
||||
* **header_offset** - Sets the output offset for headers
|
||||
* **html_to_native** - Convert HTML elements to native elements
|
||||
* **line_width** - Defines the line width to be used when outputting a document
|
||||
* **link_defs** - Pre-defines link definitions
|
||||
* **math_engine** - Set the math engine
|
||||
* **math_engine_opts** - Set the math engine options
|
||||
* **parse_block_html** - Process kramdown syntax in block HTML tags
|
||||
* **parse_span_html** - Process kramdown syntax in span HTML tags
|
||||
* **smart_quotes** - Defines the HTML entity names or code points for smart quote output
|
||||
* **syntax_highlighter** - Set the syntax highlighter
|
||||
* **syntax_highlighter_opts** - Set the syntax highlighter options
|
||||
* **toc_levels** - Defines the levels that are used for the table of contents
|
||||
* **transliterated_header_ids** - Transliterate the header text before generating the ID
|
||||
* **typographic_symbols** - Defines a mapping from typographical symbol to output characters
|
||||
|
||||
### Example Usage
|
||||
```yaml
|
||||
kramdown:
|
||||
html_to_native: true
|
||||
```
|
||||
|
||||
<div class="note warning">
|
||||
<h5>There are two unsupported kramdown options</h5>
|
||||
<p>
|
||||
Please note that both <code>remove_block_html_tags</code> and
|
||||
<code>remove_span_html_tags</code> are currently unsupported in Jekyll due
|
||||
to the fact that they are not included within the kramdown HTML converter.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
For more details about these options have a look at the [Kramdown configuration documentation](https://kramdown.gettalong.org/options.html).
|
||||
|
||||
### CommonMark
|
||||
|
||||
[CommonMark](https://commonmark.org/) is a rationalized version of Markdown syntax, implemented in C and thus faster than default Kramdown implemented in Ruby. It [slightly differs](https://github.com/commonmark/CommonMark#differences-from-original-markdown) from original Markdown and does not support all the syntax elements implemented in Kramdown, like [Block Inline Attribute Lists](https://kramdown.gettalong.org/syntax.html#block-ials).
|
||||
|
||||
It comes in two flavors: basic CommonMark with [jekyll-commonmark](https://github.com/jekyll/jekyll-commonmark) plugin and [GitHub Flavored Markdown supported by GitHub Pages](https://github.com/github/jekyll-commonmark-ghpages).
|
||||
|
||||
### Custom Markdown Processors
|
||||
|
||||
If you're interested in creating a custom markdown processor, you're in luck! Create a new class in the `Jekyll::Converters::Markdown` namespace:
|
||||
|
||||
```ruby
|
||||
class Jekyll::Converters::Markdown::MyCustomProcessor
|
||||
def initialize(config)
|
||||
require 'funky_markdown'
|
||||
@config = config
|
||||
rescue LoadError
|
||||
STDERR.puts 'You are missing a library required for Markdown. Please run:'
|
||||
STDERR.puts ' $ [sudo] gem install funky_markdown'
|
||||
raise FatalException.new("Missing dependency: funky_markdown")
|
||||
end
|
||||
|
||||
def convert(content)
|
||||
::FunkyMarkdown.new(content).convert
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
Once you've created your class and have it properly set up either as a plugin
|
||||
in the `_plugins` folder or as a gem, specify it in your `_config.yml`:
|
||||
|
||||
```yaml
|
||||
markdown: MyCustomProcessor
|
||||
```
|
||||
@@ -1,162 +0,0 @@
|
||||
---
|
||||
title: Configuration Options
|
||||
permalink: "/docs/configuration/options/"
|
||||
---
|
||||
|
||||
The tables below list the available settings for Jekyll, and the various <code
|
||||
class="option">options</code> (specified in the configuration file) and <code
|
||||
class="flag">flags</code> (specified on the command-line) that control them.
|
||||
|
||||
### Global Configuration
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th>
|
||||
<span class="option">Options</span> and <span class="flag">Flags</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for setting in site.data.config_options.global %}
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name">
|
||||
<strong>{{ setting.name }}</strong>
|
||||
{% if setting.version-badge %}
|
||||
<span class="version-badge" title="Introduced in v{{ setting.version-badge }}">{{ setting.version-badge }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
<p class="description">{{ setting.description }}</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
<p><code class="option">{{ setting.option }}</code></p>
|
||||
{% if setting.flag %}
|
||||
<p><code class="flag">{{ setting.flag }}</code></p>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td>
|
||||
<p class='name'><strong>Defaults</strong></p>
|
||||
<p class='description'>
|
||||
Set defaults for <a href="{{ '/docs/front-matter/' | relative_url }}" title="front matter">front matter</a>
|
||||
variables.
|
||||
</p>
|
||||
</td>
|
||||
<td class='align-center'>
|
||||
<p>see <a href="{{ '/docs/configuration/front-matter-defaults/' | relative_url }}" title="details">below</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="note warning">
|
||||
<h5>Destination folders are cleaned on site builds</h5>
|
||||
<p>
|
||||
The contents of <code><destination></code> are automatically
|
||||
cleaned, by default, when the site is built. Files or folders that are not
|
||||
created by your site will be removed. Some files could be retained
|
||||
by specifying them within the <code><keep_files></code> configuration directive.
|
||||
</p>
|
||||
<p>
|
||||
Do not use an important location for <code><destination></code>; instead, use it as
|
||||
a staging area and copy files from there to your web server.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
### Build Command Options
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th><span class="option">Options</span> and <span class="flag">Flags</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for setting in site.data.config_options.build %}
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name">
|
||||
<strong>{{ setting.name }}</strong>
|
||||
{% if setting.version-badge %}
|
||||
<span class="version-badge" title="Introduced in v{{ setting.version-badge }}">{{ setting.version-badge }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
<p class="description">{{ setting.description }}</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
{% if setting.option %}<p><code class="option">{{ setting.option }}</code></p>{% endif %}
|
||||
{% if setting.flag %}<p><code class="flag">{{ setting.flag }}</code></p>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
### Serve Command Options
|
||||
|
||||
In addition to the options below, the `serve` sub-command can accept any of the options
|
||||
for the `build` sub-command, which are then applied to the site build which occurs right
|
||||
before your site is served.
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Setting</th>
|
||||
<th><span class="option">Options</span> and <span class="flag">Flags</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for setting in site.data.config_options.serve %}
|
||||
<tr class="setting">
|
||||
<td>
|
||||
<p class="name">
|
||||
<strong>{{ setting.name }}</strong>
|
||||
{% if setting.version-badge %}
|
||||
<span class="version-badge" title="Introduced in v{{ setting.version-badge }}">{{ setting.version-badge }}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
<p class="description">{{ setting.description }}</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
{% if setting.option %}
|
||||
<p><code class="option">{{ setting.option }}</code></p>
|
||||
{% elsif setting.options %}
|
||||
<p>
|
||||
{% for option in setting.options %}
|
||||
<code class="option">{{ option }}</code><br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if setting.flag %}
|
||||
<p><code class="flag">{{ setting.flag }}</code></p>
|
||||
{% elsif setting.flags %}
|
||||
<p>
|
||||
{% for flag in setting.flags %}
|
||||
<code class="flag">{{ flag }}</code><br>
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="note warning">
|
||||
<h5>Do not use tabs in configuration files</h5>
|
||||
<p>
|
||||
This will either lead to parsing errors, or Jekyll will revert to the
|
||||
default settings. Use spaces instead.
|
||||
</p>
|
||||
</div>
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
title: WEBrick Options
|
||||
permalink: "/docs/configuration/webrick/"
|
||||
---
|
||||
You can provide custom headers for your site by adding them to `_config.yml`
|
||||
|
||||
```yaml
|
||||
# File: _config.yml
|
||||
webrick:
|
||||
headers:
|
||||
My-Header: My-Value
|
||||
My-Other-Header: My-Other-Value
|
||||
```
|
||||
|
||||
### Defaults
|
||||
|
||||
Jekyll provides by default `Content-Type` and `Cache-Control` response
|
||||
headers: one dynamic in order to specify the nature of the data being served,
|
||||
the other static in order to disable caching so that you don't have to fight
|
||||
with Chrome's aggressive caching when you are in development mode.
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
title: "Buddy"
|
||||
title: "BuddyWorks"
|
||||
---
|
||||
|
||||
[Buddy][buddy-homepage] is a [Docker][docker-homepage]-based CI server that you can set up in 15-20 minutes to build, test, and deploy your Jekyll websites. It supports [GitHub][github-homepage], [Bitbucket][bitbucket-homepage], and [GitLab][gitlab-homepage] repositories, and can be installed on-premises or used in cloud. The following guide will show you how to set up a free environment to build and test your Jekyll project.
|
||||
[BuddyWorks][buddyworks-homepage] is a [Docker][docker-homepage]-based CI server that you can set up in 15-20 minutes to build, test, and deploy your Jekyll websites. It supports [GitHub][github-homepage], [Bitbucket][bitbucket-homepage], and [GitLab][gitlab-homepage] repositories, and can be installed on-premises or used in cloud. The following guide will show you how to set up a free environment to build and test your Jekyll project.
|
||||
|
||||
[buddy-homepage]: https://buddy.works
|
||||
[buddyworks-homepage]: https://buddy.works
|
||||
[docker-homepage]: https://www.docker.com/
|
||||
[github-homepage]: https://github.com
|
||||
[bitbucket-homepage]: https://bitbucket.org/
|
||||
@@ -12,7 +12,7 @@ title: "Buddy"
|
||||
|
||||
## 1. Getting started
|
||||
|
||||
1. Log in at [https://buddy.works][buddy-homepage] with your GitHub/Bitbucket account or email
|
||||
1. Log in at [https://buddy.works](https://buddy.works) with your GitHub/Bitbucket account or email
|
||||
2. Choose your Git provider and select or push your Jekyll Project
|
||||
3. Create a new pipeline and set the trigger mode to 'On every push'
|
||||
4. Add and configure the Jekyll action and save the pipeline
|
||||
@@ -21,13 +21,15 @@ title: "Buddy"
|
||||
|
||||
Whenever you make a push to the selected branch, the Jekyll action runs `jekyll build` in an isolated [Jekyll Docker image][jekyll-docker-image]. The output is generated to the `/filesystem` directory, and can be further deployed to FTP/SFTP and IaaS services. You can add your own commands, install additional packages, attach services, and run Selenium tests, as well as add other actions down the pipeline, eg. a Slack notification or an SSH script that will restart your server.
|
||||
|
||||

|
||||
|
||||
[jekyll-docker-image]: https://hub.docker.com/r/jekyll/jekyll/
|
||||
|
||||
## 3. Using YAML for configuration
|
||||
|
||||
If you prefer configuration as code over GUI, you can generate a `buddy.yml` that will create a pipeline with the Jekyll action once you push it to the target branch:
|
||||
|
||||
```yaml
|
||||
```ruby
|
||||
- pipeline: "Build and Deploy Jekyll site"
|
||||
trigger_mode: "ON_EVERY_PUSH"
|
||||
ref_name: "master"
|
||||
@@ -43,7 +45,7 @@ If you prefer configuration as code over GUI, you can generate a `buddy.yml` tha
|
||||
|
||||
## 4. Setting up on-premises server
|
||||
|
||||
The self-hosted version of Buddy can be installed on any type of server supporting Docker, including [Linux][bw-linux], [Mac][bw-mac], [AWS EC2][bw-aws-ec2], [DigitalOcean][bw-digitalocean], and [Microsoft Azure][bw-azure].
|
||||
The self-hosted version of BuddyWorks can be installed on any type of server supporting Docker, including [Linux][bw-linux], [Mac][bw-mac], [AWS EC2][bw-aws-ec2], [DigitalOcean][bw-digitalocean], and [Microsoft Azure][bw-azure].
|
||||
|
||||
[bw-linux]: https://buddy.works/knowledge/standalone/installation-linux
|
||||
[bw-mac]: https://buddy.works/knowledge/standalone/installation-mac-osx
|
||||
@@ -53,8 +55,8 @@ The self-hosted version of Buddy can be installed on any type of server supporti
|
||||
|
||||
## 5. Questions?
|
||||
|
||||
This entire guide is open-source. Go ahead and [edit it][jekyll-docs-ci-buddy] if you want to expand it or have a fix or [ask for help][jekyll-help] if you run into trouble and need assistance. Buddy also has an [online community][buddy-forum] for help.
|
||||
This entire guide is open-source. Go ahead and [edit it][jekyll-docs-ci-buddyworks] if you want to expand it or have a fix or [ask for help][jekyll-help] if you run into trouble and need assistance. BuddyWorks also has an [online community][buddyworks-forum] for help.
|
||||
|
||||
[jekyll-docs-ci-buddy]: https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/buddyworks.md
|
||||
[jekyll-docs-ci-buddyworks]: https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/buddyworks.md
|
||||
[jekyll-help]: https://jekyllrb.com/help/
|
||||
[buddy-forum]: http://forum.buddy.works/
|
||||
[buddyworks-forum]: http://forum.buddy.works/
|
||||
|
||||
@@ -12,7 +12,7 @@ Building, testing, and deploying your Jekyll-generated website can quickly be do
|
||||
|
||||
To start building your project on CircleCI, all you need to do is 'follow' your project from CircleCI's website:
|
||||
|
||||
1. Visit the 'Add Projects' page
|
||||
1. Visit the 'Add Projects' page: <https://circleci.com/add-projects>
|
||||
1. From the GitHub or Bitbucket tab on the left, choose a user or organization.
|
||||
1. Find your project in the list and click 'Build project' on the right.
|
||||
1. The first build will start on its own. You can start telling CircleCI how to build your project by creating a [circle.yml][3] file in the root of your repository.
|
||||
@@ -25,7 +25,7 @@ The easiest way to manage dependencies for a Jekyll project (with or without Cir
|
||||
|
||||
[4]: http://bundler.io/gemfile.html
|
||||
|
||||
```ruby
|
||||
```yaml
|
||||
source 'https://rubygems.org'
|
||||
|
||||
ruby '2.4.0'
|
||||
@@ -34,13 +34,13 @@ gem 'jekyll'
|
||||
gem 'html-proofer'
|
||||
```
|
||||
|
||||
CircleCI detects when `Gemfile` is present and will automatically run `bundle install` for you in the `dependencies` phase.
|
||||
CircleCI detects when `Gemfile` is present is will automatically run `bundle install` for you in the `dependencies` phase.
|
||||
|
||||
## 3. Testing
|
||||
|
||||
The most basic test that can be run is seeing if `jekyll build` actually works. This is a blocker, a dependency if you will, for other tests you might run on the generate site. So we'll run Jekyll, via Bundler, in the `dependencies` phase.
|
||||
The most basic test that can be run is simply seeing if `jekyll build` actually works. This is a blocker, a dependency if you will, for other tests you might run on the generate site. So we'll run Jekyll, via Bundler, in the `dependencies` phase.
|
||||
|
||||
```yaml
|
||||
```
|
||||
dependencies:
|
||||
post:
|
||||
- bundle exec jekyll build
|
||||
@@ -61,75 +61,26 @@ test:
|
||||
|
||||
## Complete Example circle.yml File
|
||||
|
||||
Since v2, CircleCI is a Docker-based system. The example `circle.yml` below demonstrates how to
|
||||
deploy your Jekyll project to AWS. In order for this to work you would first have to set the
|
||||
`S3_BUCKET_NAME` [environment variable](https://circleci.com/docs/2.0/env-vars/).
|
||||
When you put it all together, here's an example of what that `circle.yml` file could look like:
|
||||
|
||||
```yaml
|
||||
defaults: &defaults
|
||||
working_directory: ~/repo
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
<<: *defaults
|
||||
docker:
|
||||
- image: circleci/ruby:2.5
|
||||
environment:
|
||||
BUNDLE_PATH: ~/repo/vendor/bundle
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- rubygems-v1-{% raw %}{{ checksum "Gemfile.lock" }}{% endraw %}
|
||||
- rubygems-v1-fallback
|
||||
- run:
|
||||
name: Bundle Install
|
||||
command: bundle check || bundle install
|
||||
- save_cache:
|
||||
key: rubygems-v1-{% raw %}{{ checksum "Gemfile.lock" }}{% endraw %}
|
||||
paths:
|
||||
- vendor/bundle
|
||||
- run:
|
||||
name: Jekyll build
|
||||
command: bundle exec jekyll build
|
||||
- run:
|
||||
name: HTMLProofer tests
|
||||
command: |
|
||||
bundle exec htmlproofer ./_site \
|
||||
--allow-hash-href \
|
||||
--check-favicon \
|
||||
--check-html \
|
||||
--disable-external
|
||||
- persist_to_workspace:
|
||||
root: ./
|
||||
paths:
|
||||
- _site
|
||||
deploy:
|
||||
<<: *defaults
|
||||
docker:
|
||||
- image: circleci/python:3.6.3
|
||||
environment:
|
||||
S3_BUCKET_NAME: <<YOUR BUCKET NAME HERE>>
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ./
|
||||
- run:
|
||||
name: Install AWS CLI
|
||||
command: pip install awscli --upgrade --user
|
||||
- run:
|
||||
name: Upload to s3
|
||||
command: ~/.local/bin/aws s3 sync ./_site s3://$S3_BUCKET_NAME/ --delete --acl public-read
|
||||
workflows:
|
||||
version: 2
|
||||
test-deploy:
|
||||
jobs:
|
||||
- build
|
||||
- deploy:
|
||||
requires:
|
||||
- build
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
```
|
||||
machine:
|
||||
environment:
|
||||
NOKOGIRI_USE_SYSTEM_LIBRARIES: true # speeds up installation of html-proofer
|
||||
|
||||
dependencies:
|
||||
post:
|
||||
- bundle exec jekyll build
|
||||
|
||||
test:
|
||||
post:
|
||||
- bundle exec htmlproofer ./_site --allow-hash-href --check-favicon --check-html --disable-external
|
||||
|
||||
deployment:
|
||||
prod:
|
||||
branch: master
|
||||
commands:
|
||||
- rsync -va --delete ./_site username@my-website:/var/html
|
||||
```
|
||||
|
||||
## Questions?
|
||||
|
||||
@@ -1,213 +0,0 @@
|
||||
---
|
||||
title: GitHub Actions
|
||||
---
|
||||
|
||||
When building a Jekyll site with GitHub Pages, the standard flow is restricted for security reasons
|
||||
and to make it simpler to get a site setup. For more control over the build and still host the site
|
||||
with GitHub Pages you can use GitHub Actions.
|
||||
|
||||
|
||||
## Advantages of using Actions
|
||||
|
||||
### Control over gemset
|
||||
|
||||
- **Jekyll version** --- Instead of using the currently enabled version at `3.9.0`, you can use any
|
||||
version of Jekyll you want. For example `4.0.0`, or point directly to the repository.
|
||||
- **Plugins** --- You can use any Jekyll plugins irrespective of them being on the
|
||||
[supported versions][ghp-whitelist] list, even `*.rb` files placed in the `_plugins` directory
|
||||
of your site.
|
||||
- **Themes** --- While using a custom theme is possible without Actions, it is now simpler.
|
||||
|
||||
### Workflow Management
|
||||
|
||||
- **Customization** --- By creating a workflow file to run Actions, you can specify custom build
|
||||
steps, use environment variables.
|
||||
- **Logging** --- The build log is visible and can be tweaked to be verbose, so it is much easier to
|
||||
debug errors using Actions.
|
||||
|
||||
|
||||
## Workspace setup
|
||||
|
||||
The first and foremost requirement is a Jekyll project hosted at GitHub. Choose an existing Jekyll
|
||||
project or follow the [Quickstart]({{ '/docs' | relative_url }}) and push the repository to GitHub
|
||||
if it is not hosted there already.
|
||||
|
||||
We're only going to cover builds from the `master` branch in this page. Therefore, ensure that you
|
||||
are working on the `master` branch. If necessary, you may create it based on your default branch.
|
||||
When the Action builds your site, the contents of the *destination* directory will be automatically
|
||||
pushed to the `gh-pages` branch with a commit, ready to be used for serving.
|
||||
|
||||
{: .note .warning}
|
||||
The Action we're using here will create (or reset an existing) `gh-pages` branch on every successful
|
||||
deploy.<br/> So, if you have an existing `gh-pages` branch that is used to deploy your production
|
||||
build, ensure to make a backup of the contents into a different branch so that you can rollback
|
||||
easily if necessary.
|
||||
|
||||
The Jekyll site we'll be using for the rest of this page initially consists of just a `_config.yml`,
|
||||
an `index.md` page and a `Gemfile`. The contents are respectively:
|
||||
|
||||
```yaml
|
||||
# _config.yml
|
||||
|
||||
title: "Jekyll Actions Demo"
|
||||
```
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
---
|
||||
---
|
||||
|
||||
Welcome to My Home Page
|
||||
|
||||
{% assign date = '2020-04-13T10:20:00Z' %}
|
||||
|
||||
- Original date - {{ date }}
|
||||
- With timeago filter - {{ date | timeago }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
|
||||
```ruby
|
||||
# Gemfile
|
||||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'jekyll', '~> 4.0'
|
||||
|
||||
group :jekyll_plugins do
|
||||
gem 'jekyll-timeago', '~> 0.13.1'
|
||||
end
|
||||
```
|
||||
|
||||
{: .note .info}
|
||||
The demo site uses Jekyll 4 and a [third-party plugin][timeago-plugin], both of which are currently
|
||||
not whitelisted for use on GitHub pages. The plugin will allow us to describe how far back a date
|
||||
was from today. e.g. If we give a date as `2016-03-23T10:20:00Z` and the current date is
|
||||
`2020-04-13T10:20:00Z`, then the output would be `4 years and 3 weeks ago`.
|
||||
|
||||
{: .note .info}
|
||||
The action we're using takes care of installing the Ruby gems and dependencies. While that keeps
|
||||
the setup simple for the user, one may encounter issues if they also check-in `Gemfile.lock` if it
|
||||
was generated with an old version of Bundler.
|
||||
|
||||
### Setting up the Action
|
||||
|
||||
GitHub Actions are registered for a repository by using a YAML file inside the directory path
|
||||
`.github/workflows` (note the dot at the start). Here we shall employ
|
||||
[Jekyll Actions][jekyll-actions] from the Marketplace for its simplicity.
|
||||
|
||||
Create a **workflow file**, say `github-pages.yml`, using either the GitHub interface or by pushing
|
||||
a YAML file to the workflow directory path manually. The base contents are:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Build and deploy Jekyll site to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
github-pages:
|
||||
runs-on: ubuntu-16.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: helaili/jekyll-action@2.0.1
|
||||
env:
|
||||
JEKYLL_PAT: ${{ secrets.JEKYLL_PAT }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The above workflow can be explained as the following:
|
||||
|
||||
- We trigger the build using **on.push** condition for `master` branch only --- this prevents
|
||||
the Action from overwriting the `gh-pages` branch on any feature branch pushes.
|
||||
- The **name** of the job matches our YAML filename: `github-pages`.
|
||||
- The **checkout** action takes care of cloning your repository.
|
||||
- We specify our selected **action** and **version number** using `helaili/jekyll-action@2.0.0`.
|
||||
This handles the build and deploy.
|
||||
- We set a reference to a secret **environment variable** for the action to use. The `JEKYLL_PAT`
|
||||
is a *Personal Access Token* and is detailed in the next section.
|
||||
|
||||
Instead of using the **on.push** condition, you could trigger your build on a **schedule** by
|
||||
using the [on.schedule] parameter. For example, here we build daily at midnight by specifying
|
||||
**cron** syntax, which can be tested at the [crontab guru] site.
|
||||
|
||||
```yaml
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
```
|
||||
|
||||
Note that this string must be quoted to prevent the asterisks from being evaluated incorrectly.
|
||||
|
||||
[on.schedule]: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule
|
||||
[crontab guru]: https://crontab.guru/
|
||||
|
||||
|
||||
### Providing permissions
|
||||
|
||||
The action needs permissions to push to your `gh-pages` branch. So you need to create a GitHub
|
||||
**authentication token** on your GitHub profile, then set it as an environment variable in your
|
||||
build using _Secrets_:
|
||||
|
||||
1. On your GitHub profile, under **Developer Settings**, go to the [Personal Access Tokens][tokens]
|
||||
section.
|
||||
2. **Create** a token. Give it a name like "GitHub Actions" and ensure it has permissions to
|
||||
`public_repos` (or the entire `repo` scope for private repository) --- necessary for the action
|
||||
to commit to the `gh-pages` branch.
|
||||
3. **Copy** the token value.
|
||||
4. Go to your repository's **Settings** and then the **Secrets** tab.
|
||||
5. **Create** a token named `JEKYLL_PAT` (*important*). Give it a value using the value copied
|
||||
above.
|
||||
|
||||
### Build and deploy
|
||||
|
||||
On pushing any local changes onto `master`, the action will be triggered and the build will
|
||||
**start**.
|
||||
|
||||
To watch the progress and see any build errors, check on the build **status** using one of the
|
||||
following approaches:
|
||||
|
||||
- **View by commit**
|
||||
- Go to the repository level view in GitHub. Under the most recent commit (near the top) you’ll
|
||||
see a **status symbol** next to the commit message as a tick or _X_. Hover over it and click
|
||||
the **details** link.
|
||||
- **Actions tab**
|
||||
- Go to the repository's Actions tab. Click on the `jekyll` workflow tab.
|
||||
|
||||
If all goes well, all steps will be green and the built assets will now exist on the `gh-pages`
|
||||
branch.
|
||||
|
||||
On a successful build, GitHub Pages will **publish** the site stored on the repository `gh-pages`
|
||||
branches. Note that you do not need to setup a `gh-pages` branch or enable GitHub Pages, as the
|
||||
action will take care of this for you.
|
||||
(For private repositories, you'll have to upgrade to a paid plan).
|
||||
|
||||
To see the **live site**:
|
||||
|
||||
1. Go to the **environment** tab on your repository.
|
||||
2. Click **View Deployment** to see the deployed site URL.
|
||||
3. View your site at the **URL**. Make sure the `timeago` filter works as expected.
|
||||
4. Optionally **add** this URL to your repository's main page and to your `README.md`, to make it
|
||||
easy for people to find.
|
||||
|
||||
When you need to make further **changes** to the site, commit to `master` and push. The workflow
|
||||
will build and deploy your site again.
|
||||
|
||||
Be sure **not to edit** the `gh-pages` branch directly, as any changes will be lost on the next
|
||||
successful deploy from the Action.
|
||||
|
||||
## External links
|
||||
|
||||
- [jekyll-actions] is an action available on the GitHub Marketplace and was used in this guide.
|
||||
- [jekyll-actions-quickstart] is an unofficial repository that includes a live demo of the
|
||||
`jekyll-actions` action. That project can be used as a template for making a new site.
|
||||
|
||||
|
||||
[ghp-whitelist]: https://pages.github.com/versions/
|
||||
[timeago-plugin]: https://rubygems.org/gems/jekyll-timeago
|
||||
[tokens]: https://github.com/settings/tokens
|
||||
[jekyll-actions]: https://github.com/marketplace/actions/jekyll-actions
|
||||
[jekyll-actions-quickstart]: https://github.com/MichaelCurrin/jekyll-actions-quickstart
|
||||
10
docs/_docs/continuous-integration/index.md
Normal file
10
docs/_docs/continuous-integration/index.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: Continuous Integration
|
||||
permalink: /docs/continuous-integration/
|
||||
---
|
||||
|
||||
Continuous Integration (CI) enables you to publish your Jekyll generated website with confidence by automating the quality assurance and deployment processes. You can quickly get started using CI with one of the providers below:
|
||||
|
||||
* [Travis CI](travis-ci)
|
||||
* [CircleCI](circleci)
|
||||
* [BuddyWorks](buddyworks)
|
||||
@@ -2,7 +2,7 @@
|
||||
title: "Travis CI"
|
||||
---
|
||||
|
||||
You can test your website build against one or more versions of Ruby.
|
||||
You can easily test your website build against one or more versions of Ruby.
|
||||
The following guide will show you how to set up a free build environment on
|
||||
[Travis][travis], with [GitHub][github] integration for pull requests.
|
||||
|
||||
@@ -11,7 +11,7 @@ The following guide will show you how to set up a free build environment on
|
||||
|
||||
## 1. Enabling Travis and GitHub
|
||||
|
||||
To enable Travis builds for your GitHub repository:
|
||||
Enabling Travis builds for your GitHub repository is pretty simple:
|
||||
|
||||
1. Go to your profile on travis-ci.org: https://travis-ci.org/profile/username
|
||||
2. Find the repository for which you're interested in enabling builds.
|
||||
@@ -21,7 +21,7 @@ To enable Travis builds for your GitHub repository:
|
||||
|
||||
## 2. The Test Script
|
||||
|
||||
The simplest test script runs `jekyll build` and ensures that Jekyll
|
||||
The simplest test script simply runs `jekyll build` and ensures that Jekyll
|
||||
doesn't fail to build the site. It doesn't check the resulting site, but it
|
||||
does ensure things are built properly.
|
||||
|
||||
@@ -34,7 +34,7 @@ Save the commands you want to run and succeed in a file: `./script/cibuild`
|
||||
|
||||
### The HTML Proofer Executable
|
||||
|
||||
```bash
|
||||
```sh
|
||||
#!/usr/bin/env bash
|
||||
set -e # halt script on error
|
||||
|
||||
@@ -49,7 +49,7 @@ Some options can be specified via command-line switches. Check out the
|
||||
For example to avoid testing external sites, use this command:
|
||||
|
||||
```sh
|
||||
bundle exec htmlproofer ./_site --disable-external
|
||||
$ bundle exec htmlproofer ./_site --disable-external
|
||||
```
|
||||
|
||||
### The HTML Proofer Library
|
||||
@@ -76,7 +76,7 @@ with Ruby and requires RubyGems to install, we use the Ruby language build
|
||||
environment. Below is a sample `.travis.yml` file, followed by
|
||||
an explanation of each line.
|
||||
|
||||
**Note:** You will need a Gemfile as well, [Travis will automatically install](https://docs.travis-ci.com/user/languages/ruby/#Dependency-Management) the dependencies based on the referenced gems. Here is an example `Gemfile` with two referenced gems, "jekyll" and "html-proofer":
|
||||
**Note:** You will need a Gemfile as well, [Travis will automatically install](https://docs.travis-ci.com/user/languages/ruby/#Dependency-Management) the dependencies based on the referenced gems:
|
||||
|
||||
```ruby
|
||||
source "https://rubygems.org"
|
||||
@@ -90,7 +90,7 @@ Your `.travis.yml` file should look like this:
|
||||
```yaml
|
||||
language: ruby
|
||||
rvm:
|
||||
- 2.6.3
|
||||
- 2.3.3
|
||||
|
||||
before_script:
|
||||
- chmod +x ./script/cibuild # or do this locally and commit
|
||||
@@ -105,16 +105,11 @@ branches:
|
||||
- gh-pages # test the gh-pages branch
|
||||
- /pages-(.*)/ # test every branch which starts with "pages-"
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libcurl4-openssl-dev
|
||||
env:
|
||||
global:
|
||||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
|
||||
|
||||
cache: bundler # caching bundler gem packages will speed up build
|
||||
|
||||
# Optional: disable email notifications about the outcome of your builds
|
||||
notifications:
|
||||
email: false
|
||||
sudo: false # route your build to the container-based infrastructure for a faster build
|
||||
```
|
||||
|
||||
Ok, now for an explanation of each line:
|
||||
@@ -128,13 +123,12 @@ access to Bundler, RubyGems, and a Ruby runtime.
|
||||
|
||||
```yaml
|
||||
rvm:
|
||||
- 2.6.3
|
||||
- 2.3.3
|
||||
```
|
||||
|
||||
RVM is a popular Ruby Version Manager (like rbenv, chruby, etc). This
|
||||
directive tells Travis the Ruby version to use when running your test
|
||||
script. Use a [version which is pre-installed on the Travis build docker][5]
|
||||
image to speed up the build.
|
||||
script.
|
||||
|
||||
```yaml
|
||||
before_script:
|
||||
@@ -183,6 +177,18 @@ prefixed, exemplified above with the `/pages-(.*)/` regular expression.
|
||||
The `branches` directive is completely optional. Travis will build from every
|
||||
push to any branch of your repo if leave it out.
|
||||
|
||||
```yaml
|
||||
env:
|
||||
global:
|
||||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
|
||||
```
|
||||
|
||||
Using `html-proofer`? You'll want this environment variable. Nokogiri, used
|
||||
to parse HTML files in your compiled site, comes bundled with libraries
|
||||
which it must compile each time it is installed. Luckily, you can
|
||||
dramatically decrease the install time of Nokogiri by setting the
|
||||
environment variable `NOKOGIRI_USE_SYSTEM_LIBRARIES` to `true`.
|
||||
|
||||
<div class="note warning">
|
||||
<h5>Be sure to exclude <code>vendor</code> from your
|
||||
<code>_config.yml</code></h5>
|
||||
@@ -194,21 +200,14 @@ push to any branch of your repo if leave it out.
|
||||
exclude: [vendor]
|
||||
```
|
||||
|
||||
To speed up the build, you should cache the gem packages created by `bundler`.
|
||||
Travis has a pre-defined [cache strategy for this tool][6] which should have
|
||||
all the default configs to do exactly that.
|
||||
By default you should supply the `sudo: false` command to Travis. This command
|
||||
explicitly tells Travis to run your build on Travis's [container-based
|
||||
infrastructure](https://docs.travis-ci.com/user/workers/container-based-infrastructure/#Routing-your-build-to-container-based-infrastructure). Running on the container-based infrastructure can often times
|
||||
speed up your build. If you have any trouble with your build, or if your build
|
||||
does need `sudo` access, modify the line to `sudo: required`.
|
||||
|
||||
```yaml
|
||||
cache: bundler
|
||||
```
|
||||
|
||||
Optionally, if you are not interested in the build email notifications you
|
||||
can disable them with this configuration. Travis supports a wide array of
|
||||
notification services, you may find [another one more useful (e.g. slack)][7].
|
||||
|
||||
```yaml
|
||||
notifications:
|
||||
email: false
|
||||
sudo: false
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
@@ -228,6 +227,3 @@ fix or [ask for help][4] if you run into trouble and need some help.
|
||||
|
||||
[3]: https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/travis-ci.md
|
||||
[4]: https://jekyllrb.com/help/
|
||||
[5]: https://docs.travis-ci.com/user/languages/ruby/#Specifying-Ruby-versions-and-implementations
|
||||
[6]: https://docs.travis-ci.com/user/caching/#Caching-directories-(Bundler%2C-dependencies)
|
||||
[7]: https://docs.travis-ci.com/user/notifications/
|
||||
|
||||
@@ -8,30 +8,33 @@ Hi there! Interested in contributing to Jekyll? We'd love your help. Jekyll is a
|
||||
|
||||
## Where to get help or report a problem
|
||||
|
||||
See the [support guidelines](https://jekyllrb.com/docs/support/)
|
||||
* If you have a question about using Jekyll, start a discussion on [Jekyll Talk](https://talk.jekyllrb.com).
|
||||
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
|
||||
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new).
|
||||
* More resources are listed on our [Help page](https://jekyllrb.com/help/).
|
||||
|
||||
## Ways to contribute
|
||||
|
||||
Whether you're a developer, a designer, or just a Jekyll devotee, there are lots of ways to contribute. Here's a few ideas:
|
||||
|
||||
- [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know.
|
||||
- Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better?
|
||||
- Read through the [documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved.
|
||||
- Browse through the [Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing.
|
||||
- Find an [open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions.
|
||||
- Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed.
|
||||
* [Install Jekyll on your computer](https://jekyllrb.com/docs/installation/) and kick the tires. Does it work? Does it do what you'd expect? If not, [open an issue](https://github.com/jekyll/jekyll/issues/new) and let us know.
|
||||
* Comment on some of the project's [open issues](https://github.com/jekyll/jekyll/issues). Have you experienced the same problem? Know a work around? Do you have a suggestion for how the feature could be better?
|
||||
* Read through [the documentation](https://jekyllrb.com/docs/home/), and click the "improve this page" button, any time you see something confusing, or have a suggestion for something that could be improved.
|
||||
* Browse through [the Jekyll discussion forum](https://talk.jekyllrb.com/), and lend a hand answering questions. There's a good chance you've already experienced what another user is experiencing.
|
||||
* Find [an open issue](https://github.com/jekyll/jekyll/issues) (especially [those labeled `help-wanted`](https://github.com/jekyll/jekyll/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted)), and submit a proposed fix. If it's your first pull request, we promise we won't bite, and are glad to answer any questions.
|
||||
* Help evaluate [open pull requests](https://github.com/jekyll/jekyll/pulls), by testing the changes locally and reviewing what's proposed.
|
||||
|
||||
## Submitting a pull request
|
||||
|
||||
### Pull requests generally
|
||||
|
||||
- The smaller the proposed change, the better. If you'd like to propose two unrelated changes, submit two pull requests.
|
||||
* The smaller the proposed change, the better. If you'd like to propose two unrelated changes, submit two pull requests.
|
||||
|
||||
- The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
|
||||
* The more information, the better. Make judicious use of the pull request body. Describe what changes were made, why you made them, and what impact they will have for users.
|
||||
|
||||
- If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
|
||||
* Pull requests are easy and fun. If this is your first pull request, it may help to [understand GitHub Flow](https://guides.github.com/introduction/flow/).
|
||||
|
||||
- If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
|
||||
* If you're submitting a code contribution, be sure to read the [code contributions](#code-contributions) section below.
|
||||
|
||||
### Submitting a pull request via github.com
|
||||
|
||||
@@ -53,7 +56,7 @@ That's it! You'll be automatically subscribed to receive updates as others revie
|
||||
2. Clone the repository locally `git clone https://github.com/<you-username>/jekyll`.
|
||||
3. Create a new, descriptively named branch to contain your change ( `git checkout -b my-awesome-feature` ).
|
||||
4. Hack away, add tests. Not necessarily in that order.
|
||||
5. Make sure everything still passes by running `script/cibuild` (see the [tests section](#running-tests-locally) below)
|
||||
5. Make sure everything still passes by running `script/cibuild` (see [the tests section](#running-tests-locally) below)
|
||||
6. Push the branch up ( `git push origin my-awesome-feature` ).
|
||||
7. Create a pull request by visiting `https://github.com/<your-username>/jekyll` and following the instructions at the top of the screen.
|
||||
|
||||
@@ -80,12 +83,11 @@ If you ever need to update our documentation with an icon that is not already av
|
||||
5. Click `Generate Font` on the bottom-horizontal-bar.
|
||||
6. Inspect the included icons and proceed by clicking `Download`.
|
||||
7. Extract the font files and adapt the CSS to the paths we use in Jekyll:
|
||||
|
||||
- Copy the entire `fonts` directory over and overwrite existing ones at `<jekyll>/docs/`.
|
||||
- Copy the contents of `selection.json` and overwrite existing content inside `<jekyll>/docs/icomoon-selection.json`.
|
||||
- Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the
|
||||
- Copy the entire `fonts` directory over and overwrite existing ones at `<jekyll>/docs/`.
|
||||
- Copy the contents of `selection.json` and overwrite existing content inside `<jekyll>/docs/icomoon-selection.json`.
|
||||
- Copy the entire `@font-face {}` declaration and only the **new-icon(s)' css declarations** further below, to update the
|
||||
`<jekyll>/docs/_sass/_font-awesome.scss` sass partial.
|
||||
- Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so:
|
||||
- Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so:
|
||||
`('../fonts/Fontawesome.woff?9h6hxj')`.
|
||||
|
||||
### Adding plugins
|
||||
@@ -94,7 +96,7 @@ If you want to add your plugin to the [list of plugins](https://jekyllrb.com/doc
|
||||
|
||||
## Code Contributions
|
||||
|
||||
Interested in submitting a pull request? Awesome. Read on. There's a few common gotchas that we'd love to help you avoid.
|
||||
Interesting in submitting a pull request? Awesome. Read on. There's a few common gotchas that we'd love to help you avoid.
|
||||
|
||||
### Tests and documentation
|
||||
|
||||
@@ -106,21 +108,15 @@ If your contribution changes any Jekyll behavior, make sure to update the docume
|
||||
|
||||
#### Tests
|
||||
|
||||
- If you're creating a small fix or patch to an existing feature, a simple test is more than enough. You can usually copy/paste from an existing example in the `tests` folder, but if you need you can find out about our tests suites [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and [RSpec-Mocks](https://github.com/rspec/rspec-mocks).
|
||||
* If you're creating a small fix or patch to an existing feature, a simple test is more than enough. You can usually copy/paste from an existing example in the `tests` folder, but if you need you can find out about our tests suites [Shoulda](https://github.com/thoughtbot/shoulda/tree/master) and [RSpec-Mocks](https://github.com/rspec/rspec-mocks).
|
||||
|
||||
- If it's a brand new feature, create a new [Cucumber](https://github.com/cucumber/cucumber/) feature, reusing existing steps where appropriate.
|
||||
* If it's a brand new feature, create a new [Cucumber](https://github.com/cucumber/cucumber/) feature, reusing existing steps where appropriate.
|
||||
|
||||
### Code contributions generally
|
||||
|
||||
- Jekyll uses the [Rubocop](https://github.com/bbatsov/rubocop) static analyzer to ensure that contributions follow the [GitHub Ruby Styleguide](https://github.com/styleguide/ruby). Please check your code using `script/fmt` and resolve any errors before pushing your branch.
|
||||
* Jekyll uses the [Rubocop](https://github.com/bbatsov/rubocop) static analyzer to ensure that contributions follow the [GitHub Ruby Styleguide](https://github.com/styleguide/ruby). Please check your code using `script/fmt` and resolve any errors before pushing your branch.
|
||||
|
||||
- Don't bump the Gem version in your pull request (if you don't know what that means, you probably didn't).
|
||||
|
||||
- You can use the command `script/console` to start a REPL to explore the result of
|
||||
Jekyll's methods. It also provides you with helpful methods to quickly create a
|
||||
site or configuration. [Feel free to check it out!](https://github.com/jekyll/jekyll/blob/master/script/console)
|
||||
|
||||
- Previously, we've used the WIP Probot app to help contributors determine whether their pull request is ready for review. Please use a [draft pull request](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests) instead. When you're ready, [mark the pull request as ready for review](https://help.github.com/en/articles/changing-the-stage-of-a-pull-request)
|
||||
* Don't bump the Gem version in your pull request (if you don't know what that means, you probably didn't).
|
||||
|
||||
## Running tests locally
|
||||
|
||||
@@ -128,35 +124,23 @@ If your contribution changes any Jekyll behavior, make sure to update the docume
|
||||
|
||||
To run the test suite and build the gem you'll need to install Jekyll's dependencies by running the following command:
|
||||
|
||||
```sh
|
||||
script/bootstrap
|
||||
```
|
||||
<pre class="highlight"><code>$ script/bootstrap</code></pre>
|
||||
|
||||
Before you make any changes, run the tests and make sure that they pass (to confirm your environment is configured properly):
|
||||
|
||||
```sh
|
||||
script/cibuild
|
||||
```
|
||||
<pre class="highlight"><code>$ script/cibuild</code></pre>
|
||||
|
||||
If you are only updating a file in `test/`, you can use the command:
|
||||
|
||||
```sh
|
||||
script/test test/blah_test.rb
|
||||
```
|
||||
<pre class="highlight"><code>$ script/test test/blah_test.rb</code></pre>
|
||||
|
||||
If you are only updating a `.feature` file, you can use the command:
|
||||
|
||||
```sh
|
||||
script/cucumber features/blah.feature
|
||||
```
|
||||
<pre class="highlight"><code>$ script/cucumber features/blah.feature</code></pre>
|
||||
|
||||
Both `script/test` and `script/cucumber` can be run without arguments to
|
||||
run its entire respective suite.
|
||||
|
||||
## Visual Studio Code Development Container
|
||||
|
||||
If you've got [Visual Studio Code](https://code.visualstudio.com/) with the [Remote Development Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) installed then simply opening this repository in Visual Studio Code and following the prompts to "Re-open In A Development Container" will get you setup and ready to go with a fresh environment with all the requirements installed.
|
||||
|
||||
## A thank you
|
||||
|
||||
Thanks! Hacking on Jekyll should be fun. If you find any of this hard to figure out, let us know so we can improve our process or documentation!
|
||||
|
||||
@@ -3,12 +3,13 @@ title: Data Files
|
||||
permalink: /docs/datafiles/
|
||||
---
|
||||
|
||||
In addition to the [built-in variables]({{'/docs/variables/' | relative_url }}) available from Jekyll,
|
||||
In addition to the [built-in variables](../variables/) available from Jekyll,
|
||||
you can specify your own custom data that can be accessed via the [Liquid
|
||||
templating system](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers).
|
||||
templating system](https://wiki.github.com/shopify/liquid/liquid-for-designers).
|
||||
|
||||
Jekyll supports loading data from [YAML](http://yaml.org/), [JSON](http://www.json.org/), [CSV](https://en.wikipedia.org/wiki/Comma-separated_values), and [TSV](https://en.wikipedia.org/wiki/Tab-separated_values) files located in the `_data` directory.
|
||||
Note that CSV and TSV files *must* contain a header row.
|
||||
Jekyll supports loading data from [YAML](http://yaml.org/), [JSON](http://www.json.org/),
|
||||
and [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) files located in the `_data` directory.
|
||||
Note that CSV files *must* contain a header row.
|
||||
|
||||
This powerful feature allows you to avoid repetition in your templates and to
|
||||
set site specific options without changing `_config.yml`.
|
||||
@@ -17,8 +18,9 @@ Plugins/themes can also leverage Data Files to set configuration variables.
|
||||
|
||||
## The Data Folder
|
||||
|
||||
The `_data` folder is where you can store additional data for Jekyll to use when
|
||||
generating your site. These files must be YAML, JSON, or CSV files (using either
|
||||
As explained on the [directory structure](../structure/) page, the `_data`
|
||||
folder is where you can store additional data for Jekyll to use when generating
|
||||
your site. These files must be YAML, JSON, or CSV files (using either
|
||||
the `.yml`, `.yaml`, `.json` or `.csv` extension), and they will be
|
||||
accessible via `site.data`.
|
||||
|
||||
@@ -42,20 +44,20 @@ In `_data/members.yml`:
|
||||
|
||||
Or `_data/members.csv`:
|
||||
|
||||
```
|
||||
```text
|
||||
name,github
|
||||
Eric Mill,konklone
|
||||
Parker Moore,parkr
|
||||
Liu Fengyun,liufengyun
|
||||
```
|
||||
|
||||
This data can be accessed via `site.data.members` (notice that the file's *basename* determines the variable name and
|
||||
therefore one should avoid having data files with the same basename but different extensions, in the same directory).
|
||||
This data can be accessed via `site.data.members` (notice that the filename
|
||||
determines the variable name).
|
||||
|
||||
You can now render the list of members in a template:
|
||||
|
||||
```html
|
||||
{% raw %}
|
||||
```liquid
|
||||
<ul>
|
||||
{% for member in site.data.members %}
|
||||
<li>
|
||||
@@ -65,10 +67,13 @@ You can now render the list of members in a template:
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
```
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
## Subfolders
|
||||
{: .note .info }
|
||||
If your Jekyll site has a lot of pages, such as with documentation websites, see the detailed examples in [how to build robust navigation for your site]({% link _tutorials/navigation.md %}).
|
||||
|
||||
## Example: Organizations
|
||||
|
||||
Data files can also be placed in sub-folders of the `_data` folder. Each folder
|
||||
level will be added to a variable's namespace. The example below shows how
|
||||
@@ -101,8 +106,8 @@ members:
|
||||
The organizations can then be accessed via `site.data.orgs`, followed by the
|
||||
file name:
|
||||
|
||||
```html
|
||||
{% raw %}
|
||||
```liquid
|
||||
<ul>
|
||||
{% for org_hash in site.data.orgs %}
|
||||
{% assign org = org_hash[1] %}
|
||||
@@ -114,8 +119,8 @@ file name:
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
```
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
## Example: Accessing a specific author
|
||||
|
||||
@@ -129,10 +134,10 @@ dave:
|
||||
twitter: DavidSilvaSmith
|
||||
```
|
||||
|
||||
The author can then be specified as a page variable in a post's front matter:
|
||||
The author can then be specified as a page variable in a post's frontmatter:
|
||||
|
||||
```html
|
||||
{% raw %}
|
||||
```liquid
|
||||
---
|
||||
title: sample post
|
||||
author: dave
|
||||
@@ -144,7 +149,8 @@ author: dave
|
||||
title="{{ author.name }}">
|
||||
{{ author.name }}
|
||||
</a>
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
For information on how to build robust navigation for your site (especially if you have a documentation website or another type of Jekyll site with a lot of pages to organize), see [Navigation]({{ '/tutorials/navigation/' | relative_url }}).
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
For information on how to build robust navigation for your site (especially if you have a documentation website or another type of Jekyll site with a lot of pages to organize), see [Navigation](/tutorials/navigation).
|
||||
|
||||
208
docs/_docs/deployment-methods.md
Normal file
208
docs/_docs/deployment-methods.md
Normal file
@@ -0,0 +1,208 @@
|
||||
---
|
||||
title: Deployment methods
|
||||
permalink: /docs/deployment-methods/
|
||||
---
|
||||
|
||||
Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. A few of the most common deployment techniques are described below.
|
||||
|
||||
## Web hosting providers (FTP)
|
||||
|
||||
Just about any traditional web hosting provider will let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, simply run the `jekyll build` command and copy the contents of the generated `_site` folder to the root folder of your hosting account. This is most likely to be the `httpdocs` or `public_html` folder on most hosting providers.
|
||||
|
||||
## Self-managed web server
|
||||
|
||||
If you have direct access to the deployment web server, the process is essentially the same, except you might have other methods available to you (such as `scp`, or even direct filesystem access) for transferring the files. Just remember to make sure the contents of the generated `_site` folder get placed in the appropriate web root directory for your web server.
|
||||
|
||||
## Automated methods
|
||||
|
||||
There are also a number of ways to easily automate the deployment of a Jekyll site. If you’ve got another method that isn’t listed below, we’d love it if you [contributed](../contributing/) so that everyone else can benefit too.
|
||||
|
||||
### Git post-update hook
|
||||
|
||||
If you store your Jekyll site in [Git](https://git-scm.com/) (you are using
|
||||
version control, right?), it’s pretty easy to automate the
|
||||
deployment process by setting up a post-update hook in your Git
|
||||
repository, [like
|
||||
this](http://web.archive.org/web/20091223025644/http://www.taknado.com/en/2009/03/26/deploying-a-jekyll-generated-site/).
|
||||
|
||||
### Git post-receive hook
|
||||
|
||||
To have a remote server handle the deploy for you every time you push changes using Git, you can create a user account which has all the public keys that are authorized to deploy in its `authorized_keys` file. With that in place, setting up the post-receive hook is done as follows:
|
||||
|
||||
```sh
|
||||
laptop$ ssh deployer@example.com
|
||||
server$ mkdir myrepo.git
|
||||
server$ cd myrepo.git
|
||||
server$ git --bare init
|
||||
server$ cp hooks/post-receive.sample hooks/post-receive
|
||||
server$ mkdir /var/www/myrepo
|
||||
```
|
||||
|
||||
Next, add the following lines to hooks/post-receive and be sure Jekyll is
|
||||
installed on the server:
|
||||
|
||||
```sh
|
||||
GIT_REPO=$HOME/myrepo.git
|
||||
TMP_GIT_CLONE=$HOME/tmp/myrepo
|
||||
PUBLIC_WWW=/var/www/myrepo
|
||||
|
||||
git clone $GIT_REPO $TMP_GIT_CLONE
|
||||
jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW
|
||||
rm -Rf $TMP_GIT_CLONE
|
||||
exit
|
||||
```
|
||||
|
||||
Finally, run the following command on any users laptop that needs to be able to
|
||||
deploy using this hook:
|
||||
|
||||
```sh
|
||||
laptops$ git remote add deploy deployer@example.com:~/myrepo.git
|
||||
```
|
||||
|
||||
Deploying is now as easy as telling nginx or Apache to look at
|
||||
`/var/www/myrepo` and running the following:
|
||||
|
||||
```sh
|
||||
laptops$ git push deploy master
|
||||
```
|
||||
|
||||
### Static Publisher
|
||||
|
||||
[Static Publisher](https://github.com/static-publisher/static-publisher) is another automated deployment option with a server listening for webhook posts, though it's not tied to GitHub specifically. It has a one-click deploy to Heroku, it can watch multiple projects from one server, it has an easy to user admin interface and can publish to either S3 or to a git repository (e.g. gh-pages).
|
||||
|
||||
### Rake
|
||||
|
||||
Another way to deploy your Jekyll site is to use [Rake](https://github.com/ruby/rake), [HighLine](https://github.com/JEG2/highline), and
|
||||
[Net::SSH](https://github.com/net-ssh/net-ssh). A more complex example of deploying Jekyll with Rake that deals with multiple branches can be found in [Git Ready](https://github.com/gitready/gitready/blob/cdfbc4ec5321ff8d18c3ce936e9c749dbbc4f190/Rakefile).
|
||||
|
||||
|
||||
### scp
|
||||
|
||||
Once you’ve generated the `_site` directory, you can easily scp its content using a
|
||||
`tasks/deploy` shell script similar to [this deploy script][]. You’d obviously
|
||||
need to change the values to reflect your site’s details. There is even [a
|
||||
matching TextMate command][] that will help you run this script.
|
||||
|
||||
[this deploy script]: https://github.com/henrik/henrik.nyh.se/blob/master/script/deploy
|
||||
|
||||
[a matching TextMate command]: https://gist.github.com/henrik/214959
|
||||
|
||||
### rsync
|
||||
|
||||
Once you’ve generated the `_site` directory, you can easily rsync its content using a `tasks/deploy` shell script similar to [this deploy script here](https://github.com/vitalyrepin/vrepinblog/blob/master/transfer.sh). You’d obviously need to change the values to reflect your site’s details.
|
||||
|
||||
Certificate-based authorization is another way to simplify the publishing
|
||||
process. It makes sense to restrict rsync access only to the directory which it is supposed to sync. This can be done using rrsync.
|
||||
|
||||
#### Step 1: Install rrsync to your home folder (server-side)
|
||||
|
||||
If it is not already installed by your host, you can do it yourself:
|
||||
|
||||
- [Download rrsync](https://ftp.samba.org/pub/unpacked/rsync/support/rrsync)
|
||||
- Place it in the `bin` subdirectory of your home folder (`~/bin`)
|
||||
- Make it executable (`chmod +x`)
|
||||
|
||||
#### Step 2: Set up certificate-based SSH access (server side)
|
||||
|
||||
This [process](https://wiki.gentoo.org/wiki/SSH#Passwordless_Authentication) is
|
||||
described in several places online. What is different from the typical approach
|
||||
is to put the restriction to certificate-based authorization in
|
||||
`~/.ssh/authorized_keys`. Then, launch `rrsync` and supply
|
||||
it with the folder it shall have read-write access to:
|
||||
|
||||
```sh
|
||||
command="$HOME/bin/rrsync <folder>",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa <cert>
|
||||
```
|
||||
|
||||
`<folder>` is the path to your site. E.g., `~/public_html/you.org/blog-html/`.
|
||||
|
||||
#### Step 3: Rsync (client-side)
|
||||
|
||||
Add the `deploy` script to the site source folder:
|
||||
|
||||
```sh
|
||||
#!/bin/sh
|
||||
|
||||
rsync -crvz --rsh='ssh -p2222' --delete-after --delete-excluded <folder> <user>@<site>:
|
||||
```
|
||||
|
||||
Command line parameters are:
|
||||
|
||||
- `--rsh=ssh -p2222` — The port for SSH access. It is required if
|
||||
your host uses a different port than the default (e.g, HostGator)
|
||||
- `<folder>` — The name of the local output folder (defaults to `_site`)
|
||||
- `<user>` — The username for your hosting account
|
||||
- `<site>` — Your hosting server
|
||||
|
||||
Using this setup, you might run the following command:
|
||||
|
||||
```sh
|
||||
rsync -crvz --rsh='ssh -p2222' --delete-after --delete-excluded _site/ hostuser@example.org:
|
||||
```
|
||||
|
||||
Don't forget the column `:` after server name!
|
||||
|
||||
#### Step 4 (Optional): Exclude the transfer script from being copied to the output folder.
|
||||
|
||||
This step is recommended if you use these instructions to deploy your site. If
|
||||
you put the `deploy` script in the root folder of your project, Jekyll will
|
||||
copy it to the output folder. This behavior can be changed in `_config.yml`.
|
||||
|
||||
Just add the following line:
|
||||
|
||||
```yaml
|
||||
# Do not copy these files to the output directory
|
||||
exclude: ["deploy"]
|
||||
```
|
||||
|
||||
Alternatively, you can use an `rsync-exclude.txt` file to control which files will be transferred to your server.
|
||||
|
||||
#### Done!
|
||||
|
||||
Now it's possible to publish your website simply by running the `deploy`
|
||||
script. If your SSH certificate is [passphrase-protected](https://martin.kleppmann.com/2013/05/24/improving-security-of-ssh-private-keys.html), you will be asked to enter it when the
|
||||
script executes.
|
||||
|
||||
## Rack-Jekyll
|
||||
|
||||
[Rack-Jekyll](https://github.com/adaoraul/rack-jekyll/) is an easy way to deploy your site on any Rack server such as Amazon EC2, Slicehost, Heroku, and so forth. It also can run with [shotgun](https://github.com/rtomayko/shotgun/), [rackup](https://github.com/rack/rack), [mongrel](https://github.com/mongrel/mongrel), [unicorn](https://github.com/defunkt/unicorn/), and [others](https://github.com/adaoraul/rack-jekyll#readme).
|
||||
|
||||
Read [this post](http://andycroll.com/ruby/serving-a-jekyll-blog-using-heroku/) on how to deploy to Heroku using Rack-Jekyll.
|
||||
|
||||
## Jekyll-Admin for Rails
|
||||
|
||||
If you want to maintain Jekyll inside your existing Rails app, [Jekyll-Admin](https://github.com/zkarpinski/Jekyll-Admin) contains drop in code to make this possible. See Jekyll-Admin’s [README](https://github.com/zkarpinski/Jekyll-Admin/blob/master/README) for more details.
|
||||
|
||||
## Amazon S3
|
||||
|
||||
If you want to host your site in Amazon S3, you can do so by
|
||||
using the [s3_website](https://github.com/laurilehmijoki/s3_website)
|
||||
application. It will push your site to Amazon S3 where it can be served like
|
||||
any web server,
|
||||
dynamically scaling to almost unlimited traffic. This approach has the
|
||||
benefit of being about the cheapest hosting option available for
|
||||
low-volume blogs as you only pay for what you use.
|
||||
|
||||
## OpenShift
|
||||
|
||||
If you'd like to deploy your site to an OpenShift gear, there's [a cartridge
|
||||
for that](https://github.com/openshift-quickstart/jekyll-openshift).
|
||||
|
||||
<div class="note">
|
||||
<h5>ProTip™: Use GitHub Pages for zero-hassle Jekyll hosting</h5>
|
||||
<p>GitHub Pages are powered by Jekyll behind the scenes, so if you’re looking for a zero-hassle, zero-cost solution, GitHub Pages are a great way to <a href="../github-pages/">host your Jekyll-powered website for free</a>.</p>
|
||||
</div>
|
||||
|
||||
## Kickster
|
||||
|
||||
Use [Kickster](http://kickster.nielsenramon.com/) for easy (automated) deploys to GitHub Pages when using unsupported plugins on GitHub Pages.
|
||||
|
||||
Kickster provides a basic Jekyll project setup packed with web best practises and useful optimization tools increasing your overall project quality. Kickster ships with automated and worry-free deployment scripts for GitHub Pages.
|
||||
|
||||
Setting up Kickster is very easy, just install the gem and you are good to go. More documentation can here found [here](https://github.com/nielsenramon/kickster#kickster). If you do not want to use the gem or start a new project you can just copy paste the deployment scripts for [Travis CI](https://github.com/nielsenramon/kickster/tree/master/snippets/travis) or [Circle CI](https://github.com/nielsenramon/kickster#automated-deployment-with-circle-ci).
|
||||
|
||||
## Aerobatic
|
||||
|
||||
[Aerobatic](https://www.aerobatic.com) has custom domains, global CDN distribution, basic auth, CORS proxying, and a growing list of plugins all included.
|
||||
|
||||
Automating the deployment of a Jekyll site is simple. See our [Jekyll docs](https://www.aerobatic.com/docs/static-site-generators/#jekyll) for more details. Your built `_site` folder is deployed to our highly-available, globally distributed hosting service.
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
title: Deployment
|
||||
permalink: /docs/deployment/
|
||||
redirect_from: "/docs/deployment-methods/index.html"
|
||||
---
|
||||
|
||||
Sites built using Jekyll can be deployed in a large number of ways due to the static nature of the generated output. Here's some of the most common ways:
|
||||
|
||||
* [Manually]({{ '/docs/deployment/manual/' | relative_url }})
|
||||
* [Automated]({{ '/docs/deployment/automated/' | relative_url }})
|
||||
* [Third Party]({{ '/docs/deployment/third-party/' | relative_url }})
|
||||
@@ -1,69 +0,0 @@
|
||||
---
|
||||
title: Automated Deployment
|
||||
permalink: /docs/deployment/automated/
|
||||
---
|
||||
There are a number of ways to easily automate the deployment of a Jekyll site.
|
||||
|
||||
## Continuous Integration Service
|
||||
|
||||
One of the easiest ways to set up an automated deployment flow is by using a
|
||||
CI.
|
||||
|
||||
These services run a script when there's a commit on your Git repository.
|
||||
You might want this script to build the site, run tests over the output then deploy it to the
|
||||
service of your choice.
|
||||
|
||||
We have guides for the following providers:
|
||||
|
||||
* [GitHub Actions]({{ '/docs/continuous-integration/github-actions/' | relative_url }})
|
||||
* [Travis CI]({{ '/docs/continuous-integration/travis-ci/' | relative_url }})
|
||||
* [CircleCI]({{ '/docs/continuous-integration/circleci/' | relative_url }})
|
||||
* [Buddy]({{ '/docs/continuous-integration/buddyworks/' | relative_url }})
|
||||
|
||||
## Git post-receive hook
|
||||
|
||||
To have a remote server handle the deploy for you every time you push changes using Git, you can create a user account which has all the public keys that are authorized to deploy in its `authorized_keys` file. With that in place, setting up the post-receive hook is done as follows:
|
||||
|
||||
```sh
|
||||
laptop$ ssh deployer@example.com
|
||||
server$ mkdir myrepo.git
|
||||
server$ cd myrepo.git
|
||||
server$ git --bare init
|
||||
server$ cp hooks/post-receive.sample hooks/post-receive
|
||||
server$ mkdir /var/www/myrepo
|
||||
```
|
||||
|
||||
Next, add the following lines to hooks/post-receive and be sure Jekyll is
|
||||
installed on the server:
|
||||
|
||||
```bash
|
||||
#!/bin/bash -l
|
||||
|
||||
# Install Ruby Gems to ~/gems
|
||||
export GEM_HOME=$HOME/gems
|
||||
export PATH=$GEM_HOME/bin:$PATH
|
||||
|
||||
TMP_GIT_CLONE=$HOME/tmp/myrepo
|
||||
GEMFILE=$TMP_GIT_CLONE/Gemfile
|
||||
PUBLIC_WWW=/var/www/myrepo
|
||||
|
||||
git clone $GIT_DIR $TMP_GIT_CLONE
|
||||
BUNDLE_GEMFILE=$GEMFILE bundle install
|
||||
BUNDLE_GEMFILE=$GEMFILE bundle exec jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW
|
||||
rm -Rf $TMP_GIT_CLONE
|
||||
exit
|
||||
```
|
||||
|
||||
Finally, run the following command on any users laptop that needs to be able to
|
||||
deploy using this hook:
|
||||
|
||||
```sh
|
||||
laptops$ git remote add deploy deployer@example.com:~/myrepo.git
|
||||
```
|
||||
|
||||
Deploying is now as easy as telling nginx or Apache to look at
|
||||
`/var/www/myrepo` and running the following:
|
||||
|
||||
```sh
|
||||
laptops$ git push deploy master
|
||||
```
|
||||
@@ -1,36 +0,0 @@
|
||||
---
|
||||
title: Manual Deployment
|
||||
permalink: /docs/deployment/manual/
|
||||
---
|
||||
|
||||
Jekyll generates your static site to the `_site` directory by default. You can
|
||||
transfer the contents of this directory to almost any hosting provider to get
|
||||
your site live. Here are some manual ways of achieving this:
|
||||
|
||||
## rsync
|
||||
|
||||
Rsync is similar to scp except it can be faster as it will only send changed
|
||||
parts of files as opposed to the entire file. You can learn more about using
|
||||
rsync in the [Digital Ocean tutorial](https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps).
|
||||
|
||||
## Amazon S3
|
||||
|
||||
If you want to host your site in Amazon S3, you can do so by
|
||||
using the [s3_website](https://github.com/laurilehmijoki/s3_website)
|
||||
application. It will push your site to Amazon S3 where it can be served like
|
||||
any web server,
|
||||
dynamically scaling to almost unlimited traffic. This approach has the
|
||||
benefit of being about the cheapest hosting option available for
|
||||
low-volume blogs as you only pay for what you use.
|
||||
|
||||
## FTP
|
||||
|
||||
Most traditional web hosting provider let you upload files to their servers over FTP. To upload a Jekyll site to a web host using FTP, run the `jekyll build` command and copy the contents of the generated `_site` folder to the root folder of your hosting account. This is most likely to be the `httpdocs` or `public_html` folder on most hosting providers.
|
||||
|
||||
## scp
|
||||
|
||||
If you have direct access to the deployment web server, the process is essentially the same, except you might have other methods available to you (such as `scp`, or even direct filesystem access) for transferring the files. Remember to make sure the contents of the generated `_site` folder get placed in the appropriate web root directory for your web server.
|
||||
|
||||
## Rack-Jekyll
|
||||
|
||||
[Rack-Jekyll](https://github.com/adaoraul/rack-jekyll/) allows you to deploy your site on any Rack server such as Amazon EC2, Slicehost, Heroku, and so forth. It also can run with [shotgun](https://github.com/rtomayko/shotgun/), [rackup](https://github.com/rack/rack), [mongrel](https://github.com/mongrel/mongrel), [unicorn](https://github.com/defunkt/unicorn/), and [others](https://github.com/adaoraul/rack-jekyll#readme).
|
||||
@@ -1,72 +0,0 @@
|
||||
---
|
||||
title: 3rd Party
|
||||
permalink: /docs/deployment/third-party/
|
||||
---
|
||||
|
||||
|
||||
## Aerobatic
|
||||
|
||||
[Aerobatic](https://www.aerobatic.com) has custom domains, global CDN distribution, basic auth, CORS proxying, and a growing list of plugins all included.
|
||||
|
||||
Automating the deployment of a Jekyll site is simple. See their [Jekyll docs](https://www.aerobatic.com/docs/static-site-generators/#jekyll) for more details. Your built `_site` folder is deployed to their highly-available, globally distributed hosting service.
|
||||
|
||||
## AWS Amplify
|
||||
|
||||
The [AWS Amplify Console](https://console.amplify.aws) provides continuous deployment and hosting for modern web apps (single page apps and static site generators). Continuous deployment allows developers to deploy updates to their web app on every code commit to their Git repository. Hosting includes features such as globally available CDNs, 1-click custom domain setup + HTTPS, feature branch deployments, redirects, trailing slashes, and password protection.
|
||||
|
||||
Read this [step-by-step guide](https://medium.com/@jameshamann/deploy-your-jekyll-site-using-aws-amplify-with-only-a-few-clicks-8f3dd8f26112) to deploy and host your Jekyll site on AWS Amplify.
|
||||
|
||||
## Bip
|
||||
|
||||
[Bip](https://bip.sh) provides zero downtime deployment, a global CDN, SSL, unlimited bandwidth and more for Jekyll websites. Deploy in seconds from the command line. [Visit the Bip website](https://bip.sh) for more information - which is also built with Jekyll.
|
||||
|
||||
## CloudCannon
|
||||
|
||||
[CloudCannon](https://cloudcannon.com) has everything you need to build, host
|
||||
and update Jekyll websites. Take advantage of our global CDN, automated SSL,
|
||||
continuous deployment and [more](https://cloudcannon.com/features/).
|
||||
|
||||
## GitHub Pages
|
||||
|
||||
Sites on GitHub Pages are powered by Jekyll behind the scenes, so if you’re looking for a zero-hassle, zero-cost solution, GitHub Pages are a great way to [host your Jekyll-powered website for free](/docs/github-pages/).
|
||||
|
||||
## GitLab Pages
|
||||
|
||||
[GitLab Pages](https://about.gitlab.com/stages-devops-lifecycle/pages/) offers free hosting with custom domains. [Get started with Jekyll](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_four.html#practical-example) and a fully customizable pipeline.
|
||||
|
||||
## KeyCDN
|
||||
|
||||
[KeyCDN](https://www.keycdn.com) accelerates Jekyll-powered websites with a wide range of other features such as real time image processing including WebP transformation.
|
||||
The [Jekyll hosting tutorial](https://www.keycdn.com/support/jekyll-hosting) provides various options to supercharge Jekyll sites with just a few steps. It combines best flexibility and excellent performance.
|
||||
|
||||
## Kickster
|
||||
|
||||
Use [Kickster](http://kickster.nielsenramon.com/) for automated deploys to GitHub Pages when using unsupported plugins on GitHub Pages.
|
||||
|
||||
Kickster provides a basic Jekyll project setup packed with web best practises and useful optimization tools increasing your overall project quality. Kickster ships with automated and worry-free deployment scripts for GitHub Pages.
|
||||
|
||||
Install the Kickster gem and you are good to go. More documentation can here found [here](https://github.com/nielsenramon/kickster#kickster). If you do not want to use the gem or start a new project you can just copy paste the deployment scripts for [Travis CI](https://github.com/nielsenramon/kickster/tree/master/snippets/travis) or [Circle CI](https://github.com/nielsenramon/kickster#automated-deployment-with-circle-ci).
|
||||
|
||||
## Netlify
|
||||
|
||||
Netlify provides Global CDN, Continuous Deployment, one click HTTPS and [much more](https://www.netlify.com/features/), providing developers a robust toolset for modern web projects, without added complexity. Netlify supports custom plugins for Jekyll and has a free plan for open source projects.
|
||||
|
||||
Read this [Jekyll step-by-step guide](https://www.netlify.com/blog/2020/04/02/a-step-by-step-guide-jekyll-4.0-on-netlify/) to setup your Jekyll site on Netlify.
|
||||
|
||||
## Render
|
||||
|
||||
[Render](https://render.com) provides zero config continuous deployment for static sites. The service is free under 100GB monthly bandwith.
|
||||
|
||||
## Static Publisher
|
||||
|
||||
[Static Publisher](https://github.com/static-publisher/static-publisher) is another automated deployment option with a server listening for webhook posts, though it's not tied to GitHub specifically. It has a one-click deploy to Heroku, it can watch multiple projects from one server, it has an easy to user admin interface and can publish to either S3 or to a git repository (e.g. gh-pages).
|
||||
|
||||
## Vercel
|
||||
|
||||
[Vercel](https://vercel.com/) provides zero config continuous deployment, HTTPS Custom domains, high performance smart CDN, you get instant static deploy for free.
|
||||
|
||||
## 21YunBox
|
||||
|
||||
[21YunBox](https://www.21yunbox.com) provides blazing fast Chinese CDN, Continuous Deployment, one click HTTPS and [much more](https://www.21yunbox.com/docs/), providing developers a hassle-free solution to launch their web projects in China.
|
||||
|
||||
Read this [Jekyll step-by-step guide](https://www.21yunbox.com/docs/#/deploy-jekyll) to deploy your Jekyll site on 21YunBox.
|
||||
19
docs/_docs/drafts.md
Normal file
19
docs/_docs/drafts.md
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: Working with drafts
|
||||
permalink: /docs/drafts/
|
||||
---
|
||||
|
||||
Drafts are posts without a date. They're posts you're still working on and
|
||||
don't want to publish yet. To get up and running with drafts, create a
|
||||
`_drafts` folder in your site's root (as described in the [site structure](/docs/structure/) section) and create your
|
||||
first draft:
|
||||
|
||||
```text
|
||||
|-- _drafts/
|
||||
| |-- a-draft-post.md
|
||||
```
|
||||
|
||||
To preview your site with drafts, simply run `jekyll serve` or `jekyll build`
|
||||
with the `--drafts` switch. Each will be assigned the value modification time
|
||||
of the draft file for its date, and thus you will see currently edited drafts
|
||||
as the latest posts.
|
||||
31
docs/_docs/extras.md
Normal file
31
docs/_docs/extras.md
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
title: Extras
|
||||
permalink: /docs/extras/
|
||||
---
|
||||
|
||||
There are a number of (optional) extra features that Jekyll supports that you
|
||||
may want to install, depending on how you plan to use Jekyll.
|
||||
|
||||
## Web Highlights and Commenting
|
||||
|
||||
Register your site with [txtpen](https://txtpen.com). Then append
|
||||
|
||||
```html
|
||||
<script src="https://txtpen.com/embed.js?site=<your site name>"></script>
|
||||
```
|
||||
|
||||
to your template files in `/_layout` folder.
|
||||
|
||||
## Math Support
|
||||
|
||||
Kramdown comes with optional support for LaTeX to PNG rendering via [MathJax](https://www.mathjax.org) within math blocks. See the Kramdown documentation on [math blocks](http://kramdown.gettalong.org/syntax.html#math-blocks) and [math support](http://kramdown.gettalong.org/converter/html.html#math-support) for more details. MathJax requires you to include JavaScript or CSS to render the LaTeX, e.g.
|
||||
|
||||
```html
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
|
||||
```
|
||||
|
||||
For more information about getting started, check out [this excellent blog post](http://gastonsanchez.com/visually-enforced/opinion/2014/02/16/Mathjax-with-jekyll/).
|
||||
|
||||
## Alternative Markdown Processors
|
||||
|
||||
See the Markdown section on the [configuration page](/docs/configuration/#markdown-options) for instructions on how to use and configure alternative Markdown processors, as well as how to create [custom processors](/docs/configuration/#custom-markdown-processors).
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: Front Matter
|
||||
permalink: /docs/front-matter/
|
||||
redirect_from: /docs/frontmatter/index.html
|
||||
permalink: /docs/frontmatter/
|
||||
---
|
||||
|
||||
Any file that contains a [YAML](https://yaml.org/) front matter block will be
|
||||
processed by Jekyll as a special file. The front matter must be the first thing
|
||||
in the file and must take the form of valid YAML set between triple-dashed
|
||||
lines. Here is a basic example:
|
||||
The front matter is where Jekyll starts to get really cool. Any file that
|
||||
contains a [YAML](http://yaml.org/) front matter block will be processed by
|
||||
Jekyll as a special file. The front matter must be the first thing in the file
|
||||
and must take the form of valid YAML set between triple-dashed lines. Here is a
|
||||
basic example:
|
||||
|
||||
```yaml
|
||||
---
|
||||
@@ -18,7 +18,7 @@ title: Blogging Like a Hacker
|
||||
|
||||
Between these triple-dashed lines, you can set predefined variables (see below
|
||||
for a reference) or even create custom ones of your own. These variables will
|
||||
then be available for you to access using Liquid tags both further down in the
|
||||
then be available to you to access using Liquid tags both further down in the
|
||||
file and also in any layouts or includes that the page or post in question
|
||||
relies on.
|
||||
|
||||
@@ -28,14 +28,14 @@ relies on.
|
||||
If you use UTF-8 encoding, make sure that no <code>BOM</code> header
|
||||
characters exist in your files or very, very bad things will happen to
|
||||
Jekyll. This is especially relevant if you’re running
|
||||
<a href="{{ '/docs/installation/windows/' | relative_url }}">Jekyll on Windows</a>.
|
||||
<a href="../windows/">Jekyll on Windows</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="note">
|
||||
<h5>Front Matter Variables Are Optional</h5>
|
||||
<h5>ProTip™: Front Matter Variables Are Optional</h5>
|
||||
<p>
|
||||
If you want to use <a href="{{ '/docs/variables/' | relative_url }}">Liquid tags and variables</a>
|
||||
If you want to use <a href="../variables/">Liquid tags and variables</a>
|
||||
but don’t need anything in your front matter, just leave it empty! The set
|
||||
of triple-dashed lines with nothing in between will still get Jekyll to
|
||||
process your file. (This is useful for things like CSS and RSS feeds!)
|
||||
@@ -68,20 +68,6 @@ front matter of a page or post.
|
||||
<code>_layouts</code> directory.
|
||||
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
Using <code>null</code> will produce a file without using a layout
|
||||
file. This is overridden if the file is a post/document and has a
|
||||
layout defined in the <a href="{{ '/docs/configuration/front-matter-defaults/' | relative_url }}">
|
||||
front matter defaults</a>.
|
||||
</li>
|
||||
<li>
|
||||
Starting from version 3.5.0, using <code>none</code> in a post/document will
|
||||
produce a file without using a layout file regardless of front matter defaults.
|
||||
Using <code>none</code> in a page will cause Jekyll to attempt to
|
||||
use a layout named "none".
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -114,28 +100,30 @@ front matter of a page or post.
|
||||
</div>
|
||||
|
||||
<div class="note">
|
||||
<h5>Render Posts Marked As Unpublished</h5>
|
||||
<h5>ProTip™: Render Posts Marked As Unpublished</h5>
|
||||
<p>
|
||||
To preview unpublished pages, run `jekyll serve` or `jekyll build`
|
||||
with the `--unpublished` switch. Jekyll also has a handy <a href="{{ '/docs/posts/#drafts' | relative_url }}">drafts</a>
|
||||
To preview unpublished pages, simply run `jekyll serve` or `jekyll build`
|
||||
with the `--unpublished` switch. Jekyll also has a handy <a href="../drafts/">drafts</a>
|
||||
feature tailored specifically for blog posts.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Custom Variables
|
||||
|
||||
You can also set your own front matter variables you can access in Liquid. For
|
||||
instance, if you set a variable called `food`, you can use that in your page:
|
||||
Any variables in the front matter that are not predefined are mixed into the
|
||||
data that is sent to the Liquid templating engine during the conversion. For
|
||||
instance, if you set a title, you can use that in your layout to set the page
|
||||
title:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
---
|
||||
food: Pizza
|
||||
---
|
||||
|
||||
<h1>{{ page.food }}</h1>
|
||||
```html
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>{% raw %}{{ page.title }}{% endraw %}</title>
|
||||
</head>
|
||||
<body>
|
||||
...
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Predefined Variables for Posts
|
||||
|
||||
@@ -165,7 +153,7 @@ These are available out-of-the-box to be used in the front matter for a post.
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p><code>category</code></p>
|
||||
<p style="margin-bottom: 5px;"><code>category</code></p>
|
||||
<p><code>categories</code></p>
|
||||
</td>
|
||||
<td>
|
||||
@@ -201,11 +189,10 @@ These are available out-of-the-box to be used in the front matter for a post.
|
||||
</div>
|
||||
|
||||
<div class="note">
|
||||
<h5>Don't repeat yourself</h5>
|
||||
<h5>ProTip™: Don't repeat yourself</h5>
|
||||
<p>
|
||||
If you don't want to repeat your frequently used front matter variables
|
||||
over and over, define
|
||||
<a href="{{ '/docs/configuration/front-matter-defaults/' | relative_url }}" title="Front Matter defaults">defaults</a>
|
||||
over and over, just define <a href="../configuration/#front-matter-defaults" title="Front Matter defaults">defaults</a>
|
||||
for them and only override them where necessary (or not at all). This works
|
||||
both for predefined and custom variables.
|
||||
</p>
|
||||
@@ -4,82 +4,103 @@ permalink: /docs/github-pages/
|
||||
---
|
||||
|
||||
[GitHub Pages](https://pages.github.com) are public web pages for users,
|
||||
organizations, and repositories, that are freely hosted on GitHub's `github.io`
|
||||
domain or on a custom domain name of your choice. GitHub Pages are powered by
|
||||
Jekyll behind the scenes, so they're a great way to host your Jekyll-powered
|
||||
website for free.
|
||||
|
||||
Your site is automatically generated by GitHub Pages when you push your source
|
||||
files. Note that GitHub Pages works equally well for regular HTML content,
|
||||
simply because Jekyll treats files without front matter as static assets.
|
||||
So if you only need to push generated HTML, you're good to go without any
|
||||
further setup.
|
||||
organizations, and repositories, that are freely hosted on GitHub's
|
||||
`github.io` domain or on a custom domain name of your choice. GitHub Pages are
|
||||
powered by Jekyll behind the scenes, so in addition to supporting regular HTML
|
||||
content, they’re also a great way to host your Jekyll-powered website for free.
|
||||
|
||||
Never built a website with GitHub Pages before? [See this marvelous guide by
|
||||
Jonathan McGlone](http://jmcglone.com/guides/github-pages/) to get you up and
|
||||
running. This guide will teach you what you need to know about Git, GitHub, and
|
||||
Jekyll to create your very own website on GitHub Pages.
|
||||
|
||||
## The github-pages gem
|
||||
|
||||
Our friends at GitHub have provided the
|
||||
[github-pages](https://github.com/github/pages-gem) gem which is used to manage
|
||||
[Jekyll and its dependencies on GitHub Pages](https://pages.github.com/versions/).
|
||||
Using it in your projects means that when you deploy your site to GitHub Pages,
|
||||
you will not be caught by unexpected differences between various versions of the
|
||||
gems.
|
||||
|
||||
Note that GitHub Pages runs in `safe` mode and only allows [a set of whitelisted
|
||||
plugins](https://help.github.com/articles/configuring-jekyll-plugins/#default-plugins).
|
||||
|
||||
To use the currently-deployed version of the gem in your project, add the
|
||||
following to your `Gemfile`:
|
||||
|
||||
```ruby
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "github-pages", group: :jekyll_plugins
|
||||
```
|
||||
|
||||
Be sure to run `bundle update` often.
|
||||
|
||||
<div class="note">
|
||||
<h5>GitHub Pages Documentation, Help, and Support</h5>
|
||||
<p>
|
||||
For more information about what you can do with GitHub Pages, as well as for
|
||||
troubleshooting guides, you should check out
|
||||
<a href="https://help.github.com/categories/github-pages-basics/">GitHub’s Pages Help section</a>.
|
||||
If all else fails, you should contact <a href="https://github.com/contact">GitHub Support</a>.
|
||||
</p>
|
||||
</div>
|
||||
Jonathan McGlone to get you up and running](http://jmcglone.com/guides/github-pages/).
|
||||
This guide will teach you what you need to know about Git, GitHub, and Jekyll to create your very own website on GitHub Pages.
|
||||
|
||||
### Project Page URL Structure
|
||||
|
||||
Sometimes it's nice to preview your Jekyll site before you push your `gh-pages`
|
||||
branch to GitHub. The subdirectory-like URL structure GitHub uses for
|
||||
Project Pages complicates the proper resolution of URLs. In order to assure your
|
||||
site builds properly, use the handy [URL filters]({{ '/docs/liquid/filters/' | relative_url }}):
|
||||
branch to GitHub. However, the subdirectory-like URL structure GitHub uses for
|
||||
Project Pages complicates the proper resolution of URLs. In order to assure your site builds properly, use `site.github.url` in your URLs.
|
||||
|
||||
```html
|
||||
{% raw %}
|
||||
```liquid
|
||||
<!-- For styles with static names... -->
|
||||
<link href="{{ 'assets/css/style.css' | relative_url }}" rel="stylesheet">
|
||||
<!-- For documents/pages whose URLs can change... -->
|
||||
[{{ page.title }}]("{{ page.url | relative_url }}")
|
||||
```
|
||||
<!-- Useful for styles with static names... -->
|
||||
<link href="{{ site.github.url }}/path/to/css.css" rel="stylesheet">
|
||||
<!-- and for documents/pages whose URLs can change... -->
|
||||
[{{ page.title }}]("{{ page.url | prepend: site.github.url }}")
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
This way you can preview your site locally from the site root on localhost,
|
||||
but when GitHub generates your pages from the `gh-pages` branch all the URLs
|
||||
but when GitHub generates your pages from the gh-pages branch all the URLs
|
||||
will resolve properly.
|
||||
|
||||
## Deploying Jekyll to GitHub Pages
|
||||
|
||||
GitHub Pages work by looking at certain branches of repositories on GitHub.
|
||||
There are two basic types available: [user/organization and project pages](https://help.github.com/articles/user-organization-and-project-pages/).
|
||||
There are two basic types available: user/organization pages and project pages.
|
||||
The way to deploy these two types of sites are nearly identical, except for a
|
||||
few minor details.
|
||||
|
||||
<div class="note protip" markdown="1">
|
||||
<div markdown="1">
|
||||
</div>
|
||||
|
||||
##### Use the `github-pages` gem
|
||||
|
||||
Our friends at GitHub have provided the
|
||||
[github-pages](https://github.com/github/pages-gem)
|
||||
gem which is used to manage Jekyll and its dependencies on
|
||||
GitHub Pages. Using it in your projects means that when you deploy
|
||||
your site to GitHub Pages, you will not be caught by unexpected
|
||||
differences between various versions of the gems. To use the
|
||||
currently-deployed version of the gem in your project, add the
|
||||
following to your `Gemfile`:
|
||||
|
||||
<div class="code-block" markdown="1">
|
||||
<div markdown="1">
|
||||
</div>
|
||||
|
||||
```ruby
|
||||
source 'https://rubygems.org'
|
||||
|
||||
require 'json'
|
||||
require 'open-uri'
|
||||
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
|
||||
|
||||
gem 'github-pages', versions['github-pages']
|
||||
```
|
||||
</div>
|
||||
|
||||
This will ensure that when you run `bundle install`, you
|
||||
have the correct version of the `github-pages` gem.
|
||||
|
||||
If that fails, simplify it:
|
||||
|
||||
<div class="code-block" markdown="1">
|
||||
<div markdown="1">
|
||||
</div>
|
||||
|
||||
```ruby
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'github-pages'
|
||||
```
|
||||
</div>
|
||||
|
||||
And be sure to run `bundle update` often.
|
||||
|
||||
If you like to install `pages-gem` on Windows you can find instructions by Jens Willmer on
|
||||
[how to install github-pages gem on Windows (x64)](https://jwillmer.de/blog/tutorial/how-to-install-jekyll-and-pages-gem-on-windows-10-x46#github-pages-and-plugins).
|
||||
</div>
|
||||
|
||||
<div class="note info">
|
||||
<h5>Installing <code>github-pages</code> gem on Windows</h5>
|
||||
<p>
|
||||
While Windows is not officially supported, it is possible
|
||||
to install <code>github-pages</code> gem on Windows.
|
||||
Special instructions can be found on our
|
||||
<a href="../windows/#installation">Windows-specific docs page</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
### User and Organization Pages
|
||||
|
||||
User and organization pages live in a special GitHub repository dedicated to
|
||||
@@ -119,22 +140,21 @@ Please refer to GitHub official documentation on
|
||||
to see more detailed examples.
|
||||
|
||||
<div class="note warning">
|
||||
<h5>Source files must be in the root directory</h5>
|
||||
<h5>Source Files Must be in the Root Directory</h5>
|
||||
<p>
|
||||
GitHub Pages <a href="https://help.github.com/en/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites">overrides</a>
|
||||
the <a href="{{ '/docs/configuration/options/' | relative_url }}">“Site Source”</a>
|
||||
GitHub Pages <a href="https://help.github.com/articles/troubleshooting-github-pages-build-failures#source-setting">overrides</a>
|
||||
the <a href="/docs/configuration/#global-configuration">“Site Source”</a>
|
||||
configuration value, so if you locate your files anywhere other than the
|
||||
root directory, your site may not build correctly.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="note info">
|
||||
<h5>Installing the <code>github-pages</code> gem on Windows</h5>
|
||||
|
||||
<div class="note">
|
||||
<h5>GitHub Pages Documentation, Help, and Support</h5>
|
||||
<p>
|
||||
While Windows is not officially supported, it is possible
|
||||
to install the <code>github-pages</code> gem on Windows.
|
||||
Special instructions can be found on our
|
||||
<a href="{{ '/docs/installation/windows/' | relative_url }}">Windows-specific docs page</a>.
|
||||
For more information about what you can do with GitHub Pages, as well as for
|
||||
troubleshooting guides, you should check out
|
||||
<a href="https://help.github.com/categories/github-pages-basics/">GitHub’s Pages Help section</a>.
|
||||
If all else fails, you should contact <a href="https://github.com/contact">GitHub Support</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,9 @@ permalink: /docs/includes/
|
||||
|
||||
The `include` tag allows you to include the content from another file stored in the `_includes` folder:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% include footer.html %}
|
||||
{% raw %}{% include footer.html %}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Jekyll will look for the referenced file (in this case, `footer.html`) in the `_includes` directory at the root of your source directory and insert its contents.
|
||||
|
||||
@@ -17,11 +15,9 @@ Jekyll will look for the referenced file (in this case, `footer.html`) in the `_
|
||||
|
||||
You can choose to include file fragments relative to the current file by using the `include_relative` tag:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% include_relative somedir/footer.html %}
|
||||
{% raw %}{% include_relative somedir/footer.html %}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
You won't need to place your included content within the `_includes` directory. Instead,
|
||||
the inclusion is specifically relative to the file where the tag is being used. For example,
|
||||
@@ -46,13 +42,9 @@ my_variable: footer_company_a.html
|
||||
|
||||
You could then reference that variable in your include:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% if page.my_variable %}
|
||||
{% include {{ page.my_variable }} %}
|
||||
{% endif %}
|
||||
{% raw %}{% include {{ page.my_variable }} %}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory.
|
||||
|
||||
@@ -60,22 +52,18 @@ In this example, the include would insert the file `footer_company_a.html` from
|
||||
|
||||
You can also pass parameters to an include. For example, suppose you have a file called `note.html` in your `_includes` folder that contains this formatting:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
<div markdown="span" class="alert alert-info" role="alert">
|
||||
{% raw %}<div markdown="span" class="alert alert-info" role="alert">
|
||||
<i class="fa fa-info-circle"></i> <b>Note:</b>
|
||||
{{ include.content }}
|
||||
</div>
|
||||
</div>{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The {% raw %}`{{ include.content }}`{% endraw %} is a parameter that gets populated when you call the include and specify a value for that parameter, like this:
|
||||
The `{% raw %}{{ include.content }}{% endraw %}` is a parameter that gets populated when you call the include and specify a value for that parameter, like this:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% include note.html content="This is my sample note." %}
|
||||
{% raw %}{% include note.html content="This is my sample note." %} {% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{ include.content }}`{% endraw %} parameter.
|
||||
|
||||
@@ -88,24 +76,20 @@ For example, suppose you have a special image syntax with complex formatting, an
|
||||
<a href="http://jekyllrb.com">
|
||||
<img src="logo.png" style="max-width: 200px;"
|
||||
alt="Jekyll logo" />
|
||||
</a>
|
||||
<figcaption>This is the Jekyll logo</figcaption>
|
||||
</figure>
|
||||
```
|
||||
|
||||
You could templatize this content in your include and make each value available as a parameter, like this:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
<figure>
|
||||
{% raw %}<figure>
|
||||
<a href="{{ include.url }}">
|
||||
<img src="{{ include.file }}" style="max-width: {{ include.max-width }};"
|
||||
alt="{{ include.alt }}"/>
|
||||
</a>
|
||||
<figcaption>{{ include.caption }}</figcaption>
|
||||
</figure>
|
||||
</figure>{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
This include contains 5 parameters:
|
||||
|
||||
@@ -117,19 +101,17 @@ This include contains 5 parameters:
|
||||
|
||||
Here's an example that passes all the parameters to this include (the include file is named `image.html`):
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% include image.html url="http://jekyllrb.com"
|
||||
{% raw %}{% include image.html url="http://jekyllrb.com"
|
||||
max-width="200px" file="logo.png" alt="Jekyll logo"
|
||||
caption="This is the Jekyll logo." %}
|
||||
caption="This is the Jekyll logo." %} {% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The result is the original HTML code shown earlier.
|
||||
|
||||
To safeguard situations where users don't supply a value for the parameter, you can use [Liquid's default filter](https://shopify.github.io/liquid/filters/default/).
|
||||
To safeguard situations where users don't supply a value for the parameter, you can use [Liquid's default filter](https://help.shopify.com/themes/liquid/filters/additional-filters#default).
|
||||
|
||||
Overall, you can create includes that act as templates for a variety of uses — inserting audio or video clips, alerts, special formatting, and more. Note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.)
|
||||
Overall, you can create includes that act as templates for a variety of uses — inserting audio or video clips, alerts, special formatting, and more. However, note that you should avoid using too many includes, as this will slow down the build time of your site. For example, don't use includes every time you insert an image. (The above technique shows a use case for special images.)
|
||||
|
||||
### Passing parameter variables to includes
|
||||
|
||||
@@ -139,18 +121,47 @@ The string you pass to your include parameter can't contain curly braces. For ex
|
||||
|
||||
If you want to include this variable in your parameter that you pass to an include, you need to store the entire parameter as a variable before passing it to the include. You can use `capture` tags to create the variable:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% capture download_note %}
|
||||
The latest version of {{ site.product_name }} is now available.
|
||||
{% endcapture %}
|
||||
{% raw %}{% capture download_note %}The latest version of
|
||||
{{ site.product_name }} is now available.{% endcapture %}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Then pass this captured variable into the parameter for the include. Omit the quotation marks around the parameter content because it's no longer a string (it's a variable):
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% include note.html content=download_note %}
|
||||
{% raw %}{% include note.html content=download_note %}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Passing references to YAML files as parameter values
|
||||
|
||||
Instead of passing string variables to the include, you can pass a reference to a YAML data file stored in the `_data` folder.
|
||||
|
||||
Here's an example. In the `_data` folder, suppose you have a YAML file called `profiles.yml`. Its content looks like this:
|
||||
|
||||
```yaml
|
||||
- name: John Doe
|
||||
login_age: old
|
||||
image: johndoe.jpg
|
||||
|
||||
- name: Jane Doe
|
||||
login_age: new
|
||||
image: janedoe.jpg
|
||||
```
|
||||
|
||||
In the `_includes` folder, assume you have a file called `spotlight.html` with this code:
|
||||
|
||||
```liquid
|
||||
{% raw %}{% for person in include.participants %}
|
||||
{% if person.login_age == "new" %}
|
||||
{{ person.name }}
|
||||
{% endif %}
|
||||
{% endfor %}{% endraw %}
|
||||
```
|
||||
|
||||
Now when you insert the `spotlight.html` include file, you can submit the YAML file as a parameter:
|
||||
|
||||
```
|
||||
{% raw %}{% include spotlight.html participants=site.data.profiles %}{% endraw %}
|
||||
```
|
||||
|
||||
In this instance, `site.data.profiles` gets inserted in place of {% raw %}`include.participants`{% endraw %} in the include file, and the Liquid logic processes. The result will be `Jane Doe`.
|
||||
|
||||
@@ -1,52 +1,56 @@
|
||||
---
|
||||
title: Quickstart
|
||||
permalink: /docs/
|
||||
redirect_from:
|
||||
- /docs/home/
|
||||
- /docs/quickstart/
|
||||
- /docs/extras/
|
||||
title: Welcome
|
||||
permalink: /docs/home/
|
||||
redirect_from: /docs/index.html
|
||||
---
|
||||
Jekyll is a static site generator. It takes text written in your
|
||||
favorite markup language and uses layouts to create a static website. You can
|
||||
tweak the site's look and feel, URLs, the data displayed on the page, and more.
|
||||
|
||||
## Prerequisites
|
||||
This site aims to be a comprehensive guide to Jekyll. We’ll cover topics such
|
||||
as getting your site up and running, creating and managing your content,
|
||||
customizing the way your site works and looks, deploying to various
|
||||
environments, and give you some advice on participating in the future
|
||||
development of Jekyll itself.
|
||||
|
||||
Jekyll requires the following:
|
||||
## So what is Jekyll, exactly?
|
||||
|
||||
* Ruby version **{{ site.data.ruby.min_version }}** or higher
|
||||
* RubyGems
|
||||
* GCC and Make
|
||||
Jekyll is a simple, blog-aware, static site generator. It takes a template
|
||||
directory containing raw text files in various formats, runs it through
|
||||
a converter (like [Markdown](https://daringfireball.net/projects/markdown/))
|
||||
and our [Liquid](https://github.com/Shopify/liquid/wiki) renderer, and
|
||||
spits out a complete, ready-to-publish static website suitable
|
||||
for serving with your favorite web server. Jekyll also happens to be the engine
|
||||
behind [GitHub Pages](https://pages.github.com), which means you can use Jekyll
|
||||
to host your project’s page, blog, or website from GitHub’s servers **for
|
||||
free**.
|
||||
|
||||
See [Requirements]({{ '/docs/installation/#requirements' | relative_url }}) for guides and details.
|
||||
## Helpful Hints
|
||||
|
||||
## Instructions
|
||||
Throughout this guide there are a number of small-but-handy pieces of
|
||||
information that can make using Jekyll easier, more interesting, and less
|
||||
hazardous. Here’s what to look out for.
|
||||
|
||||
1. Install all [prerequisites]({{ '/docs/installation/' | relative_url }}).
|
||||
2. Install the jekyll and bundler [gems]({{ '/docs/ruby-101/#gems' | relative_url }}).
|
||||
```
|
||||
gem install jekyll bundler
|
||||
```
|
||||
3. Create a new Jekyll site at `./myblog`.
|
||||
```
|
||||
jekyll new myblog
|
||||
```
|
||||
4. Change into your new directory.
|
||||
```
|
||||
cd myblog
|
||||
```
|
||||
5. Build the site and make it available on a local server.
|
||||
```
|
||||
bundle exec jekyll serve
|
||||
```
|
||||
6. Browse to [http://localhost:4000](http://localhost:4000){:target="_blank"}
|
||||
<div class="note">
|
||||
<h5>ProTips™ help you get more from Jekyll</h5>
|
||||
<p>These are tips and tricks that will help you be a Jekyll wizard!</p>
|
||||
</div>
|
||||
|
||||
{: .note .info}
|
||||
Pass the `--livereload` option to `serve` to automatically refresh the page with each change you make to the source files: `bundle exec jekyll serve --livereload`
|
||||
<div class="note info">
|
||||
<h5>Notes are handy pieces of information</h5>
|
||||
<p>These are for the extra tidbits sometimes necessary to understand
|
||||
Jekyll.</p>
|
||||
</div>
|
||||
|
||||
<div class="note warning">
|
||||
<h5>Warnings help you not blow things up</h5>
|
||||
<p>Be aware of these messages if you wish to avoid certain death.</p>
|
||||
</div>
|
||||
|
||||
If you encounter any errors during this process, check that you have installed all the prerequisites in [Requirements]({{ '/docs/installation/#requirements' | relative_url }}).
|
||||
If you still have issues, see [Troubleshooting]({{ '/docs/troubleshooting/#configuration-problems' | relative_url }}).
|
||||
<div class="note unreleased">
|
||||
<h5>You'll see this by a feature that hasn't been released</h5>
|
||||
<p>Some pieces of this website are for future versions of Jekyll that
|
||||
are not yet released.</p>
|
||||
</div>
|
||||
|
||||
{: .note .info}
|
||||
Installation varies based on your operating system. See our [guides]({{ '/docs/installation/#guides' | relative_url }}) for OS-specific instructions.
|
||||
If you come across anything along the way that we haven’t covered, or if you
|
||||
know of a tip you think others would find handy, please [file an
|
||||
issue]({{ site.repository }}/issues/new) and we’ll see about
|
||||
including it in this guide.
|
||||
|
||||
@@ -1,22 +1,135 @@
|
||||
---
|
||||
title: Installation
|
||||
description: Official guide to install Jekyll on macOS, GNU/Linux or Windows.
|
||||
permalink: /docs/installation/
|
||||
---
|
||||
|
||||
Jekyll is a [Ruby Gem]({{ '/docs/ruby-101/#gems' | relative_url }}) that can be installed on most systems.
|
||||
Getting Jekyll installed and ready-to-go should only take a few minutes.
|
||||
If it ever becomes a pain, please [file an issue]({{ site.repository }}/issues/new)
|
||||
(or submit a pull request) describing the issue you
|
||||
encountered and how we might make the process easier.
|
||||
|
||||
## Requirements
|
||||
### Requirements
|
||||
|
||||
* [Ruby](https://www.ruby-lang.org/en/downloads/) version **{{ site.data.ruby.min_version }}** or higher, including all development headers (check your Ruby version using `ruby -v`)
|
||||
* [RubyGems](https://rubygems.org/pages/download) (check your Gems version using `gem -v`)
|
||||
* [GCC](https://gcc.gnu.org/install/) and [Make](https://www.gnu.org/software/make/) (check versions using `gcc -v`,`g++ -v`, and `make -v`)
|
||||
Installing Jekyll should be straight-forward if all requirements are met.
|
||||
Before you start, make sure your system has the following:
|
||||
|
||||
## Guides
|
||||
- GNU/Linux, Unix, or macOS
|
||||
- [Ruby](https://www.ruby-lang.org/en/downloads/) version 2.1 or above, including all development
|
||||
headers
|
||||
- [RubyGems](https://rubygems.org/pages/download)
|
||||
- [GCC](https://gcc.gnu.org/install/) and [Make](https://www.gnu.org/software/make/) (in case your system doesn't have them installed, which you can check by running `gcc -v` and `make -v` in your system's command line interface)
|
||||
|
||||
For detailed install instructions, follow the guide for your operating system.
|
||||
#### Only required for Jekyll 2 and earlier
|
||||
|
||||
* [macOS]({{ '/docs/installation/macos/' | relative_url }})
|
||||
* [Ubuntu]({{ '/docs/installation/ubuntu/' | relative_url }})
|
||||
* [Other Linux]({{ '/docs/installation/other-linux/' | relative_url }})
|
||||
* [Windows]({{ '/docs/installation/windows/' | relative_url }})
|
||||
- [NodeJS](https://nodejs.org/), or another JavaScript runtime (for CoffeeScript support).
|
||||
- [Python 2.7](https://www.python.org/downloads/)
|
||||
|
||||
<div class="note info">
|
||||
<h5>Problems installing Jekyll?</h5>
|
||||
<p>
|
||||
Check out the <a href="../troubleshooting/">troubleshooting</a> page or
|
||||
<a href="{{ site.repository }}/issues/new">report an issue</a> so the
|
||||
Jekyll community can improve the experience for everyone.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="note info">
|
||||
<h5>Running Jekyll on Windows</h5>
|
||||
<p>
|
||||
While Windows is not officially supported, it is possible to get Jekyll running
|
||||
on Windows. Special instructions can be found on our
|
||||
<a href="../windows/#installation">Windows-specific docs page</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Install with RubyGems
|
||||
|
||||
The best way to install Jekyll is via
|
||||
[RubyGems](https://rubygems.org/pages/download). At the terminal prompt,
|
||||
simply run the following command to install Jekyll:
|
||||
|
||||
```sh
|
||||
$ gem install jekyll
|
||||
```
|
||||
|
||||
All of Jekyll’s gem dependencies are automatically installed by the above
|
||||
command, so you won’t have to worry about them at all.
|
||||
|
||||
<div class="note info">
|
||||
<h5>Installing Xcode Command-Line Tools</h5>
|
||||
<p>
|
||||
If you run into issues installing Jekyll's dependencies which make use of
|
||||
native extensions and are using macOS, you will need to install Xcode
|
||||
and the Command-Line Tools it ships with. Download them in
|
||||
<code>Preferences → Downloads → Components</code>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Pre-releases
|
||||
|
||||
In order to install a pre-release, make sure you have all the requirements
|
||||
installed properly and run:
|
||||
|
||||
```sh
|
||||
gem install jekyll --pre
|
||||
```
|
||||
|
||||
This will install the latest pre-release. If you want a particular pre-release,
|
||||
use the `-v` switch to indicate the version you'd like to install:
|
||||
|
||||
```sh
|
||||
gem install jekyll -v '2.0.0.alpha.1'
|
||||
```
|
||||
|
||||
If you'd like to install a development version of Jekyll, the process is a bit
|
||||
more involved. This gives you the advantage of having the latest and greatest,
|
||||
but may be unstable.
|
||||
|
||||
```sh
|
||||
$ git clone git://github.com/jekyll/jekyll.git
|
||||
$ cd jekyll
|
||||
$ script/bootstrap
|
||||
$ bundle exec rake build
|
||||
$ ls pkg/*.gem | head -n 1 | xargs gem install -l
|
||||
```
|
||||
|
||||
## Optional Extras
|
||||
|
||||
There are a number of (optional) extra features that Jekyll supports that you
|
||||
may want to install, depending on how you plan to use Jekyll. These extras
|
||||
include LaTeX support, and the use of alternative content rendering engines.
|
||||
Check out [the extras page](../extras/) for more information.
|
||||
|
||||
<div class="note">
|
||||
<h5>ProTip™: Enable Syntax Highlighting</h5>
|
||||
<p>
|
||||
If you’re the kind of person who is using Jekyll, then chances are you’ll
|
||||
want to enable syntax highlighting using <a href="http://pygments.org/">Pygments</a>
|
||||
or <a href="https://github.com/jayferd/rouge">Rouge</a>. You should really
|
||||
<a href="../templates/#code-snippet-highlighting">check out how to
|
||||
do that</a> before you go any farther.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Already Have Jekyll?
|
||||
|
||||
Before you start developing with Jekyll, you may want to check that you're up to date with the latest version. To find your version of Jekyll, run one of these commands:
|
||||
|
||||
```sh
|
||||
$ jekyll --version
|
||||
$ gem list jekyll
|
||||
```
|
||||
|
||||
You can also use [RubyGems](https://rubygems.org/gems/jekyll) to find the current versioning of any gem. But you can also use the `gem` command line tool:
|
||||
|
||||
```sh
|
||||
$ gem search jekyll --remote
|
||||
```
|
||||
|
||||
and you'll search for just the name `jekyll`, and in brackets will be latest version. Another way to check if you have the latest version is to run the command `gem outdated`. This will provide a list of all the gems on your system that need to be updated. If you aren't running the latest version, run this command:
|
||||
|
||||
```sh
|
||||
$ gem update jekyll
|
||||
```
|
||||
|
||||
Now that you’ve got everything up-to-date and installed, let’s get to work!
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
---
|
||||
title: Jekyll on macOS
|
||||
permalink: /docs/installation/macos/
|
||||
---
|
||||
|
||||
## Install Command Line Tools
|
||||
To install the command line tools to compile native extensions, open a terminal and run:
|
||||
|
||||
```sh
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
## Install Ruby
|
||||
|
||||
Jekyll requires **Ruby v{{ site.data.ruby.min_version }}** or higher.
|
||||
macOS Catalina 10.15 ships with Ruby 2.6.3. Check your Ruby version using `ruby -v`.
|
||||
|
||||
If you're running a previous version of macOS, you'll have to install a newer version of Ruby.
|
||||
|
||||
### With Homebrew {#brew}
|
||||
To run the latest Ruby version you need to install it through [Homebrew](https://brew.sh).
|
||||
|
||||
```sh
|
||||
# Install Homebrew
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
|
||||
# Install Ruby
|
||||
brew install ruby
|
||||
```
|
||||
|
||||
Add the brew ruby path to your shell configuration:
|
||||
|
||||
```bash
|
||||
# If you're using Zsh
|
||||
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc
|
||||
|
||||
# If you're using Bash
|
||||
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
|
||||
|
||||
# Unsure which shell you are using? Type
|
||||
echo $SHELL
|
||||
```
|
||||
|
||||
Relaunch your terminal and check your Ruby setup:
|
||||
|
||||
```sh
|
||||
which ruby
|
||||
# /usr/local/opt/ruby/bin/ruby
|
||||
|
||||
ruby -v
|
||||
{{ site.data.ruby.current_version_output }}
|
||||
```
|
||||
|
||||
You're now running the current stable version of Ruby!
|
||||
|
||||
### With rbenv {#rbenv}
|
||||
|
||||
People often use [rbenv](https://github.com/rbenv/rbenv) to manage multiple
|
||||
Ruby versions. This is very useful when you need to be able to run a given Ruby version on a project.
|
||||
|
||||
```sh
|
||||
# Install Homebrew
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
|
||||
# Install rbenv and ruby-build
|
||||
brew install rbenv
|
||||
|
||||
# Set up rbenv integration with your shell
|
||||
rbenv init
|
||||
|
||||
# Check your installation
|
||||
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
|
||||
```
|
||||
|
||||
Restart your terminal to apply your changes.
|
||||
Next, you can install the Ruby version you want. Let's install the latest stable version:
|
||||
|
||||
```sh
|
||||
rbenv install {{ site.data.ruby.current_version }}
|
||||
rbenv global {{ site.data.ruby.current_version }}
|
||||
ruby -v
|
||||
{{ site.data.ruby.current_version_output }}
|
||||
```
|
||||
|
||||
That's it! Head over to [rbenv command references](https://github.com/rbenv/rbenv#command-reference) to learn how to use different versions of Ruby in your projects.
|
||||
|
||||
## Install Jekyll
|
||||
|
||||
After installing Ruby, install Jekyll and Bundler.
|
||||
|
||||
### Local Install
|
||||
|
||||
Install the bundler and jekyll gems:
|
||||
|
||||
```sh
|
||||
gem install --user-install bundler jekyll
|
||||
```
|
||||
|
||||
Get your Ruby version:
|
||||
|
||||
```sh
|
||||
ruby -v
|
||||
{{ site.data.ruby.current_version_output }}
|
||||
```
|
||||
|
||||
Append your path file with the following, replacing the `X.X` with the first two digits of your Ruby version:
|
||||
|
||||
```bash
|
||||
# If you're using Zsh
|
||||
echo 'export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"' >> ~/.zshrc
|
||||
|
||||
# If you're using Bash
|
||||
echo 'export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"' >> ~/.bash_profile
|
||||
|
||||
# Unsure which shell you are using? Type
|
||||
echo $SHELL
|
||||
```
|
||||
|
||||
Check that `GEM PATHS:` points to your home directory:
|
||||
|
||||
```sh
|
||||
gem env
|
||||
```
|
||||
|
||||
{: .note .info}
|
||||
Every time you update Ruby to a version in which the first two digits change, update your path to match.
|
||||
|
||||
### Global Install
|
||||
|
||||
{: .note .warning}
|
||||
We recommend not installing Ruby gems globally to avoid file permissions problems and using `sudo`.
|
||||
|
||||
#### On Mojave (10.14)
|
||||
|
||||
Because of SIP Protections in Mojave, run:
|
||||
|
||||
```sh
|
||||
sudo gem install bundler
|
||||
sudo gem install -n /usr/local/bin/ jekyll
|
||||
```
|
||||
|
||||
#### Before Mojave (<10.14)
|
||||
|
||||
Run:
|
||||
|
||||
```sh
|
||||
sudo gem install bundler jekyll
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
See [Troubleshooting]({{ '/docs/troubleshooting/' | relative_url }}) or [ask for help on our forum](https://talk.jekyllrb.com).
|
||||
@@ -1,59 +0,0 @@
|
||||
---
|
||||
title: Jekyll on Linux
|
||||
permalink: /docs/installation/other-linux/
|
||||
---
|
||||
|
||||
Installation on other Linux distributions works similarly to installing on [Ubuntu](../ubuntu/).
|
||||
|
||||
## Install prerequisites
|
||||
|
||||
### Fedora
|
||||
|
||||
```sh
|
||||
sudo dnf install ruby ruby-devel openssl-devel redhat-rpm-config @development-tools
|
||||
```
|
||||
### RHEL8/CentOS8
|
||||
|
||||
```sh
|
||||
sudo dnf install ruby ruby-devel
|
||||
sudo dnf group install "Development Tools"
|
||||
```
|
||||
|
||||
### Debian
|
||||
|
||||
```sh
|
||||
sudo apt-get install ruby-full build-essential
|
||||
```
|
||||
|
||||
### Gentoo
|
||||
|
||||
```sh
|
||||
sudo emerge -av jekyll
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```sh
|
||||
sudo emerge --ask --verbose jekyll
|
||||
```
|
||||
|
||||
### ArchLinux
|
||||
|
||||
```sh
|
||||
sudo pacman -S ruby base-devel
|
||||
```
|
||||
|
||||
### OpenSUSE
|
||||
|
||||
```sh
|
||||
sudo zypper install -t pattern devel_ruby devel_C_C++
|
||||
```
|
||||
|
||||
### Clear Linux
|
||||
|
||||
```sh
|
||||
sudo swupd bundle-add ruby-basic
|
||||
```
|
||||
## Install Jekyll
|
||||
|
||||
Follow the instructions for [Ubuntu](../ubuntu/).
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
title: Jekyll on Ubuntu
|
||||
permalink: /docs/installation/ubuntu/
|
||||
---
|
||||
|
||||
## Install dependencies
|
||||
|
||||
Install Ruby and other [prerequisites]({{ '/docs/installation/#requirements' | relative_url }}):
|
||||
|
||||
```sh
|
||||
sudo apt-get install ruby-full build-essential zlib1g-dev
|
||||
```
|
||||
|
||||
Avoid installing RubyGems packages (called gems) as the root user. Instead,
|
||||
set up a gem installation directory for your user account. The following
|
||||
commands will add environment variables to your `~/.bashrc` file to configure
|
||||
the gem installation path:
|
||||
|
||||
```sh
|
||||
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
|
||||
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
|
||||
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
Finally, install Jekyll and Bundler:
|
||||
|
||||
```sh
|
||||
gem install jekyll bundler
|
||||
```
|
||||
|
||||
That's it! You're ready to start using Jekyll.
|
||||
@@ -1,152 +0,0 @@
|
||||
---
|
||||
title: Jekyll on Windows
|
||||
permalink: /docs/installation/windows/
|
||||
redirect_from:
|
||||
- /docs/windows/
|
||||
---
|
||||
|
||||
While Windows is not an officially-supported platform, it can be used to run Jekyll with the proper tweaks.
|
||||
|
||||
## Installing Ruby and Jekyll
|
||||
|
||||
### Installation via RubyInstaller
|
||||
|
||||
The easiest way to install Ruby and Jekyll is by using the [RubyInstaller](https://rubyinstaller.org/) for Windows.
|
||||
|
||||
RubyInstaller is a self-contained Windows-based installer that includes the Ruby language, an execution environment,
|
||||
important documentation, and more.
|
||||
|
||||
We only cover RubyInstaller-2.4 and newer here. Older versions need to
|
||||
[install the Devkit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit) manually.
|
||||
|
||||
1. Download and install a **Ruby+Devkit** version from [RubyInstaller Downloads](https://rubyinstaller.org/downloads/).
|
||||
Use default options for installation.
|
||||
2. Run the `ridk install` step on the last stage of the installation wizard. This is needed for installing gems with native
|
||||
extensions. You can find additional information regarding this in the
|
||||
[RubyInstaller Documentation](https://github.com/oneclick/rubyinstaller2#using-the-installer-on-a-target-system)
|
||||
3. Open a new command prompt window from the start menu, so that changes to the `PATH` environment variable becomes effective.
|
||||
Install Jekyll and Bundler using `gem install jekyll bundler`
|
||||
4. Check if Jekyll has been installed properly: `jekyll -v`
|
||||
|
||||
{: .note .info}
|
||||
You may receive an error when checking if Jekyll has been installed properly. Reboot your system and run `jekyll -v` again.
|
||||
If the error persists, please open a [RubyInstaller issue](https://github.com/oneclick/rubyinstaller2/issues/new).
|
||||
|
||||
That's it, you're ready to use Jekyll!
|
||||
|
||||
### Installation via Bash on Windows 10
|
||||
|
||||
If you are using Windows 10 version 1607 or later, another option to run Jekyll is by
|
||||
[installing](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) the Windows Subsystem for Linux.
|
||||
|
||||
{: .note .info}
|
||||
You must have [Windows Subsystem for Linux](https://msdn.microsoft.com/en-us/commandline/wsl/about) enabled.
|
||||
|
||||
Make sure all your packages and repositories are up to date. Open a new Command Prompt or Powershell window and type `bash`.
|
||||
|
||||
Your terminal should now be a Bash instance. Next, update your repository lists and packages:
|
||||
|
||||
```sh
|
||||
sudo apt-get update -y && sudo apt-get upgrade -y
|
||||
```
|
||||
|
||||
Next, install Ruby. To do this, let's use a repository from [BrightBox](https://www.brightbox.com/docs/ruby/ubuntu/),
|
||||
which hosts optimized versions of Ruby for Ubuntu.
|
||||
|
||||
```sh
|
||||
sudo apt-add-repository ppa:brightbox/ruby-ng
|
||||
sudo apt-get update
|
||||
sudo apt-get install ruby2.5 ruby2.5-dev build-essential dh-autoreconf
|
||||
```
|
||||
|
||||
Next, update your Ruby gems:
|
||||
|
||||
```sh
|
||||
gem update
|
||||
```
|
||||
|
||||
Install Jekyll:
|
||||
|
||||
```sh
|
||||
gem install jekyll bundler
|
||||
```
|
||||
|
||||
{: .note .info}
|
||||
No `sudo` here.
|
||||
|
||||
Check your Jekyll version:
|
||||
|
||||
```sh
|
||||
jekyll -v
|
||||
```
|
||||
|
||||
That's it! You're ready to start using Jekyll.
|
||||
|
||||
You can make sure time management is working properly by inspecting your `_posts` folder. You should see a markdown file
|
||||
with the current date in the filename.
|
||||
|
||||
<div class="note info">
|
||||
<h5>Non-superuser account issues</h5>
|
||||
<p>If the `jekyll new` command prints the error "Your user account isn't allowed to install to the system RubyGems", see
|
||||
the "Running Jekyll as Non-Superuser" instructions in
|
||||
<a href="{{ '/docs/troubleshooting/#no-sudo' | relative_url }}">Troubleshooting</a>.</p>
|
||||
</div>
|
||||
|
||||
{: .note .info}
|
||||
Bash on Ubuntu on Windows is still under development, so you may run into issues.
|
||||
|
||||
## Encoding
|
||||
|
||||
If you use UTF-8 encoding, make sure that no `BOM` header characters exist in your files. If they don't, Jekyll will break. This is especially relevant when you're running Jekyll on Windows.
|
||||
|
||||
Additionally, you might need to change the code page of the console window to UTF-8 in case you get a
|
||||
`Liquid Exception: Incompatible character encoding` error during the site generation process. Run the following:
|
||||
|
||||
```sh
|
||||
chcp 65001
|
||||
```
|
||||
|
||||
## Time Zone Management
|
||||
|
||||
Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter doesn't understand IANA Timezones.
|
||||
Using them had the `TZ` environment variable default to UTC/GMT 00:00.
|
||||
|
||||
Though Windows users could alternatively define their blog's timezone by setting the key to use the POSIX format of defining
|
||||
timezones, it wasn't as user-friendly when it came to having the clock altered to changing DST-rules.
|
||||
|
||||
Jekyll now uses a rubygem to internally configure Timezone based on established
|
||||
[IANA Timezone Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
||||
|
||||
While 'new' blogs created with Jekyll v3.4 and greater, will have the following added to their `Gemfile` by default, existing
|
||||
sites *will* have to update their `Gemfile` (and installed gems) to enable development on Windows:
|
||||
|
||||
```ruby
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||
```
|
||||
|
||||
<div class="note warning">
|
||||
<h5>TZInfo 2.0 incompatibility</h5>
|
||||
<p>
|
||||
Version 2.0 of the TZInfo library has introduced a change in how timezone offsets are calculated.
|
||||
This will result in incorrect date and time for your posts when the site is built with Jekyll 3.x on Windows.
|
||||
</p>
|
||||
<p>
|
||||
We therefore recommend that you lock the Timezone library to version 1.2 and above by listing
|
||||
<code>gem 'tzinfo', '~> 1.2'</code> in your <code>Gemfile</code>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Auto Regeneration
|
||||
|
||||
Jekyll uses the `listen` gem to watch for changes when the `--watch` switch is specified during a build or serve.
|
||||
While `listen` has built-in support for UNIX systems, it may require an extra gem for compatibility with Windows.
|
||||
|
||||
Add the following to the `Gemfile` for your site if you have issues with auto-regeneration on Windows alone:
|
||||
|
||||
```ruby
|
||||
gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform?
|
||||
```
|
||||
|
||||
You have to use a [Ruby+Devkit](https://rubyinstaller.org/downloads/) version of the RubyInstaller and install
|
||||
the MSYS2 build tools to successfully install the `wdm` gem.
|
||||
@@ -1,141 +0,0 @@
|
||||
---
|
||||
title: Layouts
|
||||
description: placeholder
|
||||
permalink: /docs/layouts/
|
||||
---
|
||||
Layouts are templates that wrap around your content. They allow you to have the
|
||||
source code for your template in one place so you don't have to repeat things
|
||||
like your navigation and footer on every page.
|
||||
|
||||
Layouts live in the `_layouts` directory. The convention is to have a base
|
||||
template called `default.html` and have other layouts [inherit](#inheritance)
|
||||
from this as needed.
|
||||
|
||||
<div class="note">
|
||||
<h5>Layouts Directory</h5>
|
||||
<p>
|
||||
Jekyll looks for the <code>_layouts</code> directory either at the root of
|
||||
your site's <code>source</code> or at the root of your theme.
|
||||
</p>
|
||||
<p>
|
||||
While you can configure the directory name in which your layouts can reside by
|
||||
setting the <code>layouts_dir</code> key in your config file, the directory
|
||||
itself should be located at the root of your site's <code>source</code> directory.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
## Usage
|
||||
|
||||
The first step is to put the template source code in `default.html`. `content`
|
||||
is a special variable, the value is the rendered content of the post or page
|
||||
being wrapped.
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ page.title }}</title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<a href="/">Home</a>
|
||||
<a href="/blog/">Blog</a>
|
||||
</nav>
|
||||
<h1>{{ page.title }}</h1>
|
||||
<section>
|
||||
{{ content }}
|
||||
</section>
|
||||
<footer>
|
||||
© to me
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
You have full access to the front matter of the origin. In the
|
||||
example above, `page.title` comes from the page front matter.
|
||||
|
||||
Next you need to specify what layout you're using in your page's front matter.
|
||||
You can also use
|
||||
[front matter defaults](/docs/configuration/front-matter-defaults/) to save you
|
||||
from having to set this on every page.
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: My First Page
|
||||
layout: default
|
||||
---
|
||||
|
||||
This is the content of my page
|
||||
```
|
||||
|
||||
The rendered output of this page is:
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>My First Page</title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<a href="/">Home</a>
|
||||
<a href="/blog/">Blog</a>
|
||||
</nav>
|
||||
<h1>My First Page</h1>
|
||||
<section>
|
||||
This is the content of my page
|
||||
</section>
|
||||
<footer>
|
||||
© to me
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
## Inheritance
|
||||
|
||||
Layout inheritance is useful when you want to add something to an existing
|
||||
layout for a portion of documents on your site. A common example of this is
|
||||
blog posts, you might want a post to display the date and author but otherwise
|
||||
be identical to your base layout.
|
||||
|
||||
To achieve this you need to create another layout which specifies your original
|
||||
layout in front matter. For example this layout will live at
|
||||
`_layouts/post.html`:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
<p>{{ page.date }} - Written by {{ page.author }}</p>
|
||||
|
||||
{{ content }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Now posts can use this layout while the rest of the pages use the default.
|
||||
|
||||
## Variables
|
||||
|
||||
You can set front matter in layouts, the only difference is when you're
|
||||
using in Liquid, you need to use the `layout` variable instead of `page`. For
|
||||
example:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
---
|
||||
city: San Francisco
|
||||
---
|
||||
<p>{{ layout.city }}</p>
|
||||
|
||||
{{ content }}
|
||||
```
|
||||
{% endraw %}
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
title: Liquid
|
||||
permalink: /docs/liquid/
|
||||
redirect_from: "/docs/templates/"
|
||||
---
|
||||
|
||||
Jekyll uses the [Liquid](https://shopify.github.io/liquid/) templating language
|
||||
to process templates.
|
||||
|
||||
Generally in Liquid you output content using two curly braces e.g.
|
||||
{% raw %}`{{ variable }}`{% endraw %} and perform logic statements by
|
||||
surrounding them in a curly brace percentage sign e.g.
|
||||
{% raw %}`{% if statement %}`{% endraw %}. To learn more about Liquid, check
|
||||
out the [official Liquid Documentation](https://shopify.github.io/liquid/).
|
||||
|
||||
Jekyll provides a number of useful Liquid additions to help you build your site:
|
||||
|
||||
* [Filters]({{ '/docs/liquid/filters/' | relative_url }})
|
||||
* [Tags]({{ '/docs/liquid/tags/' | relative_url }})
|
||||
@@ -1,154 +0,0 @@
|
||||
---
|
||||
title: Liquid Filters
|
||||
permalink: "/docs/liquid/filters/"
|
||||
shopify_filter_url: https://shopify.github.io/liquid/filters/
|
||||
shopify_filters:
|
||||
- abs
|
||||
- append
|
||||
- at_least
|
||||
- at_most
|
||||
- capitalize
|
||||
- ceil
|
||||
- compact
|
||||
- concat
|
||||
- date
|
||||
- default
|
||||
- divided_by
|
||||
- downcase
|
||||
- escape
|
||||
- escape_once
|
||||
- first
|
||||
- floor
|
||||
- join
|
||||
- last
|
||||
- lstrip
|
||||
- map
|
||||
- minus
|
||||
- modulo
|
||||
- newline_to_br
|
||||
- plus
|
||||
- prepend
|
||||
- remove
|
||||
- remove_first
|
||||
- replace
|
||||
- replace_first
|
||||
- reverse
|
||||
- round
|
||||
- rstrip
|
||||
- size
|
||||
- slice
|
||||
- sort
|
||||
- sort_natural
|
||||
- split
|
||||
- strip
|
||||
- strip_html
|
||||
- strip_newlines
|
||||
- times
|
||||
- truncate
|
||||
- truncatewords
|
||||
- uniq
|
||||
- upcase
|
||||
- url_decode
|
||||
- url_encode
|
||||
---
|
||||
|
||||
All of the standard Liquid [filters](#standard-liquid-filters) are supported (see below).
|
||||
|
||||
To make common tasks easier, Jekyll even adds a few handy filters of its own,
|
||||
all of which you can find on this page. You can also create your own filters
|
||||
using [plugins](/docs/plugins/).
|
||||
|
||||
<div class="mobile-side-scroller">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<th><span class="filter">Filter</span> and <span class="output">Output</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for filter in site.data.jekyll_filters %}
|
||||
<tr>
|
||||
<td>
|
||||
<p id="{{ filter.name | slugify }}" class="name"><strong>{{ filter.name }}</strong></p>
|
||||
<p>
|
||||
{{- filter.description -}}
|
||||
{%- if filter.version_badge %}
|
||||
<span class="version-badge" title="This filter is available from version {{ filter.version_badge }}">
|
||||
{{- filter.version_badge -}}
|
||||
</span>
|
||||
{% endif -%}
|
||||
</p>
|
||||
</td>
|
||||
<td class="align-center">
|
||||
{%- for example in filter.examples %}
|
||||
<p><code class="filter">{{ example.input }}</code></p>
|
||||
{% if example.output %}<p><code class="output">{{ example.output }}</code></p>{% endif %}
|
||||
{% endfor -%}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
### Options for the `slugify` filter
|
||||
|
||||
The `slugify` filter accepts an option, each specifying what to filter.
|
||||
The default is `default`. They are as follows (with what they filter):
|
||||
|
||||
- `none`: no characters
|
||||
- `raw`: spaces
|
||||
- `default`: spaces and non-alphanumeric characters
|
||||
- `pretty`: spaces and non-alphanumeric characters except for `._~!$&'()+,;=@`
|
||||
- `ascii`: spaces, non-alphanumeric, and non-ASCII characters
|
||||
- `latin`: like `default`, except Latin characters are first transliterated (e.g. `àèïòü` to `aeiou`) {%- include docs_version_badge.html version="3.7.0" -%}.
|
||||
|
||||
### Detecting `nil` values with `where` filter {%- include docs_version_badge.html version="4.0" -%}
|
||||
|
||||
You can use the `where` filter to detect documents and pages with properties that are `nil` or `""`. For example,
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
// Using `nil` to select posts that either do not have `my_prop`
|
||||
// defined or `my_prop` has been set to `nil` explicitly.
|
||||
{% assign filtered_posts = site.posts | where: 'my_prop', nil %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
// Using Liquid's special literal `empty` or `blank` to select
|
||||
// posts that have `my_prop` set to an empty value.
|
||||
{% assign filtered_posts = site.posts | where: 'my_prop', empty %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Binary operators in `where_exp` filter {%- include docs_version_badge.html version="4.0" -%}
|
||||
|
||||
You can use Liquid binary operators `or` and `and` in the expression passed to the `where_exp` filter to employ multiple
|
||||
conditionals in the operation.
|
||||
|
||||
For example, to get a list of documents on English horror flicks, one could use the following snippet:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{{ site.movies | where_exp: "item", "item.genre == 'horror' and item.language == 'English'" }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Or to get a list of comic-book based movies, one may use the following:
|
||||
|
||||
{% raw %}
|
||||
```liquid
|
||||
{{ site.movies | where_exp: "item", "item.sub_genre == 'MCU' or item.sub_genre == 'DCEU'" }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Standard Liquid Filters
|
||||
|
||||
For your convenience, here is the list of all [Liquid filters]({{ page.shopify_filter_url }}) with links to examples in the official Liquid documentation.
|
||||
|
||||
{% for filter in page.shopify_filters %}
|
||||
- [{{ filter }}]({{ filter | prepend: page.shopify_filter_url | append: '/' }})
|
||||
{% endfor %}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user