From 51d4b6bd6adad6ad9ea36233dc2e6b990dfd1681 Mon Sep 17 00:00:00 2001
From: photong <57975239+photong@users.noreply.github.com>
Date: Wed, 27 Nov 2019 03:30:30 +0800
Subject: [PATCH] Simple clean up of documentation. (#849)
* Update installation.md
* Update cli-usage.md
* Update installation.md
* Update directory-structure.md
* Update configuration.md
* Update overview.md
* Update section.md
* Update page.md
* Update section.md
* Update configuration.md
* Update page.md
* Update section.md
* Update page.md
* Update shortcodes.md
* Update linking.md
* Update table-of-contents.md
* Update syntax-highlighting.md
* Update taxonomies.md
* Update search.md
* Update sass.md
* Update index.md
* Update multilingual.md
* Update overview.md
* Update pages-sections.md
* Update pagination.md
* Update taxonomies.md
* Update rss.md
* Update sitemap.md
* Update robots.md
* Update 404.md
* Update archive.md
* Update overview.md
* Update installing-and-using-themes.md
* Update creating-a-theme.md
* Update netlify.md
* Update github-pages.md
* Update gitlab-pages.md
* Update index.md
* Update page.md
* Update section.md
* Updates.
---
.../content/image-processing/index.md | 39 +++---
docs/content/documentation/content/linking.md | 23 ++--
.../documentation/content/multilingual.md | 6 +-
.../content/documentation/content/overview.md | 82 ++++++------
docs/content/documentation/content/page.md | 80 ++++++------
docs/content/documentation/content/sass.md | 10 +-
docs/content/documentation/content/search.md | 10 +-
docs/content/documentation/content/section.md | 121 +++++++++---------
.../documentation/content/shortcodes.md | 65 +++++-----
.../content/syntax-highlighting.md | 10 +-
.../content/table-of-contents.md | 4 +-
.../documentation/content/taxonomies.md | 10 +-
.../documentation/deployment/github-pages.md | 39 +++---
.../documentation/deployment/gitlab-pages.md | 15 ++-
.../documentation/deployment/netlify.md | 37 +++---
.../getting-started/cli-usage.md | 51 ++++----
.../getting-started/configuration.md | 67 +++++-----
.../getting-started/directory-structure.md | 32 ++---
.../getting-started/installation.md | 14 +-
docs/content/documentation/templates/404.md | 3 +-
.../documentation/templates/archive.md | 8 +-
.../documentation/templates/overview.md | 92 +++++++------
.../documentation/templates/pages-sections.md | 16 +--
.../documentation/templates/pagination.md | 4 +-
.../content/documentation/templates/robots.md | 4 +-
docs/content/documentation/templates/rss.md | 8 +-
.../documentation/templates/sitemap.md | 5 +-
.../documentation/templates/taxonomies.md | 10 +-
.../documentation/themes/creating-a-theme.md | 10 +-
.../themes/installing-and-using-themes.md | 20 +--
docs/content/documentation/themes/overview.md | 5 +-
31 files changed, 461 insertions(+), 439 deletions(-)
diff --git a/docs/content/documentation/content/image-processing/index.md b/docs/content/documentation/content/image-processing/index.md
index c6973af6..e26f2dd4 100644
--- a/docs/content/documentation/content/image-processing/index.md
+++ b/docs/content/documentation/content/image-processing/index.md
@@ -24,14 +24,14 @@ resize_image(path, width, height, op, format, quality)
- `"fill"`
What each of these does is explained below. The default is `"fill"`.
-- `format` (_optional_): Encoding format of the resized image. May be one of:
+- `format` (_optional_): Encoding format of the resized image. May be one of:
- `"auto"`
- `"jpg"`
- `"png"`
- The default is `"auto"`, this means the format is chosen based on input image format.
- JPEG is chosen for JPEGs and other lossy formats, while PNG is chosen for PNGs and other lossless formats.
-- `quality` (_optional_): JPEG quality of the resized image, in percents. Only used when encoding JPEGs, default value is `75`.
+ The default is `"auto"`, this means that the format is chosen based on input image format.
+ JPEG is chosen for JPEGs and other lossy formats, and PNG is chosen for PNGs and other lossless formats.
+- `quality` (_optional_): JPEG quality of the resized image, in percent. Only used when encoding JPEGs; default value is `75`.
### Image processing and return value
@@ -41,7 +41,7 @@ Zola performs image processing during the build process and places the resized i
static/processed_images/
```
-Filename of each resized image is a hash of the function arguments,
+The filename of each resized image is a hash of the function arguments,
which means that once an image is resized in a certain way, it will be stored in the above directory and will not
need to be resized again during subsequent builds (unless the image itself, the dimensions, or other arguments are changed).
Therefore, if you have a large number of images, they will only need to be resized once.
@@ -50,7 +50,7 @@ The function returns a full URL to the resized image.
## Resize operations
-The source for all examples is this 300 × 380 pixels image:
+The source for all examples is this 300 pixel × 380 pixel image:
![zola](01-zola.png)
@@ -79,9 +79,11 @@ The source for all examples is this 300 × 380 pixels image:
### **`"fit"`**
Like `"fit_width"` and `"fit_height"` combined, but only resize if the image is bigger than any of the specified dimensions.
- This mode is handy, if e.g. images are automatically shrinked to certain sizes in a shortcode for mobile optimization.
- Resizes the image such that the result fits within `width` and `height` preserving aspect ratio. This means that both width or height
- will be at max `width` and `height`, respectively, but possibly one of them smaller so as to preserve the aspect ratio.
+ This mode is handy, if for example images are automatically shrunk to certain sizes in a shortcode for
+ mobile optimization.
+ Resizes the image such that the result fits within `width` and `height` while preserving the aspect ratio. This
+ means that both width or height will be at max `width` and `height`, respectively, but possibly one of them
+ smaller so as to preserve the aspect ratio.
`resize_image(..., width=5000, height=5000, op="fit")`
@@ -93,8 +95,9 @@ The source for all examples is this 300 × 380 pixels image:
{{ resize_image(path="documentation/content/image-processing/01-zola.png", width=150, height=150, op="fit") }}
### **`"fill"`**
- This is the default operation. It takes the image's center part with the same aspect ratio as the `width` & `height` given and resizes that
- to `width` & `height`. This means that parts of the image that are outsize of the resized aspect ratio are cropped away.
+ This is the default operation. It takes the image's center part with the same aspect ratio as the `width` and
+ `height` given and resizes that to `width` and `height`. This means that parts of the image that are outside
+ of the resized aspect ratio are cropped away.
`resize_image(..., width=150, height=150, op="fill")`
@@ -103,8 +106,8 @@ The source for all examples is this 300 × 380 pixels image:
## Using `resize_image` in markdown via shortcodes
-`resize_image` is a built-in Tera global function (see the [Templates](@/documentation/templates/_index.md) chapter),
-but it can be used in markdown, too, using [Shortcodes](@/documentation/content/shortcodes.md).
+`resize_image` is a built-in Tera global function (see the [templates](@/documentation/templates/_index.md) chapter),
+but it can be used in Markdown using [shortcodes](@/documentation/content/shortcodes.md).
The examples above were generated using a shortcode file named `resize_image.html` with this content:
@@ -118,7 +121,7 @@ The `resize_image()` can be used multiple times and/or in loops. It is designed
This can be used along with `assets` [page metadata](@/documentation/templates/pages-sections.md) to create picture galleries.
The `assets` variable holds paths to all assets in the directory of a page with resources
-(see [assets colocation](@/documentation/content/overview.md#assets-colocation)): if you have files other than images you
+(see [asset co-location](@/documentation/content/overview.md#asset-co-location)); if you have files other than images you
will need to filter them out in the loop first like in the example below.
This can be used in shortcodes. For example, we can create a very simple html-only clickable
@@ -135,10 +138,10 @@ picture gallery with the following shortcode named `gallery.html`:
{% endfor %}
```
-As you can notice, we didn't specify an `op` argument, which means it'll default to `"fill"`. Similarly, the format will default to
-`"auto"` (choosing PNG or JPEG as appropriate) and the JPEG quality will default to `75`.
+As you can notice, we didn't specify an `op` argument, which means that it'll default to `"fill"`. Similarly,
+the format will default to `"auto"` (choosing PNG or JPEG as appropriate) and the JPEG quality will default to `75`.
-To call it from a markdown file, simply do:
+To call it from a Markdown file, simply do:
```jinja2
{{/* gallery() */}}
@@ -156,4 +159,4 @@ Here is the result:
## Get image size
Sometimes when building a gallery it is useful to know the dimensions of each asset. You can get this information with
-[get_image_metadata](@/documentation/templates/overview.md#get-image-metadata)
+[get_image_metadata](@/documentation/templates/overview.md#get-image-metadata).
diff --git a/docs/content/documentation/content/linking.md b/docs/content/documentation/content/linking.md
index a758532f..3416d466 100644
--- a/docs/content/documentation/content/linking.md
+++ b/docs/content/documentation/content/linking.md
@@ -4,9 +4,9 @@ weight = 50
+++
## Heading id and anchor insertion
-While rendering the markdown content, a unique id will automatically be assigned to each heading. This id is created
-by converting the heading text to a [slug](https://en.wikipedia.org/wiki/Semantic_URL#Slug), appending numbers at the end
-if the slug already exists for that article. For example:
+While rendering the Markdown content, a unique id will automatically be assigned to each heading. This id is created
+by converting the heading text to a [slug](https://en.wikipedia.org/wiki/Semantic_URL#Slug), and appending numbers at
+the end if the slug already exists for that article. For example:
```md
# Something exciting! <- something-exciting
@@ -22,18 +22,21 @@ You can also manually specify an id with a `{#…}` suffix on the heading line:
# Something manual! {#manual}
```
-This is useful for making deep links robust, either proactively (so that you can later change the text of a heading without breaking links to it) or retroactively (keeping the slug of the old header text, when changing the text). It can also be useful for migration of existing sites with different header id schemes, so that you can keep deep links working.
+This is useful for making deep links robust, either proactively (so that you can later change the text of a heading
+without breaking links to it) or retroactively (keeping the slug of the old header text when changing the text). It
+can also be useful for migration of existing sites with different header id schemes, so that you can keep deep
+links working.
## Anchor insertion
-It is possible to have Zola automatically insert anchor links next to the heading, as you can see on the site you are currently
-reading if you hover a title.
+It is possible to have Zola automatically insert anchor links next to the heading, as you can see on this site
+if you hover a title.
This option is set at the section level: the `insert_anchor_links` variable on the
-[Section front-matter page](@/documentation/content/section.md#front-matter).
+[section front matter page](@/documentation/content/section.md#front-matter).
The default template is very basic and will need CSS tweaks in your project to look decent.
-If you want to change the anchor template, it can easily be overwritten by
-creating a `anchor-link.html` file in the `templates` directory which gets an `id` variable.
+If you want to change the anchor template, it can be easily overwritten by
+creating an `anchor-link.html` file in the `templates` directory, which gets an `id` variable.
## Internal links
Linking to other pages and their headings is so common that Zola adds a
@@ -41,4 +44,4 @@ special syntax to Markdown links to handle them: start the link with `@/` and po
to link to. The path to the file starts from the `content` directory.
For example, linking to a file located at `content/pages/about.md` would be `[my link](@/pages/about.md)`.
-You can still link to an anchor directly: `[my link](@/pages/about.md#example)` will work as expected.
+You can still link to an anchor directly; `[my link](@/pages/about.md#example)` will work as expected.
diff --git a/docs/content/documentation/content/multilingual.md b/docs/content/documentation/content/multilingual.md
index a6eaba18..9f459708 100644
--- a/docs/content/documentation/content/multilingual.md
+++ b/docs/content/documentation/content/multilingual.md
@@ -21,7 +21,7 @@ If you want to use per-language taxonomies, ensure you set the `lang` field in t
configuration.
## Content
-Once the languages are added in, you can start to translate your content. Zola
+Once the languages have been added, you can start to translate your content. Zola
uses the filename to detect the language:
- `content/an-article.md`: this will be the default language
@@ -30,9 +30,9 @@ uses the filename to detect the language:
If the language code in the filename does not correspond to one of the languages configured,
an error will be shown.
-If your default language has an `_index.md` in a directory, you will need to add a `_index.{code}.md`
+If your default language has an `_index.md` in a directory, you will need to add an `_index.{code}.md`
file with the desired front-matter options as there is no language fallback.
## Output
Zola outputs the translated content with a base URL of `{base_url}/{code}/`.
-The only exception to that is if you are setting a translated page `path` directly in the front-matter.
+The only exception to this is if you are setting a translated page `path` directly in the front matter.
diff --git a/docs/content/documentation/content/overview.md b/docs/content/documentation/content/overview.md
index 16a5092f..239acd97 100644
--- a/docs/content/documentation/content/overview.md
+++ b/docs/content/documentation/content/overview.md
@@ -4,9 +4,9 @@ weight = 10
+++
-Zola uses the folder structure to determine the site structure.
-Each folder in the `content` directory represents a [section](@/documentation/content/section.md)
-that contains [pages](@/documentation/content/page.md): your `.md` files.
+Zola uses the directory structure to determine the site structure.
+Each child directory in the `content` directory represents a [section](@/documentation/content/section.md)
+that contains [pages](@/documentation/content/page.md) (your `.md` files).
```bash
.
@@ -23,30 +23,30 @@ that contains [pages](@/documentation/content/page.md): your `.md` files.
└── _index.md // -> https://mywebsite.com/landing/
```
-Each page path (the part after the `base_url`, for example `blog/cli-usage/`) can be customised by changing the `path` or `slug`
-attribute of the [page front-matter](@/documentation/content/page.md#front-matter).
+Each page path (the part after `base_url`, for example `blog/cli-usage/`) can be customised by changing the `path` or
+`slug` attribute of the [page front-matter](@/documentation/content/page.md#front-matter).
You might have noticed a file named `_index.md` in the example above.
-This file is used to store both metadata and content of the section itself and is not considered a page.
+This file is used to store both the metadata and content of the section itself and is not considered a page.
-To make sure the terminology used in the rest of the documentation is understood, let's go over the example above.
+To ensure that the terminology used in the rest of the documentation is understood, let's go over the example above.
The `content` directory in this case has three `sections`: `content`, `blog` and `landing`. The `content` section has only
-one page, `something.md`, the `landing` section has no page and the `blog` section has 4 pages: `cli-usage.md`, `configuration.md`, `directory-structure.md`
-and `installation.md`.
+one page (`something.md`), the `landing` section has no pages and the `blog` section has 4 pages (`cli-usage.md`,
+`configuration.md`, `directory-structure.md` and `installation.md`).
-While not shown in the example, sections can be nested indefinitely.
+Sections can be nested indefinitely.
-## Assets colocation
+## Asset co-location
-The `content` directory is not limited to markup files though: it's natural to want to co-locate a page and some related
-assets, for instance images or spreadsheets. Zola supports that pattern out of the box for both sections and pages.
+The `content` directory is not limited to markup files. It's natural to want to co-locate a page and some related
+assets, such as images or spreadsheets. Zola supports this pattern out of the box for both sections and pages.
-Any non-markdown file you add in the page/section folder will be copied alongside the generated page when building the site,
-which allows us to use a relative path to access them.
+All non-Markdown files you add in a page/section directory will be copied alongside the generated page when the site is
+built, which allows us to use a relative path to access them.
-For pages to use assets colocation, they should not be placed directly in their section folder (such as `latest-experiment.md`), but as an `index.md` file
-in a dedicated folder (`latest-experiment/index.md`), like so:
+Pages with co-located assets should not be placed directly in their section directory (such as `latest-experiment.md`), but
+as an `index.md` file in a dedicated directory (`latest-experiment/index.md`), like so:
```bash
@@ -58,23 +58,23 @@ in a dedicated folder (`latest-experiment/index.md`), like so:
└── research.jpg
```
-In this setup, you may access `research.jpg` from your 'research' section,
-and `yavascript.js` from your 'latest-experiment' directly within the Markdown:
+With this setup, you may access `research.jpg` from your 'research' section
+and `yavascript.js` from your 'latest-experiment' page directly within the Markdown:
-```markdown
+```Markdown
Check out the complete program [here](yavascript.js). It's **really cool free-software**!
```
-By default, this page will get the folder name as its slug. So its permalink would be in the form of `https://example.com/research/latest-experiment/`
+By default, this page's slug will be the directory name and thus its permalink will be `https://example.com/research/latest-experiment/`.
### Excluding files from assets
It is possible to ignore selected asset files using the
[ignored_content](@/documentation/getting-started/configuration.md) setting in the config file.
-For example, say you have an Excel spreadsheet from which you are taking several screenshots and
-then linking to those image files on your website. For maintainability purposes, you want to keep
-the spreadsheet in the same folder as the markdown, but you don't want to copy the spreadsheet to
-the public web site. You can achieve this by simply setting `ignored_content` in the config file:
+For example, say that you have an Excel spreadsheet from which you are taking several screenshots and
+then linking to these image files on your website. For maintainability, you want to keep
+the spreadsheet in the same directory as the Markdown file, but you don't want to copy the spreadsheet to
+the public web site. You can achieve this by setting `ignored_content` in the config file:
```
ignored_content = ["*.xlsx"]
@@ -83,15 +83,15 @@ ignored_content = ["*.xlsx"]
## Static assets
In addition to placing content files in the `content` directory, you may also place content
-files in the `static` directory. Any files/folders that you place in the `static` directory
-will be copied, without modification, to the public directory.
+files in the `static` directory. Any files/directories that you place in the `static` directory
+will be copied, without modification, to the `public` directory.
Typically, you might put site-wide assets (such as the site favicon, site logos or site-wide
-JavaScript) in the root of the static directory. You can also place any HTML or other files that
+JavaScript) in the root of the static directory. You can also place any HTML or other files that
you wish to be included without modification (that is, without being parsed as Markdown files)
into the static directory.
-Note that the static folder provides an _alternative_ to colocation. For example, imagine that you
+Note that the static directory provides an _alternative_ to co-location. For example, imagine that you
had the following directory structure (a simplified version of the structure presented above):
```bash
@@ -103,18 +103,16 @@ had the following directory structure (a simplified version of the structure pre
└── _index.md // -> https://mywebsite.com/blog/
```
-If you wanted to add an image to the `https://mywebsite.com/blog/configuration` page, you would
-have three options:
- * You could save the image to the `content/blog/configuration` folder and then link it with a
- relative path from the `index.md` page. This is the approach described under **colocation**,
+To add an image to the `https://mywebsite.com/blog/configuration` page, you have three options:
+ * You could save the image to the `content/blog/configuration` directory and then link to it with a
+ relative path from the `index.md` page. This is the approach described under **co-location**
above.
- * You could save the image to a `static/blog/configuration` folder and link it in exactly the
- same way as if you had colocated it. If you do this, the generated files will be identical to
- if you had colocated; the only difference will be that all static files will be saved in the
- static folder rather than in the content folder. Depending on your organizational needs, this
- may be better or worse.
- * Or you could save the image to some arbitrary folder within the static folder. For example,
- you could save all images to `static/images`. Using this approach, you would no longer be able
- to use relative links, but could use an absolute link to `images/[filename]` to access your
- image. This might be preferable for small sites or for sites that associate images with
+ * You could save the image to a `static/blog/configuration` directory and link to it in exactly the
+ same way as if you had co-located it. If you do this, the generated files will be identical to those
+ obtained if you had co-located the image; the only difference will be that all static files will be saved in the
+ static directory rather than in the content directory. The choice depends on your organizational needs.
+ * Or you could save the image to some arbitrary directory within the static directory. For example,
+ you could save all images to `static/images`. Using this approach, you can no longer use relative links. Instead,
+ you must use an absolute link to `images/[filename]` to access your
+ image. This might be preferable for small sites or for sites that associate images with
multiple pages (e.g., logo images that appear on every page).
diff --git a/docs/content/documentation/content/page.md b/docs/content/documentation/content/page.md
index 505f0c09..d614d081 100644
--- a/docs/content/documentation/content/page.md
+++ b/docs/content/documentation/content/page.md
@@ -6,98 +6,98 @@ weight = 30
A page is any file ending with `.md` in the `content` directory, except files
named `_index.md`.
-If a file ending with `.md` is named `index.md`, then it will generate a page
-with the name of the containing folder (for example, `/content/about/index.md` would
-create a page at `[base_url]/about`). (Note the lack of an underscore; if the file
+If a file ending with `.md` is named `index.md`, it will generate a page
+with the name of its directory (for example, `/content/about/index.md` would
+create a page at `[base_url]/about`). (Note the lack of an underscore; if the file
were named `_index.md`, then it would create a **section** at `[base_url]/about`, as
-discussed in the prior part of this documentation. But naming the file `index.md` will
+discussed in a previous part of this documentation. In contrast, naming the file `index.md` will
create a **page** at `[base_url]/about`).
If the file is given any name *other* than `index.md` or `_index.md`, then it will
-create a page with that name (without the `.md`). So naming a file in the root of your
-content directory `about.md` would also create a page at `[base_url]/about`.
-Another exception to that rule is that a filename starting with a datetime (YYYY-mm-dd or [a RFC3339 datetime](https://www.ietf.org/rfc/rfc3339.txt)) followed by
+create a page with that name (without the `.md`). For example, naming a file in the root of your
+content directory `about.md` would create a page at `[base_url]/about`.
+Another exception to this rule is that a filename starting with a datetime (YYYY-mm-dd or [an RFC3339 datetime](https://www.ietf.org/rfc/rfc3339.txt)) followed by
an underscore (`_`) or a dash (`-`) will use that date as the page date, unless already set
-in the front-matter. The page name will be anything after `_`/`-` so a filename like `2018-10-10-hello-world.md` will
+in the front matter. The page name will be anything after `_`/`-`, so the file `2018-10-10-hello-world.md` will
be available at `[base_url]/hello-world`. Note that the full RFC3339 datetime contains colons, which is not a valid
character in a filename on Windows.
-As you can see, creating an `about.md` file is exactly equivalent to creating an
+As you can see, creating an `about.md` file is equivalent to creating an
`about/index.md` file. The only difference between the two methods is that creating
-the `about` folder allows you to use asset colocation, as discussed in the
-[Overview](@/documentation/content/overview.md#assets-colocation) section of this documentation.
+the `about` directory allows you to use asset co-location, as discussed in the
+[overview](@/documentation/content/overview.md#asset-co-location) section.
-## Front-matter
+## Front matter
-The front-matter is a set of metadata embedded in a file. In Zola,
-it is at the beginning of the file, surrounded by `+++` and uses TOML.
+The TOML front matter is a set of metadata embedded in a file at the beginning of the file enclosed
+by triple pluses (`+++`).
-While none of the front-matter variables are mandatory, the opening and closing `+++` are required.
+Although none of the front matter variables are mandatory, the opening and closing `+++` are required.
-Here is an example page with all the variables available. The values provided below are the default
-values.
+Here is an example page with all the available variables. The values provided below are the
+default values.
-```toml
+```TOML
title = ""
description = ""
# The date of the post.
-# 2 formats are allowed: YYYY-MM-DD (2012-10-02) and RFC3339 (2002-10-02T15:00:00Z)
-# Do not wrap dates in quotes, the line below only indicates that there is no default date.
+# Two formats are allowed: YYYY-MM-DD (2012-10-02) and RFC3339 (2002-10-02T15:00:00Z).
+# Do not wrap dates in quotes; the line below only indicates that there is no default date.
# If the section variable `sort_by` is set to `date`, then any page that lacks a `date`
# will not be rendered.
# Setting this overrides a date set in the filename.
date =
-# The weight as defined in the Section page
+# The weight as defined on the Section page of the documentation.
# If the section variable `sort_by` is set to `weight`, then any page that lacks a `weight`
# will not be rendered.
weight = 0
-# A draft page is only loaded if the `--drafts` flag is passed to `zola build`, `zola serve` or `zola check`
+# A draft page is only loaded if the `--drafts` flag is passed to `zola build`, `zola serve` or `zola check`.
draft = false
-# If filled, it will use that slug instead of the filename to make up the URL
-# It will still use the section path though
+# If set, this slug will be instead of the filename to make the URL.
+# The section path will still be used.
slug = ""
-# The path the content will appear at
+# The path the content will appear at.
# If set, it cannot be an empty string and will override both `slug` and the filename.
# The sections' path won't be used.
-# It should not start with a `/` and the slash will be removed if it does
+# It should not start with a `/` and the slash will be removed if it does.
path = ""
# Use aliases if you are moving content but want to redirect previous URLs to the
-# current one. This takes an array of path, not URLs.
+# current one. This takes an array of paths, not URLs.
aliases = []
-# Whether the page should be in the search index. This is only used if
-# `build_search_index` is set to true in the config and the parent section
-# hasn't set `in_search_index` to false in its front-matter
+# When set to "true", the page will be in the search index. This is only used if
+# `build_search_index` is set to "true" in the Zola configuration and the parent section
+# hasn't set `in_search_index` to "false" in its front matter.
in_search_index = true
-# Template to use to render this page
+# Template to use to render this page.
template = "page.html"
-# The taxonomies for that page. The keys need to be the same as the taxonomies
-# name configured in `config.toml` and the values an array of String like
-# tags = ["rust", "web"]
+# The taxonomies for this page. The keys need to be the same as the taxonomy
+# names configured in `config.toml` and the values are an array of String objects. For example,
+# tags = ["rust", "web"].
[taxonomies]
-# Your own data
+# Your own data.
[extra]
```
## Summary
-You can ask Zola to create a summary if you only want to show the first
-paragraph of each page in a list for example.
+You can ask Zola to create a summary if, for example, you only want to show the first
+paragraph of the page content in a list.
To do so, add <!-- more -->
in your content at the point
-where you want the summary to end and the content up to that point will be also
+where you want the summary to end. The content up to that point will be
available separately in the
[template](@/documentation/templates/pages-sections.md#page-variables).
An anchor link to this position named `continue-reading` is created, wrapped in a paragraph
-with a `zola-continue-reading` id, so you can link directly to it if needed for example:
-`Continue Reading`
+with a `zola-continue-reading` id, so you can link directly to it if needed. For example:
+`Continue Reading`.
diff --git a/docs/content/documentation/content/sass.md b/docs/content/documentation/content/sass.md
index e5cd9c71..37698b57 100644
--- a/docs/content/documentation/content/sass.md
+++ b/docs/content/documentation/content/sass.md
@@ -3,8 +3,8 @@ title = "Sass"
weight = 110
+++
-Sass is a popular CSS extension language that approaches some of the harder
-parts of maintaining large sets of CSS rules. If you're curious about what Sass
+Sass is a popular CSS preprocessor that adds special features (e.g., variables, nested rules) to facilate the
+maintenance of large sets of CSS rules. If you're curious about what Sass
is and why it might be useful for styling your static site, the following links
may be of interest:
@@ -13,7 +13,7 @@ may be of interest:
## Using Sass in Zola
-Zola processes any files with the `sass` or `scss` extensions in the `sass`
+Zola processes any files with the `sass` or `scss` extension in the `sass`
folder, and places the processed output into a `css` file with the same folder
structure and base name into the `public` folder:
@@ -38,5 +38,5 @@ folder, but can still be used as `@import` dependencies. For more information, s
Files with the `scss` extension use ["Sassy CSS" syntax](http://sass-lang.com/documentation/#Formatting),
while files with the `sass` extension use the ["indented" syntax](http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html).
-Zola will return an error if a `scss` and `sass` file exist with the same
-base name in the same folder to avoid confusion -- see the example above.
+Zola will return an error if `scss` and `sass` files with the same
+base name exist in the same folder to avoid confusion -- see the example above.
diff --git a/docs/content/documentation/content/search.md b/docs/content/documentation/content/search.md
index 2745a102..e46711b2 100644
--- a/docs/content/documentation/content/search.md
+++ b/docs/content/documentation/content/search.md
@@ -4,19 +4,19 @@ weight = 100
+++
Zola can build a search index from the sections and pages content to
-be used by a JavaScript library: [elasticlunr](http://elasticlunr.com/).
+be used by a JavaScript library such as [elasticlunr](http://elasticlunr.com/).
To enable it, you only need to set `build_search_index = true` in your `config.toml` and Zola will
generate an index for the `default_language` set for all pages not excluded from the search index.
It is very important to set the `default_language` in your `config.toml` if you are writing a site not in
-English: the index building pipelines are very different depending on the language.
+English; the index building pipelines are very different depending on the language.
After `zola build` or `zola serve`, you should see two files in your static directory:
- `search_index.${default_language}.js`: so `search_index.en.js` for a default setup
- `elasticlunr.min.js`
-As each site will be different, Zola makes no assumptions about how your search and doesn't provide
-the JavaScript/CSS code to do an actual search and display results. You can however look at how this very site
-is implementing it to have an idea: [search.js](https://github.com/getzola/zola/tree/master/docs/static/search.js).
+As each site will be different, Zola makes no assumptions about your search function and doesn't provide
+the JavaScript/CSS code to do an actual search and display results. You can look at how this site
+implements it to get an idea: [search.js](https://github.com/getzola/zola/tree/master/docs/static/search.js).
diff --git a/docs/content/documentation/content/section.md b/docs/content/documentation/content/section.md
index 41e4a0eb..3fc4252c 100644
--- a/docs/content/documentation/content/section.md
+++ b/docs/content/documentation/content/section.md
@@ -3,115 +3,116 @@ title = "Section"
weight = 20
+++
-A section is created whenever a folder (or subfolder) in the `content` section contains an
-`_index.md` file. If a folder does not contain an `_index.md` file, no section will be
-created, but markdown files within that folder will still create pages (known as orphan pages).
+A section is created whenever a directory (or subdirectory) in the `content` section contains an
+`_index.md` file. If a directory does not contain an `_index.md` file, no section will be
+created, but Markdown files within that directory will still create pages (known as orphan pages).
The index page (i.e., the page displayed when a user browses to your `base_url`) is a section,
-which is created whether or not you add an `_index.md` file at the root of your `content` folder.
+which is created whether or not you add an `_index.md` file at the root of your `content` directory.
If you do not create an `_index.md` file in your content directory, this main content section will
not have any content or metadata. If you would like to add content or metadata, you can add an
-`_index.md` file at the root of the `content` folder and edit it just as you would edit any other
+`_index.md` file at the root of the `content` directory and edit it just as you would edit any other
`_index.md` file; your `index.html` template will then have access to that content and metadata.
-Any non-Markdown file in the section folder is added to the `assets` collection of the section, as explained in the [Content Overview](@/documentation/content/overview.md#assets-colocation). These files are then available from the Markdown using relative links.
+Any non-Markdown file in a section directory is added to the `assets` collection of the section, as explained in the
+[content overview](@/documentation/content/overview.md#asset-co-location). These files are then available in the
+Markdown file using relative links.
-## Front-matter
+## Front matter
-The `_index.md` file within a folder defines the content and metadata for that section. To set
+The `_index.md` file within a directory defines the content and metadata for that section. To set
the metadata, add front matter to the file.
-The front-matter is a set of metadata embedded in a file. In Zola,
-it is at the beginning of the file, surrounded by `+++` and uses TOML.
+The TOML front matter is a set of metadata embedded in a file at the beginning of the file enclosed by triple pluses (`+++`).
-After the closing `+++`, you can add content that will be parsed as markdown and will be available
+After the closing `+++`, you can add content, which will be parsed as Markdown and made available
to your templates through the `section.content` variable.
-While none of the front-matter variables are mandatory, the opening and closing `+++` are required.
+Although none of the front matter variables are mandatory, the opening and closing `+++` are required.
-Here is an example `_index.md` with all the variables available. The values provided below are the
+Here is an example `_index.md` with all the available variables. The values provided below are the
default values.
-```toml
+```TOML
title = ""
description = ""
-# Whether to sort pages by "date", "weight", or "none". More on that below
+# Used to sort pages by "date", "weight" or "none". See below for more information.
sort_by = "none"
# Used by the parent section to order its subsections.
-# Lower values have priority.
+# Lower values have higher priority.
weight = 0
-# Template to use to render this section page
+# Template to use to render this section page.
template = "section.html"
-# Apply the given template to ALL pages below the section, recursively.
-# If you have several nested sections each with a page_template set, the page
+# The given template is applied to ALL pages below the section, recursively.
+# If you have several nested sections, each with a page_template set, the page
# will always use the closest to itself.
-# However, a page own `template` variable will always have priority.
-# Not set by default
+# However, a page's own `template` variable will always have priority.
+# Not set by default.
page_template =
-# How many pages to be displayed per paginated page.
-# No pagination will happen if this isn't set or if the value is 0
+# This sets the number of pages to be displayed per paginated page.
+# No pagination will happen if this isn't set or if the value is 0.
paginate_by = 0
-# If set, will be the path used by paginated page and the page number will be appended after it.
-# For example the default would be page/1
+# If set, this will be the path used by the paginated page. The page number will be appended after this path.
+# The default is page/1.
paginate_path = "page"
-# Whether to insert a link for each header like the ones you can see in this site if you hover one
-# The default template can be overridden by creating a `anchor-link.html` in the `templates` directory
-# Options are "left", "right" and "none"
+# This determines whether to insert a link for each header like the ones you can see on this site if you hover over
+# a header.
+# The default template can be overridden by creating an `anchor-link.html` file in the `templates` directory.
+# This value can be "left", "right" or "none".
insert_anchor_links = "none"
-# Whether the section pages should be in the search index. This is only used if
-# `build_search_index` is set to true in the config
+# If set to "true", the section pages will be in the search index. This is only used if
+# `build_search_index` is set to "true" in the Zola configuration file.
in_search_index = true
-# Whether to render that section homepage or not.
-# Useful when the section is only there to organize things but is not meant
-# to be used directly
+# If set to "true", the section homepage is rendered.
+# Useful when the section is used to organize pages (not used directly).
render = true
-# Whether to redirect when landing on that section. Defaults to not being set.
+# This determines whether to redirect when a user lands on the section. Defaults to not being set.
# Useful for the same reason as `render` but when you don't want a 404 when
# landing on the root section page.
# Example: redirect_to = "documentation/content/overview"
redirect_to = ""
-# Whether the section should pass its pages on to the parent section. Defaults to `false`.
+# If set to "true", the section will pass its pages on to the parent section. Defaults to `false`.
# Useful when the section shouldn't split up the parent section, like
# sections for each year under a posts section.
transparent = false
# Use aliases if you are moving content but want to redirect previous URLs to the
-# current one. This takes an array of path, not URLs.
+# current one. This takes an array of paths, not URLs.
aliases = []
-# Your own data
+# Your own data.
[extra]
```
-Keep in mind that any configuration apply only to the direct pages, not to the subsections' pages.
+Keep in mind that any configuration options apply only to the direct pages, not to the subsections' pages.
## Pagination
-To enable pagination for a section's pages, simply set `paginate_by` to a positive number and it will automatically
-paginate by this much. See [pagination template documentation](@/documentation/templates/pagination.md) for more information
-on what will be available in the template.
+To enable pagination for a section's pages, set `paginate_by` to a positive number. See
+[pagination template documentation](@/documentation/templates/pagination.md) for more information
+on what variables are available in the template.
You can also change the pagination path (the word displayed while paginated in the URL, like `page/1`)
by setting the `paginate_path` variable, which defaults to `page`.
## Sorting
It is very common for Zola templates to iterate over pages or sections
-to display all pages/sections a given directory. Consider a very simple
+to display all pages/sections in a given directory. Consider a very simple
example: a `blog` directory with three files: `blog/Post_1.md`,
-`blog/Post_2.md`, and `blog/Post_3.md`. To iterate over these posts and
+`blog/Post_2.md` and `blog/Post_3.md`. To iterate over these posts and
create a list of links to the posts, a simple template might look like this:
```j2
@@ -120,21 +121,21 @@ create a list of links to the posts, a simple template might look like this:
{% endfor %}
```
-This would iterate over the posts, and would do so in a specific order
-based on the `sort_by` variable set in the `_index.md` page for the
-containing section. The `sort_by` variable can be given three values: `date`,
-`weight`, and `none`. If no `sort_by` method is set, the pages will be
-sorted in the `none` order, which is not intended to be used for sorted content.
+This would iterate over the posts in the order specified
+by the `sort_by` variable set in the `_index.md` page for the corresponding
+section. The `sort_by` variable can be given one of three values: `date`,
+`weight` or `none`. If `sort_by` is not set, the pages will be
+sorted in the `none` order, which is not intended for sorted content.
Any page that is missing the data it needs to be sorted will be ignored and
-won't be rendered. For example, if a page is missing the date variable the
-containing section sets `sort_by = "date"`, then that page will be ignored.
-The terminal will warn you if this is happening.
+won't be rendered. For example, if a page is missing the date variable and its
+section sets `sort_by = "date"`, then that page will be ignored.
+The terminal will warn you if this occurs.
If several pages have the same date/weight/order, their permalink will be used
-to break the tie following an alphabetical order.
+to break the tie based on alphabetical order.
-## Sorting Pages
+## Sorting pages
The `sort_by` front-matter variable can have the following values:
### `date`
@@ -150,24 +151,24 @@ page gets `page.lighter` and `page.heavier` variables that contain the
pages with lighter and heavier weights, respectively.
When iterating through pages, you may wish to use the Tera `reverse` filter,
-which reverses the order of the pages. Thus, after using the `reverse` filter,
+which reverses the order of the pages. For example, after using the `reverse` filter,
pages sorted by weight will be sorted from lightest (at the top) to heaviest
(at the bottom); pages sorted by date will be sorted from oldest (at the top)
to newest (at the bottom).
-`reverse` has no effect on `page.later`/`page.earlier`/`page.heavier`/`page.lighter`.
+`reverse` has no effect on `page.later`/`page.earlier` or `page.heavier`/`page.lighter`.
-## Sorting Subsections
+## Sorting subsections
Sorting sections is a bit less flexible: sections are always sorted by `weight`,
-and do not have any variables that point to the next heavier/lighter sections.
+and do not have variables that point to the heavier/lighter sections.
-Based on this, by default the lightest (lowest `weight`) subsections will be at
+By default, the lightest (lowest `weight`) subsections will be at
the top of the list and the heaviest (highest `weight`) will be at the bottom;
the `reverse` filter reverses this order.
**Note**: Unlike pages, permalinks will **not** be used to break ties between
-equally weighted sections. Thus, if the `weight` variable for your section is not set (or if it
+equally weighted sections. Thus, if the `weight` variable for your section is not set (or if it
is set in a way that produces ties), then your sections will be sorted in
**random** order. Moreover, that order is determined at build time and will
change with each site rebuild. Thus, if there is any chance that you will
-iterate over your sections, you should always assign them weight.
+iterate over your sections, you should always assign them a weight.
diff --git a/docs/content/documentation/content/shortcodes.md b/docs/content/documentation/content/shortcodes.md
index ee58ab76..1240fee5 100644
--- a/docs/content/documentation/content/shortcodes.md
+++ b/docs/content/documentation/content/shortcodes.md
@@ -3,13 +3,14 @@ title = "Shortcodes"
weight = 40
+++
-While Markdown is good at writing, it isn't great when you need write inline
+Although Markdown is good for writing, it isn't great when you need write inline
HTML to add some styling for example.
To solve this, Zola borrows the concept of [shortcodes](https://codex.wordpress.org/Shortcode_API)
from WordPress.
-In our case, the shortcode corresponds to a template that is defined in the `templates/shortcodes` directory or a built-in one that can
-be used in a Markdown file. If you want to use something similar to shortcodes in your templates, try [Tera macros](https://tera.netlify.com/docs#macros).
+In our case, a shortcode corresponds to a template defined in the `templates/shortcodes` directory or
+a built-in one that can be used in a Markdown file. If you want to use something similar to shortcodes in your templates, try [Tera macros](https://tera.netlify.com/docs/templates/#macros).
+
## Writing a shortcode
Let's write a shortcode to embed YouTube videos as an example.
@@ -28,44 +29,44 @@ following:
```
This template is very straightforward: an iframe pointing to the YouTube embed URL wrapped in a `
@@ -95,7 +96,7 @@ For example, let's imagine we have the following shortcode `quote.html` template``` -We could use it in our markup file like so: +We could use it in our Markdown file like so: ```md As someone said: @@ -106,7 +107,7 @@ A quote ``` The body of the shortcode will be automatically passed down to the rendering context as the `body` variable and needs -to be in a newline. +to be on a new line. If you want to have some content that looks like a shortcode but not have Zola try to render it, you will need to escape it by using `{%/*` and `*/%}` instead of `{%` and `%}`. You won't need to escape @@ -124,8 +125,8 @@ Embed a responsive player for a YouTube video. The arguments are: - `id`: the video id (mandatory) -- `class`: a class to add the `div` surrounding the iframe -- `autoplay`: whether to autoplay the video on load +- `class`: a class to add to the `