Skip to content

Commit

Permalink
Clarify docs for static files in collection (#7812)
Browse files Browse the repository at this point in the history
Merge pull request 7812
  • Loading branch information
ashmaroli authored and jekyllbot committed Sep 5, 2019
1 parent b8e673b commit b54544c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
15 changes: 12 additions & 3 deletions docs/_docs/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ 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.
and the contents will not undergo further processing. If front matter is provided,
Jekyll will process the file contents into the expected output.

Regardless of whether front matter exists or not, Jekyll will write to the destination
directory (e.g. `_site`) only if `output: true` has been set in the collection's
metadata.

For example here's how you would add a staff member to the collection set above.
The filename is `./_staff_members/jane.md` with the following content:
Expand All @@ -60,6 +63,12 @@ position: Developer
Jane has worked on Jekyll for the past *five years*.
```

<em>
Do note that in spite of being considered as a collection internally, the above
doesn't apply to [posts](/docs/posts/). Posts with a valid filename format will be
marked for processing even if they do not contain front matter.
</em>

<div class="note info">
<h5>Be sure to name your directories correctly</h5>
<p>
Expand Down
7 changes: 7 additions & 0 deletions docs/_docs/upgrading/3-to-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ your pages and documents.
The downside to this is that some of the community-authored plugins may not work
as they previously used to.

## Static files in unrendered collections

Collections other than `posts` can contain static assets along with Markdown files.
But if the collection has not been configured with metadata `output: true`, then
neither its *documents* nor its *static assets* will be output to the destination
directory.

## For plugin authors

* If your plugin depends on the following code: `site.liquid_renderer.file(path).parse(content)`,
Expand Down

0 comments on commit b54544c

Please sign in to comment.