Clarify docs for static files in collection (#7812)

Merge pull request 7812
This commit is contained in:
Ashwin Maroli 2019-09-05 19:33:49 +05:30 committed by jekyllbot
parent b8e673b149
commit b54544c68b
2 changed files with 19 additions and 3 deletions

View File

@ -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 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 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/) 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 and the contents will not undergo further processing. If front matter is provided,
is provided, Jekyll will process the file in your collection but will not write to disk Jekyll will process the file contents into the expected output.
unless `output: true` is set in the collection's metadata.
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. 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: The filename is `./_staff_members/jane.md` with the following content:
@ -60,6 +63,12 @@ position: Developer
Jane has worked on Jekyll for the past *five years*. 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"> <div class="note info">
<h5>Be sure to name your directories correctly</h5> <h5>Be sure to name your directories correctly</h5>
<p> <p>

View File

@ -53,6 +53,13 @@ your pages and documents.
The downside to this is that some of the community-authored plugins may not work The downside to this is that some of the community-authored plugins may not work
as they previously used to. 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 ## For plugin authors
* If your plugin depends on the following code: `site.liquid_renderer.file(path).parse(content)`, * If your plugin depends on the following code: `site.liquid_renderer.file(path).parse(content)`,