Compare commits

..

4 Commits

Author SHA1 Message Date
Pat Hawks
b0c591a3f2 Add Inline Markdown converter 2016-10-27 20:30:32 -05:00
David Stosik
167af4552b Avoid modifying existing test's behavior in my PR 2016-10-24 01:03:53 +09:00
David Stosik
3cc4bef2e6 Fix Rubocop errors 2016-10-24 00:39:09 +09:00
David Stosik
4785f6f71f Provide an "inline" mode to markdownify filter 2016-10-24 00:01:09 +09:00
611 changed files with 10373 additions and 26905 deletions

View File

@@ -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/**/*
- site/**/*
- 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

86
.github/CODEOWNERS vendored
View File

@@ -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

View File

@@ -4,7 +4,10 @@ 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
@@ -12,9 +15,9 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
* [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.
* 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
@@ -25,7 +28,7 @@ Whether you're a developer, a designer, or just a Jekyll devotee, there are lots
* 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 request 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.
@@ -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.
@@ -59,37 +62,17 @@ We want the Jekyll documentation to be the best it can be. We've open-sourced ou
### How to submit changes
You can find the documentation for jekyllrb.com in the [docs](https://github.com/jekyll/jekyll/tree/master/docs) directory. See the section above, [submitting a pull request](#submitting-a-pull-request) for information on how to propose a change.
You can find the documentation for jekyllrb.com in the [site](https://github.com/jekyll/jekyll/tree/master/site) directory. See the section above, [submitting a pull request](#submitting-a-pull-request) for information on how to propose a change.
One gotcha, all pull requests should be directed at the `master` branch (the default branch).
### Updating FontAwesome iconset for jekyllrb.com
We use a custom version of FontAwesome which contains just the icons we use.
If you ever need to update our documentation with an icon that is not already available in our custom iconset, you'll have to regenerate the iconset using Icomoon's Generator:
1. Go to <https://icomoon.io/app/>.
2. Click `Import Icons` on the top-horizontal-bar and upload the existing `<jekyll>/docs/icomoon-selection.json`.
3. Click `Add Icons from Library..` further down on the page, and add 'Font Awesome'.
4. Select the required icon(s) from the Library (make sure its the 'FontAwesome' library instead of 'IcoMoon-Free' library).
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
`<jekyll>/docs/_sass/_font-awesome.scss` sass partial.
- Fix paths in the `@font-face {}` declaration by adding `../` before `fonts/FontAwesome.*` like so:
`('../fonts/Fontawesome.woff?9h6hxj')`.
### Adding plugins
If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/docs/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type.
If you want to add your plugin to the [list of plugins](https://jekyllrb.com/docs/plugins/#available-plugins), please submit a pull request modifying the [plugins page source file](https://github.com/jekyll/jekyll/blob/master/site/_docs/plugins.md) by adding a link to your plugin under the proper subheading depending upon its type.
## 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
@@ -97,7 +80,7 @@ Any time you propose a code change, you should also include updates to the docum
#### Documentation
If your contribution changes any Jekyll behavior, make sure to update the documentation. Documentation lives in the `docs/_docs` folder (spoiler alert: it's a Jekyll site!). If the docs are missing information, please feel free to add it in. Great docs make a great project. Include changes to the documentation within your pull request, and once merged, `jekyllrb.com` will be updated.
If your contribution changes any Jekyll behavior, make sure to update the documentation. Documentation lives in the `site/_docs` folder (spoiler alert: it's a Jekyll site!). If the docs are missing information, please feel free to add it in. Great docs make a great project. Include changes to the documentation within your pull request, and once merged, `jekyllrb.com` will be updated.
#### Tests
@@ -111,39 +94,25 @@ If your contribution changes any Jekyll behavior, make sure to update the docume
* 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)
## Running tests locally
### Test Dependencies
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.

5
.github/FUNDING.yml vendored
View File

@@ -1,5 +0,0 @@
# These are supported funding model platforms
github: [ashmaroli, DirtyF, mattr-]
open_collective: jekyll
tidelift: rubygems/jekyll

82
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,82 @@
<!--
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 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)

View File

@@ -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.
-->

View File

@@ -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! -->

View File

@@ -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?
-->

View File

@@ -1,15 +0,0 @@
---
name: Question
about: Have any questions about how Jekyll works?
title: ''
labels: ''
assignees: ''
---
<!--
The Jekyll issue tracker IS NOT for usage questions! Please post your
question on our dedicated forum at https://talk.jekyllrb.com.
Thank you!
-->

View File

@@ -1,45 +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. -->
<!--
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.
-->

View File

@@ -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 &mdash; 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 &mdash; 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
View File

@@ -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/

View File

@@ -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).

View File

@@ -1,6 +0,0 @@
repository: jekyll
labels:
- good first issue
- help-wanted
- first-time-only
template: .github/first-timers-issue-template.md

32
.gitignore vendored
View File

@@ -1,29 +1,23 @@
# Jekyll
_site/
.jekyll-cache
.jekyll-metadata
.sass-cache
# 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/*

View File

@@ -1,134 +1,103 @@
---
require:
- rubocop-performance
- ./rubocop/jekyll
Jekyll/NoPutsAllowed:
Exclude:
- rake/*.rake
AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.0
Include:
- lib/**/*.rb
- test/**/*.rb
Exclude:
- lib/jekyll/renderer.rb
- bin/**/*
- exe/**/*
- benchmark/**/*
- script/**/*
- vendor/**/*
- tmp/**/*
Layout/AlignHash:
EnforcedHashRocketStyle: table
Layout/IndentationWidth:
Severity: error
Layout/IndentFirstArrayElement:
EnforcedStyle: consistent
Layout/IndentFirstHashElement:
EnforcedStyle: consistent
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
Lint/NestedPercentLiteral:
Exclude:
- test/test_site.rb
Layout/EmptyComment:
Enabled: false
Layout/EndAlignment:
Lint/EndAlignment:
Severity: error
Lint/UnreachableCode:
Severity: error
Lint/Void:
Exclude:
- lib/jekyll/site.rb
Lint/UselessAccessModifier:
Enabled: false
Metrics/AbcSize:
Max: 21
Metrics/BlockLength:
Exclude:
- test/**/*.rb
- lib/jekyll/configuration.rb
- rake/*.rake
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:
Exclude:
- lib/jekyll/utils.rb
- lib/jekyll/commands/serve.rb
Max: 9
Metrics/LineLength:
Exclude:
- !ruby/regexp /features\/.*.rb/
- Rakefile
- rake/*.rake
- Gemfile
Max: 100
Max: 90
Severity: warning
Metrics/MethodLength:
CountComments: false
Max: 20
Severity: error
Metrics/ModuleLength:
Exclude:
- lib/jekyll/filters.rb
Max: 240
Metrics/ParameterLists:
Max: 4
Metrics/PerceivedComplexity:
Max: 8
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
Security/MarshalLoad:
Exclude:
- !ruby/regexp /test\/.*.rb$/
- lib/jekyll/regenerator.rb
Security/YAMLLoad:
Exclude:
- !ruby/regexp /features\/.*.rb/
- !ruby/regexp /test\/.*.rb$/
Style/AccessModifierDeclarations:
Enabled: false
Style/Alias:
EnforcedStyle: prefer_alias_method
Enabled: false
Style/AlignArray:
Enabled: false
Style/AlignHash:
EnforcedHashRocketStyle: table
Style/AlignParameters:
Enabled: false
EnforcedStyle: with_fixed_indentation
Style/AndOr:
Severity: error
Style/Attr:
Enabled: false
Style/BracesAroundHashParameters:
Enabled: false
Style/ClassAndModuleChildren:
Exclude:
- test/**/*.rb
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Enabled: false
Style/Documentation:
Enabled: false
Exclude:
- !ruby/regexp /features\/.*.rb$/
Style/DoubleNegation:
Enabled: false
Style/FormatStringToken:
Exclude:
- lib/jekyll/utils/ansi.rb
Style/EmptyLinesAroundAccessModifier:
Enabled: false
Style/EmptyLinesAroundModuleBody:
Enabled: false
Style/ExtraSpacing:
AllowForAlignment: true
Style/FileName:
Enabled: false
Style/FirstParameterIndentation:
EnforcedStyle: consistent
Style/GuardClause:
Enabled: false
Style/HashSyntax:
EnforcedStyle: hash_rockets
Severity: error
Style/MixinUsage:
Exclude:
- test/helper.rb
Style/IfUnlessModifier:
Enabled: false
Style/IndentArray:
EnforcedStyle: consistent
Style/IndentHash:
EnforcedStyle: consistent
Style/IndentationWidth:
Severity: error
Style/ModuleFunction:
Enabled: false
Style/MultilineMethodCallIndentation:
EnforcedStyle: indented
Style/MultilineOperationIndentation:
EnforcedStyle: indented
Style/MultilineTernaryOperator:
Severity: error
Style/PercentLiteralDelimiters:
@@ -140,22 +109,25 @@ Style/PercentLiteralDelimiters:
"%w": "()"
"%W": "()"
"%x": "()"
Style/RedundantReturn:
Enabled: false
Style/RedundantSelf:
Enabled: false
Style/RegexpLiteral:
EnforcedStyle: percent_r
Style/RescueModifier:
Enabled: false
Style/SafeNavigation:
Exclude:
- lib/jekyll/document.rb
Style/SignalException:
EnforcedStyle: only_raise
Style/SingleLineMethods:
Enabled: false
Style/SpaceAroundOperators:
Enabled: false
Style/SpaceInsideBrackets:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
Style/SymbolArray:
EnforcedStyle: brackets
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/UnneededCapitalW:
Enabled: false

View File

@@ -1,27 +1,21 @@
bundler_args: --without benchmark:development
bundler_args: --without benchmark:site:development
script: script/cibuild
cache: bundler
language: ruby
sudo: false
rvm:
- &ruby1 2.6.0
- &ruby2 2.4.5
- &jruby jruby-9.2.7.0
- &ruby1 2.3.1
- &ruby2 2.2.5
- &ruby3 2.1.9
- &jruby jruby-9.1.2.0
matrix:
include:
- rvm: *ruby1
env: TEST_SUITE=fmt
name: "🤖️ Code Format"
- rvm: *ruby1
env: TEST_SUITE=default-site
name: "🏠️ Default Site"
- rvm: *ruby1
env: TEST_SUITE=profile-docs
name: "Profile Docs"
- rvm: *ruby1
env: TEST_SUITE=memprof
name: "Profile Memory Allocation"
exclude:
- rvm: *jruby
env: TEST_SUITE=cucumber
@@ -34,18 +28,8 @@ branches:
only:
- master
- themes
- /.*-stable/
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
notifications:
email: false
slack:
secure: "\
dNdKk6nahNURIUbO3ULhA09/vTEQjK0fNbgjVjeYPEvROHgQBP1cIP3AJy8aWs8rl5Yyow4Y\
@@ -53,6 +37,11 @@ notifications:
O1AanCUbJSEyJTju347xCBGzESU=\
"
before_install:
- gem update --system --no-document
- gem install bundler --no-document
addons:
code_climate:
repo_token:
secure: "\
mAuvDu+nrzB8dOaLqsublDGt423mGRyZYM3vsrXh4Tf1sT+L1PxsRzU4gLmcV27HtX2Oq9\
DA4vsRURfABU0fIhwYkQuZqEcA3d8TL36BZcGEshG6MQ2AmnYsmFiTcxqV5bmlElHEqQuT\
5SUFXLafgZPBnL0qDwujQcHukID41sE=\
"

View File

@@ -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
View 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/

87
Gemfile
View File

@@ -1,38 +1,32 @@
# frozen_string_literal: true
source "https://rubygems.org"
gemspec :name => "jekyll"
# Temporarily lock JRuby builds on Travis CI to i18n-1.2.x until JRuby is able to handle
# refinements introduced in i18n-1.3.0
gem "i18n", "~> 1.2.0" if RUBY_ENGINE == "jruby"
gem "rake", "~> 11.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", "~> 3.0"
gem "httpclient"
gem "rubocop", "~> 0.44.1"
gem "cucumber", "~> 2.1"
gem "jekyll_test_plugin"
gem "jekyll_test_plugin_malicious"
gem "memory_profiler"
gem "nokogiri", "~> 1.7"
gem "rspec"
gem "codeclimate-test-reporter"
gem "rspec-mocks"
gem "rubocop", "~> 0.72.0"
gem "rubocop-performance"
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 "nokogiri"
gem "rspec"
gem "test-theme", path: File.expand_path("./test/fixtures/test-theme", File.dirname(__FILE__))
gem "jruby-openssl" if RUBY_ENGINE == "jruby"
end
@@ -40,62 +34,63 @@ end
#
group :test_legacy do
gem "test-unit" if RUBY_PLATFORM =~ %r!cygwin!
if RUBY_PLATFORM =~ /cygwin/ || RUBY_VERSION.start_with?("2.2")
gem 'test-unit'
end
gem "minitest"
gem "minitest-profile"
gem "minitest-reporters"
gem "shoulda"
gem "redgreen"
gem "simplecov"
gem "minitest-reporters"
gem "minitest-profile"
gem "minitest"
gem "shoulda"
end
#
group :benchmark do
if ENV["BENCHMARK"]
gem "benchmark-ips"
gem "rbtrace"
gem "ruby-prof"
gem "benchmark-ips"
gem "stackprof"
gem "rbtrace"
end
end
#
group :jekyll_optional_dependencies do
gem "jekyll-coffeescript"
gem "jekyll-docs", :path => "../docs" if Dir.exist?("../docs") && ENV["JEKYLL_VERSION"]
gem "jekyll-feed", "~> 0.9"
gem "toml", "~> 0.1.0"
gem "coderay", "~> 1.1.0"
gem "jekyll-docs", :path => '../docs' if Dir.exist?('../docs') && ENV['JEKYLL_VERSION']
gem "jekyll-gist"
gem "jekyll-paginate"
gem "jekyll-feed"
gem "jekyll-coffeescript"
gem "jekyll-redirect-from"
gem "kramdown-syntax-coderay"
gem "jekyll-paginate"
gem "mime-types", "~> 3.0"
gem "rdoc", "~> 6.0"
gem "tomlrb", "~> 1.2"
gem "kramdown", "~> 1.9"
gem "rdoc", "~> 4.2"
platform :ruby, :mswin, :mingw, :x64_mingw do
gem "classifier-reborn", "~> 2.2"
gem "liquid-c", "~> 4.0"
gem "yajl-ruby", "~> 1.4"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
gem "rdiscount", "~> 2.0"
gem "pygments.rb", "~> 0.6.0"
gem "redcarpet", "~> 3.2", ">= 3.2.3"
gem "classifier-reborn", "~> 2.0"
gem "liquid-c", "~> 3.0"
end
end
#
group :site do
gem "html-proofer", "~> 3.4" if ENV["PROOF"]
if ENV["PROOF"]
gem "html-proofer", "~> 2.0"
end
gem "jemoji", "0.5.1"
gem "jekyll-sitemap"
gem "jekyll-seo-tag"
gem "jekyll-avatar"
gem "jekyll-mentions"
gem "jekyll-seo-tag"
gem "jekyll-sitemap"
gem "jemoji"
end

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2008-present Tom Preston-Werner and Jekyll contributors
Copyright (c) 2008-2016 Tom Preston-Werner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -3,13 +3,13 @@
[![Gem Version](https://img.shields.io/gem/v/jekyll.svg)][ruby-gems]
[![Linux Build Status](https://img.shields.io/travis/jekyll/jekyll/master.svg?label=Linux%20build)][travis]
[![Windows Build status](https://img.shields.io/appveyor/ci/jekyll/jekyll/master.svg?label=Windows%20build)][appveyor]
[![Maintainability](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/maintainability)][codeclimate]
[![Test Coverage](https://api.codeclimate.com/v1/badges/8ba0cb5b17bb9848e128/test_coverage)][coverage]
[![Test Coverage](https://img.shields.io/codeclimate/coverage/github/jekyll/jekyll.svg)][coverage]
[![Code Climate](https://img.shields.io/codeclimate/github/jekyll/jekyll.svg)][codeclimate]
[![Dependency Status](https://img.shields.io/gemnasium/jekyll/jekyll.svg)][gemnasium]
[![Security](https://hakiri.io/github/jekyll/jekyll/master.svg)][hakiri]
[![Backers on Open Collective](https://opencollective.com/jekyll/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/jekyll/sponsors/badge.svg)](#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
@@ -22,68 +22,38 @@ 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 El Capitan?
See: https://jekyllrb.com/docs/troubleshooting/#jekyll-amp-mac-os-x-1011
## 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), or [@mattr-](https://github.com/mattr-)) 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

View File

@@ -1,15 +1,13 @@
# frozen_string_literal: true
require 'rubygems'
require 'rake'
require 'rdoc'
require 'date'
require 'yaml'
require "rubygems"
require "rake"
require "rdoc"
require "date"
require "yaml"
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib]))
require 'jekyll/version'
$LOAD_PATH.unshift File.expand_path("lib", __dir__)
require "jekyll/version"
Dir.glob("rake/**.rake").each { |f| import f }
Dir.glob('rake/**.rake').each { |f| import f }
#############################################################################
#
@@ -29,53 +27,55 @@ def docs_name
"#{name}-docs"
end
def docs_folder
"docs"
end
def gemspec_file
"#{name}.gemspec"
end
def gem_file
"#{name}-#{Gem::Version.new(version)}.gem"
"#{name}-#{Gem::Version.new(version).to_s}.gem"
end
def normalize_bullets(markdown)
markdown.gsub(%r!\n\s{2}\*{1}!, "\n-")
markdown.gsub(/\n\s{2}\*{1}/, "\n-")
end
def linkify_prs(markdown)
markdown.gsub(%r!(?<\!&)#(\d+)!) do |word|
markdown.gsub(/#(\d+)/) do |word|
"[#{word}]({{ site.repository }}/issues/#{word.delete("#")})"
end
end
def linkify_users(markdown)
markdown.gsub(/(@\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)
markdown.gsub(%r!(`{[{%].+[}%]}`)!, "{% raw %}\\1{% endraw %}")
markdown.gsub(/(`{[{%].+[}%]}`)/, "{% raw %}\\1{% endraw %}")
end
def custom_release_header_anchors(markdown)
header_regexp = %r!^(\d{1,2})\.(\d{1,2})\.(\d{1,2}) \/ \d{4}-\d{2}-\d{2}!
section_regexp = %r!^### \w+ \w+$!
markdown.split(%r!^##\s!).map do |release_notes|
header_regexp = /^(\d{1,2})\.(\d{1,2})\.(\d{1,2}) \/ \d{4}-\d{2}-\d{2}/
section_regexp = /^### \w+ \w+$/
markdown.split(/^##\s/).map do |release_notes|
_, 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)
header.delete("#").strip.downcase.gsub(%r!\s+!, "-")
def sluffigy(header)
header.gsub(/#/, '').strip.downcase.gsub(/\s+/, '-')
end
def remove_head_from_history(markdown)
index = markdown =~ %r!^##\s+\d+\.\d+\.\d+!
index = markdown =~ /^##\s+\d+\.\d+\.\d+/
markdown[index..-1]
end
@@ -84,28 +84,25 @@ def converted_history(markdown)
custom_release_header_anchors(
liquid_escape(
linkify(
normalize_bullets(markdown)
)
)
)
)
normalize_bullets(markdown)))))
end
def siteify_file(file, overrides_front_matter = {})
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exist?(file)
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exists?(file)
title = begin
File.read(file).match(%r!\A# (.*)$!)[1]
rescue NoMethodError
File.read(file).match(/\A# (.*)$/)[1]
rescue
File.basename(file, ".*").downcase.capitalize
end
slug = File.basename(file, ".markdown").downcase
front_matter = {
"title" => title,
"layout" => "docs",
"permalink" => "/docs/#{slug}/",
"note" => "This file is autogenerated. Edit /#{file} instead.",
"note" => "This file is autogenerated. Edit /#{file} instead."
}.merge(overrides_front_matter)
contents = "#{front_matter.to_yaml}---\n\n#{content_for(file)}"
File.write("#{docs_folder}/_docs/#{slug}.md", contents)
File.write("site/_docs/#{slug}.md", contents)
end
def content_for(file)
@@ -114,7 +111,7 @@ def content_for(file)
when "History.markdown"
converted_history(contents)
else
contents.gsub(%r!\A# .*\n\n?!, "")
contents.gsub(/\A# .*\n\n?/, "")
end
end
@@ -127,23 +124,23 @@ end
multitask :default => [:test, :features]
task :spec => :test
require "rake/testtask"
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << "lib" << "test"
test.pattern = "test/**/test_*.rb"
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
require "rdoc/task"
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = "rdoc"
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "#{name} #{version}"
rdoc.rdoc_files.include("README*")
rdoc.rdoc_files.include("lib/**/*.rb")
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
begin
require "cucumber/rake/task"
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features) do |t|
t.profile = "travis"
end
@@ -151,9 +148,9 @@ begin
t.profile = "html_report"
end
rescue LoadError
desc "Cucumber rake task not available"
desc 'Cucumber rake task not available'
task :features do
abort "Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin"
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
end
end

View File

@@ -1,35 +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: "24"
TEST_SUITE: "test"
- 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: "23"
TEST_SUITE: "test"
- RUBY_FOLDER_VER: "23"
TEST_SUITE: "cucumber"
- RUBY_FOLDER_VER: "23"
TEST_SUITE: "fmt"
- RUBY_FOLDER_VER: "23"
TEST_SUITE: "default-site"
- RUBY_FOLDER_VER: "23-x64"
TEST_SUITE: "test"
- RUBY_FOLDER_VER: "22"
TEST_SUITE: "test"
- RUBY_FOLDER_VER: "21"
TEST_SUITE: "test"
test_script:
- ruby --version
- gem --version
@@ -37,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
benchmark/capture-assign.rb Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require "liquid"
require "benchmark/ips"

View File

@@ -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
benchmark/end-with-vs-regexp Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
Benchmark.ips do |x|

0
benchmark/file-dir-ensure-trailing-slash Executable file → Normal file
View File

1
benchmark/flat-map Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
enum = (0..50).to_a

1
benchmark/hash-fetch Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
h = {:bar => 'uco'}

0
benchmark/jekyll-sanitize-path Executable file → Normal file
View File

View File

@@ -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

View File

@@ -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
benchmark/proc-call-vs-yield Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
def fast

0
benchmark/regexp-vs-include.rb Executable file → Normal file
View File

View File

@@ -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

View File

@@ -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
benchmark/sequential-assignment Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
Benchmark.ips do |x|

3
benchmark/string-concat Executable file → Normal file
View File

@@ -1,7 +1,6 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
url = "https://jekyllrb.com"
url = "http://jekyllrb.com"
Benchmark.ips do |x|
x.report('+=') { url += '/' }

1
benchmark/string-replacement Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
def str

1
benchmark/symbol-to-proc Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env ruby
require 'benchmark/ips'
Benchmark.ips do |x|

View File

@@ -1,62 +0,0 @@
---
version: 3.8.6
min_ruby_version: 2.4.0
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
collections:
docs:
permalink: "/:collection/:path/"
output: true
posts:
permalink: "/news/:year/:month/:day/:title/"
output: true
tutorials:
output: true
defaults:
- scope:
path: _docs
type: docs
values:
layout: docs
- scope:
path: _posts
type: posts
values:
layout: news_item
- scope:
path: ""
values:
image: "/img/jekyll-og.png"
plugins:
- jekyll-avatar
- jekyll-feed
- jekyll-mentions
- jekyll-redirect-from
- jekyll-seo-tag
- jekyll-sitemap
- jemoji
feed:
categories:
- release
sass:
style: compressed
exclude:
- .gitignore
- .jekyll-cache
- CNAME
- icomoon-selection.json
- readme.md

View File

@@ -1,36 +0,0 @@
- title: Getting Started
docs:
- link: /docs/
- link: /docs/ruby-101/
- link: /docs/installation/
- link: /docs/community/
- link: /docs/step-by-step/01-setup/
- title: Build
docs:
- link: /docs/usage/
- link: /docs/configuration/
- 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/

View File

@@ -1,298 +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: 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.
examples:
- input: '{{ page.content | number_of_words }}'
output: 1337
#
- 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 &ldquo;smart quotes.&rdquo;'
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.&nbsp;property name
2.&nbsp;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:

View File

@@ -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 `site.pages` listing those which end in `.html`.
- name: site.html_files
description: >-
A subset of `site.static_files` listing those which end in `.html`.
- 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 Posts 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 posts 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

View File

@@ -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

View File

@@ -1,241 +0,0 @@
- name: Tom Preston Werner Blog
url: http://tom.preston-werner.com/
categories:
- personal
- blog
- name: GitHub On Demand Training
url: https://services.github.com/on-demand/
categories:
- software
- knowledgebase
- name: Vesterheim Norwegian-American Museum
url: http://vesterheim.org/
categories:
- marketing-site
- name: KOTN
url: https://kotn.com/
categories:
- marketing-site
- name: MvvmCross
url: https://www.mvvmcross.com/
categories:
- software
- marketing-site
- name: Vidgrid
url: https://www.vidgrid.com/
categories:
- software
- marketing-site
- name: Bitcoin
url: https://bitcoin.org/en/
categories:
- software
- marketing-site
- name: Mapwize
url: https://www.mapwize.io/
categories:
- software
- marketing-site
- name: Auth0 Blog
url: https://auth0.com/blog/
categories:
- software
- blog
- name: AWS Amplify
url: https://aws-amplify.github.io/
categories:
- open-source
- marketing-site
- name: Yeoman
url: http://yeoman.io/
categories:
- open-source
- marketing-site
- name: Ionic Framwork
url: https://ionicframework.com/
categories:
- software
- marketing-site
- name: Release Management Blog
url: https://release.mozilla.org/
categories:
- software
- blog
- name: Freedom of Information Act
url: https://www.foia.gov/
categories:
- government
- name: Art & About Sydney
url: https://www.artandabout.com.au/
categories:
- government
- name: Passbolt Help
url: https://help.passbolt.com/
categories:
- knowledgebase
- name: We are COLLINS
url: https://www.wearecollins.com/
categories:
- agency
- name: Light Burn
url: https://lightburn.co/
categories:
- agency
- name: italia.it
url: https://developers.italia.it/
categories:
- community
- name: Sydney New Years Eve
url: https://www.sydneynewyearseve.com/
categories:
- government
- name: Login.gov
url: https://login.gov/
categories:
- government
- name: plainlanguage.gov
url: https://plainlanguage.gov/
categories:
- government
- name: U.S. Web Design Standards
url: https://standards.usa.gov/
categories:
- government
- name: Grantmaker Search
url: https://www.grantmakers.io/
categories:
- marketing-site
- name: Rehan Butt
url: http://rehanbutt.com/
categories:
- personal
- portfolio
- name: The Markdown Guide
url: https://www.markdownguide.org/
categories:
- knowledgebase
- name: PROBOT
url: https://probot.github.io/
categories:
- documentation
- name: Matt Grey
url: https://himatt.com/
categories:
- personal
- portfolio
- name: frame.ai
url: https://frame.ai/
categories:
- software
- marketing-site
- name: AdHawk
url: https://www.tryadhawk.com/
categories:
- agency
- name: City of Boston Budget
url: https://budget.boston.gov/
categories:
- government
- name: Lattice
url: https://latticehq.com/
categories:
- software
- marketing-site
- name: MailTape
url: https://www.mailta.pe/
categories:
- other
- name: Digital Democracy
url: http://www.digital-democracy.org/
categories:
- other
- name: HTML Reference
url: http://htmlreference.io/
categories:
- documentation
- name: CSS Reference
url: http://cssreference.io/
categories:
- documentation
- name: Chain
url: https://chain.com/
categories:
- marketing-site
- name: Boxy Suite
url: https://www.boxysuite.com/
categories:
- marketing-site
- software
- name: Pattern Lab
url: http://patternlab.io/
categories:
- documentation
- name: IBM MobileFirst Foundation
url: https://mobilefirstplatform.ibmcloud.com/
categories:
- documentation
- name: 18F
url: https://18f.gsa.gov/
categories:
- agency
- government
- name: Mapbox
url: https://mapbox.com/
categories:
- marketing-site
- name: Development Seed
url: https://developmentseed.org/
categories:
- agency
- name: Isomer - Singapore Government Static Websites
url: https://isomer.gov.sg/
categories:
- government
- name: SiteLeaf
url: https://siteleaf.com
categories:
- software
- marketing-site
- name: CloudCannon
url: https://cloudcannon.com/
categories:
- software
- marketing-site
- name: Ruby on Rails
url: http://rubyonrails.org/
categories:
- marketing-site
- documentation
- name: White House Social and Behavioral Sciences Team
url: https://sbst.gov/
categories:
- government
- name: UN World Statistics
url: https://worldstatisticsday.org
categories:
- government
- name: Sketch App
url: https://sketchapp.com/
categories:
- software
- marketing-site
- name: Netflix Devices
url: https://devices.netflix.com/en/
categories:
- marketing-site
- name: TwitchCon
url: https://www.twitchcon.com/
categories:
- marketing-site
- conference
- name: Twitch Developer Documentation
url: https://dev.twitch.tv/
categories:
- marketing-site
- documentation
- name: Spotify for Developers
url: https://developer.spotify.com
categories:
- marketing-site
- documentation
- software

View File

@@ -1,13 +0,0 @@
- title: Tutorials
tutorials:
- home
- video-walkthroughs
- navigation
- orderofinterpretation
- custom-404-page
- convert-site-to-jekyll
- using-jekyll-with-bundler
#- title: Another section
# tutorials:
# - sample

View File

@@ -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)

View File

@@ -1,368 +0,0 @@
---
title: Collections
permalink: /docs/collections/
---
Collections are a great way to group related content like members of a team or
talks at a conference.
## Setup
To use a Collection you first need to define it in your `_config.yml`. For
example here's a collection of staff members:
```yaml
collections:
- staff_members
```
You can optionally specify metadata for your collection in the configuration:
```yaml
collections:
staff_members:
people: true
```
<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/)
and copy it to the destination (e.g. `_site`) without processing. If front matter
is provided, Jekyll will process the file in your collection but will not write to disk
unless `output: true` is 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*.
```
<div class="note info">
<h5>Be sure to name your directories correctly</h5>
<p>
The folder must be named identically to the collection you defined in
your <code>_config.yml</code> file, with the addition of the preceding <code>_</code> character.
</p>
</div>
## Output
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`:
```yaml
collections:
staff_members:
output: true
```
You can link to the generated page using the `url` attribute:
{% 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 %}
## Permalinks
There are special [permalink variables for collections](/docs/permalinks/) to
help you control the output url for the entire collection.
{% if site.version == '4.0.0' %}{% comment %} Remove this encapsulation when v4.0 ships {% endcomment %}
## Custom Sorting of Documents
By default, documents in a collection are sorted by their paths. But 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:
```yaml
collections:
tutorials:
sort_by: lesson
```
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.
### Manually Ordering Documents
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
```
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:
```yaml
collections:
tutorials:
order:
- hello-world.md
- introduction.md
- concepts/basics.md
- concepts/advanced.md
```
If both metadata keys have been defined properly, `order` list takes precedence.
{% endif %}
## Liquid Attributes
### Collections
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">
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>label</code></p>
</td>
<td>
<p>
The name of your collection, e.g. <code>my_collection</code>.
</p>
</td>
</tr>
<tr>
<td>
<p><code>docs</code></p>
</td>
<td>
<p>
An array of <a href="#documents">documents</a>.
</p>
</td>
</tr>
<tr>
<td>
<p><code>files</code></p>
</td>
<td>
<p>
An array of static files in the collection.
</p>
</td>
</tr>
<tr>
<td>
<p><code>relative_directory</code></p>
</td>
<td>
<p>
The path to the collection's source directory, relative to the site
source.
</p>
</td>
</tr>
<tr>
<td>
<p><code>directory</code></p>
</td>
<td>
<p>
The full path to the collections's source directory.
</p>
</td>
</tr>
<tr>
<td>
<p><code>output</code></p>
</td>
<td>
<p>
Whether the collection's documents will be output as individual
files.
</p>
</td>
</tr>
</tbody>
</table>
</div>
<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
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
file, each document has the following attributes:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>content</code></p>
</td>
<td>
<p>
The (unrendered) content of the document. If no 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
after the terminating
`---` of the front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>output</code></p>
</td>
<td>
<p>
The rendered output of the document, based on the
<code>content</code>.
</p>
</td>
</tr>
<tr>
<td>
<p><code>path</code></p>
</td>
<td>
<p>
The full path to the document's source file.
</p>
</td>
</tr>
<tr>
<td>
<p><code>relative_path</code></p>
</td>
<td>
<p>
The path to the document's source file relative to the site source.
</p>
</td>
</tr>
<tr>
<td>
<p><code>url</code></p>
</td>
<td>
<p>
The URL of the rendered collection. The file is only written to the destination when the collection to which it belongs has <code>output: true</code> in the site's configuration.
</p>
</td>
</tr>
<tr>
<td>
<p><code>collection</code></p>
</td>
<td>
<p>
The name of the document's collection.
</p>
</td>
</tr>
<tr>
<td>
<p><code>date</code></p>
</td>
<td>
<p>
The date of the document's collection.
</p>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -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 &mdash; 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).

View File

@@ -1,38 +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/)
## Where to get support
If you're looking for support for Jekyll, there are a lot of options:
* Read the [Jekyll Documentation](https://jekyllrb.com/docs/)
* 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 &mdash; 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.
**Reminder: Jekyll's issue tracker is not a support forum.**
## Ways to contribute
* [How to Contribute](/docs/contributing/)
* [How to file a bug](/docs/community/bug/)
* [Guide for maintaining Jekyll](/docs/maintaining/)
## Jekyllconf
[Watch videos](/jekyllconf/) from members of the Jekyll community speak about interesting use cases, tricks theyve learned or meta Jekyll topics.
## Jekyll on Twitter
The [official Jekyll Twitter account](https://twitter.com/jekyllrb).

View File

@@ -1,82 +0,0 @@
---
title: Code of Conduct
permalink: "/docs/conduct/"
note: This file is autogenerated. Edit /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)

View File

@@ -1,18 +0,0 @@
---
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 sites root directory, or can be specified as flags for the `jekyll`
executable in the terminal.
* [Configuration Options](/docs/configuration/options/)
* [Default Configuration](/docs/configuration/default/)
* [Front Matter Defaults](/docs/configuration/front-matter-defaults/)
* [Environments](/docs/configuration/environments/)
* [Markdown Options](/docs/configuration/markdown/)
* [Liquid Options](/docs/configuration/liquid/)
* [Webrick Options](/docs/configuration/webrick/)
* [Incremental Regeneration](/docs/configuration/incremental-regeneration/)

View File

@@ -1,88 +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.
```yaml
# Where things are
source : .
destination : ./_site
collections_dir : .
plugins_dir : _plugins
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
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
show_warnings : false
```

View File

@@ -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.
<div class="note info">
<p>
To switch part of your config settings depending on the environment, use the <a href="/docs/configuration/options/#build-command-options">build command option</a>, for example <code>--config _config.yml,_config_development.yml</code>. Settings in later files override settings in earlier files.
</p>
</div>

View File

@@ -1,152 +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">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/) 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/) 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.

View File

@@ -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.

View File

@@ -1,18 +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.
- `strict` --- Output an error message and stop the build.
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.

View File

@@ -1,130 +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
<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).
### 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.](https://github.com/vmg/redcarpet/blob/v3.2.2/README.markdown#and-its-like-really-simple-to-use)
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`
### 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
```

View File

@@ -1,419 +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>
<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="/docs/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>. 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.
</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="/docs/front-matter/" title="front matter">front matter</a>
variables.
</p>
</td>
<td class='align-center'>
<p>see <a href="/docs/configuration/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>&lt;destination&gt;</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>&lt;keep_files&gt;</code> configuration directive.
</p>
<p>
Do not use an important location for <code>&lt;destination&gt;</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>Live Reload</strong></p>
<p class="description">Reload a page automatically on the browser when its content is edited.</p>
</td>
<td class="align-center">
<p><code class="option">livereload: true</code></p>
<p><code class="flag">--livereload</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, stored or symlinked in the site source.</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, stored or symlinked in the site source.</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>

View File

@@ -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.

View File

@@ -1,60 +0,0 @@
---
title: "Buddy"
---
[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.
[buddy-homepage]: https://buddy.works
[docker-homepage]: https://www.docker.com/
[github-homepage]: https://github.com
[bitbucket-homepage]: https://bitbucket.org/
[gitlab-homepage]: https://gitlab.com
## 1. Getting started
1. Log in at [https://buddy.works][buddy-homepage] 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
## 2. How it works
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
- pipeline: "Build and Deploy Jekyll site"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "master"
actions:
- action: "Execute: jekyll build"
type: "BUILD"
docker_image_name: "jekyll/jekyll"
docker_image_tag: "latest"
execute_commands:
- "chown jekyll:jekyll $WORKING_DIR"
- "jekyll build"
```
## 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].
[bw-linux]: https://buddy.works/knowledge/standalone/installation-linux
[bw-mac]: https://buddy.works/knowledge/standalone/installation-mac-osx
[bw-aws-ec2]: https://buddy.works/knowledge/standalone/installation-amazon-ec2
[bw-digitalocean]: https://buddy.works/knowledge/standalone/installation-digitalocean
[bw-azure]: https://buddy.works/knowledge/standalone/installation-azure
## 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.
[jekyll-docs-ci-buddy]: 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/

View File

@@ -1,161 +0,0 @@
---
title: "CircleCI"
---
Building, testing, and deploying your Jekyll-generated website can quickly be done with [CircleCI][0], a continuous integration & delivery tool. CircleCI supports [GitHub][1] and [Bitbucket][2], and you can get started for free using an open-source or private repository.
[0]: https://circleci.com/
[1]: https://github.com/
[2]: https://bitbucket.org/
## 1. Follow Your Project on CircleCI
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. 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.
[3]: https://circleci.com/docs/configuration/
## 2. Dependencies
The easiest way to manage dependencies for a Jekyll project (with or without CircleCI) is via a [Gemfile][4]. You'd want to have Jekyll, any Jekyll plugins, [HTML Proofer](#html-proofer), and any other gems that you are using in the `Gemfile`. Don't forget to version `Gemfile.lock` as well. Here's an example `Gemfile`:
[4]: http://bundler.io/gemfile.html
```ruby
source 'https://rubygems.org'
ruby '2.4.0'
gem 'jekyll'
gem 'html-proofer'
```
CircleCI detects when `Gemfile` is present and 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.
```yaml
dependencies:
post:
- bundle exec jekyll build
```
### HTML Proofer
With your site built, it's useful to run tests to check for valid HTML, broken links, etc. There's a few tools out there but [HTML Proofer][5] is popular amongst Jekyll users. We'll run it in the `test` phase with a few preferred flags. Check out the `html-proofer` [README][6] for all available flags, or run `htmlproofer --help` locally.
[5]: https://github.com/gjtorikian/html-proofer
[6]: https://github.com/gjtorikian/html-proofer/blob/master/README.md#configuration
```yaml
test:
post:
- bundle exec htmlproofer ./_site --check-html --disable-external
```
## Complete Example circle.yml File
When you put it all together, here's an example of what that `circle.yml` file could look like in v1:
```yaml
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
```
for CircleCI v2, a Docker-based system which new projects will follow, set the `S3_BUCKET_NAME` environment variable (an example of the required config file is shown below).
```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
```
## Questions?
This entire guide is open-source. Go ahead and [edit it][7] if you have a fix or [ask for help][8] if you run into trouble and need some help. CircleCI also has an [online community][9] for help.
[7]: https://github.com/jekyll/jekyll/edit/master/docs/_docs/continuous-integration/circleci.md
[8]: https://jekyllrb.com/help/
[9]: https://discuss.circleci.com

View File

@@ -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/)
* [Automated](/docs/deployment/automated/)
* [Third Party](/docs/deployment/third-party/)

View File

@@ -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:
* [Travis CI](/docs/continuous-integration/travis-ci/)
* [CircleCI](/docs/continuous-integration/circleci/)
* [Buddy](/docs/continuous-integration/buddyworks/)
## 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
GIT_REPO=$HOME/myrepo.git
TMP_GIT_CLONE=$HOME/tmp/myrepo
GEMFILE=$TMP_GIT_CLONE/Gemfile
PUBLIC_WWW=/var/www/myrepo
git clone $GIT_REPO $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
```

View File

@@ -1,37 +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).

View File

@@ -1,45 +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/@FizzyInTheHall/build-and-publish-a-jekyll-powered-blog-easily-with-aws-amplify-529852042ab6) to deploy and host your Jekyll site on AWS Amplify.
## 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 youre 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/).
## 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 the most robust toolset available 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/2015/10/28/a-step-by-step-guide-jekyll-3.0-on-netlify/) to setup your Jekyll site on Netlify.
## 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).

View File

@@ -1,140 +0,0 @@
---
title: GitHub Pages
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.
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/">GitHubs Pages Help section</a>.
If all else fails, you should contact <a href="https://github.com/contact">GitHub Support</a>.
</p>
</div>
### 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/):
{% 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 }}")
```
{% 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
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/).
The way to deploy these two types of sites are nearly identical, except for a
few minor details.
### User and Organization Pages
User and organization pages live in a special GitHub repository dedicated to
only the GitHub Pages files. This repository must be named after the account
name. For example, [@mojombos user page repository](https://github.com/mojombo/mojombo.github.io) has the name
`mojombo.github.io`.
Content from the `master` branch of your repository will be used to build and
publish the GitHub Pages site, so make sure your Jekyll site is stored there.
<div class="note info">
<h5>Custom domains do not affect repository names</h5>
<p>
GitHub Pages are initially configured to live under the
<code>username.github.io</code> subdomain, which is why repositories must
be named this way <strong>even if a custom domain is being used</strong>.
</p>
</div>
### Project Pages
Unlike user and organization Pages, Project Pages are kept in the same
repository as the project they are for, except that the website content is
stored in a specially named `gh-pages` branch or in a `docs` folder on the
`master` branch. The content will be rendered using Jekyll, and the output
will become available under a subpath of your user pages subdomain, such as
`username.github.io/project` (unless a custom domain is specified).
The Jekyll project repository itself is a perfect example of this branch
structure—the [master branch]({{ site.repository }}) contains the
actual software project for Jekyll, and the Jekyll website that youre
looking at right now is contained in the [docs
folder]({{ site.repository }}/tree/master/docs) of the same repository.
Please refer to GitHub official documentation on
[user, organization and project pages](https://help.github.com/articles/user-organization-and-project-pages/)
to see more detailed examples.
<div class="note warning">
<h5>Source files must be in the root directory</h5>
<p>
GitHub Pages <a href="https://help.github.com/articles/troubleshooting-github-pages-build-failures#source-setting">overrides</a>
the <a href="/docs/configuration/options/">“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>
<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/">Windows-specific docs page</a>.
</p>
</div>

View File

@@ -1,156 +0,0 @@
---
title: Includes
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 %}
```
{% 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.
### Including files relative to another file
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 %}
```
{% 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,
if `_posts/2014-09-03-my-file.markdown` uses the `include_relative` tag, the included file
must be within the `_posts` directory or one of its subdirectories.
Note that you cannot use the `../` syntax to specify an include location that refers to a higher-level directory.
All the other capabilities of the `include` tag are available to the `include_relative` tag,
such as variables.
### Using variables names for the include file
The name of the file you want to embed can be specified as a variable instead of an actual file name. For example, suppose you defined a variable in your page's front matter like this:
```yaml
---
title: My page
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 %}
```
{% endraw %}
In this example, the include would insert the file `footer_company_a.html` from the `_includes/footer_company_a.html` directory.
### Passing parameters to includes
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">
<i class="fa fa-info-circle"></i> <b>Note:</b>
{{ include.content }}
</div>
```
{% 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:
{% raw %}
```liquid
{% include note.html content="This is my sample note." %}
```
{% endraw %}
The value of `content` (which is `This is my sample note`) will be inserted into the {% raw %}`{{ include.content }}`{% endraw %} parameter.
Passing parameters to includes is especially helpful when you want to hide away complex formatting from your Markdown content.
For example, suppose you have a special image syntax with complex formatting, and you don't want your authors to remember the complex formatting. As a result, you decide to simplify the formatting by using an include with parameters. Here's an example of the special image syntax you might want to populate with an include:
```html
<figure>
<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>
<a href="{{ include.url }}">
<img src="{{ include.file }}" style="max-width: {{ include.max-width }};"
alt="{{ include.alt }}"/>
</a>
<figcaption>{{ include.caption }}</figcaption>
</figure>
```
{% endraw %}
This include contains 5 parameters:
* `url`
* `max-width`
* `file`
* `alt`
* `caption`
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"
max-width="200px" file="logo.png" alt="Jekyll logo"
caption="This is the Jekyll logo." %}
```
{% 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/).
Overall, you can create includes that act as templates for a variety of uses &mdash; 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.)
### Passing parameter variables to includes
Suppose the parameter you want to pass to the include is a variable rather than a string. For example, you might be using {% raw %}`{{ site.product_name }}`{% endraw %} to refer to every instance of your product rather than the actual hard-coded name. (In this case, your `_config.yml` file would have a key called `product_name` with a value of your product's name.)
The string you pass to your include parameter can't contain curly braces. For example, you can't pass a parameter that contains this: {% raw %}`"The latest version of {{ site.product_name }} is now available."`{% endraw %}
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 %}
```
{% 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 %}
```
{% endraw %}

View File

@@ -1,38 +0,0 @@
---
title: Quickstart
permalink: /docs/
redirect_from:
- /docs/home/
- /docs/quickstart/
- /docs/extras/
---
Jekyll is a simple, extendable, static site generator. You give it text written
in your favorite markup language and it churns through layouts to create a
static website. Throughout that process you can tweak how you want the site URLs
to look, what data gets displayed in the layout, and more.
## Instructions
1. Install a full [Ruby development environment](/docs/installation/)
2. Install Jekyll and [bundler](/docs/ruby-101/#bundler) [gems](/docs/ruby-101/#gems)
```
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. Now browse to [http://localhost:4000](http://localhost:4000){:target="_blank"}
If you encounter any unexpected errors during the above, please refer to the
[troubleshooting](/docs/troubleshooting/#configuration-problems) page or the
already-mentioned [requirements](/docs/installation/#requirements) page, as
you might be missing development headers or other prerequisites.

View File

@@ -1,22 +0,0 @@
---
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) that can be installed on most systems.
## Requirements
* [Ruby](https://www.ruby-lang.org/en/downloads/) version {{ site.min_ruby_version }} or above, including all development headers (ruby version can be checked by running `ruby -v`)
* [RubyGems](https://rubygems.org/pages/download) (which you can check by running `gem -v`)
* [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`,`g++ -v` and `make -v` in your system's command line interface)
## Guides
For detailed install instructions have a look at the guide for your operating system.
* [macOS](/docs/installation/macos/)
* [Ubuntu Linux](/docs/installation/ubuntu/)
* [Other Linux distros](/docs/installation/other-linux)
* [Windows](/docs/installation/windows/)

View File

@@ -1,135 +0,0 @@
---
title: Jekyll on macOS
permalink: /docs/installation/macos/
---
## Install Command Line Tools
First, you need to install the command-line tools to be able to compile native extensions, open a terminal and run:
```sh
xcode-select --install
```
## Install Ruby
Jekyll requires Ruby > {{ site.min_ruby_version }}.
As macOS Mojave 10.14 comes only with ruby 2.3.x, 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
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ruby
```
Don't forget to add the brew ruby path to your shell config :
```
export PATH=/usr/local/opt/ruby/bin:$PATH
```
Then relaunch your terminal and check your updated Ruby setup:
```sh
which ruby
# /usr/local/opt/ruby/bin/ruby
ruby -v
# ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-darwin18]
```
Yay, we are now running current stable 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
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install rbenv and ruby-build
brew install rbenv
# Setup rbenv integration to your shell
rbenv init
# Check your install
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
```
Restart your terminal for changes to take effect.
Now you can install the Ruby version of our choice, let's go with current latest stable Ruby:
```sh
rbenv install 2.6.2
rbenv global 2.6.2
ruby -v
# ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-darwin18]
```
That's it! Head over [rbenv command references](https://github.com/rbenv/rbenv#command-reference) to learn how to use different versions of Ruby in your projects.
## Install Jekyll
Now all that is left is installing [Bundler](/docs/ruby-101/#bundler) and Jekyll.
### Local Install
```sh
gem install --user-install bundler jekyll
```
and then get your Ruby version using
```sh
ruby -v
# ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin18]
```
Then append your path file with the following, replacing the `X.X` with the first two digits of your Ruby version.
```
export PATH=$HOME/.gem/ruby/X.X.0/bin:$PATH
```
To check your that you gem paths point to your home directory run:
```sh
gem env
```
And check that `GEM PATHS:` points to a path in your home directory
{: .note }
Every time you update Ruby to a version with a different first two digits, you will need to update your path to match.
### Global Install
{: .note .warning}
We strongly recommend against installing Ruby gems globally to avoid file permissions problems and using `sudo`.
#### On Mojave (10.14)
Because of SIP Protections in Mojave, you must run:
```sh
sudo gem install bundler
sudo gem install -n /usr/local/bin/ jekyll
```
#### Before Mojave (<10.14)
You only have to run:
```sh
sudo gem install bundler jekyll
```
## Problems?
Check out the [troubleshooting](/docs/troubleshooting/) page or [ask for help on our forum](https://talk.jekyllrb.com).

View File

@@ -1,19 +0,0 @@
---
title: Jekyll on Linux
permalink: /docs/installation/other-linux/
---
Installation on other Linux distributions works similarly as on [Ubuntu](../ubuntu/).
On Fedora, the dependencies can be installed as follows:
```sh
sudo dnf install ruby ruby-devel @development-tools
```
On Debian:
```sh
sudo apt-get install ruby-full build-essential
```
The rest works the same as on [Ubuntu](../ubuntu/).

View File

@@ -1,30 +0,0 @@
---
title: Jekyll on Ubuntu
permalink: /docs/installation/ubuntu/
---
Before we install Jekyll, we need to make sure we have all the required
dependencies.
```sh
sudo apt-get install ruby-full build-essential zlib1g-dev
```
It is best to avoid installing Ruby Gems as the root user. Therefore, we need to
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. Run them now:
```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:
```sh
gem install jekyll bundler
```
That's it! You're ready to start using Jekyll.

View File

@@ -1,149 +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. This page aims to
collect some of the general knowledge and lessons that have been unearthed by Windows users.
## Installing Jekyll
### Installation via RubyInstaller
The easiest way to run 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 via: `gem install jekyll bundler`
4. Check if Jekyll installed properly: `jekyll -v`
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:* You must have [Windows Subsystem for Linux](https://msdn.microsoft.com/en-us/commandline/wsl/about) enabled.
First let's make sure all our packages / repositories are up to date. Open a new Command Prompt instance, and type the following:
```sh
bash
```
Your Command Prompt instance should now be a Bash instance. Now we must update our repo lists and packages.
```sh
sudo apt-get update -y && sudo apt-get upgrade -y
```
Now we can install Ruby. To do this we will 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 let's update our Ruby gems:
```sh
gem update
```
Now all that is left to do is install Jekyll.
```sh
gem install jekyll bundler
```
(*Note: no `sudo` here.*)
Check if Jekyll installed properly by running:
```sh
jekyll -v
```
**And that's it!**
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">Troubleshooting</a>.</p>
</div>
**Note:** 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 or very, very bad things will happen to
Jekyll. 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. It can be done with the following
command:
```sh
chcp 65001
```
## Time-Zone Management
Since Windows doesn't have a native source of zoneinfo data, the Ruby Interpreter would not understand IANA Timezones and hence
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 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) 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>
<code>v2.0</code> 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 <code>v1.2</code> 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.

View File

@@ -1,145 +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 %}
```
<!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>
&copy; 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.
```
---
title: My First Page
layout: default
---
This is the content of my page
```
The rendered output of this page is:
```
<!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>
&copy; 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 %}
```
---
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 %}
```
---
city: San Francisco
---
<p>{{ layout.city }}</p>
{{ content }}
```
{% endraw %}

View File

@@ -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/)
* [Tags](/docs/liquid/tags/)

View File

@@ -1,128 +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 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.0" -%}
You can use the `where` filter to detect documents and pages with properties that are `nil` or `""`. For example,
```liquid
// Using `nil` to select posts that either do not have `my_prop` defined or `my_prop` has been set to `nil` explicitly.
{% raw %}{% assign filtered_posts = site.posts | where: 'my_prop', nil %}{% endraw %}
```
```liquid
// Using Liquid's special literal `empty` or `blank` to select posts that have `my_prop` set to an empty value.
{% raw %}{% assign filtered_posts = site.posts | where: 'my_prop', empty %}{% 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 %}

View File

@@ -1,160 +0,0 @@
---
title: Tags Filters
permalink: "/docs/liquid/tags/"
---
All of the standard Liquid
[tags](https://shopify.github.io/liquid/tags/control-flow/) are supported.
Jekyll has a few built in tags to help you build your site. You can also create
your own tags using [plugins](/docs/plugins/).
## Includes
If you have page snippets that you use repeatedly across your site, an
[include](/docs/includes/) is the perfect way to make this more maintainable.
## Code snippet highlighting
Jekyll has built in support for syntax highlighting of over 100 languages
thanks to [Rouge](http://rouge.jneen.net). Rouge is the default highlighter
in Jekyll 3 and above. To use it in Jekyll 2, set `highlighter` to `rouge`
and ensure the `rouge` gem is installed properly.
Alternatively, you can use [Pygments](http://pygments.org) to highlight your
code snippets in Jekyll 3.x and below. To use Pygments, you must have Python
installed on your system, have the `pygments.rb` gem installed and set
`highlighter` to `pygments` in your site's configuration file. Pygments
supports [over 100 languages](http://pygments.org/languages/)
<div class="note info">
<p>Using Pygments has been deprecated and will not be officially supported in
Jekyll 4, meaning that the configuration setting <code>highlighter: pygments</code>
will automatically fall back to using <em>Rouge</em> which is written in Ruby
and 100% compatible with stylesheets for Pygments.</p>
</div>
To render a code block with syntax highlighting, surround your code as follows:
{% raw %}
```liquid
{% highlight ruby %}
def foo
puts 'foo'
end
{% endhighlight %}
```
{% endraw %}
The argument to the `highlight` tag (`ruby` in the example above) is the
language identifier. To find the appropriate identifier to use for the language
you want to highlight, look for the “short name” on the [Rouge
wiki](https://github.com/jayferd/rouge/wiki/List-of-supported-languages-and-lexers)
or the [Pygments' Lexers page](http://pygments.org/docs/lexers/).
<div class="note info">
<h5>Jekyll processes all Liquid filters in code blocks</h5>
<p>If you are using a language that contains curly braces, you
will likely need to place <code>{&#37; raw &#37;}</code> and
<code>{&#37; endraw &#37;}</code> tags around your code.</p>
</div>
### Line numbers
There is a second argument to `highlight` called `linenos` that is optional.
Including the `linenos` argument will force the highlighted code to include line
numbers. For instance, the following code block would include line numbers next
to each line:
{% raw %}
```liquid
{% highlight ruby linenos %}
def foo
puts 'foo'
end
{% endhighlight %}
```
{% endraw %}
### Stylesheets for syntax highlighting
In order for the highlighting to show up, youll need to include a highlighting
stylesheet. For Pygments or Rouge you can use a stylesheet for Pygments, you
can find an example gallery
[here](https://jwarby.github.io/jekyll-pygments-themes/languages/ruby.html)
or from [its repository](https://github.com/jwarby/jekyll-pygments-themes).
Copy the CSS file (`native.css` for example) into your css directory and import
the syntax highlighter styles into your `main.css`:
```css
@import "native.css";
```
## Links
### Linking to pages {#link}
To link to a post, a page, collection item, or file, the `link` tag will generate the correct permalink URL for the path you specify. For example, if you use the `link` tag to link to `mypage.html`, even if you change your permalink style to include the file extension or omit it, the URL formed by the `link` tag will always be valid.
You must include the file's original extension when using the `link` tag. Here are some examples:
{% raw %}
```liquid
{% link _collection/name-of-document.md %}
{% link _posts/2016-07-26-name-of-post.md %}
{% link news/index.html %}
{% link /assets/files/doc.pdf %}
```
{% endraw %}
You can also use the `link` tag to create a link in Markdown as follows:
{% raw %}
```liquid
[Link to a document]({% link _collection/name-of-document.md %})
[Link to a post]({% link _posts/2016-07-26-name-of-post.md %})
[Link to a page]({% link news/index.html %})
[Link to a file]({% link /assets/files/doc.pdf %})
```
{% endraw %}
{: .note }
Since {% include docs_version_badge.html version="v4.0"%} you don't need to prepend `link` tags with `site.baseurl`
The path to the post, page, or collection is defined as the path relative to the root directory (where your config file is) to the file, not the path from your existing page to the other page.
For example, suppose you're creating a link in `page_a.md` (stored in `pages/folder1/folder2`) to `page_b.md` (stored in `pages/folder1`). Your path in the link would not be `../page_b.html`. Instead, it would be `/pages/folder1/page_b.md`.
If you're unsure of the path, add `{% raw %}{{ page.path }}{% endraw %}` to the page and it will display the path.
One major benefit of using the `link` or `post_url` tag is link validation. If the link doesn't exist, Jekyll won't build your site. This is a good thing, as it will alert you to a broken link so you can fix it (rather than allowing you to build and deploy a site with broken links).
Note you cannot add filters to `link` tags. For example, you cannot append a string using Liquid filters, such as `{% raw %}{% link mypage.html | append: "#section1" %} {% endraw %}`. To link to sections on a page, you will need to use regular HTML or Markdown linking techniques.
### Linking to posts
If you want to include a link to a post on your site, the `post_url` tag will generate the correct permalink URL for the post you specify.
{% raw %}
```liquid
{{ site.baseurl }}{% post_url 2010-07-21-name-of-post %}
```
{% endraw %}
If you organize your posts in subdirectories, you need to include subdirectory path to the post:
{% raw %}
```liquid
{{ site.baseurl }}{% post_url /subdir/2010-07-21-name-of-post %}
```
{% endraw %}
There is no need to include the file extension when using the `post_url` tag.
You can also use this tag to create a link to a post in Markdown as follows:
{% raw %}
```liquid
[Name of Link]({{ site.baseurl }}{% post_url 2010-07-21-name-of-post %})
```
{% endraw %}

View File

@@ -1,21 +0,0 @@
---
title: Maintaining Jekyll
permalink: /docs/maintaining/
---
**This guide is for Jekyll contributors and maintainers.** These special people contribute to one or more of Jekyll's repositories or help merge the contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
Hello! This is where we document various processes for maintaining Jekyll. Being a maintainer for any Jekyll project is a big responsibility, so we put together some helpful documentation for various tasks you might do as a maintainer.
- [Affinity teams & their captains](affinity-team-captain/)
- [Triaging an issue](triaging-an-issue/)
- [Reviewing a pull request](reviewing-a-pull-request/)
- [Merging a pull request](merging-a-pull-request/)
- [Avoiding burnout](avoiding-burnout/)
- [Special Labels](special-labels/)
- [Releasing a new version](releasing-a-new-version/)
Interested in becoming a maintainer? Here is some documentation for **contributors**:
- [Becoming a maintainer](becoming-a-maintainer/)

View File

@@ -1,89 +0,0 @@
---
title: "Releasing a new version"
---
**This guide is for maintainers.** These special people have **write access** to one or more of Jekyll's repositories and help merge the contributions of others. You may find what is written here interesting, but its definitely not for everyone.
{: .note .info }
The most important thing to understand before making a release is that there's no need to feel nervous. Most things are revertable, and even if you do publish an incomplete gem version, we can always skip that one. Don't hestitate to contact the other maintainers if you feel unsure or don't know what to do next.
### Bump the version
The only important place you need to manually bump the version is in `lib/jekyll/version.rb`. Adjust that, and everything else should work fine.
### Update the history document
Replace the first header of the history document with a version milestone. This looks like the following:
```diff
-## HEAD
+## 3.7.1 / 2018-01-25
```
Adjust the version number and the date. The `## HEAD` heading will be regenerated next time a pull request is merged.
Once you've done this, update the website by running the following command:
```sh
bundle exec rake site:generate
```
This updates the website's changelog, and pushes the versions in various other places.
It's recommended that you go over the `History.markdown` file manually one more time, in case there are any spelling errors or such. Feel free to fix those manually, and after you're done generating the website changelog, commit your changes.
## Write a release post
In case this isn't done already, you can generate a new release post using the included `rake` command:
```sh
bundle exec rake site:releases:new[3.8.0]
```
where `3.8.0` should be replaced with the new version. Then, write the post. Be sure to thank all of the collaborators and maintainers who have contributed since the last release. You can generate a log of their names using the following command:
```sh
git shortlog -sn master...v3.7.2
```
where, again `v3.7.2` is the last release. Be sure to open a pull request for your release post.
### Push the version
Before you do this step, make sure the following things are done:
- You have permission to push a new gem version to RubyGems
- You're logged into RubyGems on your command line
- A release post has been prepared, and is ideally already live
- All of the prior steps are done, committed, and pushed to `master`
Really the only thing left to do is to run this command:
```sh
bundle exec rake release
```
This will automatically build the new gem, make a release commit and tag and then push the new gem to RubyGems. Don't worry about creating a GitHub release, @jekyllbot should take care of that.
And then, you're done! :tada: Feel free to celebrate!
If you have access to the [@jekyllrb](https://twitter.com/jekyllrb) Twitter account, you should tweet the release post from there. If not, just ask another maintainer to do it or to give you access.
### Build the docs
We package our documentation as a :gem: Gem for offline use.
This is done with the
[**jekyll-docs**](https://github.com/jekyll/jekyll-docs#building) repository,
and more detailed instructions are provided there.
## For non-core gems
If you're not a maintainer for `jekyll/jekyll`, the procedure is much simpler in a lot of cases. Generally, the procedure still looks like this:
- Bump the gem version manually, usually in `lib/<plugin_name>/version.rb`
- Adjust the history file
- Run `bundle exec rake release` or `script/release`, depending on which of the two exists
- Rejoice
Be sure to ask your project's maintainers if you're unsure!

View File

@@ -1,6 +0,0 @@
---
title: Markdown 101
permalink: /docs/markdown-101/
---
# TO WRITE

View File

@@ -1,27 +0,0 @@
---
title: Pages
permalink: /docs/pages/
---
Pages are the most basic building block for content. They're useful for standalone
content (content which is not date based or is not a group of content such as staff
members or recipes).
The simplest way of adding a page is to add an HTML file in the root
directory with a suitable filename. You can also write a page in Markdown using
a `.md` extension which converts to HTML on build. For a site with
a homepage, an about page, and a contact page, heres what the root directory
and associated URLs might look like:
```sh
.
|-- about.md # => http://example.com/about.html
|-- index.html # => http://example.com/
└── contact.html # => http://example.com/contact.html
```
If you have a lot of pages, you can organize them into subfolders. The same subfolders that are used to group your pages in our project's source will exist in the `_site` folder when your site builds.
## Changing the output URL
You might want to have a particular folder structure for your source files that changes for the built site. With [permalinks](/docs/permalinks) you have full control of the output URL.

View File

@@ -1,402 +0,0 @@
---
title: Permalinks
permalink: /docs/permalinks/
---
Permalinks are the output path for your pages, posts, or collections. They
allow you to structure the directories of your source code different from the
directories in your output.
## Front Matter
The simplest way to set a permalink is using front matter. You set the
`permalink` variable in front matter to the output path you'd like.
For example, you might have a page on your site located at
`/my_pages/about-me.html` and you want the output url to be `/about/`. In
front matter of the page you would set:
```
---
permalink: /about/
---
```
## Global
Setting a permalink in front matter for every page on your site is no fun.
Luckily, Jekyll lets you set the permalink structure globally in your `_config.yml`.
To set a global permalink, you use the `permalink` variable in `_config.yml`.
You can use placeholders to your desired output. For example:
```yaml
permalink: /:categories/:year/:month/:day/:title:output_ext
```
Note that pages and collections don't have time or categories, these aspects of
the permalink style are ignored for the output.
For example, a permalink style of
`/:categories/:year/:month/:day/:title:output_ext` for posts becomes
`/:title.html` for pages and collections.
### Placeholders
Here's the full list of placeholders available:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>year</code></p>
</td>
<td>
<p>
Year from the posts filename with four digits.
May be overridden via the documents <code>date</code> front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>short_year</code></p>
</td>
<td>
<p>
Year from the posts filename without the century. (00..99)
May be overridden via the documents <code>date</code> front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>month</code></p>
</td>
<td>
<p>
Month from the posts filename. (01..12)
May be overridden via the documents <code>date</code> front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>i_month</code></p>
</td>
<td>
<p>
Month without leading zeros from the posts filename. May be
overridden via the documents <code>date</code> front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>short_month</code></p>
</td>
<td>
<p>Three-letter month abbreviation, e.g. “Jan”.</p>
</td>
</tr>
<tr>
<td>
<p><code>long_month</code></p>
<small>{% include docs_version_badge.html version="4.0.0" %}</small>
</td>
<td>
<p>Full month name, e.g. “January”.</p>
</td>
</tr>
<tr>
<td>
<p><code>day</code></p>
</td>
<td>
<p>
Day of the month from the posts filename. (01..31)
May be overridden via the documents <code>date</code> front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>i_day</code></p>
</td>
<td>
<p>
Day of the month without leading zeros from the posts filename.
May be overridden via the documents <code>date</code> front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>y_day</code></p>
</td>
<td>
<p>Ordinal day of the year from the posts filename, with leading zeros. (001..366)</p>
</td>
</tr>
<tr>
<td>
<p><code>w_year</code></p>
<small>{% include docs_version_badge.html version="4.0.0" %}</small>
</td>
<td>
<p>Week year which may differ from the month year for up to three days at the start of January and end of December</p>
</td>
</tr>
<tr>
<td>
<p><code>week</code></p>
<small>{% include docs_version_badge.html version="4.0.0" %}</small>
</td>
<td>
<p>Week number of the current year, starting with the first week having a majority of its days in January. (01..53)</p>
</td>
</tr>
<tr>
<td>
<p><code>w_day</code></p>
<small>{% include docs_version_badge.html version="4.0.0" %}</small>
</td>
<td>
<p>Day of the week, starting with Monday. (1..7)</p>
</td>
</tr>
<tr>
<td>
<p><code>short_day</code></p>
<small>{% include docs_version_badge.html version="4.0.0" %}</small>
</td>
<td>
<p>Three-letter weekday abbreviation, e.g. “Sun”.</p>
</td>
</tr>
<tr>
<td>
<p><code>long_day</code></p>
<small>{% include docs_version_badge.html version="4.0.0" %}</small>
</td>
<td>
<p>Weekday name, e.g. “Sunday”.</p>
</td>
</tr>
<tr>
<td>
<p><code>hour</code></p>
</td>
<td>
<p>
Hour of the day, 24-hour clock, zero-padded from the posts
<code>date</code> front matter. (00..23)
</p>
</td>
</tr>
<tr>
<td>
<p><code>minute</code></p>
</td>
<td>
<p>
Minute of the hour from the posts <code>date</code> front matter. (00..59)
</p>
</td>
</tr>
<tr>
<td>
<p><code>second</code></p>
</td>
<td>
<p>
Second of the minute from the posts <code>date</code> front matter. (00..59)
</p>
</td>
</tr>
<tr>
<td>
<p><code>title</code></p>
</td>
<td>
<p>
Title from the documents filename. May be overridden via
the documents <code>slug</code> front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>slug</code></p>
</td>
<td>
<p>
Slugified title from the documents filename (any character
except numbers and letters is replaced as hyphen). May be
overridden via the documents <code>slug</code> front matter.
</p>
</td>
</tr>
<tr>
<td>
<p><code>categories</code></p>
</td>
<td>
<p>
The specified categories for this post. If a post has multiple
categories, Jekyll will create a hierarchy (e.g. <code>/category1/category2</code>).
Also Jekyll automatically parses out double slashes in the URLs,
so if no categories are present, it will ignore this.
</p>
</td>
</tr>
</tbody>
</table>
</div>
### Built-in formats
For posts, Jekyll also provides the following built-in styles for convenience:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Permalink Style</th>
<th>URL Template</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>date</code></p>
</td>
<td>
<p><code>/:categories/:year/:month/:day/:title:output_ext</code></p>
</td>
</tr>
<tr>
<td>
<p><code>pretty</code></p>
</td>
<td>
<p><code>/:categories/:year/:month/:day/:title/</code></p>
</td>
</tr>
<tr>
<td>
<p><code>ordinal</code></p>
</td>
<td>
<p><code>/:categories/:year/:y_day/:title:output_ext</code></p>
</td>
</tr>
<tr>
<td>
<p><code>weekdate</code></p>
<small>{% include docs_version_badge.html version="4.0.0" %}</small>
</td>
<td>
<p><code>/:categories/:year/W:week/:short_day/:title:output_ext</code></p>
</td>
</tr>
<tr>
<td>
<p><code>none</code></p>
</td>
<td>
<p><code>/:categories/:title:output_ext</code></p>
</td>
</tr>
</tbody>
</table>
</div>
Rather than typing `permalink: /:categories/:year/:month/:day/:title/`, you can just type `permalink: pretty`.
<div class="note info">
<h5>Specifying permalinks through the front matter</h5>
<p>Built-in permalink styles are not recognized in front matter. As a result, <code>permalink: pretty</code> will not work.</p>
</div>
### Collections
For collections, you have the option to override the global permalink in the
collection configuration in `_config.yml`:
```yaml
collections:
my_collection:
output: true
permalink: /:collection/:name
```
Collections have the following placeholders available:
<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 <code>:title</code> template variable will take the
<code>slug</code> <a href="/docs/front-matter/">front matter</a>
variable value if any is present in the document; if none is
defined then <code>:title</code> will be equivalent to
<code>:name</code>, aka the slug generated from the filename.
</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>

View File

@@ -1,17 +0,0 @@
---
title: Plugins
permalink: /docs/plugins/
---
Jekyll has a plugin system with hooks that allow you to create custom generated
content specific to your site. You can run custom code for your site without
having to modify the Jekyll source itself.
* [Installation](/docs/plugins/installation/) - How to install plugins
* [Your first plugin](/docs/plugins/your-first-plugin/) - How to write plugins
* [Generators](/docs/plugins/generators/) - Create additional content on your site
* [Converters](/docs/plugins/converters/) - Change a markup language into another format
* [Commands](/docs/plugins/commands/) - Extend the `jekyll` executable with subcommands
* [Tags](/docs/plugins/tags) - Create custom Liquid tags
* [Filters](/docs/plugins/filters/) - Create custom Liquid filters
* [Hooks](/docs/plugins/hooks/) - Fine-grained control to extend the build process

View File

@@ -1,62 +0,0 @@
---
title: Commands
permalink: /docs/plugins/commands/
---
As of version 2.5.0, Jekyll can be extended with plugins which provide
subcommands for the `jekyll` executable. This is possible by including the
relevant plugins in a `Gemfile` group called `:jekyll_plugins`:
```ruby
group :jekyll_plugins do
gem "my_fancy_jekyll_plugin"
end
```
Each `Command` must be a subclass of the `Jekyll::Command` class and must
contain one class method: `init_with_program`. An example:
```ruby
class MyNewCommand < Jekyll::Command
class << self
def init_with_program(prog)
prog.command(:new) do |c|
c.syntax "new [options]"
c.description 'Create a new Jekyll site.'
c.option 'dest', '-d DEST', 'Where the site should go.'
c.action do |args, options|
Jekyll::Site.new_site_at(options['dest'])
end
end
end
end
end
```
Commands should implement this single class method:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>init_with_program</code></p>
</td>
<td><p>
This method accepts one parameter, the
<code><a href="https://github.com/jekyll/mercenary#readme">Mercenary::Program</a></code>
instance, which is the Jekyll program itself. Upon the program,
commands may be created using the above syntax. For more details,
visit the Mercenary repository on GitHub.com.
</p></td>
</tr>
</tbody>
</table>
</div>

View File

@@ -1,91 +0,0 @@
---
title: Converters
permalink: /docs/plugins/converters/
---
If you have a new markup language youd like to use with your site, you can
include it by implementing your own converter. Both the Markdown and
[Textile](https://github.com/jekyll/jekyll-textile-converter) markup
languages are implemented using this method.
<div class="note info">
<h5>Remember your Front Matter</h5>
<p>
Jekyll will only convert files that have a YAML header at the top, even for
converters you add using a plugin.
</p>
</div>
Below is a converter that will take all posts ending in `.upcase` and process
them using the `UpcaseConverter`:
```ruby
module Jekyll
class UpcaseConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /^\.upcase$/i
end
def output_ext(ext)
".html"
end
def convert(content)
content.upcase
end
end
end
```
Converters should implement at a minimum 3 methods:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>matches</code></p>
</td>
<td><p>
Does the given extension match this converters list of acceptable
extensions? Takes one argument: the files extension (including the
dot). Must return <code>true</code> if it matches, <code>false</code>
otherwise.
</p></td>
</tr>
<tr>
<td>
<p><code>output_ext</code></p>
</td>
<td><p>
The extension to be given to the output file (including the dot).
Usually this will be <code>".html"</code>.
</p></td>
</tr>
<tr>
<td>
<p><code>convert</code></p>
</td>
<td><p>
Logic to do the content conversion. Takes one argument: the raw content
of the file (without front matter). Must return a String.
</p></td>
</tr>
</tbody>
</table>
</div>
In our example, `UpcaseConverter#matches` checks if our filename extension is
`.upcase`, and will render using the converter if it is. It will call
`UpcaseConverter#convert` to process the content. In our simple converter were
simply uppercasing the entire content string. Finally, when it saves the page,
it will do so with a `.html` extension.

View File

@@ -1,30 +0,0 @@
---
title: Filters
permalink: /docs/plugins/filters/
---
Filters are modules that export their methods to liquid.
All methods will have to take at least one parameter which represents the input
of the filter. The return value will be the output of the filter.
```ruby
module Jekyll
module AssetFilter
def asset_url(input)
"http://www.example.com/#{input}?#{Time.now.to_i}"
end
end
end
Liquid::Template.register_filter(Jekyll::AssetFilter)
```
<div class="note">
<h5>ProTip™: Access the site object using Liquid</h5>
<p>
Jekyll lets you access the <code>site</code> object through the
<code>context.registers</code> feature of Liquid at <code>context.registers[:site]</code>. For example, you can
access the global configuration file <code>_config.yml</code> using
<code>context.registers[:site].config</code>.
</p>
</div>

View File

@@ -1,104 +0,0 @@
---
title: Generators
permalink: /docs/plugins/generators/
---
You can create a generator when you need Jekyll to create additional content
based on your own rules.
A generator is a subclass of `Jekyll::Generator` that defines a `generate`
method, which receives an instance of
[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb). The
return value of `generate` is ignored.
Generators run after Jekyll has made an inventory of the existing content, and
before the site is generated. Pages with front matter are stored as
instances of
[`Jekyll::Page`]({{ site.repository }}/blob/master/lib/jekyll/page.rb)
and are available via `site.pages`. Static files become instances of
[`Jekyll::StaticFile`]({{ site.repository }}/blob/master/lib/jekyll/static_file.rb)
and are available via `site.static_files`. See
[the Variables documentation page](/docs/variables/) and
[`Jekyll::Site`]({{ site.repository }}/blob/master/lib/jekyll/site.rb)
for more details.
For instance, a generator can inject values computed at build time for template
variables. In the following example the template `reading.html` has two
variables `ongoing` and `done` that we fill in the generator:
```ruby
module Reading
class Generator < Jekyll::Generator
def generate(site)
ongoing, done = Book.all.partition(&:ongoing?)
reading = site.pages.detect {|page| page.name == 'reading.html'}
reading.data['ongoing'] = ongoing
reading.data['done'] = done
end
end
end
```
This is a more complex generator that generates new pages:
```ruby
module Jekyll
class CategoryPageGenerator < Generator
safe true
def generate(site)
if site.layouts.key? 'category_index'
dir = site.config['category_dir'] || 'categories'
site.categories.each_key do |category|
site.pages << CategoryPage.new(site, site.source, File.join(dir, category), category)
end
end
end
end
# A Page subclass used in the `CategoryPageGenerator`
class CategoryPage < Page
def initialize(site, base, dir, category)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
self.data['category'] = category
category_title_prefix = site.config['category_title_prefix'] || 'Category: '
self.data['title'] = "#{category_title_prefix}#{category}"
end
end
end
```
In this example, our generator will create a series of files under the
`categories` directory for each category, listing the posts in each category
using the `category_index.html` layout.
Generators are only required to implement one method:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>generate</code></p>
</td>
<td>
<p>Generates content as a side-effect.</p>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -1,244 +0,0 @@
---
title: Hooks
permalink: /docs/plugins/hooks/
---
Using hooks, your plugin can exercise fine-grained control over various aspects
of the build process. If your plugin defines any hooks, Jekyll will call them
at pre-defined points.
Hooks are registered to a container and an event name. To register one, you
call Jekyll::Hooks.register, and pass the container, event name, and code to
call whenever the hook is triggered. For example, if you want to execute some
custom functionality every time Jekyll renders a post, you could register a
hook like this:
```ruby
Jekyll::Hooks.register :posts, :post_render do |post|
# code to call after Jekyll renders a post
end
```
Jekyll provides hooks for <code>:site</code>, <code>:pages</code>,
<code>:posts</code>, and <code>:documents</code>. In all cases, Jekyll calls
your hooks with the container object as the first callback parameter.
All `:pre_render` hooks and the`:site, :post_render` hook will also provide a
payload hash as a second parameter. In the case of `:pre_render`, the payload
gives you full control over the variables that are available while rendering.
In the case of `:site, :post_render`, the payload contains final values after
rendering all the site (useful for sitemaps, feeds, etc).
The complete list of available hooks is below:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Container</th>
<th>Event</th>
<th>Called</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:after_init</code></p>
</td>
<td>
<p>Just after the site initializes, but before setup & render. Good
for modifying the configuration of the site.</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:after_reset</code></p>
</td>
<td>
<p>Just after site reset</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_read</code></p>
</td>
<td>
<p>After site data has been read and loaded from disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering the whole site</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering the whole site, but before writing any files</p>
</td>
</tr>
<tr>
<td>
<p><code>:site</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing the whole site to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:post_init</code></p>
</td>
<td>
<p>Whenever a page is initialized</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering a page</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering a page, but before writing it to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:pages</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing a page to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:post_init</code></p>
</td>
<td>
<p>Whenever a post is initialized</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering a post</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering a post, but before writing it to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:posts</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing a post to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:post_init</code></p>
</td>
<td>
<p>Whenever a document is initialized</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:pre_render</code></p>
</td>
<td>
<p>Just before rendering a document</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:post_render</code></p>
</td>
<td>
<p>After rendering a document, but before writing it to disk</p>
</td>
</tr>
<tr>
<td>
<p><code>:documents</code></p>
</td>
<td>
<p><code>:post_write</code></p>
</td>
<td>
<p>After writing a document to disk</p>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -1,82 +0,0 @@
---
title: Plugins
permalink: /docs/plugins/installation/
---
You have 3 options for installing plugins:
1. In your site source root, make a `_plugins` directory. Place your plugins
here. Any file ending in `*.rb` inside this directory will be loaded before
Jekyll generates your site.
2. In your `_config.yml` file, add a new array with the key `plugins` (or `gems` for Jekyll < `3.5.0`) and the
values of the gem names of the plugins you'd like to use. An example:
```yaml
# This will require each of these plugins automatically.
plugins:
- jekyll-gist
- jekyll-coffeescript
- jekyll-assets
- another-jekyll-plugin
```
Then install your plugins using `gem install jekyll-gist jekyll-coffeescript jekyll-assets another-jekyll-plugin`
3. Add the relevant plugins to a Bundler group in your `Gemfile`. An
example:
```ruby
group :jekyll_plugins do
gem "jekyll-gist"
gem "jekyll-coffeescript"
gem "jekyll-assets"
gem "another-jekyll-plugin"
end
```
Now you need to install all plugins from your Bundler group by running single command `bundle install`.
<div class="note info">
<h5>Plugins on GitHub Pages</h5>
<p>
<a href="https://pages.github.com/">GitHub Pages</a> is powered by Jekyll.
All Pages sites are generated using the <code>--safe</code> option
to disable plugins (with the exception of some
<a href="https://pages.github.com/versions">whitelisted plugins</a>) for
security reasons. Unfortunately, this means
your plugins wont work if youre deploying to GitHub Pages.<br><br>
You can still use GitHub Pages to publish your site, but youll need to
convert the site locally and push the generated static files to your GitHub
repository instead of the Jekyll source files.
</p>
</div>
<div class="note info">
<h5>
<code>_plugins</code>, <code>_config.yml</code> and <code>Gemfile</code>
can be used simultaneously
</h5>
<p>
You may use any of the aforementioned plugin options simultaneously in the
same site if you so choose. Use of one does not restrict the use of the
others.
</p>
</div>
### The jekyll_plugins group
Jekyll gives this particular group of gems in your `Gemfile` a different
treatment. Any gem included in this group is loaded before Jekyll starts
processing the rest of your source directory.
A gem included here will be activated even if its not explicitly listed under
the `plugins:` key in your site's config file.
<div class="note warning">
<p>
Gems included in the <code>:jekyll-plugins</code> group are activated
regardless of the <code>--safe</code> mode setting. Be aware of what
gems are included under this group!
</p>
</div>

View File

@@ -1,115 +0,0 @@
---
title: Tags
permalink: /docs/plugins/tags/
---
If youd like to include custom liquid tags in your site, you can do so by
hooking into the tagging system. Built-in examples added by Jekyll include the
`highlight` and `include` tags. Below is an example of a custom liquid tag that
will output the time the page was rendered:
```ruby
module Jekyll
class RenderTimeTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
"#{@text} #{Time.now}"
end
end
end
Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)
```
At a minimum, liquid tags must implement:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>render</code></p>
</td>
<td>
<p>Outputs the content of the tag.</p>
</td>
</tr>
</tbody>
</table>
</div>
You must also register the custom tag with the Liquid template engine as
follows:
```ruby
Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)
```
In the example above, we can place the following tag anywhere in one of our
pages:
{% raw %}
```ruby
<p>{% render_time page rendered at: %}</p>
```
{% endraw %}
And we would get something like this on the page:
```html
<p>page rendered at: Tue June 22 23:38:47 0500 2010</p>
```
## Tag Blocks
The `render_time` tag seen above can also be rewritten as a tag block by
inheriting the `Liquid::Block` class. Look at the example below:
```ruby
module Jekyll
class RenderTimeTagBlock < Liquid::Block
def render(context)
text = super
"<p>#{text} #{Time.now}</p>"
end
end
end
Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTagBlock)
```
We can now use the tag block anywhere:
{% raw %}
```liquid
{% render_time %}
page rendered at:
{% endrender_time %}
```
{% endraw %}
And we would still get the same output as above on the page:
```html
<p>page rendered at: Tue June 22 23:38:47 0500 2010</p>
```
<div class="note info">
<p>In the above example, the tag block and the tag are both registered with
the name <code>render_time</code> but to register a tag and a tag block using
the same name in the same project is not recommended as this may lead to
conflicts.</p>
</div>

View File

@@ -1,137 +0,0 @@
---
title: Your first plugin
permalink: /docs/plugins/your-first-plugin/
---
Plugins allow you to extend Jekyll's behavior to fit your needs. There are six
types of plugins in Jekyll.
## Generators
[Generators](/docs/plugins/generators/) create content on your site.
For example:
* [jekyll-feed](https://github.com/jekyll/jekyll-feed) creates an Atom feed of
blog posts.
* [jekyll-archives](https://github.com/jekyll/jekyll-archives) creates archive
pages for blog categories and tags.
* [jekyll-sitemap](https://github.com/jekyll/jekyll-sitemap) creates a sitemap.
## Converters
[Converters](/docs/plugins/converters/) change a markup language into another
format. For example:
* [jekyll-textile-converter](https://github.com/jekyll/jekyll-textile-converter)
converts textile to HTML.
* [jekyll-coffeescript](https://github.com/jekyll/jekyll-coffeescript) converts
Coffeescript to JavaScript.
* [jekyll-opal](https://github.com/jekyll/jekyll-opal) converts Ruby to
JavaScript.
## Commands
[Commands](/docs/plugins/commands/) extend the `jekyll` executable with
subcommands. For example:
* [jekyll-compose](https://github.com/jekyll/jekyll-compose) adds subcommands
for creating a post, page or draft.
## Tags
[Tags](/docs/plugins/tags/) create custom Liquid tags. For example:
* [jekyll-youtube](https://github.com/dommmel/jekyll-youtube) embeds a YouTube
video.
* [jekyll-asset-path-plugin](https://github.com/samrayner/jekyll-asset-path-plugin)
outputs a relative URL for assets.
* [jekyll-swfobject](https://github.com/sectore/jekyll-swfobject) embeds a SWF
object.
## Filters
[Filters](/docs/plugins/filters/) create custom Liquid filters. For example:
* [jekyll-time-ago](https://github.com/markets/jekyll-timeago) - The distance
between two dates in words.
* [jekyll-toc](https://github.com/toshimaru/jekyll-toc) - Generates a table of
content.
* [jekyll-email-protect](https://github.com/vwochnik/jekyll-email-protect) -
Obfuscates emails to protect them from spam bots.
## Hooks
[Hooks](/docs/plugins/hooks/) give fine-grained control to extend the build
process.
## Flags
There are two flags to be aware of when writing a plugin:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Flag</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p><code>safe</code></p>
</td>
<td>
<p>
A boolean flag that informs Jekyll whether this plugin may be safely
executed in an environment where arbitrary code execution is not
allowed. This is used by GitHub Pages to determine which core plugins
may be used, and which are unsafe to run. If your plugin does not
allow for arbitrary code execution, set this to <code>true</code>.
GitHub Pages still wont load your plugin, but if you submit it for
inclusion in core, its best for this to be correct!
</p>
</td>
</tr>
<tr>
<td>
<p><code>priority</code></p>
</td>
<td>
<p>
This flag determines what order the plugin is loaded in. Valid values
are: <code>:lowest</code>, <code>:low</code>, <code>:normal</code>,
<code>:high</code>, and <code>:highest</code>. Highest priority
matches are applied first, lowest priority are applied last.
</p>
</td>
</tr>
</tbody>
</table>
</div>
To use one of the example plugins above as an illustration, here is how youd
specify these two flags:
```ruby
module Jekyll
class UpcaseConverter < Converter
safe true
priority :low
...
end
end
```
## Best Practices
The guides help you with the specifics of creating plugins. We also have some
recommended best practices to help structure your plugin.
We recommend using a [gem](/docs/ruby-101/#gems) for your plugin. This will
help you manage dependencies, keep separation from your site source code and
allow you to share functionality across multiple projects. For tips on creating
a gem take a look a the
[Ruby gems guide](https://guides.rubygems.org/make-your-own-gem/) or look
through the source code of an existing plugin such as
[jekyll-feed](https://github.com/jekyll/jekyll-feed).

View File

@@ -1,210 +0,0 @@
---
title: Posts
permalink: /docs/posts/
redirect_from:
- /docs/drafts/
---
Blogging is baked into Jekyll. You write blog posts as text files and Jekyll
provides everything you need to turn it into a blog.
## The Posts Folder
The `_posts` folder is where your blog posts live. You typically write posts
in [Markdown](https://daringfireball.net/projects/markdown/), HTML is
also supported.
## Creating Posts
To create a post, add a file to your `_posts` directory with the following
format:
```
YEAR-MONTH-DAY-title.MARKUP
```
Where `YEAR` is a four-digit number, `MONTH` and `DAY` are both two-digit
numbers, and `MARKUP` is the file extension representing the format used in the
file. For example, the following are examples of valid post filenames:
```
2011-12-31-new-years-eve-is-awesome.md
2012-09-12-how-to-write-a-blog.md
```
All blog post files must begin with [front matter](/docs/front-matter/) which is
typically used to set a [layout](/docs/layouts/) or other meta data. For a simple
example this can just be empty:
```markdown
---
layout: post
title: "Welcome to Jekyll!"
---
# Welcome
**Hello world**, this is my first Jekyll blog post.
I hope you like it!
```
<div class="note">
<h5>ProTip™: Link to other posts</h5>
<p>
Use the <a href="/docs/liquid/tags/#linking-to-posts"><code>post_url</code></a>
tag to link to other posts without having to worry about the URLs
breaking when the site permalink style changes.
</p>
</div>
<div class="note info">
<h5>Be aware of character sets</h5>
<p>
Content processors can modify certain characters to make them look nicer.
For example, the <code>smart</code> extension in Redcarpet converts standard,
ASCII quotation characters to curly, Unicode ones. In order for the browser
to display those characters properly, define the charset meta value by
including <code>&lt;meta charset=&quot;utf-8&quot;&gt;</code> in the
<code>&lt;head&gt;</code> of your layout.
</p>
</div>
## Including images and resources
At some point, you'll want to include images, downloads, or other
digital assets along with your text content. One common solution is to create
a folder in the root of the project directory called something like `assets`,
into which any images, files or other resources are placed. Then, from within
any post, they can be linked to using the sites root as the path for the asset
to include. The best way to do this depends on the way your sites (sub)domain
and path are configured, but here are some simple examples in Markdown:
Including an image asset in a post:
```markdown
... which is shown in the screenshot below:
![My helpful screenshot](/assets/screenshot.jpg)
```
Linking to a PDF for readers to download:
```markdown
... you can [get the PDF](/assets/mydoc.pdf) directly.
```
## Displaying an index of posts
Creating an index of posts on another page should be easy thanks to
[Liquid](https://docs.shopify.com/themes/liquid/basics) and its tags. Heres a
simple example of how to create a list of links to your blog posts:
{% raw %}
```html
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
```
{% endraw %}
You have full control over how (and where) you display your posts,
and how you structure your site. You should read more about [how templates
work](/docs/templates/) with Jekyll if you want to know more.
Note that the `post` variable only exists inside the `for` loop above. If
you wish to access the currently-rendering page/posts's variables (the
variables of the post/page that has the `for` loop in it), use the `page`
variable instead.
## Categories and Tags
Jekyll has first class support for categories and tags in blog posts. The difference
between categories and tags is a category can be part of the URL for a post
whereas a tag cannot.
To use these, first set your categories and tags in front matter:
```yaml
---
layout: post
title: A Trip
categories: [blog, travel]
tags: [hot, summer]
---
```
Jekyll makes the categories available to us at `site.categories`. Iterating over
`site.categories` on a page gives us another array with two items, the first
item is the name of the category and the second item is an array of posts in that
category.
{% raw %}
```liquid
{% for category in site.categories %}
<h3>{{ category[0] }}</h3>
<ul>
{% for post in category[1] %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endfor %}
```
{% endraw %}
For tags it's exactly the same except the variable is `site.tags`.
## Post excerpts
You can access a snippet of a posts's content by using `excerpt` variable on a
post. By default this is the first paragraph of content in the post, however it
can be customized by setting a `excerpt_separator` variable in front matter or
`_config.yml`.
```yaml
---
excerpt_separator: <!--more-->
---
Excerpt with multiple paragraphs
Here's another paragraph in the excerpt.
<!--more-->
Out-of-excerpt
```
Here's an example of outputting a list of blog posts with an excerpt:
{% raw %}
```liquid
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
{{ post.excerpt }}
</li>
{% endfor %}
</ul>
```
{% endraw %}
## Drafts
Drafts are posts without a date in the filename. 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 and create your first draft:
```text
|-- _drafts/
| |-- a-draft-post.md
```
To preview your site with drafts, 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.

View File

@@ -1,45 +0,0 @@
---
title: Ruby 101
permalink: /docs/ruby-101/
---
Jekyll is written in Ruby. If you're new to Ruby, this page is to help you get
up to speed with some of the terminology.
## Gems
A gem is code you can include in Ruby projects. It allows you to package up functionality and share it across other projects or with other people. Gems can perform functionality such as:
* Converting a Ruby object to JSON
* Pagination
* Interacting with APIs such as GitHub
* Jekyll itself is a gem as well as many Jekyll plugins including
[jekyll-feed](https://github.com/jekyll/jekyll-feed),
[jekyll-seo-tag](https://github.com/jekyll/jekyll-seo-tag) and
[jekyll-archives](https://github.com/jekyll/jekyll-archives).
## Gemfile
A `Gemfile` is a list of gems required for your site. For a simple Jekyll site it might look something like this:
```ruby
source 'https://rubygems.org'
gem 'jekyll'
group :jekyll_plugins do
gem 'jekyll-feed'
gem 'jekyll-seo-tag'
end
```
## Bundler
Bundler installs the gems in your `Gemfile`. It's not a requirement for you to use a `Gemfile` and `bundler` however it's highly recommended as it ensures you're running the same version of Jekyll and Jekyll plugins across different environments.
`gem install bundler` installs [Bundler](https://rubygems.org/gems/bundler). You only need to install it once &mdash; not every time you create a new Jekyll project. Here are some additional details:
If you're using a `Gemfile` you would first run `bundle install` to install the gems, then `bundle exec jekyll serve` to build your site. This guarantees you're using the gem versions set in the `Gemfile`. If you're not using a `Gemfile` you can just run `jekyll serve`.
For more information about how to use Bundler in your Jekyll project, this [tutorial](/tutorials/using-jekyll-with-bundler/) should provide answers to the most common questions and explain how to get up and running quickly.

View File

@@ -1,96 +0,0 @@
---
title: Static Files
permalink: /docs/static-files/
---
A static file is a file that does not contain any front matter. These
include images, PDFs, and other un-rendered content.
They're accessible in Liquid via `site.static_files` and contain the
following metadata:
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><p><code>file.path</code></p></td>
<td><p>
The relative path to the file, e.g. <code>/assets/img/image.jpg</code>
</p></td>
</tr>
<tr>
<td><p><code>file.modified_time</code></p></td>
<td><p>
The `Time` the file was last modified, e.g. <code>2016-04-01 16:35:26 +0200</code>
</p></td>
</tr>
<tr>
<td><p><code>file.name</code></p></td>
<td><p>
The string name of the file e.g. <code>image.jpg</code> for <code>image.jpg</code>
</p></td>
</tr>
<tr>
<td><p><code>file.basename</code></p></td>
<td><p>
The string basename of the file e.g. <code>image</code> for <code>image.jpg</code>
</p></td>
</tr>
<tr>
<td><p><code>file.extname</code></p></td>
<td><p>
The extension name for the file, e.g.
<code>.jpg</code> for <code>image.jpg</code>
</p></td>
</tr>
</tbody>
</table>
</div>
Note that in the above table, `file` can be anything. It's an arbitrarily set variable used in your own logic (such as in a for loop). It isn't a global site or page variable.
## Add front matter to static files
Although you can't directly add front matter values to static files, you can set front matter values through the [defaults property](/docs/configuration/front-matter-defaults/) in your configuration file. When Jekyll builds the site, it will use the front matter values you set.
Here's an example:
In your `_config.yml` file, add the following values to the `defaults` property:
```yaml
defaults:
- scope:
path: "assets/img"
values:
image: true
```
This assumes that your Jekyll site has a folder path of `assets/img` where you have images (static files) stored. When Jekyll builds the site, it will treat each image as if it had the front matter value of `image: true`.
Suppose you want to list all your image assets as contained in `assets/img`. You could use this for loop to look in the `static_files` object and get all static files that have this front matter property:
{% raw %}
```liquid
{% assign image_files = site.static_files | where: "image", true %}
{% for myimage in image_files %}
{{ myimage.path }}
{% endfor %}
```
{% endraw %}
When you build your site, the output will list the path to each file that meets this front matter condition.

View File

@@ -1,91 +0,0 @@
---
layout: step
title: Setup
menu_name: Step by Step Tutorial
position: 1
---
Welcome to Jekyll's step-by-step tutorial. The goal of this tutorial is to take
you from having some front end web development experience to building your
first Jekyll site from scratch — not relying on the default gem-based theme.
Let's get into it!
## Installation
Jekyll is a Ruby program so you need to install Ruby on your machine to begin
with. Head over to the [install guide](/docs/installation/) and follow the
instructions for your operating system.
With Ruby setup you can install Jekyll by running the following in your
terminal:
```
gem install jekyll bundler
```
To create a new `Gemfile` to list your project's dependencies run:
```
bundle init
```
Now edit the `Gemfile`and add jekyll as a dependency:
```
gem "jekyll"
```
Finally run `bundle` to install jekyll for your project.
You can now prefix all jekyll commands listed in this tutorial with `bundle exec`
to make sure you use the jekyll version defined in your `Gemfile`.
## Create a site
It's time to create a site! Create a new directory for your site, you can name
it whatever you'd like. Through the rest of this tutorial we'll refer to this
directory as “root”.
If you're feeling adventurous, you can also initialize a Git repository here.
One of the great things about Jekyll is there's no database. All content and
site structure are files which a Git repository can version. Using a repository
is completely optional but it's a great habit to get into. You can learn more
about using Git by reading through the
[Git Handbook](https://guides.github.com/introduction/git-handbook/).
Let's add your first file. Create `index.html` in the root with the following
content:
```html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Home</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
```
## Build
Jekyll is a static site generator so we need Jekyll to build the site
before we can view it. There are two commands you can run in the root of your site
to build it:
* `jekyll build` - Builds the site and outputs a static site to a directory
called `_site`.
* `jekyll serve` - Does the same thing except it rebuilds any time you make
a change and runs a local web server at `http://localhost:4000`.
When you're developing a site you'll use `jekyll serve` as it updates with any
changes you make.
Run `jekyll serve` and go to
<a href="http://localhost:4000" target="_blank" data-proofer-ignore>http://localhost:4000</a> in
your browser. You should see "Hello World!".
Well, you might be thinking what's the point in this? Jekyll just copied an
HTML file from one place to another. Well patience young grasshopper, there's
still much to learn!

View File

@@ -1,84 +0,0 @@
---
layout: step
title: Liquid
position: 2
---
Liquid is where Jekyll starts to get more interesting. Liquid is a templating
language which has three main parts: [objects](#objects), [tags](#tags) and
[filters](#filters).
## Objects
Objects tell Liquid where to output content. They're denoted by double curly
braces: {% raw %}`{{`{% endraw %} and {% raw %}`}}`{% endraw %}. For example:
{% raw %}
```liquid
{{ page.title }}
```
{% endraw %}
Outputs a variable called `page.title` on the page.
## Tags
Tags create the logic and control flow for templates. They are denoted by curly
braces and percent signs: {% raw %}`{%`{% endraw %} and
{% raw %}`%}`{% endraw %}. For example:
{% raw %}
```liquid
{% if page.show_sidebar %}
<div class="sidebar">
sidebar content
</div>
{% endif %}
```
{% endraw %}
Outputs the sidebar if `page.show_sidebar` is true. You can learn more about the
tags available to Jekyll [here](/docs/liquid/tags/).
## Filters
Filters change the output of a Liquid object. They are used within an output
and are separated by a `|`. For example:
{% raw %}
```liquid
{{ "hi" | capitalize }}
```
{% endraw %}
Outputs `Hi`. You can learn more about the filters available to Jekyll
[here](/docs/liquid/filters/).
## Use Liquid
Now it's your turn, change the Hello World! on your page to output as lowercase:
{% raw %}
```liquid
...
<h1>{{ "Hello World!" | downcase }}</h1>
...
```
{% endraw %}
To get our changes processed by Jekyll we need to add [front matter](03-front-matter/) to the top of the page:
```markdown
---
# front matter tells Jekyll to process Liquid
---
```
Our "Hello World!" will now be downcased on render.
It may not seem like it now, but much of Jekyll's power comes from combining
Liquid with other features.
In order to see the changes from `downcase` Liquid filter, we will need to add front matter.
That's next. Let's keep going.

Some files were not shown because too many files have changed in this diff Show More