diff --git a/404.html b/404.html new file mode 100644 index 0000000000..f8414f0ed2 --- /dev/null +++ b/404.html @@ -0,0 +1,3 @@ + +
Zola provides support for automatic image resizing through the built-in function resize_image
,
+which is available in template code as well as in shortcodes.
The function usage is as follows:
+resize_image(path, width, height, op, format, quality)
+
+path
: The path to the source image. The following directories will be searched, in this order:
/
(the root of the project; that is, the directory with your config.toml
)/static
/content
/public
/themes/current-theme/static
width
and height
: The dimensions in pixels of the resized image. Usage depends on the op
argument.
op
(optional): Resize operation. This can be one of:
"scale"
"fit_width"
"fit_height"
"fit"
"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:
"auto"
"jpg"
"png"
"webp"
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 or WebP quality of the resized image, in percent. Only used when encoding JPEGs or WebPs; for JPEG default value is 75
, for WebP default is lossless.
Zola performs image processing during the build process and places the resized images in a subdirectory in the static files directory:
+static/processed_images/
+
+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 have changed).
+The function returns an object with the following schema:
+/// The final URL for that asset
+url: String,
+/// The path to the static asset generated
+static_path: String,
+/// New image width
+width: u32,
+/// New image height
+height: u32,
+/// Original image width
+orig_width: u32,
+/// Original image height
+orig_height: u32,
+
+The source for all examples is this 300 pixel × 380 pixel image:
+ +"scale"
Simply scales the image to the specified dimensions (width
& height
) irrespective of the aspect ratio.
resize_image(..., width=150, height=150, op="scale")
"fit_width"
Resizes the image such that the resulting width is width
and height is whatever will preserve the aspect ratio.
+The height
argument is not needed.
resize_image(..., width=100, op="fit_width")
"fit_height"
Resizes the image such that the resulting height is height
and width is whatever will preserve the aspect ratio.
+The width
argument is not needed.
resize_image(..., height=150, op="fit_height")
"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 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")
resize_image(..., 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
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")
resize_image
in markdown via shortcodesresize_image
is a Zola built-in Tera function (see the templates chapter),
+but it can be used in Markdown using shortcodes.
The examples above were generated using a shortcode file named resize_image.html
with this content:
{% set image = resize_image(path=path, width=width, height=height, op=op) %}
+<img src="{{ image.url }}" />
+
+The resize_image()
can be used multiple times and/or in loops. It is designed to handle this efficiently.
This can be used along with assets
page metadata to create picture galleries.
+The assets
variable holds paths to all assets in the directory of a page with resources
+(see asset colocation); 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
+picture gallery with the following shortcode named gallery.html
:
<div>
+{% for asset in page.assets -%}
+ {%- if asset is matching("[.](jpg|png)$") -%}
+ {% set image = resize_image(path=asset, width=240, height=180) %}
+ <a href="{{ get_url(path=asset) }}" target="_blank">
+ <img src="{{ image.url }}" />
+ </a>
+ {%- endif %}
+{%- endfor %}
+</div>
+
+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:
+{{ gallery() }}
+
+Here is the result:
+ + + Image attribution: Public domain, except: _06-example.jpg_: Willi Heidelbach, _07-example.jpg_: Daniel Ullrich. + +Sometimes when building a gallery it is useful to know the dimensions of each asset. You can get this information with +get_image_metadata.
+ + +Click here to be redirected.
diff --git a/documentation/content/linking/index.html b/documentation/content/linking/index.html new file mode 100644 index 0000000000..bec30a404e --- /dev/null +++ b/documentation/content/linking/index.html @@ -0,0 +1,310 @@ + + + + + + + + +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 if slugify.anchors
is set to "on"
(the default).
+If slugify.paths
is set to "safe"
, whitespaces are replaced by -
and the following characters are stripped: #
, %
, <
, >
, [
, ]
, (
, )
, `, ^
, {
, |
, }
.
+If slugify.paths
is set to "off"
, no modifications are made, and you may be left with nominally illegal ids.
+A number is appended at the end if the slug already exists for that article.
+For example:
# Something exciting! <- something-exciting
+## Example code <- example-code
+
+# Something else <- something-else
+## Example code <- example-code-1
+
+You can also manually specify an id with a {#…}
suffix on the heading line as well as CSS classes:
# Something manual! {#manual .header .bold}
+
+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.
+It is possible to have Zola automatically insert anchor links next to the heading, as you can see on this documentation +if you hover a title or covering the full heading text.
+This option is set at the section level: the insert_anchor_links
variable on the
+section front matter page.
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 be easily overwritten by
+creating an anchor-link.html
file in the templates
directory. Here you can find the default template.
The anchor link template has the following variables:
+id
: the heading's id after applying the rules defined by slugify.anchors
lang
: the current language, unless called from the markdown
template filter, in which case it will always be en
level
: the heading level (between 1 and 6)If you use insert_anchor = "heading"
, the template will still be used but only the opening <a>
tag will get extracted
+from it, everything else will not be used.
Linking to other pages and their headings is so common that Zola adds a
+special syntax to Markdown links to handle them: start the link with @/
and point to the .md
file you want
+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.
By default, broken internal links are treated as errors. To treat them as warnings instead, visit the [link_checker]
section of config.toml
and set internal_level = "warn"
. Note: treating broken links as warnings allows the site to be built with broken links intact, so a link such as [my link](@/pages/whoops.md)
will be rendered to HTML as <a href="@/pages/whoops.md">
.
Zola supports having a site in multiple languages.
+To get started, you will need to add the languages you want to support
+to your config.toml
. For example:
[languages.fr]
+generate_feed = true # there will be a feed for French content
+build_search_index = true
+taxonomies = [
+ {name = "auteurs"},
+ {name = "tags"},
+]
+
+[languages.fr.translations]
+summary = "Mon blog"
+
+[languages.it]
+# Italian language doesn't have any taxonomies/feed/search index
+
+[languages.it.translations]
+summary = "Mio blog"
+
+# translations for the default language are not prefixed by languages.code
+[translations]
+summary = "My blog"
+
+Note: By default, Chinese and Japanese search indexing is not included. You can include
+the support by building zola
using cargo build --features indexing-ja --features indexing-zh
.
+Please also note that, enabling Chinese indexing will increase the binary size by approximately
+5 MB while enabling Japanese indexing will increase the binary size by approximately 70 MB
+due to the incredibly large dictionaries.
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 languagecontent/an-article.fr.md
: this will be in FrenchIf the language code in the filename does not correspond to one of the languages or +the default language configured, an error will be shown.
+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.
Zola outputs the translated content with a base URL of {base_url}/{code}/
.
+The only exception to this is if you are setting a translated page path
directly in the front matter.
Zola uses the directory structure to determine the site structure.
+Each child directory in the content
directory represents a section
+that contains pages (your .md
files).
.
+└── content
+ ├── content
+ │ └── something.md // -> https://mywebsite.com/content/something/
+ ├── blog
+ │ ├── cli-usage.md // -> https://mywebsite.com/blog/cli-usage/
+ │ ├── configuration.md // -> https://mywebsite.com/blog/configuration/
+ │ ├── directory-structure.md // -> https://mywebsite.com/blog/directory-structure/
+ │ ├── _index.md // -> https://mywebsite.com/blog/
+ │ └── installation.md // -> https://mywebsite.com/blog/installation/
+ └── landing
+ └── _index.md // -> https://mywebsite.com/landing/
+
+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.
You might have noticed a file named _index.md
in the example above.
+This file is used to store both the metadata and content of the section itself and is not considered a page.
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 pages and the blog
section has 4 pages (cli-usage.md
,
+configuration.md
, directory-structure.md
and installation.md
).
Sections can be nested indefinitely.
+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.
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.
+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:
└── research
+ ├── latest-experiment
+ │ ├── index.md
+ │ └── yavascript.js
+ ├── _index.md
+ └── research.jpg
+
+With this setup, you may access research.jpg
from your 'research' section
+and yavascript.js
from your 'latest-experiment' page directly within the Markdown:
Check out the complete program [here](yavascript.js). It's **really cool free-software**!
+
+By default, this page's slug will be the directory name and thus its permalink will be https://example.com/research/latest-experiment/
.
It is possible to ignore selected asset files using the
+ignored_content setting in the config file.
+For example, say that you have several code files which you are linking to on your website.
+For maintainability, you want to keep your code in the same directory as the Markdown file,
+but you don't want to copy the build folders to the public web site. You can achieve this by setting ignored_content
in the config file:
(Note of caution: {Cargo.lock,target}
is not the same as {Cargo.lock, target}
)
ignored_content = ["code_articles/**/{Cargo.lock,target}, *.rs"]
+
+In addition to placing content files in the content
directory, you may also place content
+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 a CSS file, 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 +you wish to be included without modification (that is, without being parsed as Markdown files) +into the static directory.
+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):
+.
+└── content
+ └── blog
+ ├── configuration
+ │ └── index.md // -> https://mywebsite.com/blog/configuration/
+ └── _index.md // -> https://mywebsite.com/blog/
+
+To add an image to the https://mywebsite.com/blog/configuration
page, you have three options:
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.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.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).A page is any file ending with .md
in the content
directory, except files
+named _index.md
. Note: page file names must not contain _index.
at all.
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 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
). 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) 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 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.
+This behavior can be disabled by setting slugify.paths_keep_dates
to true
(the default is false
). Note that a _
separating the date would be slugified into a -
with the default value for slugify.paths
of "on"
.
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
directory allows you to use asset co-location, as discussed in the
+overview section.
For any page within your content folder, its output path will be defined by either:
+slug
frontmatter keyEither way, these proposed path will be sanitized before being used.
+If slugify.paths
is set to "on"
in the site's config - the default - paths are slugified.
+If it is set to "safe"
, only sanitation is performed, with the following characters being removed: <
, >
, :
, /
, |
, ?
, *
, #
, \\
, (
, )
, [
, ]
as well as newlines and tabulations. This ensures that the path can be represented on all operating systems.
+Additionally, trailing whitespace and dots are removed and whitespaces are replaced by _
.
If slugify.paths
is set to "off"
, no modifications are made.
If you want URLs containing non-ASCII characters, slugify.paths
needs to be set to "safe"
or "off"
.
The output path for the page will first be read from the slug
key in the page's frontmatter.
Example: (file content/zines/élevage-chèvre.md
)
+++
+title = "L'élevage de chèvres, la carrière alternative de tous dévelopeurs'"
+slug = "élevage-chèvre-carrière-alternative"
++++
+This is my article.
+
+This frontmatter will output the article to [base_url]/zines/élevage-chèvre-carrière-alternative
with slugify.paths
set to "safe"
or "off"
, and to [base_url]/zines/elevage-chevre-carriere-alternative
with the default value for slugify.paths
of "on"
.
When the article's output path is not specified in the frontmatter, it is extracted from the file's path in the content folder. Consider a file content/foo/bar/thing.md
. The output path is constructed:
index.md
, its parent folder name (bar
) is used as output paththing
(the filename without the .md
extension)If the path found starts with a datetime string (YYYY-mm-dd
or a RFC3339 datetime) followed by optional whitespace and then an underscore (_
) or a dash (-
), this date is removed from the output path and will be used as the page date (unless already set in the front-matter). Note that the full RFC3339 datetime contains colons, which is not a valid character in a filename on Windows.
The output path extracted from the file path is then slugified or not, depending on the slugify.paths
config, as explained previously.
Example:
+The file content/blog/2018-10-10-hello-world.md
will yield a page at [base_url]/blog/hello-world
. With optional whitespace, the file content/blog/2021-01-23 -hello new world.md
will yield a page at [base_url]/blog/hello-new-world
The TOML front matter is a set of metadata embedded in a file at the beginning of the file enclosed
+by triple pluses (+++
).
Although none of the front matter variables are mandatory, the opening and closing +++
are required.
Note that even though the use of TOML is encouraged, YAML front matter is also supported to ease porting
+legacy content. In this case the embedded metadata must be enclosed by triple minuses (---
).
Here is an example page with all the available variables. The values provided below are the +default values.
+title = ""
+description = ""
+
+# The date of the post.
+# 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 last updated date of the post, if different from the date.
+# Same format as `date`.
+updated =
+
+# 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`.
+draft = false
+
+# If set, this slug will be used instead of the filename to make the URL.
+# The section path will still be used.
+slug = ""
+
+# 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.
+path = ""
+
+# Use aliases if you are moving content but want to redirect previous URLs to the
+# current one. This takes an array of paths, not URLs.
+aliases = []
+
+# A list of page authors. If a site feed is enabled, the first author (if any)
+# will be used as the page's author in the default feed template.
+authors = []
+
+# 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 = "page.html"
+
+# 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.
+[extra]
+
+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. The content up to that point will be
+available separately in the
+template via page.summary
.
A span element in this position with a continue-reading
id is created, so you can link directly to it if needed. For example:
+<a href="{{ page.permalink }}#continue-reading">Continue Reading</a>
.
Sass is a popular CSS preprocessor that adds special features (e.g., variables, nested rules) to facilitate 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:
+It currently uses grass, a Rust implementation of Sass roughly equivalent +with dart-sass.
+Zola always compiles Sass files in theme directories.
+However, for Zola to process files in the sass
folder, you need to set compile_sass = true
in your config.toml
.
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:
.
+└── sass
+ ├── style.scss // -> ./public/style.css
+ ├── indented_style.sass // -> ./public/indented_style.css
+ ├── _include.scss # This file won't get put into the `public` folder, but other files can @import it.
+ ├── assets
+ │ ├── fancy.scss // -> ./public/assets/fancy.css
+ │ ├── same_name.scss // -> ./public/assets/same_name.css
+ │ ├── same_name.sass # CONFLICT! This has the same base name as the file above, so Zola will return an error.
+ │ └── _common_mixins.scss # This file won't get put into the `public` folder, but other files can @import it.
+ └── secret-side-project
+ └── style.scss // -> ./public/secret-side-project/style.css
+
+Files with a leading underscore in the name are not placed into the public
+folder, but can still be used as @import
dependencies. For more information, see the "Partials" section of
+Sass Basics.
Files with the scss
extension use "Sassy CSS" syntax,
+while files with the sass
extension use the "indented" syntax: https://sass-lang.com/documentation/syntax.
+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.
Zola can build a search index from the sections and pages content to +be used by a JavaScript library such as elasticlunr.
+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.
After zola build
or zola serve
, you should see two files in your public directory:
search_index.${default_language}.js
: so search_index.en.js
for a default setupelasticlunr.min.js
If you set index_format = "elasticlunr_json"
in your config.toml
, a search_index.${default_language}.json
is generated
+instead of the default search_index.${default_language}.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.
+If you are using a language other than English, you will also need to include the corresponding JavaScript stemmer file. +See https://github.com/weixsong/lunr-languages#in-a-web-browser for details.
+In some cases, the default indexing strategy is not suitable. You can customize which fields to include and whether +to truncate the content in the search configuration.
+ + +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 homepage (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
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
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 a section directory is added to the assets
collection of the section, as explained in the
+content overview. These files are then available in the
+Markdown file using relative links.
Just like pages sections can be drafted by setting the draft
option in the front matter. By default this is not done. When a section is drafted it's descendants like pages, subsections and assets will not be processed unless the --drafts
flag is passed. Note that even pages that don't have a draft
status will not be processed if one of their parent sections is drafted.
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 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, which will be parsed as Markdown and made available
+to your templates through the section.content
variable.
Although none of the front matter variables are mandatory, the opening and closing +++
are required.
Note that even though the use of TOML is encouraged, YAML front matter is also supported to ease porting
+legacy content. In this case the embedded metadata must be enclosed by triple minuses (---
).
Here is an example _index.md
with all the available variables. The values provided below are the
+default values.
title = ""
+
+description = ""
+
+# A draft section is only loaded if the `--drafts` flag is passed to `zola build`, `zola serve` or `zola check`.
+draft = false
+
+# Used to sort pages by "date", "update_date", "title", "title_bytes", "weight", "slug" or "none". See below for more information.
+sort_by = "none"
+
+# Used by the parent section to order its subsections.
+# Lower values have higher priority.
+weight = 0
+
+# Template to use to render this section page.
+template = "section.html"
+
+# 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's own `template` variable will always have priority.
+# Not set by default.
+page_template =
+
+# 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, 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"
+
+# If set, there will pagination will happen in a reversed order.
+paginate_reversed = false
+
+# 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", "heading" or "none".
+# "heading" means the full heading becomes the text of the anchor.
+insert_anchor_links = "none"
+
+# 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
+
+# If set to "true", the section homepage is rendered.
+# Useful when the section is used to organize pages (not used directly).
+render = true
+
+# 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 =
+
+# 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 paths, not URLs.
+aliases = []
+
+# If set to "true", a feed file will be generated for this section at the
+# section's root path. This is independent of the site-wide variable of the same
+# name. The section feed will only include posts from that respective feed, and
+# not from any other sections, including sub-sections under that section.
+generate_feed = false
+
+# Your own data.
+[extra]
+
+Keep in mind that any configuration options apply only to the direct pages, not to the subsections' pages.
+To enable pagination for a section's pages, set paginate_by
to a positive number. See
+pagination template documentation 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
.
It is very common for Zola templates to iterate over pages or sections
+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
+create a list of links to the posts, a simple template might look like this:
{% for post in section.pages %}
+ <h1><a href="{{ post.permalink }}">{{ post.title }}</a></h1>
+{% endfor %}
+
+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 a few values: date
, update_date
+title
, title_bytes
, weight
, slug
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 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 based on alphabetical order.
+The sort_by
front-matter variable can have the following values:
date
This will sort all pages by their date
field, from the most recent (at the
+top of the list) to the oldest (at the bottom of the list). Each page will
+get page.lower
and page.higher
variables that contain the pages with
+earlier and later dates, respectively.
update_date
Same as date
except it will take into account any updated
date for the pages.
title
This will sort all pages by their title
field in natural lexical order, as
+defined by natural_lexical_cmp
in the lexical-sort crate. Each page will
+get page.lower
and page.higher
variables that contain the pages
+with previous and next titles, respectively.
For example, here is a natural lexical ordering: "bachata, BART, bolero, +μ-kernel, meter, Métro, Track-2, Track-3, Track-13, underground". Notice how +special characters and numbers are sorted reasonably.
+title_bytes
Same as title
except it uses the bytes directly to sort.
+Natural sorting treats non-ascii
+characters like their closest ascii character. This can lead to unexpected
+results for languages with different character sets. The last three characters
+of the Swedish alphabet, åäö, for example would be considered by the natural
+sort as aao. In that case the standard byte-order sort may be more suitable.
weight
This will sort all pages by their weight
field, from the lightest weight
+(at the top of the list) to the heaviest (at the bottom of the list). Each
+page gets page.lower
and page.higher
variables that contain the
+pages with lighter and heavier weights, respectively.
slug
This will sort pages or sections by their slug in natural lexical order.
+When iterating through pages, you may wish to use the Tera 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.lower
/ page.higher
.
If the section is paginated the paginate_reversed=true
in the front matter of the relevant section should be set instead of using the filter.
Sorting sections is a bit less flexible: sections can only be sorted by weight
,
+and do not have variables that point to the heavier/lighter sections.
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
+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 distinct weights.
Zola borrows the concept of shortcodes from WordPress.
+In our case, a shortcode corresponds to a template defined in the templates/shortcodes
directory that can be used in a Markdown file.
Broadly speaking, Zola's shortcodes cover two distinct use cases:
+The latter may also be solved by writing HTML, however Zola allows the use of Markdown based shortcodes which end in .md
+rather than .html
. This may be particularly useful if you want to include headings generated by the shortcode in the
+table of contents.
If you want to use something similar to shortcodes in your templates, you can use Tera macros. They are functions or components that you can call to return some text.
+Let's write a shortcode to embed YouTube videos as an example.
+In a file called youtube.html
in the templates/shortcodes
directory, paste the
+following:
<div {% if class %}class="{{class}}"{% endif %}>
+ <iframe
+ src="https://www.youtube.com/embed/{{id}}{% if autoplay %}?autoplay=1{% endif %}"
+ webkitallowfullscreen
+ mozallowfullscreen
+ allowfullscreen>
+ </iframe>
+</div>
+
+This template is very straightforward: an iframe pointing to the YouTube embed URL wrapped in a <div>
.
+In terms of input, this shortcode expects at least one variable: id
. Because the other variables
+are in an if
statement, they are optional.
That's it. Zola will now recognise this template as a shortcode named youtube
(the filename minus the .html
extension).
The Markdown renderer will wrap an inline HTML node such as <a>
or <span>
into a paragraph.
+If you want to disable this behaviour, wrap your shortcode in a <div>
.
A Markdown based shortcode in turn will be treated as if what it returned was part of the page's body. If we create
+books.md
in templates/shortcodes
for example:
{% set data = load_data(path=path) -%}
+{% for book in data.books %}
+### {{ book.title }}
+
+{{ book.description | safe }}
+{% endfor %}
+
+This will create a shortcode books
with the argument path
pointing to a .toml
file where it loads lists of books with
+titles and descriptions. They will flow with the rest of the document in which books
is called.
Shortcodes are rendered before the page's Markdown is parsed so they don't have access to the page's table of contents.
+Because of that, you also cannot use the get_page
/get_section
/get_taxonomy
/get_taxonomy_term
global functions. It might work while
+running zola serve
because it has been loaded but it will fail during zola build
.
There are two kinds of shortcodes:
+In both cases, the arguments must be named and they will all be passed to the template. +Parentheses are mandatory even if there are no arguments.
+Note that while shortcodes look like normal Tera expressions, they are not Tera at all -- they can +pretty much just shuttle arguments to their template. Several limitions of note are:
+If the shortcode is invalid, it will not be interpreted by the markdown parser and will instead +get rendered directly into the final HTML.
+Lastly, a shortcode name (and thus the corresponding .html
file) as well as the argument names
+can only contain numbers, letters and underscores, or in Regex terms [0-9A-Za-z_]
.
+Although theoretically an argument name could be a number, it will not be possible to use such an argument in the template.
Argument values can be of one of five types:
+true
or false
Malformed values will be silently ignored.
+Both types of shortcode will also get either a page
or section
variable depending on where they were used
+and a config
variable. These values will overwrite any arguments passed to a shortcode so these variable names
+should not be used as argument names in shortcodes.
Simply call the shortcode as if it was a Tera function in a variable block.
+Here is a YouTube video:
+
+{{ youtube(id="dQw4w9WgXcQ") }}
+
+{{ youtube(id="dQw4w9WgXcQ", autoplay=true) }}
+
+An inline {{ youtube(id="dQw4w9WgXcQ", autoplay=true, class="youtube") }} shortcode
+
+Note that 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 }}
.
Let's imagine that we have the following shortcode quote.html
template:
<blockquote>
+ {{ body }} <br>
+ -- {{ author}}
+</blockquote>
+
+We could use it in our Markdown file like so:
+As someone said:
+
+{% quote(author="Vincent") %}
+A quote
+{% end %}
+
+The body of the shortcode will be automatically passed down to the rendering context as the body
variable and needs
+to be on a new line.
Note that for both cases that the parentheses for shortcodes are necessary. +A shortcode without the parentheses will render as plaintext and no warning will be emitted.
+As an example, this is how an aside
shortcode-with-body with no arguments would be defined in aside.html
:
<aside>
+ {{ body }}
+</aside>
+
+We could use it in our Markdown file like so:
+Readers can refer to the aside for more information.
+
+{% aside() %}
+An aside
+{% end %}
+
+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
+anything else until the closing tag.
Every shortcode can access some variables, beyond what you explicitly passed as parameter. These variables are explained in the following subsections:
+nth
)lang
), unless called from the markdown
template filter (in which case it will always be the same value as default_language
in configuration, or en
when it is unset)colocated_path
When one of these variables conflict with a variable passed as argument, the argument value will be used.
+nth
: invocation countEvery shortcode context is passed in a variable named nth
that tracks how many times a particular shortcode has
+been invoked in the current Markdown file. Given a shortcode true_statement.html
template:
<p id="number{{ nth }}">{{ value }} is equal to {{ nth }}.</p>
+
+It could be used in our Markdown as follows:
+{{ true_statement(value=1) }}
+{{ true_statement(value=2) }}
+
+This is useful when implementing custom markup for features such as sidenotes or end notes.
+lang
: current languageNOTE: When calling a shortcode from within the markdown
template filter, the lang
variable will always be en
.
+If you feel like you need that, please consider using template macros instead.
+If you really need that, you can rewrite your Markdown content to pass lang
as argument to the shortcode.
Every shortcode can access the current language in the lang
variable in the context.
+This is useful for presenting/filtering information in a shortcode depending in a per-language manner. For example, to display a per-language book cover for the current page in a shortcode called bookcover.md
:
![Book cover in {{ lang }}](cover.{{ lang }}.png)
+
+page
or section
You can access a slighty stripped down version of the equivalent variables in the normal templates. +The following attributes will be empty:
+(Note: this is because the rendering of markdown is done before populating the sections)
+A useful attribute to page
in shortcodes is colocated_path
.
+This is used when you want to pass the name of some assets to shortcodes without repeating the full folders path.
+Mostly useful when combined with load_data
or resize_image
.
{% set resized = resize_image(format="jpg", path=page.colocated_path ~ img_name, width=width, op="fit_width") %}
+<img alt="{{ alt }}" src="{{ resized.url | safe }}" />
+
+Here are some shortcodes for inspiration.
+Embed a responsive player for a YouTube video.
+The arguments are:
+id
: the video id (mandatory)playlist
: the playlist id (optional)class
: a class to add to the <div>
surrounding the iframeautoplay
: when set to "true", the video autoplays on loadCode:
+<div {% if class %}class="{{class}}"{% endif %}>
+ <iframe src="https://www.youtube-nocookie.com/embed/{{id}}{% if playlist %}?list={{playlist}}{% endif %}{% if autoplay %}?autoplay=1{% endif %}" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
+</div>
+
+Usage example:
+{{ youtube(id="dCKeXuVHl1o") }}
+
+{{ youtube(id="dCKeXuVHl1o", playlist="RDdQw4w9WgXcQ") }}
+
+{{ youtube(id="dCKeXuVHl1o", autoplay=true) }}
+
+{{ youtube(id="dCKeXuVHl1o", autoplay=true, class="youtube") }}
+
+See content processing page for code and example.
+ + +Zola comes with built-in syntax highlighting but you first +need to enable it in the configuration.
+Once this is done, Zola will automatically highlight all code blocks +in your content. A code block in Markdown looks like the following:
+```rust
+let highlight = true;
+```
+
+You can replace rust
with another language or not put anything to get the text
+interpreted as plain text.
Here is a full list of supported languages and their short names:
+- ActionScript -> ["as"]
+- Advanced CSV -> ["csv", "tsv"]
+- AppleScript -> ["applescript", "script editor"]
+- ASP -> ["asa"]
+- Assembly x86 (NASM) -> ["asm", "inc", "nasm"]
+- AWK -> ["awk"]
+- Batch File -> ["bat", "cmd"]
+- BibTeX -> ["bib"]
+- Bourne Again Shell (bash) -> [".bash_aliases", ".bash_completions", ".bash_functions", ".bash_login", ".bash_logout", ".bash_profile", ".bash_variables", ".bashrc", ".ebuild", ".eclass", ".profile", ".textmate_init", ".zlogin", ".zlogout", ".zprofile", ".zshenv", ".zshrc", "PKGBUILD", "ash", "bash", "sh", "zsh"]
+- C -> ["c", "h"]
+- C# -> ["cs", "csx"]
+- C++ -> ["C", "c++", "cc", "cp", "cpp", "cxx", "h", "h++", "hh", "hpp", "hxx", "inl", "ipp"]
+- Clojure -> ["clj", "cljc", "cljs", "edn"]
+- ClojureC -> ["boot", "clj", "cljc", "cljs", "cljx"]
+- CMake -> ["CMakeLists.txt", "cmake"]
+- CMake C Header -> ["h.in"]
+- CMake C++ Header -> ["h++.in", "hh.in", "hpp.in", "hxx.in"]
+- CMakeCache -> ["CMakeCache.txt"]
+- Crystal -> ["cr"]
+- CSS -> ["css", "css.erb", "css.liquid"]
+- D -> ["d", "di"]
+- Dart -> ["dart"]
+- Diff -> ["diff", "patch"]
+- Dockerfile -> ["Dockerfile", "dockerfile"]
+- EDN -> ["edn"]
+- Elixir -> ["ex", "exs"]
+- Elm -> ["elm"]
+- Erlang -> ["Emakefile", "emakefile", "erl", "escript", "hrl"]
+- F# -> ["fs", "fsi", "fsx"]
+- Fortran (Fixed Form) -> ["F", "F77", "FOR", "FPP", "f", "f77", "for", "fpp"]
+- Fortran (Modern) -> ["F03", "F08", "F90", "F95", "f03", "f08", "f90", "f95"]
+- Fortran Namelist -> ["namelist"]
+- Friendly Interactive Shell (fish) -> ["fish"]
+- GDScript (Godot Engine) -> ["gd"]
+- Generic Config -> [".dircolors", ".gitattributes", ".gitignore", ".gitmodules", ".inputrc", "Doxyfile", "cfg", "conf", "config", "dircolors", "gitattributes", "gitignore", "gitmodules", "ini", "inputrc", "mak", "mk", "pro"]
+- Git Attributes -> [".gitattributes", "attributes", "gitattributes"]
+- Git Commit -> ["COMMIT_EDITMSG", "MERGE_MSG", "TAG_EDITMSG"]
+- Git Config -> [".gitconfig", ".gitmodules", "gitconfig"]
+- Git Ignore -> [".gitignore", "exclude", "gitignore"]
+- Git Link -> [".git"]
+- Git Log -> ["gitlog"]
+- Git Mailmap -> [".mailmap", "mailmap"]
+- Git Rebase Todo -> ["git-rebase-todo"]
+- GLSL -> ["comp", "frag", "fs", "fsh", "fshader", "geom", "glsl", "gs", "gsh", "gshader", "tesc", "tese", "vert", "vs", "vsh", "vshader"]
+- Go -> ["go"]
+- GraphQL -> ["gql", "graphql", "graphqls"]
+- Graphviz (DOT) -> ["DOT", "dot", "gv"]
+- Groovy -> ["Jenkinsfile", "gradle", "groovy", "gvy"]
+- Handlebars -> ["handlebars", "handlebars.html", "hbr", "hbrs", "hbs", "hdbs", "hjs", "mu", "mustache", "rac", "stache", "template", "tmpl"]
+- Haskell -> ["hs"]
+- HTML -> ["htm", "html", "shtml", "xhtml"]
+- HTML (ASP) -> ["asp"]
+- HTML (EEx) -> ["html.eex", "html.leex"]
+- HTML (Erlang) -> ["yaws"]
+- HTML (Jinja2) -> ["htm.j2", "html.j2", "xhtml.j2", "xml.j2"]
+- HTML (Rails) -> ["erb", "html.erb", "rails", "rhtml"]
+- HTML (Tcl) -> ["adp"]
+- Java -> ["bsh", "java"]
+- Java Properties -> ["properties"]
+- Java Server Page (JSP) -> ["jsp"]
+- JavaScript -> ["htc", "js"]
+- JavaScript (Rails) -> ["js.erb"]
+- Jinja2 -> ["j2", "jinja", "jinja2"]
+- JSON -> ["Pipfile.lock", "ipynb", "json", "sublime-build", "sublime-color-scheme", "sublime-commands", "sublime-completions", "sublime-keymap", "sublime-macro", "sublime-menu", "sublime-mousemap", "sublime-project", "sublime-settings", "sublime-theme"]
+- Julia -> ["jl"]
+- Kotlin -> ["kt", "kts"]
+- LaTeX -> ["ltx", "tex"]
+- Less -> ["css.less", "less"]
+- Linker Script -> ["ld"]
+- Lisp -> ["cl", "clisp", "el", "fasl", "l", "lisp", "lsp", "mud", "scm", "ss"]
+- Literate Haskell -> ["lhs"]
+- lrc -> ["lrc", "lyric"]
+- Lua -> ["lua"]
+- Makefile -> ["GNUmakefile", "Makefile", "Makefile.am", "Makefile.in", "OCamlMakefile", "mak", "make", "makefile", "makefile.am", "makefile.in", "mk"]
+- Markdown -> ["markdn", "markdown", "md", "mdown"]
+- MATLAB -> ["matlab"]
+- MiniZinc (MZN) -> ["dzn", "mzn"]
+- NAnt Build File -> ["build"]
+- Nim -> ["nim", "nims"]
+- Nix -> ["nix"]
+- Objective-C -> ["h", "m"]
+- Objective-C++ -> ["M", "h", "mm"]
+- OCaml -> ["ml", "mli"]
+- OCamllex -> ["mll"]
+- OCamlyacc -> ["mly"]
+- Pascal -> ["dpr", "p", "pas"]
+- Perl -> ["pc", "pl", "pm", "pmc", "pod", "t"]
+- PHP -> ["php", "php3", "php4", "php5", "php7", "phps", "phpt", "phtml"]
+- Plain Text -> ["txt"]
+- PowerShell -> ["ps1", "psd1", "psm1"]
+- Protocol Buffer -> ["proto", "protodevel"]
+- Protocol Buffer (TEXT) -> ["pb.txt", "pbtxt", "proto.text", "prototxt", "textpb"]
+- PureScript -> ["purs"]
+- Python -> ["SConscript", "SConstruct", "Sconstruct", "Snakefile", "bazel", "bzl", "cpy", "gyp", "gypi", "pxd", "pxd.in", "pxi", "pxi.in", "py", "py3", "pyi", "pyw", "pyx", "pyx.in", "rpy", "sconstruct", "vpy", "wscript"]
+- R -> ["R", "Rprofile", "r"]
+- Racket -> ["rkt"]
+- Rd (R Documentation) -> ["rd"]
+- Reason -> ["re", "rei"]
+- Regular Expression -> ["re"]
+- Regular Expressions (Elixir) -> ["ex.re"]
+- reStructuredText -> ["rest", "rst"]
+- Ruby -> ["Appfile", "Appraisals", "Berksfile", "Brewfile", "Cheffile", "Deliverfile", "Fastfile", "Gemfile", "Guardfile", "Podfile", "Rakefile", "Rantfile", "Scanfile", "Snapfile", "Thorfile", "Vagrantfile", "capfile", "cgi", "config.ru", "fcgi", "gemspec", "irbrc", "jbuilder", "podspec", "prawn", "rabl", "rake", "rb", "rbx", "rjs", "ruby.rail", "simplecov", "thor"]
+- Ruby Haml -> ["haml", "sass"]
+- Ruby on Rails -> ["builder", "rxml"]
+- Rust -> ["rs"]
+- Sass -> ["sass"]
+- Scala -> ["sbt", "sc", "scala"]
+- SCSS -> ["scss"]
+- SQL -> ["ddl", "dml", "sql"]
+- SQL (Rails) -> ["erbsql", "sql.erb"]
+- srt -> ["srt", "subrip"]
+- Stylus -> ["styl", "stylus"]
+- SWI-Prolog -> ["pro"]
+- Swift -> ["swift"]
+- Tcl -> ["tcl"]
+- TeX -> ["cls", "sty"]
+- Textile -> ["textile"]
+- TOML -> ["Cargo.lock", "Gopkg.lock", "Pipfile", "tml", "toml"]
+- TypeScript -> ["ts"]
+- TypeScriptReact -> ["tsx"]
+- VimL -> ["vim"]
+- XML -> ["dtml", "opml", "rng", "rss", "svg", "tld", "xml", "xsd", "xslt"]
+- YAML -> ["sublime-syntax", "yaml", "yml"]
+- Zig -> ["zig"]
+
+Note: due to some issues with the JavaScript syntax, the TypeScript syntax will be used instead.
+If the language you want to highlight is not on this list, the extra_syntaxes_and_themes
configuration option can be used to add additional syntax and theme files.
If your site source is laid out as follows:
+.
+├── config.toml
+├── content/
+│ └── ...
+├── static/
+│ └── ...
+├── syntaxes/
+│ ├── Sublime-Language1/
+│ │ └── lang1.sublime-syntax
+│ └── lang2.sublime-syntax
+└── templates/
+ └── ...
+
+you would set your extra_syntaxes_and_themes
to ["syntaxes", "syntaxes/Sublime-Language1"]
to load lang1.sublime-syntax
and lang2.sublime-syntax
.
You can see the list of available themes on the configuration page.
+If you use a highlighting scheme like
+highlight_theme = "base16-ocean-dark"
+
+for a code block like
+```rs
+let highlight = true;
+```
+
+you get the colors directly encoded in the html file.
+<pre class="language-rs" style="background-color:#2b303b;">
+ <code class="language-rs">
+ <span style="color:#b48ead;">let</span>
+ <span style="color:#c0c5ce;"> highlight = </span>
+ <span style="color:#d08770;">true</span>
+ <span style="color:#c0c5ce;">;
+ </span>
+ </code>
+</pre>
+
+This is nice, because your page will load faster if everything is in one file. +But if you would like to have the user choose a theme from a +list, or use different color schemes for dark/light color schemes, you need a +different solution.
+If you use the special css
color scheme
highlight_theme = "css"
+
+you get CSS class definitions, instead.
+<pre class="language-rs">
+ <code class="language-rs">
+ <span class="z-source z-rust">
+ <span class="z-storage z-type z-rust">let</span> highlight
+ <span class="z-keyword z-operator z-assignment z-rust">=</span>
+ <span class="z-constant z-language z-rust">true</span>
+ <span class="z-punctuation z-terminator z-rust">;</span>
+ </span>
+ </code>
+</pre>
+
+Zola can output a css file for a theme in the static
directory using the highlight_themes_css
option.
highlight_themes_css = [
+ { theme = "base16-ocean-dark", filename = "syntax-theme-dark.css" },
+ { theme = "base16-ocean-light", filename = "syntax-theme-light.css" },
+]
+
+You can then support light and dark mode like so:
+@import url("syntax-theme-dark.css") (prefers-color-scheme: dark);
+@import url("syntax-theme-light.css") (prefers-color-scheme: light);
+
+Alternately, you can reference the stylesheets in your base template to reduce request chains:
+<head>
+ <!-- Other content -->
+ <link rel="stylesheet" type="text/css" href="/syntax-theme-dark.css" media="(prefers-color-scheme: dark)" />
+ <link rel="stylesheet" type="text/css" href="/syntax-theme-light.css" media="(prefers-color-scheme: light)" />
+</head>
+
+Themes can conditionally include code-highlighting stylesheet <link>
tags by wrapping them in a conditional:
{% if config.markdown.highlight_code and config.markdown.highlight_theme == "css" %}
+<link rel="stylesheet" type="text/css" href="/syntax-theme-dark.css" media="(prefers-color-scheme: dark)" />
+<link rel="stylesheet" type="text/css" href="/syntax-theme-light.css" media="(prefers-color-scheme: light)" />
+{% endif %}
+
+You can use additional annotations to customize how code blocks are displayed:
+linenos
to enable line numbering.```rust,linenos
+use highlighter::highlight;
+let code = "...";
+highlight(code);
+```
+
+linenostart
to specify the number for the first line (defaults to 1)```rust,linenos,linenostart=20
+use highlighter::highlight;
+let code = "...";
+highlight(code);
+```
+
+hl_lines
to highlight lines. You must specify a list of inclusive ranges of lines to highlight,
+separated by
(whitespace). Ranges are 1-indexed and linenostart
doesn't influence the values, it always refers to the codeblock line number.```rust,hl_lines=1 3-5 9
+use highlighter::highlight;
+let code = "...";
+highlight(code);
+```
+
+hide_lines
to hide lines. You must specify a list of inclusive ranges of lines to hide,
+separated by
(whitespace). Ranges are 1-indexed.```rust,hide_lines=1-2
+use highlighter::highlight;
+let code = "...";
+highlight(code);
+```
+
+Depending on the annotations used, some codeblocks will be hard to read without any CSS. We recommend using the following +snippet in your sites:
+pre {
+ padding: 1rem;
+ overflow: auto;
+}
+// The line numbers already provide some kind of left/right padding
+pre[data-linenos] {
+ padding: 1rem 0;
+}
+pre table td {
+ padding: 0;
+}
+// The line number cells
+pre table td:nth-of-type(1) {
+ text-align: center;
+ user-select: none;
+}
+pre mark {
+ // If you want your highlights to take the full width.
+ display: block;
+ // The default background colour of a mark is bright yellow
+ background-color: rgba(254, 252, 232, 0.9);
+}
+pre table {
+ width: 100%;
+ border-collapse: collapse;
+}
+
+This snippet makes the highlighting work on the full width and ensures that a user can copy the content without +selecting the line numbers. Obviously you will probably need to adjust it to fit your site style.
+Here's an example with all the options used: scss, linenos, linenostart=10, hl_lines=3-4 8-9, hide_lines=2 7
with the
+snippet above.
10 pre mark {
+ 12 display: block;
+ 13 color: currentcolor;
+ 14 }
+ 15 pre table td:nth-of-type(1) {
+ 17 color: #6b6b6b;
+ 18 font-style: italic;
+ 19 }
+
+Line 2 and 7 are comments that are not shown in the final output.
+When line numbers are active, the code block is turned into a table with one row and two cells. The first cell contains the line number and the second cell contains the code.
+Highlights are done via the <mark>
HTML tag. When a line with line number is highlighted two <mark>
tags are created: one around the line number(s) and one around the code.
The default theme for syntax highlighting is called base16-ocean-dark
, you can choose another theme from the built in set of highlight themes using the highlight_theme
configuration option.
+For example, this documentation site currently uses the kronuz
theme, which is built in.
[markdown]
+highlight_code = true
+highlight_theme = "kronuz"
+
+Alternatively, the extra_syntaxes_and_themes
configuration option can be used to add additional theme files.
+You can load your own highlight theme from a TextMate .tmTheme
file.
It works the same way as adding extra syntaxes. It should contain a list of paths to folders containing the .tmTheme files you want to include.
+You would then set highlight_theme
to the name of one of these files, without the .tmTheme
extension.
If your site source is laid out as follows:
+.
+├── config.toml
+├── content/
+│ └── ...
+├── static/
+│ └── ...
+├── highlight_themes/
+│ ├── MyGroovyTheme/
+│ │ └── theme1.tmTheme
+│ ├── theme2.tmTheme
+└── templates/
+ └── ...
+
+you would set your extra_syntaxes_and_themes
to ["highlight_themes", "highlight_themes/MyGroovyTheme"]
to load theme1.tmTheme
and theme2.tmTheme
.
+Then choose one of them to use, say theme1, by setting highlight_theme = theme1
.
Each page/section will automatically generate a table of contents for itself based on the headers generated with markdown.
+It is available in the template through the page.toc
or section.toc
variable.
+You can view the template variables
+documentation for information on its structure.
Here is an example of using that field to render a two-level table of contents:
+{% if page.toc %}
+ <ul>
+ {% for h1 in page.toc %}
+ <li>
+ <a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
+ {% if h1.children %}
+ <ul>
+ {% for h2 in h1.children %}
+ <li>
+ <a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+{% endif %}
+
+While headers are neatly ordered in this example, it will work just as well with disjoint headers.
+Note that all existing HTML tags from the title will NOT be present in the table of contents to +avoid various issues.
+ + +Zola has built-in support for taxonomies. Taxonomies are a way for users to group content according to user-defined categories.
+Imagine that you want to make a website to display information about various movies. In that case you could use the following taxonomies:
+Then at build time Zola can create pages for each taxonomy listing all of the known terms as well as pages for each term in a taxonomy, listing all of the pieces of content associated with that term.
+Imagine again we have the following movies:
+- Shape of water <--- Value
+ - Director <--- Taxonomy
+ - Guillermo Del Toro <--- Term
+ - Genres <--- Taxonomy
+ - Thriller <--- Term
+ - Drama <--- Term
+ - Awards <--- Taxonomy
+ - Golden globe <--- Term
+ - Academy award <--- Term
+ - BAFTA <--- Term
+ - Release year <--- Taxonomy
+ - 2017 <--- Term
+
+- The Room: <--- Value
+ - Director <--- Taxonomy
+ - Tommy Wiseau <--- Term
+ - Genres <--- Taxonomy
+ - Romance <--- Term
+ - Drama <--- Term
+ - Release Year <--- Taxonomy
+ - 2003 <--- Term
+
+- Bright <--- Value
+ - Director <--- Taxonomy
+ - David Ayer <--- Term
+ - Genres <--- Taxonomy
+ - Fantasy <--- Term
+ - Action <--- Term
+ - Awards <--- Taxonomy
+ - California on Location Awards <--- Term
+ - Release Year <--- Taxonomy
+ - 2017 <--- Term
+
+In this example the page for Release year
would include links to pages for both 2003 and 2017, where the page for 2017 would list both Shape of Water and Bright.
A taxonomy has six variables:
+name
: a required string that will be used in the URLs, usually the plural version (i.e., tags, categories, etc.)paginate_by
: if this is set to a number, each term page will be paginated by this much.paginate_path
: if set, this path will be used by the paginated page and the page number will be appended after it.
+For example the default would be page/1.feed
: if set to true
, a feed (atom by default) will be generated for each term.lang
: only set this if you are making a multilingual site and want to indicate which language this taxonomy is forrender
: if set to false
, pages will not be rendered for the taxonomy or for individual terms.Insert into the configuration file (config.toml):
+⚠️ Place the taxonomies key in the main section and not in the [extra]
section
Example 1: (one language)
+taxonomies = [
+ { name = "director", feed = true},
+ { name = "genres", feed = true},
+ { name = "awards", feed = true},
+ { name = "release-year", feed = true},
+]
+
+Example 2: (multilingual site)
+# These taxonomies go in the main section
+taxonomies = [
+ {name = "director", feed = true},
+ {name = "genres", feed = true},
+ {name = "awards", feed = true},
+ {name = "release-year", feed = true},
+]
+
+[languages.fr]
+taxonomies = [
+ {name = "director", feed = true},
+ {name = "genres", feed = true},
+ {name = "awards", feed = true},
+ {name = "release-year", feed = true},
+]
+
+Once the configuration is done, you can then set taxonomies in your content and Zola will pick them up:
+Example:
++++
+title = "Shape of water"
+date = 2019-08-15 # date of the post, not the movie
+[taxonomies]
+director=["Guillermo Del Toro"]
+genres=["Thriller","Drama"]
+awards=["Golden Globe", "Academy award", "BAFTA"]
+release-year = ["2017"]
++++
+
+In a similar manner to how section and pages calculate their output path:
+slugify.taxonomies
is enabled ("on"
, the default) in the configurationThe taxonomy pages are then available at the following paths:
+$BASE_URL/$NAME/ (taxonomy)
+$BASE_URL/$NAME/$SLUG (taxonomy entry)
+
+Note that taxonomies are case insensitive so terms that have the same slug will get merged, e.g. sections and pages containing the tag "example" will be shown in the same taxonomy page as ones containing "Example"
+ + +Amazon Simple Storage Service (Amazon S3) is an object storage service offering static website hosting. We're going to look at the setup required to build and deploy your Zola website to S3 via GitHub Actions.
+The official AWS developer guide has detailed instruction on how to create your bucket and set it up correctly for static website hosting. In AWS you can not only host the website files, but also buy a domain name and speed up your website via their global CDN (CloudFront).
+For GitHub Actions to modify the files in your bucket, you need to create an IAM user in your AWS account that has just enough permissions to perform what we need and no more.
+First we need to create a new policy by logging on to AWS Console and going to IAM > Policies > Create policy. Switch from the visual editor to JSON and paste the following snippet. Remember to update your bucket name:
+{
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Sid": "AccessToWebsiteBuckets",
+ "Effect": "Allow",
+ "Action": [
+ "s3:PutBucketWebsite",
+ "s3:PutObject",
+ "s3:PutObjectAcl",
+ "s3:GetObject",
+ "s3:ListBucket",
+ "s3:DeleteObject"
+ ],
+ "Resource": [
+ "arn:aws:s3:::Bucket-Name"
+ "arn:aws:s3:::Bucket-Name/*"
+ ]
+ },
+ {
+ "Sid": "AccessToCloudfront",
+ "Effect": "Allow",
+ "Action": ["cloudfront:GetInvalidation", "cloudfront:CreateInvalidation"],
+ "Resource": "*"
+ }
+ ]
+}
+
+The AccessToCloudfront
portion is not required if you're not going to speed up your website with CloudFront.
Once the policy is created you need to create a new user under IAM > Users. Give it a name such as github-actions-user
. On the Set permissions step select Attach policies directly and find the policy we created in the last step.
From the list of users click on your newly created account and then open the Security Credentials tab. Under Access keys select > Create access key and choose Command Line Interface (CLI). Click "I understand the above recommendation" and then Create access key. Note the Access key ID and Secret access key.
+The access keys we just created need to be configured as secrets in your GitHub repo. To do so, navigate to Setting > expand Secrets and variables > click on Actions.
+Under Repository secrets click Add repository secret. In the Name field enter AWS_ACCESS_KEY_ID
and in the Secret field enter the value from the previous step. Do the same for the secret access key, naming it AWS_SECRET_ACCESS_KEY
. Finally create one secret for your bucket name S3_BUCKET
and one CLOUDFRONT_DISTRIBUTION_ID
if you have created a distribution for your website.
Next we need to create the Github Action to build and deploy our files to S3. We need to create a workflow file in .github/workflows
directory of our repository. This can be done by navigating to the Actions tab in GitHub or by commiting the file from your machine.
.github/workflows/publish.yml
:
name: Build and Publish to AWS
+on:
+ push:
+ branches:
+ - main
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ steps:
+ - uses: actions/checkout@v3
+ - uses: taiki-e/install-action@v2
+ with:
+ tool: zola@0.17.2
+ - name: Build
+ run: zola build
+ - uses: reggionick/s3-deploy@v4
+ env:
+ AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+ with:
+ folder: public
+ bucket: ${{ secrets.S3_BUCKET }}
+ private: true
+ bucket-region: us-east-1
+ # Use the next two only if you have created a CloudFront distribution
+ dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
+ invalidation: /*
+
+Note, that you may need to change the branch name in the above snippet if you desire a different behavior.
+ + +Cloudflare is a cloud solutions provider with a huge proprietary content delivery network (CDN). Like Netlify or Vercel, Cloudflare Pages makes the deployment process flexible and easy. You can add a GitHub repo to the service and build & host Zola-based websites after each PR automatically.
+ZOLA_VERSION
as a variable name. Use 0.17.2
or a different Zola version as the value.Your website is now built and deployed to Cloudflare's network! You can add a custom domain or modify settings in the Pages dashboard.
+You may find documentation and guides like Getting started with Cloudflare Pages and +Deploying Zola with Cloudflare Pages in the Developers portal.
+Some tips to help troubleshoot issues getting started with Cloudflare Pages.
+zola: not found
If you see build output that resembles something like this:
+23:03:54.609 > build
+23:03:54.609 > zola build $BUILD_OPTS && npx tailwindcss -i ./public/input.css -o ./public/style.css -m
+23:03:54.609
+23:03:54.621 sh: 1: zola: not found
+23:03:54.635 Failed: Error while executing user command. Exited with error code: 127
+23:03:54.644 Failed: build command exited with code: 1
+23:03:55.699 Failed: error occurred while running build command
+
+Then it might be due to an outstanding issue. There are currently two recommended workarounds:
+v1
From within the workers & pages dash, go to the following:
+
Then select v1
and save.
UNSTABLE_PRE_BUILD
environment variable + asdf
From within the workers & pages dash, do the following:
+
And add an environment variable UNSTABLE_PRE_BUILD
, with the following value and save.
asdf plugin add zola https://github.com/salasrod/asdf-zola && asdf install zola 0.18.0 && asdf global zola 0.18.0
+
+
+
+ If you have to distribute a Zola based web site through Docker, it's easy to do with a multi-stage build.
+Here is an example that builds the current folder, and put the result in a docker image that will be served by +static-web-server, a minimalist web server written in rust.
+Of course, you may want to replace the second stage with another static web server like Nginx or Apache.
+FROM ghcr.io/getzola/zola:v0.17.1 as zola
+
+COPY . /project
+WORKDIR /project
+RUN ["zola", "build"]
+
+FROM ghcr.io/static-web-server/static-web-server:2
+WORKDIR /
+COPY --from=zola /project/public /public
+
+To build your website as a docker image, you then run:
+docker build -t my_website:latest .
+
+To test your site, just run the docker image and browse http://localhost:8000
+docker run --rm -p 8000:80 my_website:latest
+
+Note that, if you want to be able to use your docker image from multiple locations, you'll have to set base_url
to /
.
If you don't have an account with Edgio, you can sign up here.
+For a command-line manual deploy, follow these steps:
+npm i -g @edgio/cli
+
+npm init -y
+
+edgio init
+
+// This file was added by edgio init.
+// You should commit this file to source control.
+
+import { Router } from '@edgio/core/router'
+
+export default new Router().static('public')
+
+zola build
+
+edgio deploy
+
+
+
+ If you don't have an account with fly.io, you can sign up here.
+Then install the flyctl
tool following the instructions here.
Create a Dockerfile
:
FROM ghcr.io/getzola/zola:v0.17.2 AS builder
+
+WORKDIR /app
+COPY . .
+RUN ["zola", "build"]
+
+FROM joseluisq/static-web-server:2
+COPY --from=builder /app/public /public
+ENV SERVER_PORT 8080
+
+You can now run fly launch
. It will detect the Dockerfile
and mostly auto-configure everything. Fill out the necessary information, but say "no" to (1) launching any databases and (2) deploying immediately.
Take note of the hostname assigned to your app.
+If you already have a Zola site you must now ensure that base_url
in config.toml
is set correctly using the hostname from your app (or whatever domain you have pointing to the app):
base_url = "https://white-snow-9922.fly.dev"
+
+If you don't have an existing site, initialize one with zola init -f
and remember to set the correct base_url
.
You're now ready to launch your site! Run flyctl deploy
and have fun!
Finally, to set up continuous deployment of your site from GitHub, follow this guide, steps 4-8. Any changes to your site will now be pushed automatically.
+ + +By default, GitHub Pages uses Jekyll (a ruby based static site generator),
+but you can also publish any generated files provided you have an index.html
file in the root of a branch called
+gh-pages
, main
or master
. In addition you can publish from a docs
directory in your repository. That branch name can
+also be manually changed in the settings of a repository. To serve a site at <username>.github.io
or
+<organization>.github.io
, you must name the repository <username>.github.io
or
+<organization>.github.io
(otherwise GitHub will append the repository name to the URL, e.g.:
+<username>.github.io/<repositoryname>
.
We can use any continuous integration (CI) server to build and deploy our site. For example:
+ +In either case, it seems to work best if you use git submodule
to include your theme, e.g.:
git submodule add https://github.com/getzola/after-dark.git themes/after-dark
+
+Using Github Actions for the deployment of your Zola-Page on Github-Pages is pretty easy. You basically need three things:
+Let's start with the token. Remember, if you are publishing the site on the same repo, you do not need to follow that step. But you will still need to pass in the automatic GITHUB_TOKEN
as explained here.
For creating the token either click on here or go to Settings > Developer Settings > Personal access tokens. Under the Select Scopes section, give it public_repo permissions and click Generate token. Then copy the token, navigate to your repository and add in the Settings tab the Secret TOKEN
and paste your token in it.
Next we need to create the Github Action. Here we can make use of the zola-deploy-action. Go to the Actions tab of your repository, click on set up a workflow yourself to get a blank workflow file. Copy the following script into it and commit it afterwards; note that you may need to change the github.ref
branch from main
to master
or similar, as the action will only run for the branch you choose.
+If you get a permissions denied error, you may need to change the workflow permissions to read and write in Settings > Actions > Workflow permissions.
# On every push this script is executed
+on: push
+name: Build and deploy GH Pages
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ if: github.ref == 'refs/heads/main'
+ steps:
+ - name: checkout
+ uses: actions/checkout@v4
+ - name: build_and_deploy
+ uses: shalzz/zola-deploy-action@v0.17.2
+ env:
+ # Target branch
+ PAGES_BRANCH: gh-pages
+ # Provide personal access token
+ TOKEN: ${{ secrets.TOKEN }}
+ # Or if publishing to the same repo, use the automatic token
+ #TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+This script is pretty simple, because the zola-deploy-action is doing everything for you. You just need to provide some details. For more configuration options check out the README.
+By committing the action your first build is triggered. Wait until it's finished, then you should see in your repository a new branch gh-pages with the compiled Zola page in it.
+Finally we need to check the Github Pages section of the repository settings. Click on the Settings tab and scroll down to the Github Pages section. Check if the source is set to gh-pages branch and the directory is / (root). You should also see your Github Pages link.
+There you can also configure a custom domain and Enforce HTTPS mode. Before configuring a custom domains, please check out this.
+If you want to keep the source of your site in a private repository (including, for example, draft
+posts), adapt the following .github/workflows/main.yml
(making sure to update the branches as required):
on: push
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ if: github.ref != 'refs/heads/main'
+ steps:
+ - name: 'checkout'
+ uses: actions/checkout@v4
+ - name: 'build'
+ uses: shalzz/zola-deploy-action@v0.17.2
+ env:
+ PAGES_BRANCH: gh-pages
+ BUILD_DIR: .
+ TOKEN: ${{ secrets.TOKEN }}
+ # BUILD_ONLY: true
+ build_and_deploy:
+ runs-on: ubuntu-latest
+ if: github.ref == 'refs/heads/main'
+ steps:
+ - name: 'checkout'
+ uses: actions/checkout@v4
+ - name: 'build and deploy'
+ uses: shalzz/zola-deploy-action@v0.17.2
+ env:
+ PAGES_BRANCH: master
+ BUILD_DIR: .
+ TOKEN: ${{ secrets.PUBLIC_TOKEN }}
+ REPOSITORY: username/username.github.io
+
+by substituting your username or organization.
+Alternatively, you can use Travis CI to automatically publish the site. If you are not using Travis +already, you will need to login with the GitHub OAuth and activate Travis for the repository. +Don't forget to also check if your repository allows GitHub Pages in its settings.
+Depending on how you added your theme, Travis may not know how to access
+it. The best way to ensure that it will have full access to the theme is to use git
+submodules. When doing this, ensure that you are using the https
version of the URL.
$ git submodule add {THEME_URL} themes/{THEME_NAME}
+
+Before pushing anything, Travis needs a Github private access key to make changes to your repository.
+If you're already logged in to your account, just click here to go to
+your tokens page.
+Otherwise, navigate to Settings > Developer Settings > Personal Access Tokens
.
+Generate a new token and give it any description you'd like.
+Under the "Select Scopes" section, give it repo permissions. Click "Generate token" to finish up.
Your token will now be visible.
+Copy it into your clipboard and head back to Travis.
+Once on Travis, click on your project, and navigate to "Settings". Scroll down to "Environment Variables" and input a name of GH_TOKEN
with a value of your access token.
+Make sure that "Display value in build log" is off, and then click add. Now Travis has access to your repository.
We're almost done. We just need some scripts in a .travis.yml file to tell Travis what to do.
+NOTE: The script below assumes that we're taking the code from the code
branch and will generate the HTML to be published in the master
branch of the same repository. You're free to use any other branch for the Markdown files but if you want to use <username>.github.io
or <org>.github.io
, the destination branch MUST be master
.
language: minimal
+
+before_script:
+ # Download and unzip the zola executable
+ # Replace the version numbers in the URL by the version you want to use
+ - curl -s -L https://github.com/getzola/zola/releases/download/v0.13.0/zola-v0.13.0-x86_64-unknown-linux-gnu.tar.gz | sudo tar xvzf - -C /usr/local/bin
+
+script:
+ - zola build
+
+# If you are using a different folder than `public` for the output directory, you will
+# need to change the `zola` command and the `ghp-import` path
+after_success: |
+ [ $TRAVIS_BRANCH = code ] &&
+ [ $TRAVIS_PULL_REQUEST = false ] &&
+ zola build &&
+ sudo pip install ghp-import &&
+ ghp-import -n public -b master &&
+ git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git master
+
+If your site is using a custom domain, you will need to mention it in the ghp-import
command:
+ghp-import -c vaporsoft.net -n public
for example.
Credits: The Travis-CI section of this page is based on the article https://vaporsoft.net/publishing-gutenberg-to-github/
+If you're using a custom domain for your GitHub Pages site, put the CNAME in static/CNAME so that Zola puts it in the root of the public folder which is where GitHub expects it to be.
+ + +We are going to use the GitLab Runner in GitLab CI/CD to host +the site on GitLab Pages.
+It is possible to host your Zola site on either the SaaS instance offered by +GitLab (https://gitlab.com) or on a self-hosted instance.
+It is recommended to create a repository on GitLab that contains solely your +Zola project. The Zola's directory structure +should be located in the root directory of your repository.
+For information on how to create and manage a repository on GitLab, refer to:
+https://docs.gitlab.com/ee/user/project/repository/
+Depending on how you added your theme, your repository may not contain it.
+The best way to ensure that the theme will be added is to use submodules.
+When doing this, ensure that you are using the https
version of the URL.
git submodule add {THEME_URL} themes/{THEME_NAME}
+
+For example, this could look like:
+git submodule add https://github.com/getzola/hyde.git themes/hyde
+
+The GitLab Runner needs to know how to create your site in order to deploy +it to the GitLab Pages server.
+We provide you with a template to accomplish this task easily.
+Create a file called .gitlab-ci.yml
in the root directory of your
+repository and copy the contents of the template below.
stages:
+ - deploy
+
+default:
+ image: debian:stable-slim
+ tags:
+ - docker
+
+variables:
+ # The runner will be able to pull your Zola theme when the strategy is
+ # set to "recursive".
+ GIT_SUBMODULE_STRATEGY: "recursive"
+
+ # If you don't set a version here, your site will be built with the latest
+ # version of Zola available in GitHub releases.
+ # Use the semver (x.y.z) format to specify a version. For example: "0.17.2" or "0.18.0".
+ ZOLA_VERSION:
+ description: "The version of Zola used to build the site."
+ value: ""
+
+pages:
+ stage: deploy
+ script:
+ - |
+ apt-get update --assume-yes && apt-get install --assume-yes --no-install-recommends wget ca-certificates
+ if [ $ZOLA_VERSION ]; then
+ zola_url="https://github.com/getzola/zola/releases/download/v$ZOLA_VERSION/zola-v$ZOLA_VERSION-x86_64-unknown-linux-gnu.tar.gz"
+ if ! wget --quiet --spider $zola_url; then
+ echo "A Zola release with the specified version could not be found.";
+ exit 1;
+ fi
+ else
+ github_api_url="https://api.github.com/repos/getzola/zola/releases/latest"
+ zola_url=$(
+ wget --output-document - $github_api_url |
+ grep "browser_download_url.*linux-gnu.tar.gz" |
+ cut --delimiter : --fields 2,3 |
+ tr --delete "\" "
+ )
+ fi
+ wget $zola_url
+ tar -xzf *.tar.gz
+ ./zola build
+
+ artifacts:
+ paths:
+ # This is the directory whose contents will be deployed to the GitLab Pages
+ # server.
+ # GitLab Pages expects a directory with this name by default.
+ - public
+
+ rules:
+ # This rule makes it so that your website is published and updated only when
+ # you push to the default branch of your repository (e.g. "master" or "main").
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+
+Please, keep in mind that this template assumes you are using the +Docker executor +on your GitLab Runner. +Feel free to adjust the file to your workflow and specific requirements.
+After you push this file to the default branch of your repository +(e.g. "master" or "main"), your site will be ready. The GitLab CI/CD pipelines +will ensure your site is published and updated automatically.
+On the left sidebar of GitLab, navigate to Deploy > Pages to find the URL of your +website inside the Access pages section.
+More information on how to host your site on GitLab Pages is available +in the official GitLab documentation.
+ + +Click here to be redirected.
diff --git a/documentation/deployment/netlify/index.html b/documentation/deployment/netlify/index.html new file mode 100644 index 0000000000..7c4eaaf500 --- /dev/null +++ b/documentation/deployment/netlify/index.html @@ -0,0 +1,320 @@ + + + + + + + + +If you don't have an account with Netlify, you can sign up for one.
+Once you are in the admin interface, you can add a site from a Git provider (GitHub, GitLab or Bitbucket). At the end +of this process, you can select the deploy settings for the project:
+zola build
(replace the version number in the variable by the version you want to use)public
directory isZOLA_VERSION
with for example 0.13.0
as valueWith this setup, your site should be automatically deployed on every commit on master. For ZOLA_VERSION
, you may
+use any of the tagged release
versions in the GitHub repository. Netlify will automatically fetch the tagged version
+and use it to build your site.
However, if you want to use everything that Netlify gives you, you should also publish temporary sites for pull requests.
+This is done by adding the following netlify.toml
file in your repository and removing the build command/publish
+directory in the admin interface.
[build]
+# This assumes that the Zola site is in a docs folder. If it isn't, you don't need
+# to have a `base` variable but you do need the `publish` and `command` variables.
+base = "docs"
+publish = "docs/public"
+command = "zola build"
+
+[build.environment]
+# Set the version name that you want to use and Netlify will automatically use it.
+ZOLA_VERSION = "0.13.0"
+
+# The magic for deploying previews of branches.
+# We need to override the base url with whatever url Netlify assigns to our
+# preview site. We do this using the Netlify environment variable
+# `$DEPLOY_PRIME_URL`.
+
+[context.deploy-preview]
+command = "zola build --base-url $DEPLOY_PRIME_URL"
+
+If you would prefer to use a version of Zola that isn't a tagged release (for example, after having built Zola from
+source and made modifications), then you will need to manually deploy your public
folder to Netlify. You can do
+this through Netlify's web GUI or via the command line.
For a command-line manual deploy, follow these steps:
+Personal Access Token
from the settings section of your Netlify account (not an OAuth Application).zola build
.public
directory.curl
command below, filling in your values for PERSONAL_ACCESS_TOKEN_FROM_STEP_1, FILE_NAME.zip
+and SITE_NAME.curl -H "Content-Type: application/zip" \
+ -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN_FROM_STEP_1" \
+ --data-binary "@FILE_NAME.zip" \
+ https://api.netlify.com/api/v1/sites/SITE_NAME.netlify.com/deploys
+
+
+
+ Zola outputs plain files, no databases needed. This makes hosting and deployment +trivial on many providers.
+ + +Deploying your static Zola website on Sourcehut Pages is very simple.
+You need to create a .build.yml
manifest file in the root folder of your Zola project and push your changes to the
+Sourcehut git/hg repository.
+To create your .build.yml
file you can start with a template or use the following example:
image: alpine/edge
+packages:
+ - hut
+ - zola
+oauth: pages.sr.ht/PAGES:RW
+environment:
+ site: your_username.srht.site
+sources:
+ - https://git.sr.ht/~your_username/my-website
+tasks:
+ - build: |
+ cd my-website
+ zola build
+ - package: |
+ cd my-website
+ tar -C public -cvz . > ../site.tar.gz
+ - upload: |
+ hut pages publish -d $site site.tar.gz
+
+This manifest will clone your source code, build the website and upload the generated static files to the domain
+you specified in site
.
+For publishing the website, the build manifest uses hut
, a commandline tool which takes care of automatically
+generating authentication tokens, so there is nothing else you need to do.
From this template you need to customize the variable site
with the domain that will host your website and
+sources
to point to your Sourcehut git/hg public URL (in this example my-website
is the name of the repository).
Then commit and push your changes:
+$ git push
+Enumerating objects: 5, done.
+...
+remote: Build started:
+remote: https://builds.sr.ht/~your_username/job/430625 [.build.yml]
+To git.sr.ht:~your_username/www
+ fbe9afa..59ae556 master -> master
+
+The build job will be automatically triggered. +Notice that Sourcehut returns a direct link to the build page, where you can check the progress and success status.
+By default you can use a subdomain of Sourcehut Pages to host your static website - your_username.srht.site
.
+If you want to use a custom domain (e.g. "blog.mydomain.org"), you will need to configure a DNS record to point to
+the Sourcehut server.
+Instructions on how to do this are available on Sourcehut.
Vercel (previously Zeit) is similar to Netlify, making the deployment of your site easy as pie. +The sites are hosted by Vercel and automatically deployed whenever we push a commit to our +selected production branch (e.g, master).
+If you don't have an account with Vercel, you can sign up here.
+Once you sign up you can import your site from a Git provider (Github, GitLab or Bitbucket). +When you import your repository, Vercel will try to find out what framework your site is using.
+If it doesn't default to Zola:
+By default, Vercel chooses output directory as public
. If you use a different directory, then
+specify output directory under the "Build and Output Settings" dropdown.
+You can learn more about how to setup a custom domain and how to get the most out of Vercel
+via their documentation.
After you click the blue "Deploy" button, it's off to the races!
+To use a specific version of Zola, set ZOLA_VERSION
environment variable in project settings to a valid
+release tag, for example 0.17.2
.
GLIBC_X.XX
not foundThis is because Vercel's build images comes with an older glibc version whereas Zola +depends on a newer glibc. However, Vercel provides a newer build image which can be used in +deployments by setting Node.js version to "20.x", allowing Zola to work properly.
+Visiting a page without trailing slash may break relative paths, so you might want to configure +Vercel to always redirect paths with a trailing slash. By default, redirecting to a trailing +slash is not enabled on Vercel.
+For example if you have an about.md
file, and when visiting the path without a trailing
+slash, like /about
, Vercel will redirect with trailing slash, resulting in /about/
.
+Paths with a file extension will not redirect to a trailing slash, for example if you
+have a static file named favicon.ico
, it will stay as-is.
To enable that, create a file in the root of your git repository named vercel.json
+(if it doesn't exists already), and set this option:
{
+ "trailingSlash": true
+}
+
+When enabled, all HTML files will be served without their file extension. For example
+if you have an about.md
file, Zola will generate a about/index.html
file, but Vercel
+will serve the file as /about
, without its index.html
suffix.
To enable that, create a file in the root of your git repository named vercel.json
+(if it doesn't exists already), and set this option:
{
+ "cleanUrls": true
+}
+
+If you want to use your own Zola binary that published on GitHub, or if you want to +always use the latest version of Zola, you can run a shell command to grab the +latest release from GitHub.
+To do that, set "Framework Preset" to "Other", and override "Install Command" to:
+REPO="getzola/zola"; curl -fsS https://api.github.com/repos/${REPO}/releases/latest | grep -oP '"browser_download_url": ?"\K(.+linux-gnu.tar.gz)' | xargs -n 1 curl -fsSL -o zola.tar.gz && tar -xzvf zola.tar.gz
+
+This command will fetch the latest release from GitHub, download the archive and extract it.
+Then, set "Build Command" to ./zola build
. Now Vercel will use the downloaded Zola
+binary to build the documentation instead of using the built-in one.
If you prefer to use vercel.json
instead, (which overrides the options set in the dashboard)
+you can use this configuration.
{
+ "framework": null,
+ "installCommand": "REPO=\"getzola/zola\"; curl -fsS https://api.github.com/repos/${REPO}/releases/latest | grep -oP '\"browser_download_url\": ?\"\\K(.+linux-gnu.tar.gz)' | xargs -n 1 curl -fsSL -o zola.tar.gz && tar -xzvf zola.tar.gz",
+ "buildCommand": "./zola build",
+ "outputDirectory": "public"
+}
+
+See Vercel's own documentation
+for all available options in vercel.json
.
In this tutorial, we'll guide you through the process of deploying your Zola site onto the Zeabur. Zeabur provides a seamless deployment experience, with automatic SSL certificates and global-edge network delivery. Let's get started!
+Initialize a Git repository in your Zola project folder if you haven't already:
+git init
+git add .
+git commit -m "Initial commit"
+
+Push your Zola project to GitHub:
+git remote add origin <your-github-repo-url>
+git branch -M main
+git push -u origin main
+
+Replace <your-github-repo-url>
with the URL of your GitHub repository.
Zeabur will automatically detect that you're deploying a Zola project and will handle the deployment process for you without any additional configuration needed.
+To use a specific version of Zola, set ZOLA_VERSION
environment variable in project settings to a valid
+release tag, for example 0.17.2
.
.zeabur.app
subdomain or bind your own custom domain.Congratulations! Your Zola site is now deployed and live, served through Zeabur's edge network.
+You can now visit your website at the domain you've set up.
+ + +Zola only has 4 commands: init
, build
, serve
and check
.
You can view the help for the whole program by running zola --help
and
+that for a specific command by running zola <cmd> --help
.
Creates the directory structure used by Zola at the given directory after asking a few basic configuration questions.
+Any choices made during these prompts can be easily changed by modifying config.toml
.
$ zola init my_site
+$ zola init
+
+If the my_site
directory already exists, Zola will only populate it if it contains only hidden files (dotfiles are ignored). If no my_site
argument is passed, Zola will try to populate the current directory.
In case you want to attempt to populate a non-empty directory and are brave, you can use zola init --force
. Note that this will not overwrite existing folders or files; in those cases you will get a File exists (os error 17)
error or similar.
You can initialize a git repository and a Zola site directly from within a new folder:
+$ git init
+$ zola init
+
+This will build the whole site in the public
directory (if this directory already exists, it is deleted).
$ zola build
+
+You can override the config base_url
by passing a new URL to the base-url
flag.
$ zola build --base-url $DEPLOY_URL
+
+This is useful for example when you want to deploy previews of a site to a dynamic URL, such as Netlify +deploy previews.
+You can override the default output directory public
by passing another value to the output-dir
flag. If this directory already exists, the user will be prompted whether to replace the folder; you can override this prompt by passing the --force flag.
$ zola build --output-dir $DOCUMENT_ROOT
+
+You can point to a config file other than config.toml
like so (note that the position of the config
option is important):
$ zola --config config.staging.toml build
+
+You can also process a project from a different directory with the root
flag. If building a project 'out-of-tree' with the root
flag, you may want to combine it with the output-dir
flag. (Note that like config
, the position is important):
$ zola --root /path/to/project build
+
+By default, drafts are not loaded. If you wish to include them, pass the --drafts
flag.
This will build and serve the site using a local server. You can also specify
+the interface/port combination to use if you want something different than the default (127.0.0.1:1111
).
You can also specify different addresses for the interface and base_url using --interface
and -u
/--base-url
, respectively, if for example you are running Zola in a Docker container.
++By default, devices from the local network won't be able to access the served pages. This may be of importance when you want to test page interaction and layout on your mobile device or tablet. If you set the interface to
+0.0.0.0
however, devices from your local network will be able to access the served pages by requesting the local ip-address of the machine serving the pages and port used.In order to have everything work correctly, you might also have to alter the
+base-url
flag to your local ip or set it to/
to use server-base relative paths.
Use the --open
flag to automatically open the locally hosted instance in your
+web browser.
Before starting, Zola will delete the output directory (by default public
in project root) to start from a clean slate.
If you are specifying the directory but are also using the output-dir
flag, Zola will not use the specified directory if it already exists unless the --force flag is used.
$ zola serve
+$ zola serve --port 2000
+$ zola serve --interface 0.0.0.0
+$ zola serve --interface 0.0.0.0 --port 2000
+$ zola serve --interface 0.0.0.0 --base-url 127.0.0.1
+$ zola serve --interface 0.0.0.0 --base-url /
+$ zola serve --interface 0.0.0.0 --port 2000 --output-dir www/public
+$ zola serve --open
+
+The serve command will watch all your content and provide live reload without +a hard refresh if possible. If you are using WSL2 on Windows, make sure to store the website on the WSL file system.
+Some changes cannot be handled automatically and thus live reload may not always work. If you
+fail to see your change or get an error, try restarting zola serve
.
You can also point to a config file other than config.toml
like so (note that the position of the config
option is important):
$ zola --config config.staging.toml serve
+
+By default, drafts are not loaded. If you wish to include them, pass the --drafts
flag.
The check subcommand will try to build all pages just like the build command would, but without writing any of the +results to disk. Additionally, it will also check all external links in Markdown files by trying to fetch +them (links in the template files are not checked).
+By default, drafts are not loaded. If you wish to include them, pass the --drafts
flag.
Colored output is used if your terminal supports it.
+Note: coloring is automatically disabled when the output is redirected to a pipe or a file (i.e., when the standard output is not a TTY).
+You can disable this behavior by exporting one of the following two environment variables:
+NO_COLOR
(the value does not matter)CLICOLOR=0
To force the use of colors, you can set the following environment variable:
+CLICOLOR_FORCE=1
The default configuration is sufficient to get Zola running locally but not more than that. +It follows the philosophy of paying for only what you need, almost everything is turned off by default.
+To change the configuration, edit the config.toml
file.
+If you are not familiar with TOML, have a look at the TOML spec.
⚠️ If you add keys to your config.toml
, you must pay attention to which TOML section it belongs to. A TOML section starts with a header, e.g. [search]
, and ends at the next section or EOF.
Here are the current config.toml
sections:
Only the base_url
variable is mandatory. Everything else is optional. All configuration variables
+used by Zola as well as their default values are listed below:
# The base URL of the site; the only required configuration variable.
+base_url = "https://mywebsite.com"
+
+# The site title and description; used in feeds by default.
+title = ""
+description = ""
+
+# The default language; used in feeds.
+default_language = "en"
+
+# The site theme to use.
+theme = ""
+
+# For overriding the default output directory `public`, set it to another value (e.g.: "docs")
+output_dir = "public"
+
+# Whether dotfiles at the root level of the output directory are preserved when (re)building the site.
+# Enabling this also prevents the deletion of the output folder itself on rebuilds.
+preserve_dotfiles_in_output = false
+
+# When set to "true", the Sass files in the `sass` directory in the site root are compiled.
+# Sass files in theme directories are always compiled.
+compile_sass = false
+
+# When set to "true", the generated HTML files are minified.
+minify_html = false
+
+# A list of glob patterns specifying asset files to ignore when the content
+# directory is processed. Defaults to none, which means that all asset files are
+# copied over to the `public` directory.
+# Example:
+# ignored_content = ["*.{graphml,xlsx}", "temp.*", "**/build_folder"]
+ignored_content = []
+
+# Similar to ignored_content, a list of glob patterns specifying asset files to
+# ignore when the static directory is processed. Defaults to none, which means
+# that all asset files are copied over to the `public` directory
+ignored_static = []
+
+# When set to "true", a feed is automatically generated.
+generate_feed = false
+
+# The filename to use for the feed. Used as the template filename, too.
+# Defaults to "atom.xml", which has a built-in template that renders an Atom 1.0 feed.
+# There is also a built-in template "rss.xml" that renders an RSS 2.0 feed.
+feed_filename = "atom.xml"
+
+# The number of articles to include in the feed. All items are included if
+# this limit is not set (the default).
+# feed_limit = 20
+
+# When set to "true", files in the `static` directory are hard-linked. Useful for large
+# static files. Note that for this to work, both `static` and the
+# output directory need to be on the same filesystem. Note that the theme's `static`
+# files are always copied, regardless of this setting.
+hard_link_static = false
+
+# The default author for pages
+author =
+
+# The taxonomies to be rendered for the site and their configuration of the default languages
+# Example:
+# taxonomies = [
+# {name = "tags", feed = true}, # each tag will have its own feed
+# {name = "tags"}, # you can have taxonomies with the same name in multiple languages
+# {name = "categories", paginate_by = 5}, # 5 items per page for a term
+# {name = "authors"}, # Basic definition: no feed or pagination
+# ]
+#
+taxonomies = []
+
+# When set to "true", a search index is built from the pages and section
+# content for `default_language`.
+build_search_index = false
+
+# Configuration of the Markdown rendering
+[markdown]
+# When set to "true", all code blocks are highlighted.
+highlight_code = false
+
+# A list of directories used to search for additional `.sublime-syntax` and `.tmTheme` files.
+extra_syntaxes_and_themes = []
+
+# The theme to use for code highlighting.
+# See below for list of allowed values.
+highlight_theme = "base16-ocean-dark"
+
+# When set to "true", emoji aliases translated to their corresponding
+# Unicode emoji equivalent in the rendered Markdown files. (e.g.: :smile: => 😄)
+render_emoji = false
+
+# Whether external links are to be opened in a new tab
+# If this is true, a `rel="noopener"` will always automatically be added for security reasons
+external_links_target_blank = false
+
+# Whether to set rel="nofollow" for all external links
+external_links_no_follow = false
+
+# Whether to set rel="noreferrer" for all external links
+external_links_no_referrer = false
+
+# Whether smart punctuation is enabled (changing quotes, dashes, dots in their typographic form)
+# For example, `...` into `…`, `"quote"` into `“curly”` etc
+smart_punctuation = false
+
+# Whether to set decoding="async" and loading="lazy" for all images
+# When turned on, the alt text must be plain text.
+# For example, `![xx](...)` is ok but `![*x*x](...)` isn’t ok
+lazy_async_image = false
+
+# Configuration of the link checker.
+[link_checker]
+# Skip link checking for external URLs that start with these prefixes
+skip_prefixes = [
+ "http://[2001:db8::]/",
+]
+
+# Skip anchor checking for external URLs that start with these prefixes
+skip_anchor_prefixes = [
+ "https://caniuse.com/",
+]
+
+# Treat internal link problems as either "error" or "warn", default is "error"
+internal_level = "error"
+
+# Treat external link problems as either "error" or "warn", default is "error"
+external_level = "error"
+
+# Various slugification strategies, see below for details
+# Defaults to everything being a slug
+[slugify]
+paths = "on"
+taxonomies = "on"
+anchors = "on"
+# Whether to remove date prefixes for page path slugs.
+# For example, content/posts/2016-10-08_a-post-with-dates.md => posts/a-post-with-dates
+# When true, content/posts/2016-10-08_a-post-with-dates.md => posts/2016-10-08-a-post-with-dates
+paths_keep_dates = false
+
+[search]
+# Whether to include the title of the page/section in the index
+include_title = true
+# Whether to include the description of the page/section in the index
+include_description = false
+# Whether to include the path of the page/section in the index
+include_path = false
+# Whether to include the rendered content of the page/section in the index
+include_content = true
+# At which character to truncate the content to. Useful if you have a lot of pages and the index would
+# become too big to load on the site. Defaults to not being set.
+# truncate_content_length = 100
+
+# Wether to produce the search index as a javascript file or as a JSON file
+# Accepted value "elasticlunr_javascript" or "elasticlunr_json"
+index_format = "elasticlunr_javascript"
+
+# Optional translation object for the default language
+# Example:
+# default_language = "fr"
+#
+# [translations]
+# title = "Un titre"
+#
+[translations]
+
+# Additional languages definition
+# You can define language specific config values and translations:
+# title, description, generate_feed, feed_filename, taxonomies, build_search_index
+# as well as its own search configuration and translations (see above for details on those)
+[languages]
+# For example
+# [languages.fr]
+# title = "Mon blog"
+# generate_feed = true
+# taxonomies = [
+# {name = "auteurs"},
+# {name = "tags"},
+# ]
+# build_search_index = false
+
+# You can put any kind of data here. The data
+# will be accessible in all templates
+# Example:
+# [extra]
+# author = "Famous author"
+#
+# author value will be available using {{ config.extra.author }} in templates
+#
+[extra]
+
+Zola currently has the following highlight themes available:
+Zola uses the Sublime Text themes, making it very easy to add more. +If you want a theme not listed above, please open an issue or a pull request on the Zola repo.
+Alternatively you can use the extra_syntaxes_and_themes
configuration option to load your own custom themes from a .tmTheme file.
+See Syntax Highlighting for more details.
By default, Zola will turn every path, taxonomies and anchors to a slug, an ASCII representation with no special characters. +You can however change that strategy for each kind of item, if you want UTF-8 characters in your URLs for example. There are 3 strategies:
+on
: the default one, everything is turned into a slugsafe
: characters that cannot exist in files on Windows (<>:"/\|?*
) or Unix (/
) are removed, everything else staysoff
: nothing is changed, your site might not build on some OS and/or break various URL parsersSince there are no filename issues with anchors, the safe
and off
strategies are identical in their case: the only change
+is space being replaced by _
since a space is not valid in an anchor.
Note that if you are using a strategy other than the default, you will have to manually escape whitespace and Markdown
+tokens to be able to link to your pages. For example an internal link to a file named some space.md
will need to be
+written like some%20space.md
in your Markdown files.
After running zola init
, you should see the following structure in your directory:
.
+├── config.toml
+├── content
+├── sass
+├── static
+├── templates
+└── themes
+
+5 directories, 1 file
+
+You might also see a public
directory if you are running the default zola build/serve
commands which contains some output for the site: the full site for zola build
and only the static assets for zola serve
. This folder will be deleted/created automatically by zola serve
.
Here's a high-level overview of each of these directories and config.toml
.
config.toml
A mandatory Zola configuration file in TOML format. +This file is explained in detail in the configuration documentation.
+content
Contains all your markup content (mostly .md
files).
+Each child directory of the content
directory represents a section
+that contains pages (your .md
files).
To learn more, read the content overview page.
+sass
Contains the Sass files to be compiled. Non-Sass files will be ignored.
+The directory structure of the sass
folder will be preserved when copying over the compiled files; for example, a file at
+sass/something/site.scss
will be compiled to public/something/site.css
.
static
Contains any kind of file. All the files/directories in the static
directory will be copied as-is to the output directory.
+If your static files are large, you can configure Zola to hard link them
+instead of copying them by setting hard_link_static = true
in the config file.
templates
Contains all the Tera templates that will be used to render your site. +Have a look at the templates documentation to learn more about default templates +and available variables.
+themes
Contains themes that can be used for your site. If you are not planning to use themes, leave this directory empty. +If you want to learn about themes, see the themes documentation.
+ + +Click here to be redirected.
diff --git a/documentation/getting-started/installation/index.html b/documentation/getting-started/installation/index.html new file mode 100644 index 0000000000..56e347ee9a --- /dev/null +++ b/documentation/getting-started/installation/index.html @@ -0,0 +1,408 @@ + + + + + + + + +Zola provides pre-built binaries for MacOS, Linux and Windows on the +GitHub release page.
+Zola is available on Brew:
+$ brew install zola
+
+Zola is also available on MacPorts:
+$ sudo port install zola
+
+Zola is available in the official Arch Linux repositories.
+$ pacman -S zola
+
+Zola is available in the official Alpine Linux community repository since Alpine v3.13.
+See this section of the Alpine Wiki explaining how to enable the community repository if necessary: https://wiki.alpinelinux.org/wiki/Repositories#Enabling_the_community_repository
+$ apk add zola
+
+Zola is available over at barnumbirr/zola-debian.
+Grab the latest .deb
for your Debian version then simply run:
$ sudo dpkg -i zola_<version>_amd64_debian_<debian_version>.deb
+
+On Fedora, Zola is available via COPR.
+$ sudo dnf copr enable fz0x1/zola
+$ sudo dnf install zola
+
+Zola is available via GURU.
+$ sudo eselect repository enable guru
+$ sudo emaint sync --repo guru
+$ sudo emerge --ask www-apps/zola
+
+Zola is available in the official Void Linux repositories.
+$ sudo xbps-install zola
+
+Zola is available in the official package repository.
+$ pkg install zola
+
+Zola is available in the official package repository.
+$ doas pkg_add zola
+
+Zola is available in the official package repository, with pkgin.
+$ pkgin install zola
+
+Zola is available on snapcraft:
+$ snap install --edge zola
+
+Zola is available as a flatpak on flathub:
+$ flatpak install flathub org.getzola.zola
+
+To use zola:
+$ flatpak run org.getzola.zola [command]
+
+To avoid having to type this every time, an alias can be created in ~/.bashrc
:
$ alias zola="flatpak run org.getzola.zola"
+
+Zola is available
+in the nixpkgs repository. If you're using NixOS, you can install Zola
+by adding the following to /etc/nixos/configuration.nix
:
environment.systemPackages = [
+ pkgs.zola
+];
+
+If you're using Nix as a package manager in another OS, you can install it using:
+nix-env -iA nixpkgs.zola
+
+Zola can be installed in a GHA workflow with taiki-e/install-action. +Simply add it in your CI config, for example:
+jobs:
+ foo:
+ steps:
+ - uses: taiki-e/install-action@v2
+ with:
+ tool: zola@0.17.1
+ # ...
+
+See the action repo for docs and more examples.
+Zola is available on the GitHub registry.
+It has no latest
tag, you will need to specify a specific version to pull.
$ docker pull ghcr.io/getzola/zola:v0.17.1
+
+$ docker run -u "$(id -u):$(id -g)" -v $PWD:/app --workdir /app ghcr.io/getzola/zola:v0.17.1 build
+
+$ docker run -u "$(id -u):$(id -g)" -v $PWD:/app --workdir /app -p 8080:8080 ghcr.io/getzola/zola:v0.17.1 serve --interface 0.0.0.0 --port 8080 --base-url localhost
+
+You can now browse http://localhost:8080.
+++To enable live browser reload, you may have to bind to port 1024. Zola searches for an open +port between 1024 and 9000 for live reload. The new docker command would be +
+$ docker run -u "$(id -u):$(id -g)" -v $PWD:/app --workdir /app -p 8080:8080 -p 1024:1024 ghcr.io/getzola/zola:v0.17.1 serve --interface 0.0.0.0 --port 8080 --base-url localhost
Since there is no shell in the Zola docker image, if you want to use it from inside a Dockerfile, you have to use the
+exec form of RUN
, like:
FROM ghcr.io/getzola/zola:v0.17.1 as zola
+
+COPY . /project
+WORKDIR /project
+RUN ["zola", "build"]
+
+Zola could be installed using official Winget command:
+$ winget install getzola.zola
+
+Also it is available on Scoop:
+$ scoop install zola
+
+and Chocolatey:
+$ choco install zola
+
+Zola does not work in PowerShell ISE.
+To build Zola from source, you will need to have Git, Rust and Cargo +installed.
+From a terminal, you can now run the following commands:
+$ git clone https://github.com/getzola/zola.git
+$ cd zola
+$ cargo install --path . --locked
+$ zola --version
+
+If you encountered compilation errors like error: failed to run custom build command for 'ring v0.16.20'
, you can try the command below instead:
$ cargo build --release --locked --no-default-features --features=native-tls
+
+The binary will be available in the target/release
directory. You can move it in your $PATH
to have the
+zola
command available globally:
$ cp target/release/zola ~/.cargo/bin/zola
+
+or in a directory if you want for example to have the binary in the same repository as the site.
+ + +Zola is a static site generator (SSG), similar to Hugo, Pelican, and Jekyll (for a comprehensive list of SSGs, please see Jamstack). It is written in Rust and uses the Tera template engine, which is similar to Jinja2, Django templates, Liquid, and Twig.
+Content is written in CommonMark, a strongly defined, highly compatible specification of Markdown. Zola uses pulldown-cmark to parse markdown files. The goal of this library is 100% compliance with the CommonMark spec. It adds a few additional features such as parsing footnotes, Github flavored tables, Github flavored task lists and strikethrough.
+SSGs use dynamic templates to transform content into static HTML pages. Static sites are thus very fast and require no databases, making them easy to host. A comparison between static and dynamic sites, such as WordPress, Drupal, and Django, can be found here.
+To get a taste of Zola, please see the quick overview below.
+Unlike some SSGs, Zola makes no assumptions regarding the structure of your site. In this overview, we'll be making a simple blog site.
+++This overview is based on Zola 0.17.1.
+
Please see the detailed installation instructions for your platform. With Zola installed, let's initialize our site:
+$ zola init myblog
+
+You will be asked a few questions.
+> What is the URL of your site? (https://example.com):
+> Do you want to enable Sass compilation? [Y/n]:
+> Do you want to enable syntax highlighting? [y/N]:
+> Do you want to build a search index of the content? [y/N]:
+
+For our blog, let's accept the default values (i.e., press Enter for each question). We now have a myblog
directory with the following structure:
├── config.toml
+├── content
+├── sass
+├── static
+├── templates
+└── themes
+
+For reference, by the end of this overview, our myblog
directory will have the following structure:
├── config.toml
+├── content/
+│ └── blog/
+│ ├── _index.md
+│ ├── first.md
+│ └── second.md
+├── sass/
+├── static/
+├── templates/
+│ ├── base.html
+│ ├── blog-page.html
+│ ├── blog.html
+│ └── index.html
+└── themes/
+
+Let's start the Zola development server within the newly created myblog
directory:
$ cd myblog
+$ zola serve
+Building site...
+Checking all internal links with anchors.
+> Successfully checked 0 internal link(s) with anchors.
+-> Creating 0 pages (0 orphan) and 0 sections
+Done in 13ms.
+
+Listening for changes in .../myblog/{config.toml,content,sass,static,templates}
+Press Ctrl+C to stop
+
+Web server is available at http://127.0.0.1:1111
+
+If you point your web browser to http://127.0.0.1:1111, you should see a "Welcome to Zola" message.
+Let's make a home page. To do this, let's first create a base.html
file inside the templates
directory. This step will make more sense as we move through this overview.
<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="utf-8">
+ <title>MyBlog</title>
+</head>
+
+<body>
+ <section class="section">
+ <div class="container">
+ {% block content %} {% endblock %}
+ </div>
+ </section>
+</body>
+
+</html>
+
+Now, let's create an index.html
file inside the templates
directory.
{% extends "base.html" %}
+
+{% block content %}
+<h1 class="title">
+ This is my blog made with Zola.
+</h1>
+{% endblock content %}
+
+This tells Zola that index.html
extends our base.html
file and replaces the block called "content" with the text between the {% block content %}
and {% endblock content %}
tags.
Now let's add some content. We'll start by making a blog
subdirectory in the content
directory and creating an _index.md
file inside it. This file tells Zola that blog
is a section, which is how content is categorized in Zola.
├── content
+│ └── blog
+│ └── _index.md
+
+In the _index.md
file, we'll set the following variables in TOML format:
+++
+title = "List of blog posts"
+sort_by = "date"
+template = "blog.html"
+page_template = "blog-page.html"
++++
+
+++Note that although no variables are mandatory, the opening and closing
++++
are required.
blog.html
in the templates
directory as the template for listing the Markdown files in this section. blog-page.html
in the templates
directory as the template for individual Markdown files. For a full list of section variables, please see the section documentation. We will use title = "List of blog posts" in a template (see below).
+Let's now create some more templates. In the templates
directory, create a blog.html
file with the following contents:
{% extends "base.html" %}
+
+{% block content %}
+<h1 class="title">
+ {{ section.title }}
+</h1>
+<ul>
+ <!-- If you are using pagination, section.pages will be empty. You need to use the paginator object -->
+ {% for page in section.pages %}
+ <li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li>
+ {% endfor %}
+</ul>
+{% endblock content %}
+
+As done by index.html
, blog.html
extends base.html
, but this time we want to list the blog posts. The title we set in the _index.md
file above is available to us as {{ section.title }}
. In the list below the title, we loop through all the pages in our section (blog
directory) and output the page title and URL using {{ page.title }}
and {{ page.permalink | safe }}
, respectively. We use the | safe
filter because the permalink doesn't need to be HTML escaped (escaping would cause /
to render as /
).
If you go to http://127.0.0.1:1111/blog/, you will see the section page for blog
. The list is empty because we don't have any blog posts. Let's fix that now.
In the blog
directory, create a file called first.md
with the following contents:
+++
+title = "My first post"
+date = 2019-11-27
++++
+
+This is my first blog post.
+
+The title and date will be available to us in the blog-page.html
template as {{ page.title }}
and {{ page.date }}
, respectively. All text below the closing +++
will be available to us as {{ page.content }}
.
We now need to make the blog-page.html
template. In the templates
directory, create this file with the contents:
{% extends "base.html" %}
+
+{% block content %}
+<h1 class="title">
+ {{ page.title }}
+</h1>
+<p class="subtitle"><strong>{{ page.date }}</strong></p>
+{{ page.content | safe }}
+{% endblock content %}
+
+++Note the
+| safe
filter for{{ page.content }}
.
This should start to look familiar. If you now go back to our blog list page at http://127.0.0.1:1111/blog/, you should see our lonely post. Let's add another. In the content/blog
directory, let's create the file second.md
with the contents:
+++
+title = "My second post"
+date = 2019-11-28
++++
+
+This is my second blog post.
+
+Back at http://127.0.0.1:1111/blog/, our second post shows up on top of the list because it's newer than the first post and we had set sort_by = "date" in our _index.md
file. As a final step, let's modify our home page to link to our blog posts.
The index.html
file inside the templates
directory should be:
{% extends "base.html" %}
+
+{% block content %}
+<h1 class="title">
+ This is my blog made with Zola.
+</h1>
+<p>Click <a href="{{ get_url(path='@/blog/_index.md') }}">here</a> to see my posts.</p>
+{% endblock content %}
+
+This has been a quick overview of Zola. You can now dive into the rest of the documentation.
+ + +Click here to be redirected.
diff --git a/documentation/templates/404/index.html b/documentation/templates/404/index.html new file mode 100644 index 0000000000..0df8da44e7 --- /dev/null +++ b/documentation/templates/404/index.html @@ -0,0 +1,269 @@ + + + + + + + + +Zola will look for a 404.html
file in the templates
directory or
+use the built-in one. The default template is very basic and gets config
in its context.
Zola doesn't have a built-in way to display an archive page (a page showing +all post titles ordered by year). However, this can be accomplished directly in the templates:
+{% for year, posts in section.pages | group_by(attribute="year") %}
+ <h2>{{ year }}</h2>
+
+ <ul>
+ {% for post in posts %}
+ <li><a href="{{ post.permalink }}">{{ post.title }}</a></li>
+ {% endfor %}
+ </ul>
+{% endfor %}
+
+This snippet assumes that posts are sorted by date and that you want to display the archive +in descending order. If you want to show articles in ascending order, you need to further +process the list of pages:
+{% set posts_by_year = section.pages | group_by(attribute="year") %}
+{% set_global years = [] %}
+{% for year, ignored in posts_by_year %}
+ {% set_global years = years | concat(with=year) %}
+{% endfor %}
+{% for year in years | reverse %}
+ {% set posts = posts_by_year[year] %}
+ {# (same as the previous snippet) #}
+{% endfor %}
+
+
+
+ If the site config.toml
file sets generate_feed = true
, then Zola will
+generate a feed file for the site, named according to the feed_filename
+setting in config.toml
, which defaults to atom.xml
. Given the feed filename
+atom.xml
, the generated file will live at base_url/atom.xml
, based upon the
+atom.xml
file in the templates
directory, or the built-in Atom template.
feed_filename
can be set to any value, but built-in templates are provided
+for atom.xml
(in the preferred Atom 1.0 format), and rss.xml
(in the RSS
+2.0 format). If you choose a different filename (e.g. feed.xml
), you will
+need to provide a template yourself.
In case you want to extend, or modify, the built-in templates, you can get a
+copy from the source code here
+and place it in the templates/
directory with the appropriate name. You can
+check the documentation for the specifications for Atom 1.0 and RSS 2.0 in
+W3C Feed Validation Service.
Only pages with a date will be available.
+The author in the feed is set as
+authors
set in the
+front matterauthor
in the
+ConfigurationUnknown
.Note that atom.xml
and rss.xml
require different formats for specifying the
+author. According to RFC 4287 atom.xml
requires the author's
+name, for example "John Doe"
. While according to the
+RSS 2.0 Specification the email address is required, and the name
+optionally included, for example "lawyer@boyer.net"
or
+"lawyer@boyer.net (Lawyer Boyer)"
.
The feed template gets five variables:
+config
: the site configfeed_url
: the full url to that specific feedlast_updated
: the most recent updated
or date
field of any postpages
: see page variables
+for a detailed description of what this containslang
: the language code that applies to all of the pages in the feed,
+if the site is multilingual, or config.default_language
if it is notFeeds for taxonomy terms get two more variables, using types from the +taxonomies templates:
+taxonomy
: of type TaxonomyConfig
term
: of type TaxonomyTerm
, but without term.pages
(use pages
instead)You can also enable separate feeds for each section by setting the
+generate_feed
variable to true in the respective section's front matter.
+Section feeds will use the same template as indicated in the config.toml
file.
+Section feeds, in addition to the five feed template variables, get the
+section
variable from the section
+template.
Enable feed autodiscovery allows feed readers and browsers to notify user about a RSS or Atom feed available on your web site. So it is easier for user to subscribe. +As an example this is how it looks like using Firefox Livemarks addon.
+ +You can enable posts autodiscovery modifying your blog base.html
template adding the following code in between the <head>
tags.
{% block rss %}
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml", trailing_slash=false) }}">
+{% endblock %}
+
+You can as well use an Atom feed using type="application/atom+xml"
and path="atom.xml"
.
All pages on your site will refer to your post feed.
+In order to enable the tag feeds as well, you can overload the block rss
using the following code in your tags/single.html
template.
{% block rss %}
+ {% set rss_path = "tags/" ~ term.name ~ "/rss.xml" %}
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="{{/* get_url(path=rss_path, trailing_slash=false) */}}">
+{% endblock rss %}
+
+Each tag page will refer to it's dedicated feed.
+ + +Click here to be redirected.
diff --git a/documentation/templates/overview/index.html b/documentation/templates/overview/index.html new file mode 100644 index 0000000000..116e634cbc --- /dev/null +++ b/documentation/templates/overview/index.html @@ -0,0 +1,624 @@ + + + + + + + + +Zola uses the Tera template engine, which is very similar +to Jinja2, Liquid and Twig.
+As this documentation will only talk about how templates work in Zola, please read +the Tera template documentation if you want +to learn more about it first.
+All templates live in the templates
directory. If you are not sure what variables are available in a template,
+you can place {{ __tera_context }}
in the template to print the whole context.
A few variables are available on all templates except feeds and the sitemap:
+config
: the language aware configurationcurrent_path
: the path (full URL without base_url
) of the current page, always starting with a /
current_url
: the full URL for the current pagelang
: the language for the current pageConfig variables can be accessed like config.variable
, in HTML for example with {{ config.base_url }}
.
+The 404 template does not get current_path
and current_url
(this information cannot be determined).
On top of the config
attributes mentioned above, it also gets config.mode
which is whether it's run in build
, serve
or check
.
By default, Zola will look for three templates: index.html
, which is applied
+to the site homepage; section.html
, which is applied to all sections (any HTML
+page generated by creating a directory within your content
directory); and
+page.html
, which is applied to all pages (any HTML page generated by creating an
+.md
file within your content
directory).
The homepage is always a section (regardless of whether it contains other pages).
+Thus, the index.html
and section.html
templates both have access to the
+section variables. The page.html
template has access to the page variables.
+The page and section variables are described in more detail in the next section.
Zola comes with four built-in templates: atom.xml
and rss.xml
(described in
+Feeds), sitemap.xml
(described in Sitemap),
+and robots.txt
(described in Robots.txt).
+Additionally, themes can add their own templates, which will be applied if not
+overridden. You can override built-in or theme templates by creating a template with
+the same name in the correct path. For example, you can override the Atom template by
+creating a templates/atom.xml
file.
In addition to the standard index.html
, section.html
and page.html
templates,
+you may also create custom templates by creating an .html
file in the templates
+directory. These custom templates will not be used by default. Instead, a custom template will only be used if you apply it by setting the template
front-matter variable to the path for that template (or if you include
it in another template that is applied). For example, if you created a custom template for your site's About page called about.html
, you could apply it to your about.md
page by including the following front matter in your about.md
page:
+++
+title = "About Us"
+template = "about.html"
++++
+
+Custom templates are not required to live at the root of your templates
directory.
+For example, product_pages/with_pictures.html
is a valid template.
Zola adds a few filters in addition to those already present +in Tera.
+Converts the given variable to HTML using Markdown. There are a few differences compared to page/section Markdown rendering:
+config
will be available, but accessing section
or page
(among others) from a shortcode called within the markdown
filter will prevent your site from building (see this discussion)lang
in shortcodes will always be equal to the site's config.default_language
(or en
otherwise) ; it should not be a problem, but if it is in most cases, but if you need to use language-aware shortcodes in this filter, please refer to the Shortcode context section of the docs.By default, the filter will wrap all text in a paragraph. To disable this behaviour, you can
+pass true
to the inline argument:
{{ some_text | markdown(inline=true) }}
+
+You do not need to use this filter with page.content
or section.content
, the content is already rendered.
Encode the variable to base64.
+Decode the variable from base64.
+Replace text via regular expressions.
+{{ "World Hello" | regex_replace(pattern=`(?P<subject>\w+), (?P<greeting>\w+)`, rep=`$greeting $subject`) }}
+<!-- Hello World -->
+
+Format a number into its string representation.
+{{ 1000000 | num_format }}
+<!-- 1,000,000 -->
+
+By default this will format the number using the locale set by config.default_language
in config.toml.
To format a number for a specific locale, you can use the locale
argument and pass the name of the desired locale:
{{ 1000000 | num_format(locale="en-IN") }}
+<!-- 10,00,000 -->
+
+Zola adds a few Tera functions to those built-in in Tera +to make it easier to develop complex sites.
+For functions that are searching for a file on disk other than through get_page
and get_section
, the following
+logic applies.
config.toml
is@/
, replace that with content/
instead and trim any leading /
$base_directory
+ $path
$base_directory
+ "static/"
+ $path
$base_directory
+ "content/"
+ $path
$base_directory
+ $output_path
+ $path
$base_directory
+ "themes"
+ $theme
+ "static/"
+ $path
(only if using a theme)In practice this means that @/some/image.jpg
, /content/some/image.jpg
and content/some/image.jpg
will point to the
+same thing.
It will error if the path is outside the Zola directory.
+get_page
Takes a path to an .md
file and returns the associated page. The base path is the content
directory.
{% set page = get_page(path="blog/page2.md") %}
+
+get_section
Takes a path to an _index.md
file and returns the associated section. The base path is the content
directory.
{% set section = get_section(path="blog/_index.md") %}
+
+If you only need the metadata of the section, you can pass metadata_only=true
to the function:
{% set section = get_section(path="blog/_index.md", metadata_only=true) %}
+
+get_taxonomy_url
Gets the permalink for the taxonomy item found.
+{% set url = get_taxonomy_url(kind="categories", name=page.taxonomies.category, lang=page.lang) %}
+
+name
will almost always come from a variable but in case you want to do it manually,
+the value should be the same as the one in the front matter, not the slugified version.
lang
(optional) default to config.default_language
in config.toml
required
(optional) if a taxonomy is defined but there isn't any content that uses it then throw an error. Defaults to true.
get_taxonomy
Gets the whole taxonomy of a specific kind.
+{% set categories = get_taxonomy(kind="categories") %}
+
+The type of the output is:
+kind: TaxonomyConfig;
+items: Array<TaxonomyTerm>;
+lang: String;
+permalink: String;
+
+lang
(optional) default to config.default_language
in config.toml
required
(optional) if a taxonomy is defined but there isn't any content that uses it then throw an error. Defaults to true.
See the Taxonomies documentation for a full documentation of those types.
+get_taxonomy_term
Gets a single term from a taxonomy of a specific kind.
+{% set categories = get_taxonomy_term(kind="categories", term="term_name") %}
+
+The type of the output is a single TaxonomyTerm
item.
lang
(optional) default to config.default_language
in config.toml
include_pages
(optional) default to true. If false, the pages
item in the TaxonomyTerm
will be empty, regardless of what pages may actually exist for this term. page_count
will correctly reflect the number of pages for this term in both cases.
required
(optional) if a taxonomy or term is not found`.
See the Taxonomies documentation for a full documentation of those types.
+get_url
Gets the permalink for the given path.
+If the path starts with @/
, it will be treated as an internal link like the ones used in Markdown,
+starting from the root content
directory as well as validated.
{% set url = get_url(path="@/blog/_index.md") %}
+
+It accepts an optional parameter lang
in order to compute a language-aware URL in multilingual websites. Assuming config.base_url
is "http://example.com"
, the following snippet will:
"http://example.com/blog/"
if config.default_language
is "en"
"http://example.com/en/blog/"
if config.default_language
is not "en"
and "en"
appears in config.languages
"'en' is not an authorized language (check config.languages)."
{% set url = get_url(path="@/blog/_index.md", lang="en") %}
+
+This can also be used to get the permalink for a static file, for example if
+you want to link to the file that is located at static/css/app.css
:
{{ get_url(path="css/app.css") }}
+
+By default, the link will not have a trailing slash. You can force one by passing trailing_slash=true
to the get_url
function.
+An example is:
{{ get_url(path="css/app.css", trailing_slash=true) }}
+
+In the case of a non-internal link, you can also add a cachebust of the format ?h=<sha256>
at the end of a URL
+by passing cachebust=true
to the get_url
function. In this case, the path will need to resolve to an actual file.
+See File Searching Logic for details.
get_hash
Returns the hash digest (SHA-256, SHA-384 or SHA-512) of a file or a string literal.
+It can take the following arguments:
+path
: mandatory, see File Searching Logic for detailsliteral
: mandatory, the string value to be hashedsha_type
: optional, one of 256
, 384
or 512
, defaults to 384
base64
: optional, true
or false
, defaults to true
. Whether to encode the hash as base64Either path
or literal
must be given.
{{ get_hash(literal="Hello World", sha_type=256) }}
+{{ get_hash(path="static/js/app.js", sha_type=256) }}
+
+The function can also output a base64-encoded hash value when its base64
+parameter is set to true
. This can be used to implement subresource
+integrity.
<script src="{{ get_url(path="static/js/app.js") }}"
+ integrity="sha384-{{ get_hash(path="static/js/app.js", sha_type=384, base64=true) | safe }}"></script>
+
+Do note that subresource integrity is typically used when using external scripts, which get_hash
does not support.
get_image_metadata
Gets metadata for an image. This supports common formats like JPEG, PNG, WebP, BMP, GIF as well as SVG.
+It can take the following arguments:
+path
: mandatory, see File Searching Logic for detailsallow_missing
: optional, true
or false
, defaults to false
. Whether a missing file should raise an error or not.The method returns a map containing width
, height
and format
(the lowercased value as string).
{% set meta = get_image_metadata(path="...") %}
+ Our image (.{{meta.format}}) has format is {{ meta.width }}x{{ meta.height }}
+
+load_data
Loads data from a file, URL, or string literal. Supported file types include toml, json, csv, bibtex, yaml/yml, +and xml and only supports UTF-8 encoding.
+Any other file type will be loaded as plain text.
+The path
argument specifies the path to a local data file, according to the File Searching Logic.
{% set data = load_data(path="content/blog/story/data.toml") %}
+
+Alternatively, the url
argument specifies the location of a remote URL to load.
{% set data = load_data(url="https://en.wikipedia.org/wiki/Commune_of_Paris") %}
+
+Alternatively, the literal
argument specifies an object literal. Note: if the format
argument is not specified, then plain text will be what is assumed.
{% set data = load_data(literal='{"name": "bob"}', format="json") %}
+{{ data["name"] }}
+
+Note: the required
parameter has no effect when used in combination with the literal
argument.
The optional required
boolean argument can be set to false so that missing data (HTTP error or local file not found) does not produce an error, but returns a null value instead. However, permission issues with a local file and invalid data that could not be parsed to the requested data format will still produce an error even with required=false
.
The snippet below outputs the HTML from a Wikipedia page, or "No data found" if the page was not reachable, or did not return a successful HTTP code:
+{% set data = load_data(url="https://en.wikipedia.org/wiki/Commune_of_Paris", required=false) %}
+{% if data %}{{ data | safe }}{% else %}No data found{% endif %}
+
+The optional format
argument allows you to specify and override which data type is contained within the specified file or URL.
+Valid entries are toml
, json
, csv
, bibtex
, yaml
, xml
or plain
. If the format
argument isn't specified, then the
+path extension is used. In the case of a literal, plain
is assumed if format
is unspecified.
{% set data = load_data(path="content/blog/story/data.txt", format="json") %}
+
+Use the plain
format for when your file has a supported extension but you want to load it as plain text.
For toml, json, yaml and xml, the data is loaded into a structure matching the original data file; +however, for csv there is no native notion of such a structure. Instead, the data is separated +into a data structure containing headers and records. See the example below to see +how this works.
+In the template:
+{% set data = load_data(path="content/blog/story/data.csv") %}
+
+In the content/blog/story/data.csv file:
+Number, Title
+1,Gutenberg
+2,Printing
+
+The equivalent json value of the parsed data would be stored in the data
variable in the
+template:
{
+ "headers": ["Number", "Title"],
+ "records": [
+ ["1", "Gutenberg"],
+ ["2", "Printing"]
+ ],
+}
+
+The bibtex
format loads data into a structure matching the format used by the
+nom-bibtex crate. The following is an example of data
+in bibtex format:
@preamble{"A bibtex preamble" # " this is."}
+
+@Comment{
+ Here is a comment.
+}
+
+Another comment!
+
+@string(name = "Vincent Prouillet")
+@string(github = "https://github.com/getzola/zola")
+
+@misc {my_citation_key,
+ author= name,
+ title = "Zola",
+ note = "github: " # github
+} }
+
+The following is the json-equivalent format of the produced bibtex data structure:
+{
+ "preambles": ["A bibtex preamble this is."],
+ "comments": ["Here is a comment.", "Another comment!"],
+ "variables": {
+ "name": "Vincent Prouillet",
+ "github": "https://github.com/getzola/zola"
+ },
+ "bibliographies": [
+ {
+ "entry_type": "misc",
+ "citation_key": "my_citation_key",
+ "tags": {
+ "author": "Vincent Prouillet",
+ "title": "Zola",
+ "note": "github: https://github.com/getzola/zola"
+ }
+ }
+ ]
+}
+
+Finally, the bibtex data can be accessed from the template as follows:
+{% set tags = data.bibliographies[0].tags %}
+This was generated using {{ tags.title }}, authored by {{ tags.author }}.
+
+Instead of using a file, you can load data from a remote URL. This can be done by specifying a url
parameter
+to load_data
rather than path
.
{% set response = load_data(url="https://api.github.com/repos/getzola/zola") %}
+{{ response }}
+
+By default, the response body will be returned with no parsing. This can be changed by using the format
argument
+as below.
{% set response = load_data(url="https://api.github.com/repos/getzola/zola", format="json") %}
+{{ response }}
+
+When no other parameters are specified the URL will always be retrieved using a HTTP GET request.
+Using the parameter method
, since version 0.14.0, you can also choose to retrieve the URL using a POST request.
When using method="POST"
you can also use the parameters body
and content_type
.
+The parameter body is the actual contents sent in the POST request.
+The parameter content_type
should be the mimetype of the body.
This example will make a POST request to the kroki service to generate a SVG.
+{% set postdata = load_data(url="https://kroki.io/blockdiag/svg", format="plain", method="POST" ,content_type="text/plain", body="blockdiag {
+ 'Doing POST' -> 'using load_data'
+ 'using load_data' -> 'can generate' -> 'block diagrams';
+ 'using load_data' -> is -> 'very easy!';
+
+ 'Doing POST' [color = 'greenyellow'];
+ 'block diagrams' [color = 'pink'];
+ 'very easy!' [color = 'orange'];
+}")%}
+{{postdata|safe}}
+
+If you need additional handling for the HTTP headers, you can use the headers
parameter.
+You might need this parameter when the resource requires authentication or require passing additional
+parameters via special headers.
+Please note that the headers will be appended to the default headers set by Zola itself instead of replacing them.
This example will make a POST request to the GitHub markdown rendering service.
+{% set postdata = load_data(url="https://api.github.com/markdown", format="plain", method="POST", content_type="application/json", headers=["accept=application/vnd.github.v3+json"], body='{"text":"headers support added in #1710, commit before it: b3918f124d13ec1bedad4860c15a060dd3751368","context":"getzola/zola","mode":"gfm"}')%}
+{{postdata|safe}}
+
+The following example shows how to send a GraphQL query to GitHub (requires authentication).
+If you want to try this example on your own machine, you need to provide a GitHub PAT (Personal Access Token),
+you can acquire the access token at this link: https://github.com/settings/tokens and then set GITHUB_TOKEN
+environment variable to the access token you have obtained.
{% set token = get_env(name="GITHUB_TOKEN") %}
+{% set postdata = load_data(url="https://api.github.com/graphql", format="json", method="POST" ,content_type="application/json", headers=["accept=application/vnd.github.v4.idl", "authorization=Bearer " ~ token], body='{"query":"query { viewer { login }}"}')%}
+{{postdata|safe}}
+
+In case you need to specify multiple headers with the same name, you can specify them like this:
+headers=["accept=application/json,text/html"]
+
+Which is equivalent to two Accept
headers with application/json
and text/html
.
If it doesn't work, you can instead specify the headers multiple times to achieve a similar effect:
+headers=["accept=application/json", "accept=text/html"]
+
+Data file loading and remote requests are cached in memory during the build, so multiple requests aren't made +to the same endpoint. +URLs are cached based on the URL, and data files are cached based on the file modified time. +The format is also taken into account when caching, so a request will be sent twice if it's loaded with two +different formats.
+trans
Gets the translation of the given key
, for the default_language
, the lang
uage given or the active language:
{{ trans(key="title") }}
+{{ trans(key="title", lang="fr") }}
+{{/* trans(key="title", lang=lang) */}}
+
+resize_image
Resizes an image file. +Please refer to Content / Image Processing for complete documentation.
+ + +Templates for pages and sections are very similar.
+Zola will try to load the templates/page.html
template, the page.html
template of the theme if one is used
+or render the built-in template (a blank page).
Whichever template you decide to render, you will get a page
variable in your template
+with the following fields:
// The HTML output of the Markdown content
+content: String;
+title: String?;
+description: String?;
+date: String?;
+updated: String?;
+slug: String;
+path: String;
+authors: Array<String>;
+draft: Bool;
+// the path, split on '/'
+components: Array<String>;
+permalink: String;
+summary: String?;
+taxonomies: HashMap<String, Array<String>>;
+extra: HashMap<String, Any>;
+toc: Array<Header>,
+// Naive word count, will not work for languages without whitespace
+word_count: Number;
+// Based on https://help.medium.com/hc/en-us/articles/214991667-Read-time
+reading_time: Number;
+// earlier / lighter
+lower: Page?;
+// later / heavier
+higher: Page?;
+// Year/month/day is only set if the page has a date and month/day are 1-indexed
+year: Number?;
+month: Number?;
+day: Number?;
+// Paths of colocated assets, relative to the content directory
+assets: Array<String>;
+// The relative paths of the parent sections until the index one, for use with the `get_section` Tera function
+// The first item is the index section and the last one is the parent section
+// This is filled after rendering a page content so it will be empty in shortcodes
+ancestors: Array<String>;
+// The relative path from the `content` directory to the markdown file
+relative_path: String;
+// The relative path from the `content` directory to the directory of a colocated index.md markdown file
+// Null if the file is not colocated.
+colocated_path: String?;
+// The language for the page if there is one. Default to the config `default_language`
+lang: String;
+// Information about all the available languages for that content, including the current page
+translations: Array<TranslatedContent>;
+// All the pages/sections linking this page: their permalink and a title if there is one
+backlinks: Array<{permalink: String, title: String?}>;
+
+By default, Zola will try to load templates/index.html
for content/_index.md
+and templates/section.html
for other _index.md
files. If there isn't
+one, it will render the built-in template (a blank page).
Whichever template you decide to render, you will get a section
variable in your template
+with the following fields:
// The HTML output of the Markdown content
+content: String;
+title: String?;
+description: String?;
+path: String;
+// the path, split on '/'
+components: Array<String>;
+permalink: String;
+extra: HashMap<String, Any>;
+// Pages directly in this section. By default, the pages are not sorted. Please set the "sort_by"
+// variable in the _index.md file of the corresponding section to "date" or "weight" for sorting by
+// date and weight, respectively.
+pages: Array<Page>;
+// Direct subsections to this section, sorted by subsections weight
+// This only contains the path to use in the `get_section` built-in function to get
+// the actual section object if you need it
+subsections: Array<String>;
+toc: Array<Header>,
+// Unicode word count
+word_count: Number;
+// Based on https://help.medium.com/hc/en-us/articles/214991667-Read-time
+reading_time: Number;
+// Paths of colocated assets, relative to the content directory
+assets: Array<String>;
+// The relative paths of the parent sections until the index one, for use with the `get_section` Tera function
+// The first item is the index section and the last one is the parent section
+// This is filled after rendering a page content so it will be empty in shortcodes
+ancestors: Array<String>;
+// The relative path from the `content` directory to the markdown file
+relative_path: String;
+// The language for the section if there is one. Default to the config `default_language`
+lang: String;
+// Information about all the available languages for that content
+translations: Array<TranslatedContent>;
+// All the pages/sections linking this page: their permalink and a title if there is one
+backlinks: Array<{permalink: String, title: String?}>;
+// Whether this section generates a feed or not. Taken from the front-matter if set
+generate_feed: bool;
+
+Both page and section templates have a toc
variable that corresponds to an array of Header
.
+A Header
has the following fields:
// The hX level
+level: 1 | 2 | 3 | 4 | 5 | 6;
+// The generated slug id
+id: String;
+// The text of the header
+title: String;
+// A link pointing directly to the header, using the inserted anchor
+permalink: String;
+// All lower level headers below this header
+children: Array<Header>;
+
+Both pages and sections have a translations
field that corresponds to an array of TranslatedContent
. If your
+site is not using multiple languages, this will always be an empty array.
+TranslatedContent
has the following fields:
// The language code for that content, empty if it is the default language
+lang: String?;
+// The title of that content if there is one
+title: String?;
+// A permalink to that content
+permalink: String;
+// The path to the markdown file; useful for retrieving the full page through
+// the `get_page` function.
+path: String;
+
+
+
+ Two things can get paginated: a section and a taxonomy term.
+Both kinds get a paginator
variable of the Pager
type, on top of the common variables mentioned in the
+overview page:
// How many items per pager
+paginate_by: Number;
+// The base URL for the pagination: section permalink + pagination path
+// You can concatenate an integer with that to get a link to a given pagination pager.
+base_url: String;
+// How many pagers in total
+number_pagers: Number;
+// Permalink to the first pager
+first: String;
+// Permalink to the last pager
+last: String;
+// Permalink to the previous pager, if there is one
+previous: String?;
+// Permalink to the next pager, if there is one
+next: String?;
+// All pages for the current pager
+pages: Array<Page>;
+// Which pager are we on, 1-indexed
+current_index: Number;
+// Total number of pages across all the pagers
+total_pages: Number;
+
+The variable will not be defined if paginate_by
is not set to a positive number.
A pager is a page of the pagination; if you have 100 pages and paginate_by is set to 10, you will have 10 pagers each +containing 10 pages.
+A paginated section gets the same section
variable as a normal
+section page
+minus its pages. The pages are instead in paginator.pages
.
A paginated taxonomy gets two variables aside from the paginator
variable:
taxonomy
variable of type TaxonomyConfig
term
variable of type TaxonomyTerm
.See the taxonomies page for a detailed version of the types.
+Here is an example from a theme on how to use pagination on a page (index.html
in this case):
<div class="posts">
+ {% for page in paginator.pages %}
+ <article class="post">
+ {{ post_macros::title(page=page) }}
+ <div class="post__summary">
+ {{ page.summary | safe }}
+ </div>
+ <div class="read-more">
+ <a href="{{ page.permalink }}">Read more...</a>
+ </div>
+ </article>
+ {% endfor %}
+</div>
+<nav class="pagination">
+ {% if paginator.previous %}
+ <a class="previous" href="{{ paginator.previous }}">‹ Previous</a>
+ {% endif %}
+ {% if paginator.next %}
+ <a class="next" href="{{ paginator.next }}">Next ›</a>
+ {% endif %}
+</nav>
+
+
+
+ Zola will look for a robots.txt
file in the templates
directory or
+use the built-in one.
Robots.txt is the simplest of all templates: it only gets config
+and the default is what most sites want:
User-agent: *
+Disallow:
+Allow: /
+Sitemap: {{ get_url(path="sitemap.xml") }}
+
+
+
+ Click here to be redirected.
diff --git a/documentation/templates/sitemap/index.html b/documentation/templates/sitemap/index.html new file mode 100644 index 0000000000..1be5157da8 --- /dev/null +++ b/documentation/templates/sitemap/index.html @@ -0,0 +1,291 @@ + + + + + + + + +Zola will look for a sitemap.xml
file in the templates
directory or
+use the built-in one.
If your site has more than 30 000 pages, it will automatically split +the links into multiple sitemaps, as recommended by Google:
+++All formats limit a single sitemap to 50MB (uncompressed) and 50,000 URLs. +If you have a larger file or more URLs, you will have to break your list into multiple sitemaps. +You can optionally create a sitemap index file (a file that points to a list of sitemaps) and submit +that single index file to Google.
+
In such a case, Zola will use a template called split_sitemap_index.xml
to render the index sitemap.
The sitemap.xml
template gets a single variable:
entries
: all pages of the site, as a list of SitemapEntry
A SitemapEntry
has the following fields:
permalink: String;
+updated: String?;
+extra: Hashmap<String, Any>?;
+
+The split_sitemap_index.xml
also gets a single variable:
sitemaps
: a list of permalinks to the sitemapsZola will look up the following, taxon-specific files in the templates
directory:
$TAXONOMY_NAME/single.html
$TAXONOMY_NAME/list.html
if they are not found, it will attempt to fall back on the following generic template files:
+taxonomy_single.html
taxonomy_list.html
The taxonomy templates are required only if at least one taxonomy exists with render
set to true
.
First, TaxonomyTerm
has the following fields:
name: String;
+slug: String;
+path: String;
+permalink: String;
+pages: Array<Page>;
+page_count: Number;
+
+and TaxonomyConfig
has the following fields:
name: String,
+paginate_by: Number?;
+paginate_path: String?;
+feed: Bool;
+render: Bool;
+
+list.html
)This template is never paginated and therefore gets the following variables in all cases.
+// The site config
+config: Config;
+// The data of the taxonomy, from the config
+taxonomy: TaxonomyConfig;
+// The current full permalink for that page
+current_url: String;
+// The current path for that page
+current_path: String;
+// All terms for that taxonomy
+terms: Array<TaxonomyTerm>;
+// The lang of the current page
+lang: String;
+
+single.html
)// The site config
+config: Config;
+// The data of the taxonomy, from the config
+taxonomy: TaxonomyConfig;
+// The current full permalink for that page
+current_url: String;
+// The current path for that page
+current_path: String;
+// The current term being rendered
+term: TaxonomyTerm;
+// The lang of the current page
+lang: String;
+
+A paginated taxonomy term will also get a paginator
variable; see the
+pagination page for more details.
Creating a theme is exactly like creating a normal site with Zola, except you +will want to use many Tera blocks to +allow users to easily modify it.
+As mentioned, a theme is just like any site; start by running zola init MY_THEME_NAME
.
The only thing needed to turn that site into a theme is to add a theme.toml
configuration file with the
+following fields:
name = "my theme name"
+description = "A classic blog theme"
+license = "MIT"
+homepage = "https://github.com/getzola/hyde"
+# The minimum version of Zola required
+min_version = "0.4.0"
+# An optional live demo URL
+demo = ""
+
+# Any variable there can be overridden in the end user `config.toml`
+# You don't need to prefix variables by the theme name but as this will
+# be merged with user data, some kind of prefix or nesting is preferable
+# Use snake_casing to be consistent with the rest of Zola
+[extra]
+
+# The theme author info: you!
+[author]
+name = "Vincent Prouillet"
+homepage = "https://vincent.is"
+
+# If this is porting a theme from another static site engine, provide
+# the info of the original author here
+[original]
+author = "mdo"
+homepage = "https://markdotto.com/"
+repo = "https://www.github.com/mdo/hyde"
+
+A simple theme you can use as an example is Hyde.
+As a theme is just a site, you can simply use zola serve
and make changes to your
+theme, with live reload working as expected.
Make sure to commit every directory (including content
) in order for other people
+to be able to build the theme from your repository.
If you want your theme to be featured in the themes section +of this site, make sure that the theme meets the following three requirements:
+screenshot.png
of the theme in action with a max size of around 2000x1000README.md
explaining how to use the theme and any other information
+of importanceWhen your theme is ready, you can submit it to the themes repository +by following the process in the README.
+ + +When your site uses a theme, you can replace parts of it in your site's templates folder. For any given theme template, you can either override a single block in it, or replace the whole template. If a site template and a theme template collide, the site template will be given priority. Whether a theme template collides or not, theme templates remain accessible from any template within theme_name/templates/
.
When your site uses a theme, the generated structure follows the theme's structure whenever possible, i.e. there are no user defined templates with the same name and relative path as the theme's; for example: with two files templates/page.html
and themes/theme_name/templates/page.html
, the site template is the one that will be used. Such a conflict results in the theme's template being ignored in favor of the template defined by the user.
If you don't want to replace a whole template, but override parts of it, you can extend the template and redefine some specific blocks. For example, if you want to override the title
block in your theme's page.html, you can create a page.html file in your site templates with the following content:
{% extends "theme_name/templates/page.html" %}
+{% block title %}{{ page.title }}{% endblock %}
+
+If you extend page.html
and not theme_name/templates/page.html
specifically, it will extend the site's page template if it exists, and the theme's page template otherwise. This makes it possible to override your theme's base template(s) from your site templates, as long as the theme templates do not hardcode the theme name in template paths. For instance, children templates in the theme should use {% extends 'index.html' %}
, not {% extends 'theme_name/templates/index.html' %}
.
Click here to be redirected.
diff --git a/documentation/themes/installing-and-using-themes/index.html b/documentation/themes/installing-and-using-themes/index.html new file mode 100644 index 0000000000..d50d0b4f00 --- /dev/null +++ b/documentation/themes/installing-and-using-themes/index.html @@ -0,0 +1,310 @@ + + + + + + + + +The easiest way to install a theme is to clone its repository in the themes
+directory:
$ cd themes
+$ git clone <theme repository URL>
+
+Cloning the repository using Git or another VCS will allow you to easily +update. Alternatively, you can download the files manually and place +them in a folder.
+You can find a list of themes here.
+Now that you have the theme in your themes
directory, you need to tell
+Zola to use it by setting the theme
variable in the
+configuration file. The theme
+name has to be the name of the directory you cloned the theme in.
+For example, if you cloned a theme in themes/simple-blog
, the theme name to use
+in the configuration file is simple-blog
. Also make sure to place the variable in the top level of the
+.toml
hierarchy and not after a dict like [extra] or [markdown].
+Some themes require additional configuration before they can work properly. Be sure to follow the instructions found on your chosen theme's documentation to properly configure the theme.
Any file from the theme can be overridden by creating a file with the same path and name in your templates
or static
+directory. Here are a few examples of that, assuming that the theme name is simple-blog
:
templates/pages/post.html -> replace themes/simple-blog/templates/pages/post.html
+templates/macros.html -> replace themes/simple-blog/templates/macros.html
+static/js/site.js -> replace themes/simple-blog/static/js/site.js
+
+You can also choose to only override parts of a page if a theme defines some blocks by extending it. If we wanted
+to only change a single block from the post.html
page in the example above, we could do the following:
{% extends "simple-blog/templates/pages/post.html" %}
+
+{% block some_block %}
+Some custom data
+{% endblock %}
+
+Most themes will also provide some variables that are meant to be overridden. This happens in the extra
section
+of the configuration file.
+Let's say a theme uses a show_twitter
variable and sets it to false
by default. If you want to set it to true
,
+you can update your config.toml
like so:
[extra]
+show_twitter = true
+
+You can modify files directly in the themes
directory but this will make updating the theme harder and live reload
+won't work with these files.
Themes are collections of layouts and styles used to facilitate the creation and management of Zola projects. As such, themes are Zola projects which provide their own templates, content and even static assets.
+Zola has built-in support for themes which makes it easy to customise and update them.
+All themes can use the full power of Zola, from shortcodes to Sass compilation.
+A list of themes is available here.
+ + ++ Forget dependencies. Everything you need in one binary. +
+ Get started ++ Zola comes as a single executable with Sass compilation, syntax highlighting, table of contents + and many other features that traditionally require setting up a dev environment + or adding some JavaScript libraries to your site. +
++ The average site will be generated in less than a second, + including Sass compilation and syntax highlighting. +
++ Zola renders your whole site as static files, making it trivial to handle + any kind of traffic you will throw at it at no cost without having + to worry about managing a server or a database. +
++ From the CLI to the template engine, everything is designed to be intuitive. + Don't take my word for it though, look at the + documentation and see for yourself. +
++ Zola gets out of your way so you can focus on your content, be it a blog, + a knowledge base, a landing page or a combination of them. +
++ Zola comes with shortcodes and + internal links + to make it easier to write your content. +
+A fast, lightweight, and modern Zola theme utilizing abridge.css (a class-light semantic HTML CSS Framework). Perfect Lighthouse, YellowLabTools, and Observatory scores. Here is a Zola Themes Benchmarks Page.
+ +Maintenance of this project is made possible by all the contributors and sponsors. If you'd like to sponsor this project and have your avatar or company logo appear below click here. 💖
+ +View Abridge.css demo [abridge.css framework]
+The Abridge.css demo is simply using Abridge theme as a submodule: config.toml, sass/abridge.scss
+offline = true
in config.toml
(full search support)./
focus, arrow
move, enter
select, escape
close.Enter Key
or click
the search button icon.Complete Documentation is available here
+This theme requires version 0.18.0 or later of Zola
+git clone https://github.com/jieiku/abridge.git
+cd abridge
+zola serve
+# open http://127.0.0.1:1111/ in the browser
+
+The Quick Start shows how to run the theme directly. Next we will use abridge as a theme to a NEW site.
+yes "" | zola init mysite
+cd mysite
+
+Add the theme as a git submodule:
+git init # if your project is a git repository already, ignore this command
+git submodule add https://github.com/jieiku/abridge.git themes/abridge
+git submodule update --init --recursive
+git submodule update --remote --merge
+
+Or clone the theme into your themes directory:
+git clone https://github.com/jieiku/abridge.git themes/abridge
+
+Copy some files from the theme directory to your project's root directory:
+rsync themes/abridge/.gitignore .gitignore
+rsync themes/abridge/config.toml config.toml
+rsync themes/abridge/content/_index.md content/
+rsync -r themes/abridge/COPY-TO-ROOT-SASS/* sass/
+rsync themes/abridge/netlify.toml netlify.toml
+rsync themes/abridge/package_abridge.js package_abridge.js
+rsync themes/abridge/package.json package.json
+
+config.toml
base configuration with all config values.content/_index.md
required to set pagination.COPY-TO-ROOT-SASS/abridge.scss
overrides to customize Abridge variables.netlify.toml
settings to deploy your repo with netlfiy.package_abridge.js
node script to: update cache files list in PWA, minify js, bundle jspackage.json
to facilitate use of package_abridge.jsUncomment the theme line in your project's root config.toml:
+sed -i 's/^#theme = "abridge"/theme = "abridge"/' config.toml
+
+Copy the content from the theme directory to your project or make a new post:
+rsync -r themes/abridge/content .
+
+Just run zola serve
in the root path of the project:
zola serve
+
+Zola will start the dev web server, accessible by default at http://127.0.0.1:1111
.
Saved changes will live reload in the browser. (press ctrl+f5
, or while developing set pwa=false
in config.toml
)
For further customization be sure to check the docs.
+Do you love this theme? Was it useful to you? Please leave a github star, and if you feel inclined to donate you can make a donation to me through github sponsors.
+We'd love your help! Especially with fixes to issues, or improvements to existing features.
+The goal is for Abridge to be lightweight, fast, and to work properly even if javascript is disabled or blocked.
+The only feature that may be considered a necessity that relies on javascript is the Search.
+Abridge is distributed under the terms of the MIT license.
+ + +AdiDoks is a modern documentation theme, which is a port of the Hugo +theme Doks for Zola.
+Before using the theme, you need to install the Zola ≥ 0.15.0.
+git clone https://github.com/aaranxu/adidoks.git
+cd adidoks
+zola serve
+# open http://127.0.0.1:1111/ in the browser
+
+Read more from the document of the AdiDoks.
+Just earlier we showed you how to run the theme directly. Now we start to +install the theme in an existing site step by step.
+zola init mysite
+
+Download this theme to your themes directory:
+cd mysite/themes
+git clone https://github.com/aaranxu/adidoks.git
+
+Or install as a submodule:
+cd mysite
+git init # if your project is a git repository already, ignore this command
+git submodule add https://github.com/aaranxu/adidoks.git themes/adidoks
+
+Enable the theme in your config.toml
in the site directory:
theme = "adidoks"
+
+Or copy the config.toml.example
from the theme directory to your project's
+root directory:
cp themes/adidoks/config.toml.example config.toml
+
+You can copy the content from the theme directory to your project:
+cp -r themes/adidoks/content .
+
+You can modify or add new posts in the content/blog
, content/docs
or other
+content directories as needed.
Just run zola serve
in the root path of the project:
zola serve
+
+AdiDoks will start the Zola development web server accessible by default at
+http://127.0.0.1:1111
. Saved changes will live reload in the browser.
You can customize your configurations, templates and content for yourself. Look
+at the config.toml
, theme.toml
, content
files and templates files in this
+repo for an idea.
There are some configuration options that you can customize in config.toml
.
extra
optionsSet the authors's taxonomies for the site.
+taxonomies = [
+ {name = "authors"},
+]
+
+Use search function for the content.
+build_search_index = true
+
+extra
The following options should be under the [extra]
in config.toml
language_code
- set HTML file language (default to en-US
)theme_color
- your site's HTML color (default to #fff
)title_separator
- the separator to your site title, like |
and -
(defaults to |
)title_addition
- the additon content for the title of the homepagetimeformat
- the timeformat for the blog article published datetimezone
- the timezone for the blog article published dateedit_page
(and docs_repo
, repo_branch
) - whether to show the edit page in the github repo for your docsmath
(and library
) - set KaTeX or MathJax library[extra.open]
- Open Graph + Twitter Cards for the site[extra.schema]
- set JSON-LD for the site[[extra.menu.main]]
- the header navigations for the site[[extra.menu.social]]
- the social links on the header of the page[extra.footer]
- the footer content on the left[[extra.footer.nav]]
- the footer navigations on the rightAll pages are extend to the base.html
, and you can customize them as need.
Go to the content/_index.md file to add your own homepage content.
+[extra]
- the main content of the homepage[[extra.ist]]
- the lists' content of the homepageEach section includes a _index.md
, and you can customize it or add your new
+section under the content
folder.
There are mainly three types of pages in the site.
+blog
- blog articledocs
- documentation articleauthors
- authors page if you need to add some information for a new authorWe use GitHub Issues as the official bug tracker for the AdiDoks. Please +search existing issues. It’s +possible someone has already reported the same problem.
+If your problem or idea is not addressed yet, open a new issue.
+We'd love your help! Please see CONTRIBUTING.md to learn +about the kinds of contributions we're looking for.
+AdiDoks is distributed under the terms of the +MIT license.
+ + +First download this theme to your themes
directory:
cd themes
+git clone https://github.com/getzola/after-dark.git
+
+and then enable it in your config.toml
:
theme = "after-dark"
+
+This theme requires your index section (content/_index.md
) to be paginated to work:
paginate_by = 5
+
+The posts should therefore be in directly under the content
folder.
The theme requires tags and categories taxonomies to be enabled in your config.toml
:
taxonomies = [
+ # You can enable/disable RSS
+ {name = "categories", feed = true},
+ {name = "tags", feed = true},
+]
+
+If you want to paginate taxonomies pages, you will need to overwrite the templates +as it only works for non-paginated taxonomies by default.
+Set a field in extra
with a key of after_dark_menu
:
after_dark_menu = [
+ {url = "$BASE_URL", name = "Home"},
+ {url = "$BASE_URL/categories", name = "Categories"},
+ {url = "$BASE_URL/tags", name = "Tags"},
+ {url = "https://google.com", name = "Google"},
+]
+
+If you put $BASE_URL
in a url, it will automatically be replaced by the actual
+site URL.
The site title is shown on the homepage. As it might be different from the <title>
+element that the title
field in the config represents, you can set the after_dark_title
+instead.
You can set this on a per page basis or in the config file.
+config.toml
:
[extra]
+author = "John Smith"
+
+In a page (wrap this in +++):
+title = "..."
+date = 1970-01-01
+
+[extra]
+author = "John Smith"
+
+This template is based on the Hugo template https://git.habd.as/comfusion/after-dark
+ + +This theme was made for Duniter website. It was then abstracted and turned into Albatros.
+ +Add the theme as a git submodule:
+git submodule add --name albatros https://git.42l.fr/HugoTrentesaux/albatros.git themes/albatros
+
+and enable the theme in your config.toml
theme = "albatros"
+It has a lot of feature that I could not find time to document yet. Most of the available customization is in theme.toml
/extra
section and sass/_albatros.sass
file (e.g. for colors).
See:
+for reference.
+You are encouraged to provide custom landing pages that you can write in template/custom
.
+The theme will take care of the rest (pages organised as wiki with breadcrumb).
Each author must have a card in content/team
folder.
I'll provide support on demand on Zola forum by documenting the theme step by step.
+ + +Anatole theme for Farbox ported to Zola
+Zola Homepage | Demo with customizations
+First download this theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/longfangsong/anatole-zola.git
+
+and then enable it in your config.toml
:
theme = "anatole-zola"
+
+And copy the content/about
, content/archive
, content/_index.md
in the theme folder to your own content folder. And edit the _index.md
in about
folder to edit the content of your about
page.
Add title
, description
and base_url
:
title = "Anatole"
+description = "A other zola theme"
+base_url = "https://example.com"
+
+Though the origin theme only support light mode, we added a dark mode option here.
+You can either
+extra.mode
field in config.toml
to use the dark/light modeextra.default_mode
field in config.toml
to read the dark/light mode from localStorage
(the key is 'mode'
), and use some Javascript to control the theme each reader is usingCurrently, we have English, Chinese, German and Swedish translations, set the default_language
if necessary:
# 如果你想要中文
+default_language = "zh"
+
+If there are complications, you can copy this snippet to your config.toml
:
[languages.en.translations]
+language_name = "English"
+about = "About"
+home = "Home"
+tags = "Tags"
+archive = "Archive"
+links = "Links"
+date_format = "%Y-%m-%d"
+next_page = "Next Page"
+last_page = "Last Page"
+
+[languages.zh.translations]
+language_name = "中文"
+home = "首页"
+about = "关于"
+tags = "标签"
+archive = "归档"
+links = "友链"
+date_format = "%Y-%m-%d"
+next_page = "下一页"
+last_page = "上一页"
+
+[languages.de.translations]
+language_name = "Deutsch"
+about = "Info"
+home = "Home"
+tags = "Kategorien"
+archive = "Archiv"
+links = "Links"
+date_format = "%d-%m-%Y"
+next_page = "Nächste Seite"
+last_page = "Vorherige Seite"
+
+[languages.sv.translations]
+language_name = "Svenska"
+about = "Info"
+home = "Hem"
+tags = "Etiketter"
+archive = "Arkiv"
+links = "Länkar"
+date_format = "%Y-%m-%d"
+next_page = "Nästa Sidan"
+last_page = "Sista Sidan"
+
+Feel free to create a pull request if you want to translate the theme into other languages!
+The theme will become multilingual automatically if you specify another language except default_language
.
You'll see a language-switching button on top right.
+Tags and links sections are optional.
+If you want to enable the tags page, add
+taxonomies = [
+ {name = "tags"},
+]
+
+[extra.show]
+tags = true
+
+To your config.toml
If you want to enable the links page, add
+[extra.show]
+links = true
+
+and copy content/links
to your own content
library. And edit the _index.md
in it to modify its content.
If you want to add the author's name on each page, add:
+[extra]
+author = "John Doe"
+
+We support a bunch of social links:
+[extra.social]
+github = ""
+gitlab = ""
+stackoverflow = "" # use user_id
+twitter = ""
+mastodon = "" # use hostname/@username
+facebook = ""
+instagram = ""
+dribbble = ""
+weibo = ""
+linkedin = ""
+flickr = ""
+
+Fill in your username if you want! And the logo won't appear if you leave it empty.
+We currently support...
+[extra.comment.valine]
+appid = "Your appid goes here"
+appkey = "Your appkey goes here"
+notify = false # true/false: mail notify https://github.com/xCss/Valine/wiki/Valine-%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F%E4%B8%AD%E7%9A%84%E9%82%AE%E4%BB%B6%E6%8F%90%E9%86%92%E8%AE%BE%E7%BD%AE
+verify = false # true/false: verify code
+avatar = "mm" # avatar style https://github.com/xCss/Valine/wiki/avatar-setting-for-valine
+placeholder = "Say something here"
+
+[extra.comment.disqus]
+name = "longfangsong"
+
+[extra.comment.utterances]
+repo = "Your repo for comments"
+issue_term = "pathname"
+theme = "github-light"
+
+There are several options I left in the origin templates for you to customize your site.
+You can create a blog.scss
or something similiar in the your sass
folder, add a templates.html
with following content:
{%/* extends "anatole-zola/templates/basic.html" */%}
+{%/* block extra_head */%}
+<link rel="stylesheet" href="{{ get_url(path="blog.css") }}">
+{%/* endblock */%}
+
+You can add more social links by adding a templates.html
with some content added to more_social_link
block:
{%/* extends "anatole-zola/templates/basic.html" */%}
+{%/* block more_social_link */%}
+<div id="pirate" data-wordart-src="//cdn.wordart.com/json/685czi4rqil5" style="width: 100%;" data-wordart-show-attribution></div>
+{%/* endblock */%}
+
+If you want to use some awesome logos, FontAwesome icons are already available.
+ + +++Andromeda is a lightweight photojournal & blog theme designed for Zola.
+
With built-in support for galleries and some options for customization, Andromeda is designed for photojournalism without complications.
+Index demo: +
+Post demo: +
+Assuming you already have a site set up (see the Zola guide for setting up a site),
+themes
directory in the root of your site if it does not already exist. git clone https://github.com/Pixadus/andromeda-theme themes/andromeda
+
+config.toml
file found in themes/andromeda/config.toml
or this repository within your own config.toml
.theme = andromeda
in your config.toml
file.To create a new post, create a .md
file within /content
, with the header format:
+++
+title = "Post title"
+date = 2023-04-25
+description = "Post description"
+extra = {header_img = "image-url"}
++++
+
+Note: The +++ are necessary.
+The header_img
field is the image shown on the homepage of the blog and in the heading of each page. It can be a remote URL or local - if local, by default this will be files stored in the static
folder, or /images
in the URL.
Galleries can be set up by using the following template in your Markdown file:
+<div class="gallery">
+ <a href="original_photo1.jpg" data-ngthumb="thumbnail_photo1.jpg"></a>
+ <a href="original_photo2.jpg" data-ngthumb="thumbnail_photo2.jpg"></a>
+</div>
+
+For more or less photos, use <a href>
tags. Flickr provides a good hosting option as it automatically generates thumbnails for you.
Andromeda supports custom navbar links - see config.toml for an example. You may also set a custom favicon.ico
though config.toml
.
If you wish to customize the design of the gallery, basic Javascript knowledge will be necessary. Andromeda uses nanogallery2
by default - the documentation can be found here. Customizations to the gallery design are done within the {%/* macro pagefooter() */%}
block within /templates/macros.html
.
By default, this script is divided into three sections (indicated by item==
): single-image, two-image and three+ image gallery setups.
The demo images used included Antelope Canyon by Anishkumar Sugumaran and Bryce Canyon by Marco Isler.
+ + +Introducing "anemone," a minimalist Zola theme that prioritizes clean CSS and avoids heavy JavaScript. Enjoy a seamless user experience with lightning-fast load times. Let your content take center stage in a clutter-free, elegant design that enhances readability. Responsive and efficient, anemone brings focus to your ideas.
+You can browse the demo website here +I also use it on my own website.
+Anemone is a versatile Zola theme that comes with both light and dark variants. You can easily switch between the light and dark themes to suit your preferences.
+ +To get started with Anemone, follow these simple steps:
+themes
directory:cd themes
+git clone https://github.com/Speyll/anemone
+
+config.toml
:theme = "anemone"
+
+This release brings several improvements and enhancements, focusing mainly on optimizing performance and user experience. Here's a summary of the key changes:
+suCSS Integration: The core CSS now leverages the lightweight suCSS framework made by yours truly, providing better maintainability, robustness, and scalability. With suCSS, the theme should maintain consistent appearance across different browsers.
+Enhanced Theme Toggle: The dark and light theme toggle has been revamped for more consistency. Now, the website respects the user's system-wide theme settings, ensuring a seamless experience. Additionally, the toggle retains the selected theme for future visits, offering improved usability.
+Smooth Transition and Sound Effect: Enjoy a smoother transition between the dark and light mode accompanied by a subtle sound effect. Rest assured, the added sound effect incurs minimal performance overhead, with the file size being just 1kb.
+Class Names and Shortcodes Update: Some class names and shortcodes have been modified for better organization and clarity. I apologize for any inconvenience this may cause.
+Slight change in Color Choice: Some dark mode colors have been changed for the sake of readability, still using veqev.
+Anemone provides various options to customize your website:
+To use tags, add the following code to a page's metadata:
+[taxonomies]
+tags = ["tag1", "tag2"]
+
+Enable listing of pages in the homepage by adding the following code to config.toml
:
[extra]
+list_pages = true
+
+The theme has a built-in feature that allows you to use multiple languages. For detailed instructions on how to use this feature, you can refer to the Zola Multilingual documentation. This documentation provides additional information on how to make the most out of this multilingual capability.
+[languages.fr]
+weight = 2
+title = "anemone"
+languageName = "Français"
+languageCode = "fr"
+
+Customize the header navigation links with the following code in the extra
section of config.toml
:
[extra]
+
+header_nav = [
+ { url = "/", name_en = "/home/", name_fr = "/accueil/" },
+ { url = "/about", name_en = "/about/", name_fr = "/concernant/" },
+ { url = "/journal", name_en = "/journal/", name_fr = "/journal/" },
+ { url = "/blog", name_en = "/blog/", name_fr = "/blog/" }
+]
+
+In a page's frontmatter, set extra.toc
to true
:
[extra]
+toc = true
+
+Customize the display of the author's name in your blog posts by toggling the display_author
variable to either true
or false
:
[extra]
+display_author = true
+
+Add a webring with a shortcode:
+{{ webring(prev="#", webring="#", webringName="Random Webring", next="#") }}
+
+author
in both the main config and in pages metadata.image
variable in pages to add an image to HTML <meta>
tags.favicon
in the main config, and it will be used as the site icon.footer_content_license
and footer_content_license_link
if you wish to display content license information in the footer.Twitter metatags are generated by default. To disable them, set extra.twitter_card
to false
in config.toml
:
[extra]
+twitter_card = true
+
+The Anemone theme is available as open source under the terms of the MIT License.
+ + +This is a port of the Hugo theme Anubis for Zola.
+Light mode | Dark mode |
---|---|
In order to use the theme you need to clone this repository in your themes
folder:
git clone https://github.com/zbrox/anpu-zola-theme.git themes/anpu
+
+Then set your theme setting in config.toml
to anpu
:
theme = "anpu"
+
+This theme requires both the tags
and categories
taxonomies.
taxonomies = [
+ { name = "categories" },
+ { name = "tags" },
+]
+
+There are two things you can customize:
+In your config.toml
under the [extra]
section you need to set the anpu_menu_links
list.
Example:
+[extra]
+anpu_menu_links = [
+ { url = "$BASE_URL/about/", name = "About" },
+]
+
+If you include $BASE_URL
in the url of a link it will be replaced to the base url of your site.
In your config.toml
under the [extra]
section you need to set the anpu_date_format
value.
Example:
+[extra]
+anpu_date_format = "%e %B %Y"
+
+The formatting uses the standart date
filter in Tera. The date format options you can use are listed in the chrono crate documentation.
The icons used are part of UXWing's collection.
+Source code is available under MIT.
+ + +Modern and minimalistic blog theme powered by Zola. See a live preview here.
+Named after the greek god of knowledge, wisdom and intellect
+git submodule add https://github.com/not-matthias/apollo themes/apollo
+
+theme = "apollo"
to your config.toml
cp -r themes/apollo/content content
+
+You can enable comment (Giscus) for each page:
+[extra]
+comment = true
+
+And then save your script from Giscus to templates/_giscus_script.html
.
You can add stylesheets to override the theme:
+[extra]
+stylesheets = [
+ "override.css",
+ "something_else.css"
+]
+
+These filenames are relative to the root of the site. In this example, the two CSS files would be in the static
folder.
To enable MathJax equation rendering, set the variable mathjax
to true
in
+the extra
section of your config.toml. Set mathjax_dollar_inline_enable
to
+true
to render inline math by surrounding them inside $..$.
[extra]
+mathjax = true
+mathjax_dollar_inline_enable = true
+
+<meta/>
tagsThe following TOML and YAML code will yiled two <meta/>
tags, <meta property="og:title" content="the og title"/>
, <meta property="og:description" content="the og description"/>
.
TOML:
+title = "post title"
+description = "post desc"
+date = "2023-01-01"
+
+[extra]
+meta = [
+ {property = "og:title", content = "the og title"},
+ {property = "og:description", content = "the og description"},
+]
+
+YAML:
+title: "post title"
+description: "post desc"
+date: "2023-01-01"
+extra:
+ meta:
+ - property: "og:title"
+ content: "the og title"
+ - property: "og:description"
+ content: "the og description"
+
+If the og:title
, the og:description
, or the "description" are not set, the page's title and description will be used. That is, the following TOML code generates <meta property="og:title" content="post title"/>
, <meta property="og:description" content="post desc"/>
, and <meta property="og:description" content="post desc"/>
as default values.
title = "post title"
+description = "post desc"
+date = "2023-01-01"
+
+This theme is based on archie-zola.
+ + +A zola theme forked from https://github.com/athul/archie
+The Main branch source code hosted on https://archie-zola.netlify.app
+First download this theme to your themes directory:
+cd themes
+git clone https://github.com/XXXMrG/archie-zola.git
+
+or add as a git submodule:
+git submodule add https://github.com/XXXMrG/archie-zola.git themes/archie-zola
+
+and then enable it in your config.toml:
+theme = "archie-zola"
+
+If this is the first time you've checked out a repository containing this submodule, you need to initialize the submodules:
+git submodule update --init
+
+If your project contains multiple submodules, this command initializes all of them.
+Then, update all submodule:
+git submodule update --remote
+
+Finally, check your commit and push it.
+in the planning stage:
+<meta/>
tagsThe following TOML and YAML code will yiled two <meta/>
tags, <meta property="og:title" content="the og title"/>
, <meta property="og:description" content="the og description"/>
.
TOML:
+title = "post title"
+description = "post desc"
+date = "2023-01-01"
+
+[extra]
+meta = [
+ {property = "og:title", content = "the og title"},
+ {property = "og:description", content = "the og description"},
+]
+
+YAML:
+title: "post title"
+description: "post desc"
+date: "2023-01-01"
+extra:
+ meta:
+ - property: "og:title"
+ content: "the og title"
+ - property: "og:description"
+ content: "the og description"
+
+If the og:title
, the og:description
, or the "description" are not set, the page's title and description will be used. That is, the following TOML code generates <meta property="og:title" content="post title"/>
, <meta property="og:description" content="post desc"/>
, and <meta property="og:description" content="post desc"/>
as default values.
title = "post title"
+description = "post desc"
+date = "2023-01-01"
+
+Cause Zola limited custom config must under the extra
field, so there are some different with the origin theme:
Demo website config.toml:
+# control dark mode: auto | dark | toggle
+mode = "toggle"
+
+# subtitle will show under the title in index page
+subtitle = "A zola theme forked from [archie](https://github.com/athul/archie)"
+
+# if set true, will use external CDN resource to load font and js file
+useCDN = false
+
+favicon = "/icon/favicon.png"
+
+# show in the footer
+copyright = "keith"
+
+# config your Google Analysis ID
+ga = "XXXX-XXXXX"
+
+# optional: config your i18n entry
+[extra.translations]
+languages = [{name = "en", url = "/"}]
+
+# config multi-language menu and other text
+[[extra.translations.en]]
+show_more = "Read more ⟶"
+previous_page = "← Previous"
+next_page = "Next →"
+posted_on = "on "
+posted_by = "Published by"
+read_time = "minute read"
+all_tags = "All tags"
+menus = [
+ { name = "Home", url = "/", weight = 2 },
+ { name = "All posts", url = "/posts", weight = 2 },
+ { name = "About", url = "/about", weight = 3 },
+ { name = "Tags", url = "/tags", weight = 4 },
+]
+
+# config social icon info in the footer
+[[extra.social]]
+icon = "github"
+name = "GitHub"
+url = "https://github.com/XXXMrG/archie-zola"
+
+[[extra.social]]
+icon = "twitter"
+name = "Twitter"
+url = "https://github.com/your-name/"
+
+[[extra.social]]
+icon = "gitlab"
+name = "GitLab"
+url = "https://gitlab.com/your-name/"
+
+
+This theme support latex math formula, by using KaTeX.
+You can enable it by add katex_enable = true
in the extra
section of config.toml:
[extra]
+katex_enable = true
+
+After that, you can use latex math formula in your markdown file:
+$$
+{x: \mathbf{Num},\ y: \mathbf{Num} \over x + y : \mathbf{Num} }\ (\text{N-Add})
+$$
+
+You can also use inline and block-style:
+1. \\( \KaTeX \\) inline
+2. \\[ \KaTeX \\]
+3. $$ \KaTeX $$
+
+In content/posts/_index.md. I use Zola config: transparent = true to implement the pagination
+In Zola, you can use config in the _index.md to control pagination and sort post list:
+paginate_by = 3
+sort_by = "date"
+
+[taxonomies]
+tags = ["FE", "Rust"]
+
+[extra]
+author = { name = "XXXMRG", social= "https://github.com/XXXMrG" }
+
+Follow this doc to extend theme.
+Thank you very much for considering contributing to this project!
+We appreciate any form of contribution:
+A personal theme for Zola focused on readability that aims to be simple, beautiful, and modern. It is designed to support multiple languages and be highly customizable.
+The theme takes visual inspiration from the Chirpy and Neumorphism themes.
+Open a command terminal at your site path and run:
+cd themes
+
+git clone https://github.com/gersonbenavides/ataraxia-zola.git ataraxia
+
+Copy the config_sample.toml
file to your site's main path, then rename it to config.toml
and edit it with your site data.
++You can see the Gerson's website repository for theme setup guide.
+
For the site to work properly you need to create a _index.md
file within the content
path with the following structure:
+++
+title = "Home"
+description = "Home site description."
+sort_by = "date"
+template = "index.html"
+page_template = "page.html"
++++
+
+You can add more markdown content inside this file if you need to.
+If you want to enable the site's blog, create a _index.md file inside the content/blog
path then copy the following structure inside the file:
+++
+title = "Blog"
+description = "Blog site description."
+sort_by = "date"
+paginate_by = 5
+template = "blog.html"
+page_template = "blog_page.html"
++++
+
+You can display the result of your website by running:
+zola serve
+
+By default, the theme comes with all the scss styles already compiled, in such a way that the installation of Bootstrap is not necessary, in order to avoid dependencies such as Node.js in the production file.
+If you want to edit the theme's styles, you'll need to have a Node.js interpreter and a Sass compiler installed. After that, go to the main path of the theme and execute:
+npm install
+
+sass --watch scss/custom.scss:static/assets/css/custom.css
+
+++Keep in mind that the main branch of this repository only has the stable versions of the theme, if you want to see the development status and the unstable versions, change to the corresponding branch.
+
This theme is mainly built on Zola and Bootstrap, plus it makes use of Google fonts.
+This work is published under the MPL-2.0 license
+ + +🧸 A Zola-theme based on Bear Blog.
+++Free, no-nonsense, super-fast blogging.
+
This theme has multiple demo sites, to provide examples of how to set up deployment
+ +When the user's browser is running »dark mode«, the dark color scheme will be used automatically. The default is the light/white color scheme. Check out the style.html
-file for the implementation.
If you already have a Zola site on your machine, you can simply add this theme via
+git submodule add https://codeberg.org/alanpearce/zola-bearblog themes/zola-bearblog
+
+Then, adjust the config.toml
as detailed below.
For more information, read the official setup guide of Zola.
+Alternatively, you can quickly deploy a copy of the theme site to Netlify using this button:
+ +(Note that this method makes it harder to keep up-to-date with theme updates, which might be necessary for newer versions of Zola.)
+Please check out the included config.toml
+Create an array in extra
with a key of main_menu
. url
is passed to get_url
[[extra.main_menu]]
+name = "Home"
+url = "@/_index.md"
+
+[[extra.main_menu]]
+name = "Bear"
+url = "@/bear.md"
+
+[[extra.main_menu]]
+name = "Zola"
+url = "@/zola.md"
+
+[[extra.main_menu]]
+name = "Blog"
+url = "@/blog/_index.md"
+
+The contents of the index
-page may be changed by editing your content/_index.md
-file.
Add a custom_head.html
-file to your templates/
-directory. In there you may add a <style>
-tag, or you may add a <link>
-tag referencing your own custom.css
(in case you prefer to have a separate .css
-file). Check out the style.html
-file to find out which CSS-styles are applied by default.
Table of contents are not rendered by default. To render them, set extra.table_of_contents.show = true
in config.toml
.
The table of contents is rendered inside a details
element.
+If you want the section to be collapsed on page load, set extra.table_of_contents.visible_on_load = false
.
+This defaults to true
.
In addition, extra.table_of_contents.max_level
can limit the maximum level of headers to show.
+To show only h1
s, set max_level = 1
, to show h1
s and h2
s, set max_level = 2
, and so on.
+By default, max_level
is set to 6, so all headers on the page are shown.
Below is an example of how to configure the table of contents in config.toml
.
[extra.table_of_contents]
+show = true
+max_level = 2
+visible_on_load = false
+
+It can also be toggled on page-by-page basis. Add extra.hide_table_of_contents = true
to the page's frontmatter to hide the table of contents for that specific page.
Please use Codeberg issues and Pull Requests.
+A special thank you goes out to Herman, for creating the original ʕ•ᴥ•ʔ Bear Blog and Jan Raasch for creating the hugo port of the Bear Blog theme.
+A Zola theme built with tailwindcss
+(WIP) Example : Here
+You should follow the official documentation about installing a Zola theme.
+I recommend adding the theme as a git submodule :
+cd my-zola-website
+git submodule add -b main git@github.com:tchartron/blow.git themes/blow
+
+Edit the theme used in your config.toml
file
# The site theme to use.
+theme = "blow"
+
+Then edit your config.toml
file to override values from the theme :
[extra]
+enable_search = true
+enable_sidebar = true
+enable_adsense = true
+enable_multilingue = true
+adsense_link = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=myclientid"
+
+[extra.lang]
+items = [
+ { lang = "en", links = [
+ { base_url = "/", name = "English" },
+ { base_url = "/fr", name = "French" },
+ ] },
+ { lang = "fr", links = [
+ { base_url = "/", name = "Anglais" },
+ { base_url = "/fr", name = "Français" },
+ ] },
+]
+
+[extra.navbar]
+items = [
+ { lang = "en", links = [
+ { url = "/", name = "Home" },
+ { url = "/categories", name = "Categories" },
+ { url = "/tags", name = "Tags" },
+ ] },
+ { lang = "fr", links = [
+ { url = "/fr", name = "Accueil" },
+ { url = "/fr/categories", name = "Categories" },
+ { url = "/fr/tags", name = "Tags" },
+ ] },
+]
+title = "title"
+
+[extra.sidebar]
+items = [
+ { lang = "en", links = [
+ { url = "/markdown", name = "Markdown" },
+ { url = "/blog", name = "Blog" },
+ ] },
+ { lang = "fr", links = [
+ { url = "/fr/markdown", name = "Markdown" },
+ { url = "/fr/blog", name = "Blog" },
+ ] },
+]
+
+# Index page
+[extra.index]
+title = "Main title"
+image = "https://via.placeholder.com/200"
+image_alt = "Placeholder text describing the index's image."
+
+[extra.default_author]
+name = "John Doe"
+avatar = "https://via.placeholder.com/200"
+avatar_alt = "Placeholder text describing the default author's avatar."
+
+[extra.social]
+codeberg = "https://codeberg.org/johndoe"
+github = "https://github.com/johndoe"
+gitlab = "https://gitlab.com/johndoe"
+twitter = "https://twitter.com/johndoe"
+mastodon = "https://social.somewhere.com/users/johndoe"
+linkedin = "https://www.linkedin.com/in/john-doe-b1234567/"
+stackoverflow = "https://stackoverflow.com/users/01234567/johndoe"
+telegram = "https://t.me/johndoe"
+email = "john.doe@gmail.com"
+
+[extra.favicon]
+favicon = "/icons/favicon.ico"
+favicon_16x16 = "/icons/favicon-16x16.png"
+favicon_32x32 = "/icons/favicon-32x32.png"
+apple_touch_icon = "/icons/apple-touch-icon.png"
+android_chrome_512 = "/icons/android-chrome-512x512.png"
+android_chrome_192 = "/icons/android-chrome-192x192.png"
+manifest = "/icons/site.webmanifest"
+
+You can now run zola serve
and visit : http://127.0.0.1:1111/
to see your site
Blow makes use of Zola code highlighting feature.
+It supports setting a different color scheme depending on the user selected theme (Dark / Light)
+In order to use it you should select the color scheme you want to use for light and dark themes in the list provided here and edit your config.toml
file like this example :
highlight_theme = "css"
+
+highlight_themes_css = [
+ { theme = "ayu-dark", filename = "syntax-dark.css" },
+ { theme = "ayu-light", filename = "syntax-light.css" },
+]
+
+There is a section about deployment in Zola documentation but you'll find an example to deploy your site to github pages
+ + +A theme based on Gitbook, to write documentation +or books.
+ +First download this theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/getzola/book.git
+
+and then enable it in your config.toml
:
theme = "book"
+# Optional, if you want search
+build_search_index = true
+
+Book will generate a book from the files you place in the content
directory. Your book
+can have two levels of hierarchy: chapters and subchapters.
Each chapter should be a section
within the Gutenberg site and should have an _index.md
+file that sets its weight
front-matter variable to its chapter number. For example,
+chapter 2 should have weight = 2
. Additionally, each chapter should also set the
+sort_by = "weight"
in its front matter.
Each subchapter should be a page
and should have its weight
variable set to the subchapter
+number. For example, subchapter 3.4 should have weight = 4
.
Finally, you should create an _index.md
file and set the redirect_to
front-matter variable
+to redirect to the first section of your content. For example, if your first section has the
+slug introduction
, then you would set redirect_to = "introduction"
.
By default, the book
theme will number the chapters and pages in the left menu.
+You can disable that by setting the book_number_chapters
in extra
:
book_number_chapters = false
+
+
+
+ Minimal theme for Zola, powered by +TailwindCSS
+https://boring-zola.netlify.app/
+ +In your zola site directory
+Get theme
+git submodule add https://github.com/ssiyad/boring themes/boring
+
+Build CSS
+cd themes/boring
+yarn install --frozen-lockfile
+yarn build
+
+Change theme specific variables. They are listed in extra
section of
+config.toml
Refer Zola Docs +for further instructions
+A port of the StartBootstrap Clean Blog theme, for Zola.
+To use the theme, clone this repository to your themes
directory.
+It requires that you use the categories and tags taxonomies.
+This can be done with the following additions to config.toml
:
theme = "zola-clean-blog"
+
+taxonomies = [
+ {name = "categories", rss = true, paginate_by=5},
+ {name = "tags", rss = true, paginate_by=5},
+]
+
+To replace header images, add a new image to static/img/$page-bg.jpg
where $page
is one of about
, home
, post
or contact
.
To replace the copyright field, create your own templates/index.html
to extend the template and add a copyright
block:
{%/* extends "zola-clean-blog/templates/index.html" */%}
+{%/* block copyright */%}
+Copyright %copy; Example, Inc. 2016-2019
+{%/* endblock copyright */%}
+
+To add a new menu item, override clean_blog_menu
in your config.toml
. You can use $BASE_URL
to reference your own site.
To add a new social link, override clean_blog_social
in your config.toml
. You can use $BASE_URL
to reference your own site.
To add Google Analytics, you may add your script to the extrascripts
block using your own index.html
{%/* extends "zola-clean-blog/templates/index.html" */%}
+{%/* block analytics */%}
+<script>
+...
+</script>
+{%/* endblock analytics */%}
+
+
+
+ This is a Zola theme inspired to Codinfox-Lanyon, a Lanyon based theme for Jekyll. See a live demo here.
+This theme places content first by tucking away navigation in a hidden drawer.
+This theme supports:
+_config.scss
)_config.scss
)All the configuration variables and their meaning are inside:
+config.toml
(for the zola config variables and some extra variables required by this theme),author.toml
(for the personal informations to be displayed about the author of the site),nav.toml
(for the navigation menu structure available in the site's sidebar)_config.scss
(for the definition of some css customizations)The options are fairly straightforward and described in comments.
+Learn more and contribute on GitHub.
+Have questions or suggestions? Feel free to open an issue on GitHub or ask me on Twitter.
+Get a gravatar account and set this up with a profile image.
+hash
value on line 4hash
value to author.toml
line 10To use this theme you can follow the instruction required by any Zola theme.
+Simply clone this repository under the themes
folder of your site's main folder.
Then, define the required extra variables in the config.toml (take it from the config.toml file of the theme), create and define the author.toml and nav.toml configuration files in the main folder of your site (the same level of the config.toml), and that's it!
+To define your own home picture, put an image file in the static/img/
folder and set the path in the config.extra.image variable.
Now is possible to create the content inside the content
folder as usual for Zola sites.
If you want to have a Blog with this theme, then create a folder inside the content
folder containing all the blog posts in Markdown format. Zola automatically generate a section that you can manage as a blog. See an example in the live demo.
Open sourced under the MIT license.
+d3c3nt is a simple, clean, and flexible theme for personal sites, made +by FIGBERT for the Zola static site engine. This theme is +developed mainly for use on my personal site, so new features and styles +will be added when I stumble onto the need to make them.
+All in all, it's fairly... decent.
+To use d3c3nt in your own site, you have to add it to your themes
+directory. You can do this in a variety of ways, but I recommend adding
+it as a git submodule:
$ cd themes/
+$ git submodule add git://git.figbert.com/d3c3nt.git
+
+After installing the theme, set the top-level theme
variable to
+"d3c3nt"
in your config.toml
.
For more information about Zola themes in general, check out Zola's +official site. To find out more about d3c3nt's features and +configuration, head over to the project's docs.
+To learn more about me, feel free to check out my website and +subscribe via the Atom feed. You can contact me via email at: +figbert+d3c3nt@figbert.com.
+ + ++ A simple blog theme focused on writing powered by Bulma and Zola. +
+ ++ + + + + + + + + + + + + + + + + + +
+You need static site generator (SSG) Zola installed in your machine to use this theme follow their guide on getting started.
+ +Follow zola's guide on installing a theme.
+Make sure to add theme = "DeepThought"
to your config.toml
Check zola version (only 0.9.0+) +Just to double-check to make sure you have the right version. It is not supported to use this theme with a version under 0.14.1.
+ +Go into your sites directory and type zola serve
. You should see your new site at localhost:1111
.
NOTE: you must provide the theme options variables in config.toml
to serve a functioning site
Zola already has great documentation for deploying to Netlify or Github Pages. I won't bore you with a regurgitated explanation.
+ +Following options are available with the DeepThought
theme
# Enable external libraries
+[extra]
+katex.enabled = true
+katex.auto_render = true
+
+chart.enabled = true
+mermaid.enabled = true
+galleria.enabled = true
+
+navbar_items = [
+ { code = "en", nav_items = [
+ { url = "$BASE_URL/", name = "Home" },
+ { url = "$BASE_URL/posts", name = "Posts" },
+ { url = "$BASE_URL/docs", name = "Docs" },
+ { url = "$BASE_URL/tags", name = "Tags" },
+ { url = "$BASE_URL/categories", name = "Categories" },
+ ]},
+]
+
+# Add links to favicon, you can use https://realfavicongenerator.net/ to generate favicon for your site
+[extra.favicon]
+favicon_16x16 = "/icons/favicon-16x16.png"
+favicon_32x32 = "/icons/favicon-32x32.png"
+apple_touch_icon = "/icons/apple-touch-icon.png"
+safari_pinned_tab = "/icons/safari-pinned-tab.svg"
+webmanifest = "/icons/site.webmanifest"
+
+# Author details
+[extra.author]
+name = "DeepThought"
+avatar = "/images/avatar.png"
+
+# Social links
+[extra.social]
+email = "<email_id>"
+facebook = "<facebook_username>"
+github = "<github_username>"
+gitlab = "<gitlab_username>"
+keybase = "<keybase_username>"
+linkedin = "<linkedin_username>"
+stackoverflow = "<stackoverflow_userid>"
+twitter = "<twitter_username>"
+instagram = "<instagram_username>"
+behance = "<behance_username>"
+google_scholar = "<googlescholar_userid>"
+orcid = "<orcid_userid>"
+mastodon_username = "<mastadon_username>"
+mastodon_server = "<mastodon_server>" (if not set, defaults to mastodon.social)
+
+
+# To add google analytics
+[extra.analytics]
+google = "<your_gtag>"
+
+# To add disqus comments
+[extra.commenting]
+disqus = "<your_disqus_shortname>"
+
+# To enable mapbox maps
+[extra.mapbox]
+enabled = true
+access_token = "<your_access_token>"
+
+If you want to have a multilingual navbar on your blog, you must add your new code language in the languages array in the config.toml
file.
NOTE: Don't add you default language to this array
+languages = [
+ {code = "fr"},
+ {code = "es"},
+]
+
+And then create and array of nav item for each language:
+NOTE: Include your default language in this array
+navbar_items = [
+ { code = "en", nav_items = [
+ { url = "$BASE_URL/", name = "Home" },
+ { url = "$BASE_URL/posts", name = "Posts" },
+ { url = "$BASE_URL/docs", name = "Docs" },
+ { url = "$BASE_URL/tags", name = "Tags" },
+ { url = "$BASE_URL/categories", name = "Categories" },
+ ]},
+ { code = "fr", nav_items = [
+ { url = "$BASE_URL/", name = "Connexion" },
+ ]},
+ { code = "es", nav_items = [
+ { url = "$BASE_URL/", name = "Publicationes" },
+ { url = "$BASE_URL/", name = "Registrar" },
+ ]}
+]
+
+en:
+ +fr:
+ +es:
+ +This theme contains math formula support using KaTeX,
+which can be enabled by setting katex.enabled = true
in the extra
section
+of config.toml
.
After enabling this extension, the katex
short code can be used in documents:
{{ katex(body="\KaTeX") }}
to typeset a math formula inlined into a text,
+similar to $...$
in LaTeX{% katex(block=true) %}\KaTeX{% end %}
to typeset a block of math formulas,
+similar to $$...$$
in LaTeXOptionally, \\( \KaTeX \\)
/ $ \KaTeX $
inline and \\[ \KaTeX \\]
/ $$ \KaTeX $$
+block-style automatic rendering is also supported, if enabled in the config
+by setting katex.auto_render = true
.
Zola use Elasticlunr.js to add full-text search feature.
+To use languages other than en (English), you need to add some javascript files. See the Zola's issue #1349.
+By placing the templates/base.html
on your project and using the other_lang_search_js
block, you can load the required additional javascript files in the right timing.
e.g. templates/base.html
{%/* extends "DeepThought/templates/base.html" */%} {%/* block other_lang_search_js */%}
+<script src="{{ get_url(path='js/lunr.stemmer.support.js') }}"></script>
+<script src="{{ get_url(path='js/tinyseg.js') }}"></script>
+<script src="{{/* get_url(path='js/lunr.' ~ lang ~ '.js') */}}"></script>
+<script src="{{ get_url(path='js/search.js') }}"></script>
+{%/* endblock */%}
+
+More detailed explanations are aound in elasticlunr's documents.
+ +Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
+Distributed under the MIT License. See LICENSE
for more information.
Ratan Kulshreshtha - @RatanShreshtha - ratan.shreshtha[at]gmail.com
+Project Link: https://github.com/RatanShreshtha/DeepThought
+ +Use this section to mention useful resources and libraries that you have used in your projects.
+ + + ++
Rust BR Blog template for Gutenberg
+[extra]
+blog_logo="/imgs/common/logo.png" #will appear on top header
+blog_title="rust::br::Blog" #will appear on top header after logo
+
+## i18n words
+label_tags = "Tags"
+label_tag = "Tag"
+label_categories = "Categorias"
+label_category = "Categoria"
+label_relative_posts = "Postagens Relacionadas"
+label_next = "Próxima"
+label_previous = "Anterior"
+label_page = "Página"
+label_of = "de"
+label_minutes = "minutos"
+
+og_image="" # Image that will appear on social media
+og_alt_image="" # Alt for og_image
+og_site_name="" # Site Name for Open Graphic
+keywords="" # Keywords for SEO
+
+educational_use="knowledge share" # OPTIONAL
+copyright_year="2018" # OPTIONAL
+
+fb_app_id="???" # OPTIONAL, Facebook App Id to help in metrics
+twitter_username="@???" # OPTIONAL, Twitter User to help with metrics
+
+## Sidebar automatic links
+sidebar = [
+ {name = "Social", urls=[
+ {name="Telegram", url="https://t.me/rustlangbr"},
+ {name="Github", url="https://github.com/rust-br"},
+ ]},
+ {name = "Divida Conhecimento!", urls=[
+ {name="Contribuir!", url="https://rust-br.github.io/blog/hello-world"}
+ ]}
+]
+
+
+This configuration was the same configuration that we use on RustBR Blog
+By default Dinkleberg wait that you have all icons on root of your static, for it you can use the site https://www.favicon-generator.org/ to generate that bundle and put it inside you /static
:D
Demo: docsascode.codeandmedia.com
+I was inspired by Linode's approach to creating and managing docs. They call it docs as code methodology. Thereby my aim was making simple and productive way to work with any sort of documents and articles through Markdown, Git and Docker/k8s optionally.
+The repo contains a theme for Zola (the best static site generator I've ever seen) and dockerfile for building Docker images with Nginx-alpine. You can pull to your Docker an image with demo-content
+codeandmedia/docsascode-theme:latest
+
+If you would use Docker on MacBook M1 processors \ Raspberry Pi4 64bit \ Amazon Graviton or another ARM64 - just fork the ARM64 branch or push
+codeandmedia/docsascode-theme-arm64:latest
+
+But, zola is amazing static site generator, so you feel free to
+Zola supports Netlify and other similar services, or you can decide to create your own CI/CD process.
+All your articles should be inside content folder. Any images, videos, other static files should be inside static.
+Every folder should contains _index.md like
++++
+title = "Docsascode title"
+description = "Description is optional"
+sort_by = "date" # sort by weight or date
+insert_anchor_links = "right" # if you want § next to headers
++++
+
+Each folder is the section of the website, it means if you create folder foo it will be seen as yoursitedomain.com/foo
+The theme supports folders in folders and articles + folders in one folder (see an example inside content). So you can store inside folder another folders and describe in index some specific details.
+A page should be started by
++++
+title = "File and folders in folder"
+date = 2020-01-18 # or weight
+description = "Description"
+insert_anchor_links = "right"
+
+[taxonomies] #all taxonomies is optional
+tags = ["newtag"]
+authors = ["John Doe"]
++++
+
+Zola allows to create drafts:
+draft = true
+
+Also, by default you have two taxonomies: tags and authors. It's optional, not necessary to use it on all pages. And you can add your own taxonomy:
+ {%/* if page.taxonomies.yourtaxonomynameplural */%}
+ <ul>
+ {%/* for tag in page.taxonomies.yourtaxonomynameplural */%}
+ <li><a href="{{/* get_taxonomy_url(kind="yourtaxonomynameplural", name=yourtaxonomyname) | safe */}}" >{{/* yourtaxonomyname */}}</a></li>
+ {%/* endfor */%}
+ </ul>
+ {%/* endif */%}
+
+Done. I told you Zola is amazing :)
+Anyway you can rewrite theme for your own wishes with Zola (link to documentation)
+ + +First install the theme into the themes
directory with one of these options:
# If you work with git:
+git submodule add https://github.com/oltdaniel/dose.git themes/dose
+# or just do a download:
+git clone https://github.com/oltdaniel/dose.git themes/dose
+
+and then enable it in your config.toml
:
theme = "dose"
+
+You can enable the following taxonomies:
+taxonomies = [
+ { name = "tags", feed = true },
+]
+
+And the theme uses the following extras:
+[extra]
+social_media = [
+ { name = "GitHub", url = "https://github.com/oltdaniel" },
+ { name = "Twitter", url = "https://twitter.com/@twitter" },
+ { name = "Mastodon", url = "https://mastodon.social/@Mastodon", rel = "me" }
+]
+default_theme = "dark" # or "light"
+
+The description of yourself with your image, you can modify by using a template. Just create a new
+file myblog/templates/parts/me.html
:
<img src="https://via.placeholder.com/50" height="50px" width="50px">
+<p>Hi, this is me. I write about microcontrollers, programming and cloud software. ...</p>
+
+If you want to have all pages sorted by their date, please create myblog/content/_index.md
:
+++
+sort_by = "date"
++++
+
+I created this theme mainly for my personal website. You are free to use it or modify it. It is inspired by the no-style-please
jekyll theme.
This theme uses no special font, just the browsers default monospace font. Yes, this can mean that the website could be rendered differently, but users can freely choose their webfont.
+This theme supports dark and light mode. Currently this will be only switched based on the users preffered system theme. But a manual switch will follow in the future in the footer (see the todo).
+light | dark |
---|---|
The JavaScript has been moved into the page itself to allow minification. Together this results in the following sizes for the index.html
:
~ 3kB
JavaScript~ 3kB
CSS~ 17kB
Profile Image~5kB - ~3kB = ~2kB
HTMLWhich results in a total loading size of 3kB + 3kB + 17kB + 2kB = 25kB
.
As I didn't want to invest any time in creating an own syntax color schema for this theme, I suggest to use visual-studio-dark
, which is the same one used in the demo page.
You can create your own version of this theme, by simply changing the sass variables in sass/style.scss
to match your taste.
/**
+ * Variables
+ */
+$base-background: white;
+$text-color: black;
+$article-tag: green;
+$lang-tag: red;
+$link-color: blue;
+$target-color: yellow;
+$separator-decoration: "//////";
+
+This project was created by Daniel Oltmanns and has been imporved by these contributors.
+ + +Duckquill is a modern, pretty, and clean (and opinionated) Zola theme that has the purpose of greatly simplifying the process of rolling up your blog. It aims to provide all the needed options for comfortable writing, keeping the balance of it being simple.
+ +Docs are provided in form of a live demo.
+This website is under the MIT license:
+There are several ways to contribute to this project:
+When making any sort of contribution, please make sure to follow Forgejo's Code of Conduct. If you don't have the time to read it, just know that all you have to do is be nice, and you'll be just fine.
+</> with <3 by daudix | README based on libreivan's
+ + +A KISS theme for Zola (static site generator written in Rust).
+Features:
+Demo site is here.
+cd YOUR_SITE_DIRECTORY/themes
+git clone https://github.com/kyoheiu/emily_zola_theme.git
+
+and set the theme-name in config.toml
to emily_zola_theme
.
theme = "emily_zola_theme"
+
+In YOUR_SITE_DIRECTORY/themes/emily_zola_theme/content
.
To use MathJax, add the following lines to the front matter in .md
file. [extra]
is mandatory:
[extra]
+math = true
+
+In addition to default values, you can customize following parts easily:
+index.html
(default 5)Set your own in themes/emily_zola_theme/theme.toml
, or to overwrite, copy [extra]
block, paste it into your config.toml
and edit.
A light, simple & beautiful Zola theme made with a focus on writing. Inspired by sbvtle and Pixyll.
+Like both those web designs, Ergo is a theme that emphasizes content, but still tries to be stylish. Frankly, the design is +most like sbvtle (http://sbvtle.com) but without the clever svbtle Engine, Javascript, community or kudos button (kudos is on the list of additions, though! But then i'll have to use JS...) +If you find that you like all those things, please check out svbtle; this theme is meant as a lighter (free) alternative, +and ergo's design will most likely diverge more in the future as this theme evolves with me and it's users (if there are any). +This is not meant as a svbtle clone.
+ +Get Zola and/or follow their guide on installing a theme.
+Make sure to add theme = "ergo"
to your config.toml
Ergo relies on having paginate_by
variable set in content/_index.md
.
Just to double-check to make sure you have the right version. It is not supported to use this theme with a version under 0.11.0.
+go into your sites directory, and type zola serve
. You should see your new site at localhost:1111
.
Zola already has great documentation for deploying to Netlify or Github Pages. I won't bore you with a regurgitated explanation.
+All colors used on the site are from sass/colors.scss
. There's only about 5-6 colors total.
+Change them however you like! Feel free to go into theme and edit the colors. However, editing anything other than sass/colors.scss
is strongly advised against. Continue at your own peril!
# Specify a profile picture to use for the logos in the theme. It can be svg, png, jpg, whatever, just make sure to copy the logo you want and put it in img/${YOUR_PROFILE}.*
+# and update your config.toml accordingly
+profile = 'profile.svg'
+
+# Description. This is needed for SEO/site metadata purposes
+description = "Simple blog theme focused on writing, inspired by svbtle"
+
+# Color themes used by the theme (theme will use ${color_theme}.css file, generated by SASS or SCSS file with the same name). Defaults to ["default"]. User can choose either of them, default theme is the first in list.
+color_themes = ["my-awesome-theme", "default"]
+
+[[extra.socials]] # website
+icon = "globe"
+icon_class = "fas"
+display = "code.liquidthink.net"
+uri = "https://code.liquidthink.net"
+
+[[extra.socials]] # github
+icon = "github"
+display = "Insipx"
+uri = "https://github.com/Insipx"
+
+[[extra.socials]] # twitter
+icon = "twitter"
+display = "@liquid_think"
+uri = "https://twitter.com/liquid_think"
+
+[[extra.socials]] # email
+icon = "envelope"
+icon_class = "fas"
+display = "say hello"
+uri = "mailto:${MY_EMAIL}@cool_domain.com?subject=hi"
+
+[[extra.socials]]
+icon = "instagram"
+display = "${your_insta}"
+uri = "https://instagram.com/${your_insta}"
+
+[[extra.socials]]
+icon = "keybase"
+display = "${your_keybase}"
+uri = "https://keybase.io/${your_keybase}"
+
+[[extra.socials]]
+icon = "linkedin"
+display = "${your_linkedin}"
+uri = "https://www.linkedin.com/in/${your_linkedin}"
+
+[[extra.socials]]
+icon = "reddit"
+display = "${your_reddit}"
+uri = "https://www.reddit.com/u/${your_reddit}"
+
+[[extra.socials]]
+icon = "youtube"
+display = "${your_youtube_channel_id}"
+uri = "https://youtube.com/channel/${your_youtube_channel_id}"
+
+# Whether to use country flags or language code
+country_flags = true
+
+config.toml
Even is a clean, responsive theme based on the Hugo theme with the same name featuring categories, tags and pagination.
+ +First download this theme to your themes
directory:
cd themes
+git clone https://github.com/getzola/even.git
+
+and then enable it in your config.toml
:
theme = "even"
+
+The theme requires tags and categories taxonomies to be enabled in your config.toml
:
taxonomies = [
+ # You can enable/disable RSS
+ {name = "categories", feed = true},
+ {name = "tags", feed = true},
+]
+
+If you want to paginate taxonomies pages, you will need to overwrite the templates +as it only works for non-paginated taxonomies by default.
+It also requires to put the posts in the root of the content
folder and to enable pagination, for example in content/_index.md
:
+++
+paginate_by = 5
+sort_by = "date"
++++
+
+Set a field in extra
with a key of even_menu
:
# This is the default menu
+even_menu = [
+ {url = "$BASE_URL", name = "Home"},
+ {url = "$BASE_URL/categories", name = "Categories"},
+ {url = "$BASE_URL/tags", name = "Tags"},
+ {url = "$BASE_URL/about", name = "About"},
+]
+
+If you put $BASE_URL
in a url, it will automatically be replaced by the actual
+site URL.
The site title is shown on the header. As it might be different from the <title>
+element that the title
field in the config represents, you can set the even_title
+instead.
This theme contains math formula support using KaTeX,
+which can be enabled by setting katex_enable = true
in the extra
section
+of config.toml
:
[extra]
+katex_enable = true
+
+After enabling this extension, the katex
short code can be used in documents:
{{ katex(body="\KaTeX") }}
to typeset a math formula inlined into a text,
+similar to $...$
in LaTeX{% katex(block=true) %}\KaTeX{% end %}
to typeset a block of math formulas,
+similar to $$...$$
in LaTeXOptionally, \\( \KaTeX \\)
inline and \\[ \KaTeX \\]
/ $$ \KaTeX $$
+block-style automatic rendering is also supported, if enabled in the config:
[extra]
+katex_enable = true
+katex_auto_render = true
+
+
+
+ A lightweight blog theme for Zola (and to my knowledge the first of now +many themes created specifically for Zola).
+Zola allows themes to define [extra]
variables
+in the config. Here's a full list of theme variables with example values and comments.
# Regular variables you might want to set...
+title = "My site" # Otherwise, this will read "Home" in the nav
+
+[extra]
+# Specify a theme
+# Default: unset
+#
+# by default, feather enables light and dark mode
+# (and switching when javascript is enabled.)
+# However, if you prefer to only allow one mode,
+# set this to "dark" or "light".
+feather_theme = "dark"
+
+# Quickly insert into `<head>`
+# Default: unset
+feather_head = "<script>alert()</script>"
+
+# Add Disqus comments
+# Default: unset
+#
+# Adds comments to pages by providing your
+# disqus domain. Comments will not appear on
+# index pages, etc.
+feather_disqus_domain = "mysite-com"
+
+# Hide the nav bottom border/background image
+# Default: false
+feather_hide_nav_image = true
+
+Using feather is easy. Install Zola and follow
+the guide for creating a site and using a theme. Then,
+add theme = "feather"
to your config.toml
file.
If you intend to publish your site to GitHub Pages, please check out this +tutorial.
+You can specify tags
taxonomies .
Because feather comes with example content, you can run the theme just like any Zola
+blog with zola serve
.
Float 是一款為 Zola 設計的佈景主題。
+[[TOC]]
+resize_image()
自動產生適用於 DPR 1.0 ~ 3.0 的圖片,卡片配圖會由瀏覽器依據設備之 DPR 自動選用最佳尺寸的圖片。在您的 Zola 專案資料夾內:
+把 Float 以 Git 子模組的方式加入專案內:
+git submodule add https://gitlab.com/float-theme/float.git themes/float
+
+編輯您的 config.toml,指定 Float 作為佈景主題:
+theme = "float"
+
+編輯您的 config.toml,加入 tags 作為分類系統:
+taxonomies = [
+ {name = "tags", paginate_by = 10},
+]
+
+複製 float/static/ 的所有子資料夾與檔案到您的 static/:
+cp -r themes/float/static/* static/
+
+複製 float/content/ 的所有子資料夾與檔案到您的 content/:
+cp -r themes/float/content/* content/
+
+文章皆以資料夾的方式存在,如下例:
+content/
+└── blog/
+ └── 2020/
+ └── 2020-06-15-Zola-Theme-Float/
+ ├── index.md
+ ├── pic1.png
+ ├── pic2.png
+ └── qa_report.pdf
+
+文章為 index.md,文內的配圖或其它檔案也是放在文章資料夾內。
+Front-matter 請參照下列註解說明:
+title = "Float theme for Zola"
+description = "Float features and usage guide"
+draft = false
+[taxonomies]
+tags = ["Float", "Zola"]
+[extra]
+feature_image = "pic1.png" # 卡片圖片。
+feature = true # 是否為重點文章,重點文章會以寬版卡片顯示。
+link = "" # 指定卡片連結,若有指定則卡片不會連結到文章頁。
+
+可客製化設定大多可以在 config.toml 的 [extra]
區段做設定:
[extra]
+main_section = "blog"
+
+copyright = ""
+
+web_fonts = "<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@500;700&display=swap'>"
+
+google_analytics = false
+# google_analytics_id = "UA-XXXXXX-X"
+
+google_adsense = false
+# google_adsense_id = "ca-pub-XXXXXXXXXXXXXXXX"
+
+twitter_account = "@xxx"
+
+likecoin = false
+# likecoin_name = "xxx"
+
+utterances = false
+# utterances_repo = "xxx/xxx"
+
+字體的 CSS 位於 float/sass/font.scss,欲更換字體,把 float/sass/font.scss 複製到自己的 sass/font.scss,並修改之。
+get_section()
無法取得該 section 的分頁設定。++ +A single-page theme to introduce yourself.
+Zola port of hallo-hugo.
+
This is a port of the original hallo-hugo theme for Hugo (License).
+The easiest way to install this theme is to either clone it ...
+git clone https://github.com/janbaudisch/zola-hallo.git themes/hallo
+
+... or to use it as a submodule.
+git submodule add https://github.com/janbaudisch/zola-hallo.git themes/hallo
+
+Either way, you will have to enable the theme in your config.toml
.
theme = "hallo"
+
+The introduction text is made in content/_index.md
.
See config.toml
for an example configuration.
The given name will be used for the 'I am ...' text.
+Default: Hallo
[extra.author]
+name = "Hallo"
+
+The string will be used as a greeting.
+Default: Hello!
[extra]
+greeting = "Hello!"
+
+iam
This variable defines the I am
text, which you may want to swap out for another language.
Default: I am
[extra]
+iam = "I am"
+
+Links show up below the introduction. They are styled with Font Awesome, you may optionally choose the iconset (default is brands).
+[extra]
+links = [
+ { title = "E-Mail", url = "mailto:mail@example.org", iconset = "fas", icon = "envelope" },
+ { title = "GitHub", url = "https://github.com", icon = "github" },
+ { title = "Twitter", url = "https://twitter.com", icon = "twitter" }
+]
+
+Change the colors used.
+[extra.theme]
+background = "#6FCDBD"
+foreground = "#FFF" # text and portrait border
+hover = "#333" # link hover
+
+
+
+ halve-z
A two-column theme for Zola.
+ +This is a retro port of Halve (Jekyll). It features:
+Add theme submodule using git
:
git submodule add https://github.com/charlesrocket/halve-z themes/halve-z
+
+Use the following command to update theme to the latest version:
+git submodule update --recursive --remote
+
+theme = "halve-z"
at the top of the config file.cp -R -f themes/halve-z/content/ content/
+
+See demo posts.
+ + +HayFlow is a modular landing page made as a theme for Zola, a static site generator written in Rust. It features a dark theme with a particles background, vertical arrows for navigation and a few card types which you are free to include to best suit your needs. Nearly all UI elements are subtly animated to convey a professional look (although I'm no designer 🤷 merely an embedded systems engineer).
+It has been designed to require only Markdown editing (no HTML/CSS), but feel free to do so if you need to. I'll be glad to review a Merge Request if you implement a new card type !
+[[TOC]]
+See my personal website for an example of what can be accomplished in a few minutes with this theme. Its source code is also available as an example in my Gitlab website repository.
+Initialize a Zola website and install HayFlow:
+zola init mywebsite
+cd mywebsite
+git clone git@gitlab.com:cyril-marpaud/hayflow.git themes/hayflow
+
+Add theme = "hayflow"
at the top of config.toml
file to tell Zola to use HayFlow (as described in the documentation).
Finally, run...
+zola serve
+
+...and go to http://localhost:1111 to see the landing page in action with the default name displayed (John Doe).
+Customizing the landing page boils down to two things:
+name
and links
variables to the config.toml
's [extra]
section (links
is optional. So is name
if your name is John Doe)roles
variable to the content/_index.md
's [extra]
section (also optional)The difference comes from the fact that you might need to translate the roles
into other languages. For that to be possible, they must be placed in a MarkDown file. See multilingual support for more info.
name
speaks for itself.roles
is an array of strings. Each string is displayed on a separate line.links
is an array of {icon, url}
objects. You can use any free icon from Font Awesome here, all you need is the icon's code. The enveloppe icon's code is fa-solid fa-envelope
. The pizza-slice icon's code is fa-solid fa-pizza-slice
.This is what the config.toml
's [extra]
section might look like after customization:
[extra]
+name = { first = "ninja", last = "turtle" }
+
+links = [
+ { icon = "fa-solid fa-envelope", url = "mailto:slice@pizza.it" },
+ { icon = "fa-solid fa-pizza-slice", url = "https://en.wikipedia.org/wiki/Pizza" },
+]
+
+And here's a customized version of content/_index.md
:
+++
+[extra]
+roles = ["Green 🟢", "Turtle 🐢", "Pizza enthusiast 🍕"]
++++
+
+Inside the content
directory, create a pizza
folder and place this _index.md
file inside:
+++
+title = "Pizza"
++++
+
+What a mouthful !
+
+Then, add this sections
variable (an array of strings) to the config.toml
's [extra]
section:
[extra]
+sections = ["pizza"]
+
+A new internal link pointing to that section will appear on the landing page. Click it and see what happens ! This is called a "simple card" section.
+HayFlow currently supports three card types : simple
, columns
and list
. If left unspecified, the type will default to simple
. To change it, add a card_type
variable to the _index.md
's [extra]
section:
+++
+title = "Pizza"
+
+[extra]
+card_type = "simple"
++++
+
+What a mouthful !
+
+Add a new section and set its card type to columns
. Then, alongside the _index.md
file, create three other files: one.md
, two.md
and three.md
. These will be the ingredients of your new pizza. Their content is similar to _index.md
:
+++
+title = "Tomato"
+
+[extra]
+icons = ["fa-solid fa-tomato"]
++++
+
+The basis of any self-respecting pizza. It is the edible berry of the plant Solanum lycopersicum.
+
+The icons
variable is optional.
Add a new section and set its card type to list
. Then, alongside the _index.md
file, create three other files: one.md
, two.md
and three.md
. These will be your favourite pizzas. Their content is similar to _index.md
:
+++
+title = "Margherita"
+
+[extra]
+link = "https://en.wikipedia.org/wiki/Pizza_Margherita"
++++
+
+Margherita pizza is a typical [Neapolitan pizza](https://en.wikipedia.org/wiki/Neapolitan_pizza), made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.
+
+The link
variable is optional.
HayFlow supports multilingual websites out of the box.
+In config.toml
, add the languages you want to support like so:
default_language = "fr"
+[translations]
+flag = "🇫🇷"
+
+[languages.en]
+[languages.en.translations]
+flag = "🇬🇧"
+
+[languages.italian]
+[languages.italian.translations]
+flag = "🇮🇹"
+
+This will make the language-select block in the top-right corner visible. It consists of clickable links to the translated versions of your website.
+The flag
variable is optional and you can use simple text instead of an emoji flag. If left unspecified, it will default to the country code you chose for that language (fr
, en
and italian
in this example).
Each .md
file in the content
folder now needs to be translated into every additional language previously declared in config.toml
.
Following the above example (three languages, french, english and italian) and given this initial filetree:
+content/
+ _index.md
+ pizzas/
+ _index.md
+ margherita.md
+ capricciosa.md
+
+The final filetree should look like this for the translation to be complete:
+content/
+ _index.md
+ _index.en.md
+ _index.italian.md
+ pizzas/
+ _index.md
+ _index.en.md
+ _index.italian.md
+ margherita.md
+ margherita.en.md
+ margherita.italian.md
+ capricciosa.md
+ capricciosa.en.md
+ capricciosa.italian.md
+
+Additionally, if your website includes any "list card" sections, you might want to specify a discover
variable in their [extra]
sections like so:
+++
+title = "List Card Section"
+
+[extra]
+card_type = "list"
+discover = "Découvrir"
++++
+
+My name is Cyril Marpaud, I'm an embedded systems freelance engineer and a Rust enthusiast 🦀 I have nearly 10 years experience and am currently living in Lyon (France).
+ + + +Hephaestus is a portfolio theme for zola. It uses bulma css and supports using icons from ion-icon.
+ +First, you will download the theme into your themes
directory:
$ cd themes
+$ git clone https://github.com/BConquest/hephaestus
+
+Second, you will enable the theme in your config.toml
directory:
theme = "hephaestus"
+
+To edit the navigation bar you will need to edit your config.toml
to include:
menu = [
+{ text = "foo", link = "/foo"},
+{ text = "bar", link = "/bar"},
+]
+
+You can have as many items as you want to have and the links can be to anything.
+To edit the education that is displayed you will need to create a directory in content
.
+In the _index.md
the frontmatter needs to include:
title = "foo"
+template = "education.html"
+
+[extra]
+author = "Name"
+
+For every educational level you want to add you will need to create a new markdown file that includes the frontmatter:
+title = "place of education"
+
+[extra]
+image = "image-location"
+link = "link to school"
++++
+
+Any content that is typed will be rendered underneath these two items.
+To edit the projects that are displayed you will need to create a directory in content
.
+In the _index.md
the frontmatter needs to include:
title = "foo"
+template = "projects.html"
+
+[extra]
+author = "bar"
+
+Then for every project you want to add you will need to format the *.md
as:
+++
+title = "foo"
+
+[extra]
+image = "/image_location"
+link = "link to project"
+technologies = ["bar", "baz"]
++++
+
+Description of project named foo.
+
+To edit the skills that you want to display it is important to note that there are two types of skills that can be
+displayed (lan, and tools). To format the look you will need to create a directory in content
that includes the
+frontmatter of:
title = "foo"
+template = "skills.html"
+page_template = "skills.html"
+
+[extra]
+author = "author-name"
+image = "image-location"
+
+lan = [
+{ lang = "language", expr = "num between 1-5", image = "image-location", comfort = "word to describe comfort"},
+]
+
+tools = [
+{ tool = "tool-name", expr = "num between 1-5", image = "tool-image"},
+]
+
+To edit the social links that appear in the footer of the page, you need to edit your config.toml
to include:
social = [
+{ user = "username", link = "link", icon = "icon-name from ion-icon"},
+]
+
+
+
+ ++this is a port of the Hermit theme for Zola
+
Hermit is a minimal & fast Zola theme for bloggers.
+ + +First download the theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/VersBinarii/hermit_zola
+
+and then enable it in your config.toml
:
theme = "hermit_zola"
+
+[extra]
+home_subtitle = "Some profound and catchy statement"
+
+footer_copyright = ' · <a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener">CC BY-NC 4.0</a>'
+
+hermit_menu = [
+ { link = "/posts", name = "Posts" },
+ { link = "/about", name = "About" }
+]
+
+hermit_social = [
+ { name = "twitter", link = "https://twitter.com" },
+ { name = "github", link = "https://github.com" },
+ { name = "email", link = "mailto:author@domain.com" }
+]
+
+
+
+[extra.highlightjs]
+enable = true
+clipboard = true
+theme = "vs2015"
+
+[extra.disqus]
+enable = false
+# Take this from your Disqus account
+shortname = "my-supa-dupa-blog"
+
+[extra.author]
+name = "The Author"
+email = "author@domain.com"
+
+[extra.google_analytics]
+enable = false
+id = "UA-4XXXXXXX-X"
+
+Table of content can be enabled by adding
++++
+[extra]
+toc=true
++++
+
+to the page front matter. Icon will then appear above the page title that will +allow to toggle the ToC.
+Thanks to Track3 for creating the original!
+ + +A clean and simple personal site/blog theme for Zola.
+ +Clone this repo into your themes
folder:
cd themes
+git clone https://github.com/InputUsername/zola-hook.git hook
+
+Then, enable it in your config.toml
:
theme = "hook"
+
+The following templates are built-in:
+index.html
- the homepage;page.html
- pages and posts (extends index.html
);section.html
- archive of pages in a section, mostly for a blog (extends page.html
);404.html
- 404 page (extends page.html
).Templates have the following Tera blocks:
+title
- to override the default <title>
(config.title
);description
- to override the <meta name="description">
's content (config.description
);extra_head
- to override styles and anything else in <head>
;header
- to change the header (best to put this in a <header>
);content
- to change the content (best to put this in a <main>
).You can set a section or page description using description
in your front matter.
+By default, the description
in config.toml
is used.
You can define links to include in the header on the homepage in config.toml
:
[extra]
+
+links = [
+ { title = "Link display text", href = "http://example.com" },
+ # ...
+]
+
+Pages in the root section can define extra.in_header = true
to be included in the header links on the homepage.
The content in the root _index.md
is included in the homepage if present.
Below that is a list of the 20 most recent posts. For this, the blog/_index.md
section is expected to exist
+(will error if it doesn't exist). There is also a link to an archive of all blog posts by year.
Hook supports light/dark mode based on the user's preference. There is also a manual toggle button +(requires JavaScript).
+MIT license, see LICENSE
.
Hyde is a brazen two-column Zola based on the Jekyll theme of the same name that pairs a prominent sidebar with uncomplicated content.
+ +First download this theme to your themes
directory:
cd themes
+git clone https://github.com/getzola/hyde.git
+
+and then enable it in your config.toml
:
theme = "hyde"
+
+Set a field in extra
with a key of hyde_links
:
[extra]
+hyde_links = [
+ {url = "https://google.com", name = "Google.com"},
+ {url = "https://google.fr", name = "Google.fr"},
+]
+
+Each link needs to have a url
and a name
.
By default Hyde ships with a sidebar that affixes it's content to the bottom of the sidebar. You can optionally disable this by setting hyde_sticky
to false in your config.toml
.
Hyde ships with eight optional themes based on the base16 color scheme. Apply a theme to change the color scheme (mostly applies to sidebar and links).
+ +There are eight themes available at this time.
+ +To use a theme, set the hyde_theme
field in config.toml
to any of the themes name:
[extra]
+hyde_theme = "theme-base-08"
+
+To create your own theme, look to the Themes section of included CSS file. Copy any existing theme (they're only a few lines of CSS), rename it, and change the provided colors.
+Hyde's page orientation can be reversed by setting hyde_reverse
to true
in the config.toml
.
++An elegant and understated theme for Zola
+
Zola Inky (view demo) is a theme by jimmyff and mr-karan for the Zola static site generator. This theme was originally based on the hugo-ink theme, ported by mr-karan. It was then packaged and developed further by jimmyff. The theme is available on Github under the MIT license, for more information on how to use it please see the readme and check the changelog for a list of the latest changes.
+ +For latest changes please see the changelog.
+themes/
folder (recommended method: git submodule).theme = 'zola-inky'
at the top of the file.content/
directory the root of your project and change the files as your necessary.config.toml
in to your project and update as required (make sure you add the theme variable at the top of the file, see the getting started heading above).sass/variables.scss
in to your project under the same folder and update as required.templates/macros/hooks.html
and update as required.Using the responsive images will make sure your images are generated at various sizes and served up to viewers at the size that best suits their device via the image srcset attribute. You can use this feature in your markdown like so:
+{{ image(src="yourimage.jpg", alt="This is my image") }}
+
+I'm afraid I'm unable to accept feature requests or provide user support for this theme. The Zola documentation and Tera documentation are great resources and there is a Zola discussion forum. If you've found a bug in the themse please open a github issue.
+Contributions are very welcome! If you are planning to add a feature to the theme then feel free to open an issue to discuss your approach and we will be able to say if it's it will likely be accepted. Please keep the following in mind:
+New theme maintainers are welcome but should provide pull-request or two first!
+ + +Juice is an intuitive, elegant, and responsive Zola theme for product sites.
+https://juice.huhu.io
+First download this theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/huhu/juice.git
+
+or add as a submodule
+$ git submodule add https://github.com/huhu/juice themes/juice
+
+and then enable it in your config.toml
:
theme = "juice"
+
+Juice is designed for product websites, hence we let hero part fills whole of screen.
+You can customize your hero by using hero
block in the templates/index.html
.
{%/* extends "juice/templates/index.html" */%}
+{%/* block hero */%}
+ <div>
+ Your cool hero html...
+ </div>
+{%/* endblock hero */%}
+
+Every markdown file located in content
directory will become a Page. There also will display as
+a navigate link on the top-right corner.
+You can change the frontmatter's weight
value to sort the order (ascending order).
+++
+title = "Changelog"
+description = "Changelog"
+weight = 2
++++
+
+
+You can override theme variable by creating a file named _variables.html
in your templates
directory.
See the default value here
+The same way as changing the hero
block in the templates/index.html
, you can change the favicon.
{%/* extends "juice/templates/index.html" */%}
+{%/* block favicon */%}
+ <link rel="icon" type="image/png" href="/favicon.ico">
+{%/* endblock favicon */%}
+
+If you changed the --xy-font-family
-variable in _variables.html
, you have to load the mentioned fonts in the templates/index.html
.
{%/* extends "juice/templates/index.html" */%}
+{%/* block fonts */%}
+ <link href="https://cdn.jsdelivr.net/npm/fork-awesome@1.2.0/css/fork-awesome.min.css" rel="stylesheet" crossorigin="anonymous">
+ <link href="https://fonts.googleapis.com/css2?family=Babylonica&display=swap" rel="stylesheet">
+{%/* endblock fonts */%}
+
+You can customize some builtin property in config.toml
file:
[extra]
+juice_logo_name = "Juice"
+juice_logo_path = "juice.svg"
+juice_extra_menu = [
+ { title = "Github", link = "https://github.com/huhu/juice"}
+]
+juice_exclude_menu = [
+ "exclude_from_nav"
+]
+repository_url = "https://github.com/huhu/juice"
+
+Juice have some builtin shortcodes available in templates/shortcodes
directory.
issue(id)
- A shortcode to render issue url, e.g. issue(id=1)
would render to the link https://github.com/huhu/juice/issue/1
.++The
+repository_url
is required.
Please see the showcases page.
+Thank you very much for considering contributing to this project!
+We appreciate any form of contribution:
+kangae is a lightweight microblog theme for zola.
++ + +
+I've created kangae from scratch and it is not based on any other theme. However, I was inspired to +create kangae after I came across Wolfgang Müller's microblog. Thanks Wolf!
+kangae is licensed under the NCSA license, which is quite similar to the BSD-3-Clause license. +Unlike BSD-3-Clause, NCSA also covers documentation of a project.
+Here's a list of websites using the kangae theme
+ +If you want to mention your website in this section, please raise a pull request.
+Before using this theme, install zola. After you've installed zola,
+$ zola init microblog
+> What is the URL of your site? (https://example.com):
+> Do you want to enable Sass compilation? [Y/n]:
+> Do you want to enable syntax highlighting? [y/N]:
+> Do you want to build a search index of the content? [y/N]:
+$ cd microblog/
+
+kangae doesn't use Sass or syntax highlighting so if you don't want to use custom Sass code or +enable syntax highlighting, answer the 2nd and 3rd question with a 'no'. kangae also doesn't use any +JavaScript library to search content. If you don't intend to install a JavaScript library to enable +search on your microblog, answer 'no' to the last question as well.
+If you intend to publish your microblog on a forge like GitHub, initialize an empty git repository +using
+$ git init
+$ git commit --allow-empty -m 'initial empty root commit'
+
+If you don't want to make an empty commit, add and commit a README or a LICENSE file instead.
+At this point, you can install kangae using one of the following methods
+git subtree
$ git subtree add -P themes/kangae/ --squash https://github.com/ayushnix/kangae.git master
+
+git submodule
$ git submodule add https://github.com/ayushnix/kangae.git themes/kangae
+
+If you want to keep things simple and figure out version control later, you can
+$ git clone https://github.com/ayushnix/kangae.git themes/kangae
+
+To begin using kangae after installing it,
+$ cp themes/kangae/config.toml ./
+$ sed -i 's;# theme =\(.*\);theme =\1;' config.toml
+
+The config.toml
file of kangae has been documented carefully using TOML comments. If you have
+any questions about configuring kangae which haven't been answered in the config.toml
file itself,
+please raise an issue.
kangae provides several shortcodes that can be used to add content in an accessible manner
+(・_・)ノ
If you want to use kaomoji in your posts, you can use insert them in an accessbile manner using
+I don't know. {{ kaomoji(label="shrug kaomoji", text="╮( ˘_˘ )╭") }} I've never thought about it.
+
+Providing a value for the label
is optional but highly recommended. A short text should be
+mentioned that explains what the kaomoji means to convey. The value of text
should be the actual
+emoticon itself.
This shortcode can also be used for any other ASCII emoticon that can fit in an inline paragraph.
+This includes western emoticons such as ;)
and combination emoticons such as <(^_^<)
.
You can add quotes in your microblog posts using
+{% quote(author="Nara Shikamaru") %}
+You would think just this once, when it was life or death, I could pull through.
+{% end %}
+
+This is the most basic form of improvement in writing quotes over simply using >
in markdown.
If you want to mention the name of the source from where the quote has been taken, such as the name +of the book or a movie, you can use
+{% quote(citation="Mass Effect 3", author="Javik") %}
+Stand in the ashes of a trillion dead souls, and ask the ghosts if honor matters. The silence is your answer.
+{% end %}
+
+A citeurl
can also be given as an argument to this shortcode to provide the actual URL from where
+the source is borrowed.
{% quote(author="Edward Snowden", citeurl="https://old.reddit.com/r/IAmA/comments/36ru89/just_days_left_to_kill_mass_surveillance_under/crglgh2/") %}
+Arguing that you don't care about the right to privacy because you have nothing to hide is no different than saying you don't care about free speech because you have nothing to say.
+{% end %}
+
+A live preview of these how these shortcodes look like can be found on this blog post.
+kangae includes some optional features that aren't enabled by default
+ +If you found kangae helpful in creating your own microblog website, please consider supporting me by +buying me a coffee :coffee:
+ +If you're in India, you can also use UPI for donations. My UPI address is ayushnix@ybl
.
Although I'm not a web developer, I am interested in learning HTML and CSS to create lightweight +textual websites. You may be interested in reading my log about how I learned HTML and CSS. +However, that page is just an unorganized dump of my thoughts and isn't a polished blog post. +Seirdy's blog post on creating textual websites is probably a better reference.
++ Documentation +
+zola init zola_site
+
+git clone https://codeberg.org/kogeletey/karzok zola_site/themes
+
+or install as submodule:
+cd zola_site
+git init # if your project is a git repository already, ignore this command
+git submodule add https://codeberg.org/kogeletey/karzok zola_site/themes
+
+config.toml
base_url = "https://karzok.example.net" # set-up for production
+theme = "karzok"
+
+See more in configuration
+ cp ./themes/content/_index.md content/_index.md
+
+how you can give freedom to your creativity
+i. development enviroment
+pnpm ci
+pnpm run build
+
+zola serve
in the root path of the projectzola serve
+
+Open in favorite browser http://127.0.0.1:1111. Saved +changes live reolad.
+ii. production enviroment
+FROM ghcr.io/kogeletey/karzok:latest AS build-stage
+# or your path to image
+ADD . /www
+WORKDIR /www
+RUN sh /www/build.sh
+
+FROM nginx:stable-alpine
+
+COPY --from=build-stage /www/public /usr/share/nginx/html
+
+EXPOSE 80
+
+docker build -t <your_name_image> . &&\
+docker run -d -p 8080:8080 <your_name_image>
+
+image: ghcr.io/kogeletey/karzok:latest # or change use your registry
+
+pages:
+ script:
+ - sh /www/build.sh
+ - mv /www/public public
+ artifacts:
+ paths:
+ - public/
+
+Open in favorite browser https://localhost:8080
+This program is Free Software: You can use, study share and improve it at your +will. Specifically you can redistribute and/or modify it under the terms of the +MIT
+Make sure to read the Code of Conduct
+On the codeberg issues or +github issues
+ + +Kita is a clean, elegant and simple blog theme for Zola.
+This theme is based on Hugo theme hugo-paper with some features added.
+ + +The easiest way to install this theme is to clone this repository in the themes directory:
+git clone https://github.com/st1020/kita.git themes/kita
+
+Or to use it as a submodule:
+git submodule add https://github.com/st1020/kita.git themes/kita
+
+Then set kita
as your theme in config.toml
.
theme = "kita"
+
+See the extra
section in config.toml as a example.
Copyright (c) 2023-present, st1020
+ + +This theme is greatly inspired from hugo academic theme.
+First lets introduce some technical details:
+The best way to get started is to follow the official zola tutorial.
+This theme can be installed as any other theme.
+mkdir themes
+cd themes & git clone https://github.com/adfaure/kodama-theme
+
+and set in the config.toml
the variable theme
to kodama-theme
.
Tailwindcss is a framework that parses your html files, and generate the minimal CSS required. +This theme depends on this framework.
+The theme comes with the precompiled style files (static/styles/styles.css
). However, if you wish to change the style, or modify the template htlm, you might need to recompile your styles.
The most simple way, is to follow the installation page of tailwindcss.
+At the end, you should have tailwindcss installed, and I advise to use the following tailwind configuration:
+# tailwind.config.js
+module.exports = {
+ content: ["./templates/**/*.html", "./themes/**/*.html", "./themes/**/*.html"],
+ theme: {},
+ variants: {},
+ plugins: [
+ require('@tailwindcss/typography'),
+ ],
+};
+
+Create a file styles/styles.css
, and use the following command to generate the final CSS file:
npx tailwindcss -i styles/styles.css -o static/styles/styles.css
+
+The resulting file static/styles/styles.css
is loaded in the html.
Note that, for the moment the generation of the css is not automated. As a result, it is necessary to re-run this command when changes are made with the styling.
+This theme use some extra configuration, that can be set in the extra section of your config.toml
.
# Title displayed in the index page
+title = "Website title"
+
+# Use this theme
+theme = "kodama-theme"
+
+[extra]
+
+# Image of your avatar displayed on the landing page
+avatar = "static/img/avatar.jpg"
+# Image of the favicon
+favicon = "static/img/avatar.jpg"
+
+# Your email address showed in the contact section
+email = "kodama[at]domain.com"
+
+# If you don't want to show your contact information in the index
+contact_in_index = true
+
+# Additional menu items
+# `Name` is what it is displayed, `path` is the url
+menu_items = [
+ { path = "#contacts", name = "Contact" },
+]
+
+The information needed to build the index page are located in the page front matter of root index file (e.g content/_index.md
).
The available configuration options are:
+# Insert zola front matter variable such as date etc
+
+[extra]
+
+# Show a concise description of what you do below your avatar.
+title = "Concise description"
+
+# The list of interests displayed
+interests = [
+ "Rainbow pony",
+ "Martian food",
+ "Quantic science"
+]
+
+# The list of your degrees / education
+[[extra.education.courses]]
+ course = "Latest degree"
+ institution = "Some acamedy"
+ year = 2020
+
+[[extra.education.courses]]
+ course = "Another degree"
+ institution = "Here and there"
+ year = 2016
+
+# Finally, a list of icons with a link displayed below your avatar
+[[extra.avatar_icons]]
+ icon = "github"
+ link = "https://github.com/adfaure"
+[[extra.avatar_icons]]
+ icon = "gitlab"
+ link = "https://gitlab.com/adfaure"
+[[extra.avatar_icons]]
+ icon = "linkedin"
+ link = "https://www.linkedin.com/in/adrien-faure-9958978b/"
+
+The predefined contact page can be use. +The front matter extra part should contains a list of the link to show in the contacts.
+The section available in your website are automatically detected and displayed in the nav bar at the top of the page.
+To prevent a section to be displayed in the nav bar, you can set the extra front matter option extra.hidden_nav = false
to false.
The section are sorted by weight
defined in the front matter of the section.
By default, the sections (i.e folders under content/section_name
) have a summary showed in the index.
+This is configurable in the front matter of the section (e.g content/section_name/_index.md
).
# The name displayed in the section summary
+extra.index_title = "Recent Posts"
+# Set to false to remove the section from the index
+extra.index_show = true
+
+The section blog
is the most standard section. It show a list of article with things that you want to share in your website.
+To use the blog template, configure the section with the following front matter:
template = "section.html"
+page_template = "blog-page.html"
+
+The section publication
is very similar to the blog
section however it is dedicated to show your list of scientific articles.
+The articles are showed in two subcategories: Thesis and Conference / Workshop.
To configure a publication section (e.g content/research
) and set the following content:
+++
+title = "Research"
+sort_by = "date"
+
+# Here the two dedicated templates
+template = "publications.html"
+page_template = "publication-page.html"
+
+# If you want to show your publications under different sections
+# the title will be the displayed text in your website, and the type
+# should be the type of publication.
+# Each individual plublication has an `extra.type` that refers to the
+# publication type (example in content sub-section).
+extra.publications_types = [
+ { title = "Journal articles", type = "journals" },
+ { title = "Thesis", type = "thesis" },
+ { title = "Conferences and workshops ", type = "conferences" }
+]
++++
+
+## Content
+
+Any content will be displayed on top of the section.
+
+Article are referenced in subdirectories of this section.
+tree content/research
+content/research
+├── _index.md
+├── paper1
+│ ├── bib
+│ └── index.md
+└── thesis
+ ├── bib
+ ├── index.md
+ ├── thesis.pdf
+ └── thesis_slides.pdf
+
+The bib files are automatically loaded to get information from it. However, it is also possible to add information in the front matter of the article markdown file.
++++
+title = "Article 1"
+date = 2021-05-18
+
+[extra]
+type = "Conference"
+authors = [ "Kodama Mononoke" ]
+
+# Should be the type of the publication type it should appears under
+# configured in the front matter of publications/_index.md
+type = "conferences"
+
+featured = true
+publication = "2020 IEE rainbow workshop"
+# Add full url for your pdf and your presentation
+url_pdf = "https://your-pdf"
+url_slides = "path_to_slides"
+
+# Add a link to a local pdf inside of your paper folder (example in content/publications/paper1.index.md)
+pdf = "paper.pdf"
+slides = "path_to_slides.pdf"
++++
+
+In some cases, it is needed to add extra javascript or css files to be loaded by the web browsers.
+The base template of this theme define an empty block named user_head
.
To use this block, you can just create a new template name templates/base.html
with the following content:
{%/* extends "kodama-theme/templates/base.html" */%}
+
+{%/* block user_head */%}
+ <script>
+ console.log("hello world!");
+ </script>
+{%/* endblock user_head */%}
+
+The icons available in this project are stored in a dedicated macro function in templates/macros/icons.html
.
+To add a new svg, you can add a case in the if elif .. else
of the function containing the svg copied from heroicons for instance.
An insanely fast and performance-based Zola theme, ported from Light Speed Jekyll.
+Some fun facts about the theme:
+Demo: quirky-perlman-34d0da.netlify.com
+First download this theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/carpetscheme/lightspeed.git
+
+and then enable it in your config.toml
:
theme = "lightspeed"
+
+Posts should be placed directly in the content
folder.
To sort the post index by date, enable sort in your index section content/_index.md
:
sort_by = "date"
+
+Set a title and description in the config to appear in the site header:
+title = "Different strokes"
+description = "for different folks"
+
+
+Set a field in extra
with a key of footer_links
:
[extra]
+
+footer_links = [
+ {url = "$BASE_URL/about", name = "About"},
+ {url = "$BASE_URL/atom.xml", name = "RSS"},
+ {url = "https://google.com", name = "Google"},
+]
+
+If you put $BASE_URL
in a url, it will automatically be replaced by the actual
+site URL.
Create pages such as $BASE_URL/about
by placing them in a subfolder of the content directory, and specifying the path in the frontmatter:
path = "about"
+
+Most SEO tags are populated by the page metadata, but you can set the author
and for the og:image
tag provide the path to an image:
[extra]
+
+author = "Grant Green"
+ogimage = "Greenery.png"
+
+By default the footer provides links to Zola and Netlify, and a tagline of "Maintained with :heart: for the web". +To disable any of those parts, and/or add a custom tagline of your own, the following options are available:
+[extra]
+
+zola = true
+netlify = false
+maintained_with_love = false
+footer_tagline = "What if everything is an illusion and nothing exists? In that case, I definitely overpaid for my carpet."
+
+Styles are compiled from sass and imported inline to the header :zap:
+You can overide the styles by enabling sass compilation in the config:
+compile_sass = true
+
+...and placing a replacement style.scss
file in your sass folder.
This template is based on the Jekyll template Light Speed Jekyll by Bradley Taunt.
+Open sourced under the MIT license.
+This project is open source except for example articles found in content
.
Mabuya is a minimal Zola theme for building light and SEO-ready blogs.
+Put your work front and center with Mabuya as the base of your project.
Check out the demo.
+ +While searching for themes, I came across Zola Tale. Sadly, the project's last update was on Dec, 2021. Shortly after, I decided to fork the project and add my own touches to it.
+The name Mabuya comes from the Mabuya hispaniolae, a possibly extinct1 species of skink endemic to the Dominican Republic, my home country.
+While working on the theme, I have added new functionality and made many quality of life improvements. Here's a short list:
+Before using the theme, you need to install Zola ≥ v0.18.0.
+# 1. Clone the repo
+git clone git@github.com:semanticdata/mabuya.git
+
+# 2. Change directory into clone
+cd mabuya
+
+# 3. Serve the site locally
+zola serve
+
+# 4. Open http://127.0.0.1:1111/ in the browser
+
+For more detailed instructions, visit the Documentation page about installing and using themes.
+You can change the configuration, templates and content yourself. Refer to the config.toml, and templates for ideas. In most cases you only need to modify the contents of config.toml to customize the appearance of your blog. Make sure to visit the Zola Documentation.
+Adding custom CSS is as easy as adding your styles to sass/_custom.scss. This is made possible because SCSS files are backwards compatible with CSS. This means you can type normal CSS code into a SCSS file and it will be valid.
+We use GitHub Issues as the official bug tracker for Mabuya. Please search existing issues. It’s possible someone has already reported the same problem. If your problem or idea is not addressed yet, open a new issue.
+We'd love your help! Please see CONTRIBUTING and our Code of Conduct before contributing.
+Source code in this repository is available under the MIT License.
+Mabuya hispaniolae's conservation status is Critically endangered, possibly extinct.
+I am not the best webmaster, but should be somewhat responsive. +I intentionally using the bigger fonts to make, feel free to change it in main.scss
+Now light mode also supported.
+Please make sure to set up your base_url with trailing slash:
+base_url = "https://kuznetsov17.github.io/minimal-dark/"
+
+Theme supports Giscuss for comments. The configuration is done via config.toml. Here you can see the example section used for this page deployment:
+[extra.giscus]
+data_repo="kuznetsov17/minimal-dark"
+data_repo_id="R_kgDOLIfXYA"
+data_category="General"
+data_category_id="DIC_kwDOLIfXYM4Ccn56"
+data_mapping="title"
+data_strict="0"
+data_reactions_enabled="0"
+data_emit_metadata="0"
+data_input_position="top"
+data_theme="//kuznetsov17.github.io/minimal-dark/css/gs_dark.css"
+data_lang="en"
+crossorigin="anonymous"
+nonce=""
+
+Customize the page blocks by setting configuration in [extra] section:
+copyright_string = "Сreated in %YEAR% for fun." # the string displayed in footer. %YEAR% is replaced by current year on build
+show_copyright = true / false # enables / disables footer with copyright
+show_comments = true / false # enables / disables comments
+show_shares = true / false # enables / disables section with social share buttons
+show_toc = true / false # enables / disable TOC
+show_date = true / false # displays publication date in page
+
+I am using this theme for my notes, or probably blog. +The section template supports pagination, tags, sorts the pages by publication date. You may see the working example here
+author = "John Doe" # author. Will be puth in page metadata
+description = "Some description, if you somehow didn't set it in page / section settings"
+logo_src = "images/logo.svg" # logo src
+avatar_src = "images/avatar.png" # avatar src
+index_page="index" # name of the index page. Should be one of top_menu to make things work
+top_menu = ["index","features","notes"] # Menu items
+copyright_string = "Сreated by John Doe in 2024 – %YEAR% for fun." # footer content. %YEAR% will be replaced with current year
+nonce = "${SOME_HASH_VALUE}" # used for JavaScript src nonce
+
+{% callout(type = 'warning') %}
+This is an example of **Warning** callout. [Some link](#)
+{% end %}
+{% callout(type = 'alert') %}
+This is an example of **Alert** callout. [Some link](#)
+{% end %}
+{% callout(type = 'info') %}
+This is an example of **Info** callout. [Some link](#)
+{% end %}
+
+{% timeline() %}
+[{
+ "title":"Lorem Ipsum Event",
+ "body":"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
+ "date":"Jul-2023"
+},
+{
+ "title":"Lorem Ipsum event 2",
+ "body":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.",
+ "date":"Jun-2022"
+}]
+{% end %}
+
+Font Awesome for icons
+Nunito Font
First download this theme to your themes
directory:
$ git submodule add git@github.com:lucasnasm/nasm-theme.git themes/nasm-theme
+
+and then enable it in your config.toml
:
theme = "nasm-theme"
+
+This theme requires your index section (content/_index.md
) to be paginated to work:
paginate_by = 5
+
+The posts should therefore be in directly under the content
folder.
The theme requires tags and categories taxonomies to be enabled in your config.toml
:
taxonomies = [
+ # You can enable/disable RSS
+ {name = "categories", rss = true},
+ {name = "tags", rss = true},
+]
+
+If you want to paginate taxonomies pages, you will need to overwrite the templates +as it only works for non-paginated taxonomies by default.
+set a field extra
with key of disqus_username
:
disqus_username = 'username'
+
+Set a field in extra
with a key of nasm-theme
:
+Font Awesome default icons
nasm_menu = [
+ {url = "$BASE_URL", name = "Home", fawesome = "fas fa-home"},
+ {url = "$BASE_URL/categories", name = "Categories", fawesome = "fas fa-folder-open"},
+ {url = "$BASE_URL/tags", name = "Tags", fawesome = "fas fa-tag" },
+ {url = "$BASE_URL/about", name = "About", fawesome = "fas fa-user-alt" },
+
+]
+
+If you put $BASE_URL
in a url, it will automatically be replaced by the actual
+site URL.
The site title is shown on the homepage. As it might be different from the <title>
+element that the title
field in the config represents, you can set the nasm_theme_title
+instead.
This template is based on the Zola template https://github.com/getzola/after-dark
+Thanks
A (nearly) no-CSS, fast, minimalist Zola theme. +Ported from from riggraz's no style, please! Jekyll theme, and you can find the demo here
+ +First download this theme to your themes
directory:
cd themes
+git clone https://gitlab.com/4bcx/no-style-please.git
+
+and then enable it in your config.toml
:
theme = "no-style-please"
+
+Special templates for tags
, categories
, and contexts
taxonomies are provided. However, generic templates exist for custom taxonomies.
To use taxonomies, in a page metadata add
+[taxonomies]
+tags = [ 'tag1', 'tag2' ]
+categories = [ 'category A', 'B class' ]
+genre = [ 'rock', 'alternative' ] # custom taxonomy
+
+To enable listing of pages in homepage add the following in config.toml
[extra]
+list_pages = true
+
+If you do not want the date of the post added next to the title in the list, add the following as well:
+no_list_date = true
+
+Also in the extra
section in config.toml
[extra]
+
+header_nav = [
+ { name = "~home", url = "/" },
+ { name = "#tags", url = "/tags" },
+ { name = "+categories", url = "/categories" },
+ { name = "@contexts", url = "/contexts" },
+ { name = "example", url = "http://example.com", new_tab=true },
+]
+footer_nav = [
+ { name = "< previous", url = "#" },
+ { name = "webring", url = "#" },
+ { name = "next >", url = "#" },
+]
+
+In a page frontmatter, set extra.add_toc
to true
[extra]
+add_toc = true
+
+author
can be set in both main config and in pages metadataimage
variable can be used in pages to add an image to HTML <meta>
tagslogo
in main config, except this one is also used as the site iconhr()
Adds the option to insert text in the thematic break
+{{ hr(data_content="footnotes") }}
+
+is rendered
+ +iimg()
Images are not inverted in darkmode by default. To add an invertable image use the following
+{{ iimg(src="logo.png", alt="alt text") }}
+
+In light mode
+ +In dark mode
+ +Twitter metatags are generated by default, to disable them set extra.twitter_card
to false
in in your config.toml
[extra]
+twitter_card = true
+
+The theme is available as open source under the terms of the MIT License.
+ + +Live demo : https://netoun.github.io/ntun/
+First download this theme to your themes
directory:
cd themes
+git clone https://github.com/netoun/ntun.git
+
+and then enable it in your config.toml
:
theme = "ntun"
+
+This theme requires index section in about
(content/about/_index.md
)
The posts should therefore be in directly under the content about
folder.
Set a field in extra
with a key of after_dark_menu
:
[extra]
+author = "Jon Snow"
+author_image="me.jpg"
+city="Winterfell"
+years="281"
+
+job = "King of the north"
+description = "Dragons & Aunt ❤️"
+
+links = [
+ { url = "", title="", icon = "fab fa-github"},
+ { url = "", title="", icon = "fab fa-twitter"},
+ { url = "", title="", icon = "fab fa-linkedin"},
+ { url = "mailto:", title="", icon = "fas fa-envelope"}
+]
+
+# if you add languages, put your emoji flag on array
+languages_flags = [
+ "🇬🇧"
+]
+
+If you put $BASE_URL
in a url, it will automatically be replaced by the actual
+site URL.
Oceanic Zen is a theme for Zola static site generator
+Oceanic Zen is a minimalistic theme for personal blog.
++
+Download theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/barlog-m/oceanic-zen.git
+
+Or add as git submodule
+$ git submodule add https://github.com/barlog-m/oceanic-zen.git themes/oceanic-zen
+
+Enable it in your config.toml
:
theme = "oceanic-zen"
+
+Theme supported some extra options
+[extra]
+author = "blog author name"
+github = "github author name"
+twitter = "twitter author name"
+
+Font Iosevka
+ + ++ +
+you can see the demo here
+git
and zola
(aka download the theme)
+lets assume that your website's directory name in daftpunk
. it will appear in commands a few times, and you should replace it with your website's name.
$ git clone git@git.blek.codes:blek/otherworld.git daftpunk
+$ cd daftpunk
+
+in the same directory, run
+$ zola serve
+
+content
directory......as per zola docs
+go to content/index.md
, and in the +++
blocks, set extra.noload
to true
.
like this:
++++
+title = "Welcome"
+
+[extra]
+noload = true
++++
+
+
+
+ A clean Zola theme for blogging and projects, forked from Anpu.
+Demo site: https://justintennant.me/papaya/
+ ++ + + +
++ + + +
+{{ img() }}
)Clone this repository to your themes
folder:
git clone https://github.com/justint/papaya.git themes/papaya
+
+Set your theme setting in config.toml
to papaya
:
theme = "papaya"
+
+Copy the following sections and keys (and their contents/values) from papaya's config.toml
and paste them into your site's config.toml
:
[languages]
+[languages.en]
[languages.en.translations]
[extra.cdn]
+font_awesome
In your content
directory, add new blog
and projects
directories. Copy the _index.md
file from Papaya's content/blog
into your content/blog
, and the _index.md
and categories.json
files from Papaya's content/projects
into your content/projects
.
Your content
directory structure should look like this:
content
+├── blog
+│ └── _index.md
+└── projects
+ └── _index.md
+ └── categories.json
+
+(optional) To enable GitHub repository stars/fork counts (disabled by default to avoid hitting API rate limits), set the $ZOLA_ENV
environment variable to prod
prior to your zola serve
/zola build
execution.
For csh/tsch:
+setenv ZOLA_ENV prod
+
+For bash/ksh/zsh:
+export ZOLA_ENV=prod
+
+Here are the customizable features of Papaya:
+In your content/projects/categories.json
, you can specify the categories of projects. The formatting of the file is:
{
+ "title": "keyword"
+}
+
+"title"
: the title text displayed for each category grouping on your projects page."keyword"
: the taxonomy term you'll use in your project pages.A project can have multiple categories, and will be displayed once in each category configured.
+Projects without categories will be displayed in the "Other" category listing of your project page. If you don't want the "Other" category displayed, you can copy the templates/projects.html
to your own templates
directory and delete/comment out the "Other" category code.
Example categories.json
:
{
+ "Software": "software",
+ "Films": "film"
+}
+
+Example project page front matter:
+title = "Example software project"
+date = 2021-08-11
+
+[taxonomies]
+categories = ["software"]
+
+The example project page above would be grouped into & displayed within the "Software" category of your projects page.
+The Papaya theme can be set to "light"
, "dark"
, or "auto"
mode in the config.toml
.
In "auto"
, the light and dark modes are implicitly chosen by the prefers-color-scheme
CSS media feature. The theme will switch automatically based on the viewer's OS or user agent setting.
Currently Zola has basic internationalization (i18n
) support, you can read more in zola's Multilingual Sites doc.
To write a multilingual site, follow the steps below (English and Chinese in this example):
+Add a default_language
configuration and [languages.zh]
and [languages.en]
sections to your config.toml
:
default_language = "en"
+
+[languages]
+
+[languages.en]
+
+[languages.zh]
+title = "中文标题"
+description = "中文描述"
+
+Under the [languages.zh]
section you can override default configurations like title
, description
, etc.
Add translations of all keywords in [languages.zh.translations]
and languages.en.translations]
sections (see Papaya's config.toml
for a listing of all keywords):
[languages]
+
+[languages.en]
+
+[languages.en.translations]
+projects = "Projects"
+blog = "Blog"
+about = "About"
+recent_projects = "Recent Projects"
+more_projects = "More Projects"
+recent_blog_posts = "Recent Blog Posts"
+more_blog_posts = "More blog posts"
+...
+
+[languages.zh]
+
+[languages.zh.translations]
+projects = "项目"
+blog = "博文"
+about = "关于"
+recent_projects = "近期项目"
+more_projects = "更多项目"
+recent_blog_posts = "近期博文"
+more_blog_posts = "更多博文"
+...
+
+Add a _index.zh.md
file into every section.
For example: add content/blog/_index.zh.md
and content/projects/_index.zh.md
.
Provide a {page-name}.zh.md
(or index.zh.md
into the page's directory, if it has one) for every page you'd like to translate.
For example: add content/blog/what-is-zola.zh.md
and content/blog/blog-with-image/index.zh.md
.
Add a content/categories.zh.json
file. For example:
{
+ "软件": "software",
+ "电影": "film"
+}
+
+Now you will have a website that supports both English and Chinese! Since default_language
in config.toml
is set to "en", by visiting {base_url}
you will see the English version of this blog. You can visit the Chinese version by visiting {base_url}/zh
.
A page (post or project) can be available in both languages or only in one language, and it's not necessary that a page is available in the default language.
+The navigation menu is constructed from a list of menu_items
in your config.toml
. For example:
[extra]
+
+menu_items = [
+ { name = "projects", url = "$LANG_BASE_URL/projects", show_recent = true, recent_items = 3, recent_trans_key = "recent_projects", more_trans_key = "more_projects" },
+ { name = "blog", url = "$LANG_BASE_URL/blog", show_recent = true, recent_items = 3, recent_trans_key = "recent_blog_posts", more_trans_key = "more_blog_posts" },
+ { name = "tags", url = "$LANG_BASE_URL/tags" },
+ { name = "about", url = "$LANG_BASE_URL/about" },
+]
+
+A menu_item
can be one of two things:
a link to a section. Section links can be optionally configured to display its most recently authored items on your index page. See Configuring section menu items.
+a link to a URL. See Configuring URL menu items
+A section is created whenever a directory (or subdirectory) in the content section contains an _index.md
file; see the Zola docs on sections.
Papaya has two sections by default: projects
and blog
. You can add additional sections or change section names. For example, you can add a section called Diary. In order to add this section, you need to:
Create a directory called diary
in content/
.
Create an _index.md
inside content/diary/
, for example:
+++
+title = "Diary"
+render = true
+# diary will use blog.html for its template
+template = "blog.html"
++++
+
+Sections can be added to the navigation menu, and optionally configured to display its most recently authored items on your index page. To add your section to the navigation menu:
+In your config.toml
under the [extra]
section, add your section to the menu_items
:
[extra]
+menu_items = [
+ ...
+ { name = "diary", url = "$LANG_BASE_URL/diary" }
+]
+
+In your config.toml
under the [languages.<code>.translations]
section, add your section name translation keys:
[languages]
+
+[languages.en]
+
+[languages.en.translations]
+diary = "Diary"
+
+[languages.zh]
+
+[languages.zh.translations]
+diary = "日记"
+
+This will add a simple hyperlink to your new Diary section in the navigation menu.
+To also display recently authored items from your Diary section on your index page:
+Add the following attributes to your menu item:
+show_recent
: Adds the section's recent items listing to your index page.recent_items
: Number of recent items to display.recent_trans_key
: Translation key for the recent items listing title text.more_trans_key
: Translation key for the hyperlink text to the section.For example:
+[extra]
+menu_items = [
+ ...
+ { name = "diary", url = "$LANG_BASE_URL/diary", show_recent = true, recent_items = 3, recent_trans_key = "recent_diary", more_trans_key = "more_diary" }
+]
+
+In your config.toml
under the [languages.<code>.translations]
section, add your section name, recent_trans_key
, and more_trans_key
translation keys:
[languages]
+
+[languages.en]
+
+[languages.en.translations]
+diary = "Diary"
+recent_diary = "Recent Diaries"
+more_diary = "More Diaries"
+
+[languages.zh]
+
+[languages.zh.translations]
+diary = "日记"
+recent_diary = "近期日记"
+more_diary = "更多日记"
+
+This will add both a hyperlink to your new Diary section in the navigation menu, and a listing of the three most recent items from your Diary section on your index page.
+If you want to add a simple link to the navigation menu, add an item with a name
and url
. For example:
[extra]
+sections = [
+ ...
+ { name = "tag", url = "$LANG_BASE_URL/tags" }
+]
+
+A translation key for your link's name
must be added into your config.toml
:
[languages]
+
+[languages.en]
+
+[languages.en.translations]
+tag = "Tag"
+
+[languages.zh]
+
+[langauges.zh.translations]
+tag = "标签"
+
+If you include $BASE_URL
in the URL of a link it will be replaced with the base URL of your site, and $LANG_BASE_URL
will be replaced with the language-specific base URL of your site.
You can have different date formats in different languages. You need to set the date_format
value in every langauge's translation section.
Example:
+[languages]
+
+[languages.en]
+
+[languages.en.translations]
+date_format = "%e %B %Y"
+
+[languages.zh]
+
+[languages.zh.translations]
+date_format = "%Y 年 %m 月 %d 日"
+
+The formatting uses the standard date
filter in Tera. The date format options you can use are listed in the chrono crate documentation.
Posts and projects can have featured images which display at the top of their page before the page contents.
+[extra]
+featured_image = "image.jpg"
+featured_image_alt = "A lodge overlooks a forested mountain range."
+
+
+Featured images can also be extended to the full width of the viewport:
+[extra]
+featured_image = "image.jpg"
+featured_image_alt = "A lodge overlooks a forested mountain range."
+featured_image_extended = true
+
+
+In your config.toml
you can add a [extra.ogp]
section to specify your Open Graph Protocol locale and profile information.
Open Graph Protocol provides you control over how your website's content should be displayed on social media sites.
+For the more information on Open Graph Protocol and valid property values, visit the official website.
+Example:
+[extra.ogp]
+locale = "en_US"
+first_name = "Papaya"
+last_name = "Tiliqua"
+gender = "female"
+username = "tiliquasp"
+
+Utterances is a comments widget built on GitHub issues. When enabled, Papaya can display GitHub issues as comments on your blog posts.
+To enable:
+Follow instructions on the utterances website.
+Once you're at the "Enable Utterances" step, enter the following keys into your config.toml
:
[extra.utterances]
+enabled = true
+repo = "yourname/yourrepository" # put your repository's short path here
+post_map = "pathname"
+label = "utterances"
+theme = "preferred-color-scheme"
+
+
+In your config.toml
you can add a [extra.social]
section to specify your social network/contact accounts. Changing these will update what links appear on your website's footer.
Example:
+[extra.social]
+email = "papaya@tiliqua.sp"
+github = "papaya"
+linkedin = "papayatiliqua"
+twitter = "papayathehisser"
+
+If you want to include other custom social websites, you can add them to other
:
Example:
+[extra.social]
+other = [
+ { name = "BTC", font_awesome = "fa-brands fa-btc", url = "https://www.bitcoin.com/" }
+]
+
+The font_awesome
attribute specifies the Font Awesome classes; you can find them in Font Awesome. Be aware that different versions of Font Awesome may include different sets of icons; you can change your version of Font Awesome by updating the CDN path in the [extra.cdn]
section:
[extra]
+
+[extra.cdn]
+font_awesome = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css"
+
+Included with Papaya is a shortcode for embedding images into your posts:
+img(path, alt, caption, class, extended_width_pct, quality)
+
+You can use ./<image-path>
to specify the relative path of image which is relative to current markdown file.
path
: The path to the image. It can be either:
https://somesite.com/my-image.jpg
), content
directory in the directory structure (eg: @/projects/project-1/my-image.jpg
), or./my-image.jpg
).alt
: (optional) The alternate text for the image.
caption
: (optional) A caption for the image. Text/HTML/Tera templates supported.
class
: (optional) Any CSS classes to assign to the image. Multiple classes should be separated with a space (" "
).
quality
: (optional) JPEG or WebP quality of the image, in percent. Only used when encoding JPEGs or WebPs; default value is 90
.
extended_width_pct
: (optional) The percentage by which the image's width should be expanded past it's default figure width, up to maximum configured pixel width.
Range is 0.0-1.0
, or -1
for document width.
Max pixel width can be defined in your config.toml
with the extra.images.max_width
property (2500px default).
See Extended width images section for more details and examples.
+The benefits of using this shortcode over regular Markdown/HTML image embedding are:
+Images embedded into pages using the img
shortcode can be configured to extend past their document width. This is especially nice for displaying wide/landscape images at higher resolutions.
By default, images embedded with the img
shortcode will be inserted as a figure
with default margins:
{{ img(path="image.jpg",
+ alt="A very cute leopard gecko.",
+ caption="A very cute leopard gecko. Default sizing.") }}
+
+
+With the extended_width_pct
argument, we can specify a percentage of how much the image should expand outside its default figure width, up to your maximum configured image width (config.extra.images.max_width
, 2500px default).
Here's an example with extended_width_pct=0.1
:
{{ img(path="image.jpg",
+ alt="A very cute leopard gecko.",
+ caption="A very cute leopard gecko. extended_width_pct=0.1",
+ extended_width_pct=0.1) }}
+
+
+The image is now displayed with a 10% larger width, while maintaining its original aspect ratio.
+Here's an even wider example:
+{{ img(path="image.jpg",
+ alt="A very cute leopard gecko.",
+ caption="A very cute leopard gecko. extended_width_pct=0.2",
+ extended_width_pct=0.2) }}
+
+
+The images will resize in resolution up to your maximum configured image width, and will display on the webpage up to the maximum width of the viewport.
+You can also force the image width to match the document's width by setting extended_width_pct
to -1
:
{{ img(path="image.jpg",
+ alt="A very cute leopard gecko.",
+ caption="A very cute leopard gecko. extended_width_pct=-1",
+ extended_width_pct=-1) }}
+
+
+🦎
+ + +A work in progress port of the hugo-PaperMod theme by @adityatelange to Zola
+Demo @ https://cydave.github.io/zola-theme-papermod/
+git submodule add https://github.com/cydave/zola-theme-papermod themes/papermod
+
+theme = "papermod"
to your zola config.toml
cp -r themes/papermod/content content
+
+Papermod customizations exist under a designated extra.papermod
section.
+Refer to config.toml for available options.
If you would like to help out porting hugo-Papermod to Zola feel free to pick +up a feature and start working on it. All help, no matter how small the +contribution is highly appreciated.
+ + +This is a simple and minimalist template for Zola designed for developers that want to show of their portfolio.
+The Theme features:
+git clone https://github.com/svavs/particle-zola.git
config.toml
to personalize your site.You have to fill some informations on the [extra]
section of the config.toml
to customize your site.
# Site settings
+description = "A blog about lorem ipsum dolor sit amet"
+
+# User settings
+username = "Lorem Ipsum"
+user_description = "Anon Developer at Lorem Ipsum Dolor"
+user_title = "Anon Developer"
+email = "my@email.com"
+twitter_username = "lorem_ipsum"
+github_username = "lorem_ipsum"
+gplus_username = "lorem_ipsum"
+
+_vars.scss
)To customize the project lists and the about sections, you need to edit the templates/content.html
template file.
+In future versions will be provided a simpler way.
Having any issues file a GitHub Issue.
+This theme is free and open source software, distributed under the The MIT License. So feel free to use this Jekyll theme anyway you want.
+This theme was partially designed with the inspiration from these fine folks
+ + + +I am not the best webmaster, but should be somewhat responsive. +I intentionally using the bigger fonts to make, feel free to change it in main.css
+Now light mode also supported.
+Please make sure to set up your base_url with trailing slash:
+base_url = "https://kuznetsov17.github.io/pico/"
+
+Theme supports Giscuss for comments. The configuration is done via config.toml. Here you can see the example section used for this page deployment:
+[extra.giscus]
+data_repo="kuznetsov17/pico"
+data_repo_id="R_kgDOLIfXYA"
+data_category="General"
+data_category_id="DIC_kwDOLIfXYM4Ccn56"
+data_mapping="title"
+data_strict="0"
+data_reactions_enabled="0"
+data_emit_metadata="0"
+data_input_position="top"
+data_theme="//kuznetsov17.github.io/pico/css/gs_dark.css"
+data_lang="en"
+crossorigin="anonymous"
+nonce=""
+
+Customize the page blocks by setting configuration in [extra] section:
+show_copyright = true / false # enables / disables footer with copyright
+show_comments = true / false # enables / disables comments
+show_shares = true / false # enables / disables section with social share buttons
+show_toc = true / false # enables / disable TOC
+show_date = true / false # displays publication date in page
+
+I am using this theme for my notes, or probably blog. +The section template supports pagination, tags, sorts the pages by publication date. You may see the working example here
+The theme supports the search using elasticrunrjs. To enable the search, you will need the following configuration in config.toml:
+build_search_index = true
+
+[search]
+index_format = "elasticlunr_json"
+
+author = "John Doe" # author. Will be puth in page metadata
+description = "Some description, if you somehow didn't set it in page / section settings"
+logo_src = "images/logo.svg" # logo src
+avatar_src = "images/avatar.png" # avatar src
+index_page="index" # name of the index page. Should be one of top_menu to make things work
+top_menu = ["index","features","notes"] # Menu items
+copyright_string = "Сreated by John Doe in 2024 – %YEAR% for fun." # footer content. %YEAR% will be replaced with current year
+nonce = "${SOME_HASH_VALUE}" # used for JavaScript src nonce
+
+{% timeline() %}
+[{
+ "title":"Lorem Ipsum Event",
+ "body":"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
+ "date":"Jul-2023"
+},
+{
+ "title":"Lorem Ipsum event 2",
+ "body":"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.",
+ "date":"Jun-2022"
+}]
+{% end %}
+
+{% callout(type = 'warning') %}
+This is an example of **Warning** callout. [Some link](#)
+{% end %}
+{% callout(type = 'alert') %}
+This is an example of **Alert** callout. [Some link](#)
+{% end %}
+{% callout(type = 'info') %}
+This is an example of **Info** callout. [Some link](#)
+{% end %}
+
+Read more on how to use mermaid in their documentation
+{% mermaid() %}
+gitGraph
+ commit
+ commit
+ branch develop
+ checkout develop
+ commit
+ commit
+ checkout main
+ merge develop
+ commit
+ commit
+{% end %}
+
+{% mermaid() %}
+graph LR
+ A[Square Rect] -- Link text --> B((Circle))
+ A --> C(Round Rect)
+ B --> D{Rhombus}
+ C --> D
+{% end %}
+
+polymathic is a Zola portfolio (and not only) theme.
+I made it for my own portfolio. The theme is called polymathic
, inspired by individuals with a wide range of talents. The theme focuses on rich and consistent navigation experience, exposing the variety of topics to chose from, yet allowing the user to focus on a single thread of your story once they've made a choice.
Docs and theme demo are available here main--polymathic-demo.netlify.app
+Be sure to chek the demo repo and follow zola docs on installing and using a theme
+This theme uses Bulma scss framework, making the theme styles highly customizable and enabling mobile first theme design.
+This theme uses Animate.css for animations.
+This theme adds minimal Open Graph tags to every page head
.
You can quickly deploy the theme to netlify, theme comes with a config file.
+See all features demonstrated in the docs.
+The theme is friendly to wide range of screen sizes from mobile
to fullhd
. Theme comes with minimal styles for print
media.
Theme includes preference based dark mode as separate stylesheet. No switch.
+This theme automatically finds accessible colors when using customizations, with minimal config.
+This theme supports no script environments.
+This theme respects user preference for reduced motion.
+This theme builds navigation for your site. The outcome is highly customizable via your config.toml
and front-matter of your sections.
The theme comes with templates for index.html
, page.html
, section.html
, taxonomy_list.html
, taxonomy_single.html
, 404.html
. You can use them in your Zola project as is or by extending them, templates are divided in block
s and partials/*.html
for convenience of extending the theme.
The theme is highly customizable via config.toml
and sass variables. Your customization can start from just the primary color or extend all the way to bulma variables.
The theme comes with several shortcodes for building forms, galleries, navigation cards and banners.
+Once you already have zola installed and ran zola init
, then run from your project directory
$ git init
+$ git submodule add https://github.com/anvlkv/polymathic themes/polymathic
+
+You will also need npm installed, then run
+$ npm --prefix themes/polymathic install
+
+For those using netlify deployments config is available here
+$ cp themes/polymathic/netlify.toml netlify.toml
+
+In your config.toml
Set zola theme to polymathic
theme = "polymathic"
+
+Issues or contributions are welcome. Also, curious what you make with it.
+ + +Redesigned form hugo resume.
+/admin
endpoint that can allow authorized users to use a WYSIWYG editor and commit files back to markdown, but with a Wordpress/CMS like experience.git clone git@github.com:alongwy/zola-resume.git
+cd zola-resume
+zola serve
+# open http://127.0.0.1:1111/
+
+Just earlier we showed you how to run the theme directly. Now we start to install the theme in an existing site step by step.
+zola init mysite
+
+Download this theme to your themes directory:
+cd mysite/themes
+git clone git@github.com:alongwy/zola-resume.git
+
+Or install as a submodule:
+cd mysite
+git init # if your project is a git repository already, ignore this command
+git submodule add git@github.com:alongwy/zola-resume.git themes/zola-resume
+
+Enable the theme in your config.toml in the site derectory:
+theme = "zola-resume"
+
+Or copy the config.toml.example from the theme directory to your project's root directory:
+cp themes/zola-resume/config.toml.example config.toml
+
+cp themes/zola-resume/static/admin/config.yml static/admin/config.yml
+
+and change those
+# static/admin/config.yml
+
+backend:
+ name: github
+ repo: USERNAME/REPO
+ branch: BRANCH
+ cms_label_prefix: netlify-cms/
+ site_domain: DOMAIN.netlify.com
+
+You can copy the content from the theme directory to your project:
+cp -r themes/zola-resume/data .
+cp -r themes/zola-resume/content .
+
+You can modify or add new posts in the content/blog, content/projects or other content directories as needed.
+Just run zola serve in the root path of the project:
+zola serve
+
+This will start the Zola development web server accessible by default at http://127.0.0.1:1111. Saved changes will live reload in the browser.
+See along's site for a live example.
+This theme uses a combination of custom sections and some data files to drive content.
+Edit the main contents/_index.md with a brief bio/summary
Data files are used for simple content presented on the homepage.
+The difference indicates your role as originator or colaborator.
+Similar to projects, create them under publications
. Include any papers, speaking engagements, articles, etc.
Similar to posts, create them under blog
. Include any thoughts, musiings, etc.
+This template does not support a posts
folder
Almost All personal information outside the above details is captured by extra in config.toml
, or can be edited in the "Settings" collection if using CMS.
Does not require deployment to Netlify!
+Netlify CMS is an open source project that enables CMS like experience for static site generation tools like Hugo. This theme includes a fully working integration and guide in static/admin
+This project ports the Hugo Resume theme by Feng Yunlong to support zola.
+ + +++ +A Simple and Minimalist theme with a focus on typography and content.
+Zola port of hugo-theme-sam.
+
This is a port of the original hugo-theme-sam theme for Hugo (License).
+See upstream
for source code take from there.
The easiest way to install this theme is to either clone it ...
+git clone https://github.com/janbaudisch/zola-sam.git themes/sam
+
+... or to use it as a submodule.
+git submodule add https://github.com/janbaudisch/zola-sam.git themes/sam
+
+Either way, you will have to enable the theme in your config.toml
.
theme = "sam"
+
+Sam supports the tags
and authors
taxonomies.
To use them, declare them in your config.toml
:
taxonomies = [
+ { name = "tags", rss = true },
+ { name = "authors", rss = true }
+]
+
+Set them in your page's frontmatter:
+[taxonomies]
+tags = ["some", "tag"]
+authors = ["Alice", "Sam"]
+
+See Zola's documentation for more details.
+See config.toml
for an example configuration.
The menu on the index page is created as follows: If the sam_menu
variable is set, it gets used.
[extra]
+sam_menu = [
+ { text = "posts", link = "/posts" },
+ { text = "about", link = "/about" },
+ { text = "github", link = "https://github.com" }
+]
+
+If it is not set, all sections under content
will get linked.
This variable decides wether the menu - as mentioned above - will also be displayed at the bottom of pages.
+Default: false
[extra]
+sam_bottom_menu = true
+
+home
Sets the name for all links referring to the home page in the menus and the 404 page.
+Default: home
[extra]
+home = "home"
+
+Specifies how to display dates. The format is described here.
+Default: %a %b %e, %Y
[extra]
+date_format = "%a %b %e, %Y"
+
+You can enable or disable word count and reading time for posts across the whole site:
+Default: true
(both)
[extra]
+show_word_count = true
+show_reading_time = true
+
+If enabled, you can opt-out per page via front-matter:
+Default: false
(both)
+++
+[extra]
+hide_word_count = true
+hide_reading_time = true
++++
+
+If you want to disable the complete header of a page (for example a page which is explicitly not a post), you can do so via front-matter:
+Default: false
+++
+[extra]
+no_header = true
++++
+
+To place some text at the end of pages, set the following:
+[extra.sam_footer]
+text = "Some footer text."
+
+
+
+ A Zola theme.
+ +Add the theme as a git submodule
+git submodule add --name seagull https://git.42l.fr/HugoTrentesaux/seagull.git themes/seagull
+
+Enable the theme in your config.toml
theme = "seagull"
+
+Add a _variables.sass
file in a sass
folder
mkdir sass
+touch sass/_variables.sass
+
+Add a _index.md
file in your content
folder.
Features can be seen on the demo website: https://seagull.coinduf.eu/.
+You can customize the theme with the /sass/_variables.sass
file.
I'll provide support on demand on Zola forum if you tag @HugoTrentesaux
+Because of the hack used to allow theme customization, before building seagull website itself, you need to create an empty file
+mkdir ../../sass
+touch ../../sass/_variables.sass
+
+
+
+ First download this theme to your themes
directory:
cd themes
+git clone https://github.com/eatradish/Seje2
+
+and then enable it in your config.toml
:
theme = "Seje2"
+
+This theme requires your index section (content/_index.md
) to be paginated to work:
paginate_by = 5
+
+The posts should therefore be in directly under the content
folder.
and requires your index section (about/_index.md
) to be paginated to work:
title = "..."
+
+[extra]
+year = 2019
+month = 11
+day = 3
+
+Set a field in extra
with a key of seje2_menu_links
:
seje2_menu_links = [
+ {url = "$BASE_URL", name = "Home"},
+ {url = "$BASE_URL/categories", name = "Categories"},
+ {url = "$BASE_URL/tags", name = "Tags"},
+ {url = "https://google.com", name = "Google"},
+]
+
+If you put $BASE_URL
in a url, it will automatically be replaced by the actual
+site URL.
Set a field in extra
with a key of license
:
license = "@ 宇宙眼睛人"
+
+
+
+ A blog theme for zola, simple and clean
+latest
branchSimple blog theme powered by Zola. See a live preview here.
+++Name derived from the Bengali Word - সাধারণ which translates to "generic"
+
Initialize Git Repo if not initialized
+Download the theme
+git submodule add https://github.com/syedzayyan/shadharon themes/shadharon
+
+Add theme = "shadharon"
to your config.toml
Copy the example content
+cp -R themes/shadharon/content/. content
+
+For customization refer to config.toml files, which has comments.
+For customizing the banner on the homepage the content/posts/_index.md needs modification. The desc variable under extra
, specifically. You could delete this as well to remove banner. For an about page or any aditional page an .md file in the "content" directory will do.
You can add stylesheets to override the theme:
+[extra]
+stylesheets = [
+ "override.css",
+]
+
+These filenames are relative to the root of the site. In this example, the two CSS files would be in the static
folder.
This theme takes inspiration from
+ + + +A simple dev-blog theme for Zola. It uses no JavaScript, prerenders links between navigation, blog posts and tags and adds common tags for SEO.
+You can view it live here.
+To create a new Zola site, first download the CLI and install it on your system. This theme requires Zola version 0.14 or greater.
+You can find installation instructions on the Zola website.
+After you've installed the Zola CLI, run the following command to create a new site:
+zola init my_amazing_site
+cd my_amazing_site
+
+After you've created the site, install the "Simple Dev Blog" theme like so:
+git clone --depth=1 \
+ https://github.com/bennetthardwick/simple-dev-blog-zola-starter \
+ themes/simple-dev-blog
+
+Now in your config.toml
file, choose the theme by setting theme = "simple-dev-blog"
.
This theme uses the tags
taxonomy, in your config.toml
file set taxonomies = [ { name = "tags" } ]
Copy across the default content from the theme by running cp themes/simple-dev-blog/content/* ./content -r
That's it! Now build your site by running the following command, and navigate to 127.0.0.1:111
:
zola serve
+
+You should now have a speedy simple dev blog up and running, have fun!
+Look at the config.toml
and theme.toml
in this repo for an idea, here's a list of all the options:
The following options should be under the [extra]
in config.toml
accent_light
- a lighter shade of your site's accent coloraccent
- your site's accent colorblog_path
- the path to your blog (defaults to blog
)default_og_image
- the path default og:image for your pagefooter_about
- the content for your footer in markdownicon
- the path to the icon for your site in the content folder
+icon.png
you should put it in content/icon.png
nav
- see theme.toml
, the navigation links for your sitenot_found_message
- the content for your 404 page in markdownprofile_large
- the path to a larger vertical version of your profile picture in the content folderprofile_small
- the path to a small version of your profile picture in the content folderThe following options should be under the [extra]
section of each page
thumbnail
- the path to your og:image for that pageSlim is a minimal, clean and beautiful theme for Zola.
+This theme was ported to Zola, the original is available at zhe/hugo-theme-slim. It is excellent, thank you zhe!
+ +Demo.
+cd themes
+git clone https://github.com/jameshclrk/zola-slim slim
+
+See the official docs for more information.
+Slim supports a tags
taxonomy by default. This can be enabled by setting it in your config.toml
:
taxonomies = [
+ {name = "tags", paginate_by = 5, rss = true}
+]
+
+There are a couple of extra options supported:
+[extra]
+# Show a summary of a post in a list
+slim_summary = false
+# Show the content of a post in a list
+slim_content = false
+# Links to show at the top of the menu
+slim_menu = [
+ {url = "$BASE_URL/tags", name = "Tags"}
+]
+# Links to show at the bottom of the menu
+slim_social = [
+ {url = "https://github.com/jameshclrk", name = "Github"}
+]
+
+Open sourced under MIT license.
+ + +A divless dark theme for zola. See it in action.
+ +See installation for installation directions.
+The following config is optional, but can add a few niceties.
+[extra]
+list_header = "Hello World" # title of the main page
+favicon_href = "http://example.com" # link to favicon
+gravatar_img_src = "https://0.gravatar.com/avatar/abc123?s=60" # adds gravatar image in footer
+gravatar_href = "https://example.com" # link for gravatar image
+github_link = "https://github.com/JohnDoe" # adds a github link in footer
+about_link = "https://example.com" # adds an about link in footer
+signature_img_src = "/example.png" # adds an image to bottom of article
+signature_text = "Signing off!" # adds signature text to bottom of articles
+ga_code = "UA-1234" # adds google analytics code
+theme_color = "#000" # for meta browser theme only
+
+
+
+ Port of Solar theme for Hugo to Zola.
+ +First download this theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/hulufei/solar-theme-zola.git
+
+and then enable it in your config.toml
:
theme = "solar-theme-zola"
+
+Add title
and description
:
title = "Your Blog Title"
+description = "Your blog description"
+
+Set color scheme to (Solarized) dark
or (Solarized) light
with highlight_theme
option:
highlight_theme = "solarized-dark"
+
+Set a field in extra
with a key of site_menus
:
site_menus = [
+ { url = "https://github.com/hulufei/solar-theme-zola", name = "Repository" },
+ { url = "rss.xml", name = "RSS" },
+]
+
+Each link needs to have a url
and a name
.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A fast, lightweight, and modern Zola theme with multi-language support. It aims to be a personal page and home to blog posts.
+See a live preview (and the theme's documentation) here.
+Explore the Sites Using tabi section to see real-world applications.
+++ +tabi (旅, /tɐˈbi/): Journey.
+
tabi has a perfect score on Google's Lighthouse audit:
+ +To add tabi to you existing Zola site:
+git init
+
+git submodule add https://github.com/welpo/tabi.git themes/tabi
+
+Or clone the theme into your themes directory:
+git clone https://github.com/welpo/tabi.git themes/tabi
+
+config.toml
:theme = "tabi"
+
+title
in your config.toml
:title = "Your Site Title"
+
+config.toml
:[markdown]
+highlight_code = true
+highlight_theme = "css"
+
+content/_index.md
file with the following content:+++
+title = "Home"
+paginate_by = 5 # Set the number of posts per page
+template = "index.html"
++++
+
+If you want to serve your blog posts from a different path, such as blog/
, add a section_path
in the [extra]
section of content/_index.md
(this file will need pagination):
[extra]
+section_path = "blog/_index.md"
+
+content/_index.md
:[extra]
+header = {title = "Hello! I'm tabi~", img = "img/main.webp", img_alt = "Your Name" }
+
+The content outside the front matter will be rendered between the header title and the posts listing. In the screenshot above, it's the text that reads "tabi is a fast, lightweight, and modern Zola theme…".
+config.toml
, set the title and taxonomies for each language, like:[languages.es]
+title = "~/tabi"
+taxonomies = [{name = "tags", feed = true}]
+
+You will need an _index.{language_code}.md
per language for each section (e.g. /blog or /projects) that you want to enable in that language.
The same is true for individual posts, which should have the exact same name as the default language, with an extra .{code}
before the extension (e.g. the Spanish version of security.md
would be security.es.md
).
This configuration allows the language switcher to take the user to the translation of the current URL. If a translation doesn't exist, the 404 page will be displayed, with an explanation in each language set in the config.
+To learn more about multilingual support, see the Frequently Asked Questions.
+If you added the theme as a git submodule, run:
+git submodule update --recursive --remote
+
+If you cloned it:
+cd themes/tabi
+git pull
+
+Website | Creator | Description | Site Source |
---|---|---|---|
osc.garden | Óscar Fernández (welpo) | Data science, psychology, and Zola | Source |
sandip.live | Sandip G (sandman) | Startups, tech and the good life | Source |
seadve.github.io | Dave Patrick Caberto (SeaDve) | Personal blog and portfolio with custom CSS | Source |
mikufan.page | Nadia | Personal blog | Source |
tim-boettcher.online | Tim Böttcher | Insights and ramblings of a deafblind programmer | Source |
www.richtman.au | Ariel Richtman | Personal tech blog | Source |
Using tabi? Feel free to create a PR and add your site to this list.
+This theme was inspired by:
+Please do! We appreciate bug reports, improvements to translations or documentation (however minor), feature requests…
+Take a look at the Contributing Guidelines to learn more.
+The code is available under the MIT license.
+ + +Tala-Zola is a minimal Zola theme helping you to +build a light and seo-ready blog, and you can customise any information of the +blog without having to modify the codes of the template. Tala-Zola is a port of +the Jekyll theme Tale.
+Before using the theme, you need to install the Zola ≥ 0.13.0.
+git clone git@github.com:aaranxu/tale-zola.git
+cd tale-zola
+zola serve
+# open http://127.0.0.1:1111/ in the browser
+
+Just earlier we showed you how to run the theme directly. Now we start to +install the theme in an existing site step by step.
+zola init blog
+
+Download this theme to your themes directory:
+cd blog/themes
+git clone git@github.com:aaranxu/tale-zola.git
+
+Or install as a submodule:
+cd blog
+git init # if your project is a git repository already, ignore this command
+git submodule add git@github.com:aaranxu/tale-zola.git themes/tale-zola
+
+Enable the theme in your config.toml
in the site derectory:
theme = "tale-zola"
+
+Or copy the config.toml.example
from the theme directory to your project's
+root directory:
cp themes/tale-zola/config.toml.example config.toml
+
+Add an _index.md
file to your content
directory with some lines as bellows.
+++
+sort_by = "date"
+paginate_by = 5
++++
+
+Add a blog article file with a filename first-post.md
(or other filenames) and
+input some content in it.
+++
+title = "First Post"
+date = 2021-05-01T18:18:18+00:00
+
+[taxonomies]
+tags = ["Post"]
+
+[extra]
+author = "Your Name"
++++
+
+This is my first post.
+
+Or you can just copy the content from the theme directory to your project:
+cp -r themes/tale-zola/content .
+
+Just run zola serve
in the root path of the project:
zola serve
+
+Tale-Zola will start the Zola development web server accessible by default at
+http://127.0.0.1:1111
. Saved changes will live reload in the browser.
You can customize your configurations, templates and content for yourself. Look
+at the config.toml
, theme.toml
and templates files in this repo for an idea.
In most cases you only need to modify the content in the config.toml
file to
+custom your blog, including different expressions in your speaking language.
Add some information for your blog.
+title = "You Blog Title"
+description = "The description of your blog."
+
+Set the tags for the site.
+taxonomies = [
+ {name = "tags"},
+]
+
+Add menus and footer information for your blog.
+# Menu items
+[[extra.menu]]
+name = "Posts"
+url = "/"
+
+[[extra.menu]]
+name = "Tags"
+url = "tags"
+
+[[extra.menu]]
+name = "About"
+url = "about"
+
+[extra.footer]
+start_year = "2020" # start year of the site
+end_year = "2021" # end year of the site
+info = "The information on the footer."
+
+Add your name as the author name for the blog globally.
+[extra]
+author = "Your Name"
+
+Use Google Analytics. Add your own Google Analytics ID.
+[extra]
+google_analytics = "UA—XXXXXXXX-X"
+
+Whether to use Disqus globally and set to your disqus id name.
+And you can enable the disqus on per post page with extra.disqus
option
[extra]
+disqus = false
+disqus_id = ""
+
+Code syntax highlighting. See also syntax highlighting.
+[markdown]
+highlight_code = true
+highlight_theme = "base16-ocean-light"
+
+Use KaTeX to support the math notation
+[extra]
+katex = true
+
+++Note: You can also add the
+katex
option on per mardown file of the page or section.
Set date format in the site
+[extra]
+timeformat = "%B %e, %Y" # e.g. June 14, 2021, and this is the default format
+
+SEO settings, like Open Graph + Twitter Cards
+[extra.seo]
+# this image will be used as fallback if a page has no image of its own
+image = "tale.png"
+image_height = 50
+image_width = 50
+og_locale = "en_US"
+
+ [extra.seo.twitter]
+ site = "twitter_accout"
+ creator = "twitter_accout"
+
+ [extra.seo.facebook]
+ admins = "facebook_accout"
+ publisher = "facebook_accout"
+
+Change the words in your speaking language.
+[extra.expressions]
+home = "Home" # The homepage's name
+pinned = "Pinned" # On the header of the post list
+written_by = "Written by" # Like: Written by Aaran Xu
+on = "on" # Like: on May 3, 2021
+top = "Top" # Go to the top of the page in the post
+tags = "Tags" # In the page of Tags
+
+# disqus comments block
+disqus_discussion = "Discussion and feedback"
+
+# The contents of the 404 page
+p404 = "404: Page not found"
+p404_info = "Oops! We can't seem to find the page you are looking for."
+p404_back_home_start = "Let's"
+p404_back_home_with_link = "head back home"
+p404_back_home_end = "."
+
+Just add your own styles to sass/_custom.scss
file.
We use GitHub Issues as the official bug tracker for the Tale-Zola. Please +search existing issues. It’s +possible someone has already reported the same problem.
+If your problem or idea is not addressed yet, open a new issue.
+We'd love your help! Please see CONTRIBUTING.md to learn +about the kinds of contributions we're looking for.
+Tale-Zola is distributed under the terms of the +MIT license.
+ + +Lightweight and minimal blog theme for the Zola +static site generator.
+Live demo is available here: +https://savoy.srht.site/blog-demo
+ + +Clone this repository into your site's themes
directory or add it as a
+submodule:
# Clone into themes
+$ git clone https://git.sr.ht/~savoy/tilde themes/tilde
+# Add as a submodule
+$ git submodule add https://git.sr.ht/~savoy/tilde themes/tilde
+
+This theme offers the following config options:
+[extra]
+
+homepage = "" # author homepage
+subtitle = "" # blog subtitle
+git_source = "" # blog source code
+author = "" # author name
+email = "" # author email
+license = "" # blog license
+
+
+
+ A light theme for Zola adapted from Pelican.
+ +You can add the theme as a submodule :
+git submodule add --name toucan https://git.42l.fr/HugoTrentesaux/toucan.git themes/toucan
+
+and enable the theme in your config.toml
theme = "toucan"
+
+Categories will be added to the menu, and all articles from categories with
+transparent = true
+
+will be listed in the home page.
+You can personalize the following options :
+[extra]
+title = "Toucan theme"
+title_pic = "/favicon.ico"
+description = "Theme for Zola inspired from Pelican website theme"
+license = """Content under <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA</a> Licence"""
+
+
+
+
+
+
+A blog theme for Zola. Simple, elegant and uses Tailwind. Based on Isunjns Serene theme.
This theme wouldn't have existed without Isunjns Serene theme. It's a great theme, so go check that one out as well.
+When I doubted about layout, I always went to look at FasterThanLimes blog to see how he did it.
+Of course, this website wouldn't render without Zola and it wouldn't show anything without Tailwind.
+Tranquil is a fork of Serene. The main reason to fork was not that I thought Serene was bad: I just wanted to try out Tailwind for a while and reimplementing a blog theme seemed like the perfect way to do so.
+The main and pretty much only difference between Tranquil and Serene is that the styling is built from scratch with Tailwind. The icons have also been changed to align better with Tailwind.
+main
branch.a minimalist and dark theme for Zola.
+ + +Largely a port of Radek Kozieł's Terminal +Theme for Hugo. 4/5ths of my way +through porting this theme, I discovered Paweł Romanowski own independent fork +for Zola, Terminimal, +which helped me get the PostCSS to Sass styling conversion done more +quickly. My sincerest thanks to both of you!
+This theme is largely true to the original by Radek, but there are some mild +differences. They are almost all stylistic in nature and are intended to +emphasize minimalism even more. Some of them are as follows:
+Some of these might be added later and PR's are always +welcomed.
+Please follow the Zola documentation for how to use a +theme.
+In config.toml
, you will find all values for customization that are supported
+thus far have documentation explaining how they are used. If there is any confusion or something is not working as intended, please open an issue!
You can use KaTeX for mathematical typesetting.
+Assets are only available if you opt-in on a per-page level through
+a single line (math=true
) on the extra section of the page frontmatter.
# index.md
++++
+title="this page title"
+...
+
+[extra]
+math=true
++++
+
+Content
+
+Pages wich doesn't opt-in are not affected in any way, so you doesn't have +to worry about any performance hit.
+MIT. See LICENSE.md
for more details.
An elegant but still playful theme for Zola powered by Spectre.css.
+It is especially optimized for mobile navigation (optionally without JavaScript, if you don't like fancy stuff).
+DEMO: https://zhuia.netlify.app/
+First download this theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/gicrisf/zhuia.git
+
+and then enable it in your config.toml
:
theme = "zhuia"
+
+Posts should be placed directly in the content
folder.
To sort the post index by date, enable sort in your index section content/_index.md
:
sort_by = "date"
+
+Set a title and description in the config to appear in the site header and on the RSS feed:
+title = "Der Prozess"
+description = "a novel written by Franz Kafka in 1914"
+
+Most SEO tags are populated by the page metadata, but you can set the author
and for the og:image
tag provide the path to an image:
[extra]
+
+author = "Timothy Morton"
+og_image = "Hyperobjects.png"
+
+You can choose between two modes:
+Set a field in extra
with a key of footer_links
:
[extra]
+
+# Freely comment out or delete every field
+social_links = [
+ {url = "https://t.me/yourname", name = "telegram"},
+ {url = "https://twitter.com/gicrisf", name = "twitter"},
+ {url = "https://github.com/gicrisf", name = "github"},
+ # {url = "", name = "facebook"},
+ # {url = "", name = "instagram"},
+ # {url = "", name = "bookstack"},
+ # {url = "", name = "dokuwiki"},
+]
+
+
+The theme automatically picks up the right icons. +We can expand the support to other social, for sure: make a PR or open an enhancement issue to ask a new implementation.
+You can add your own copyright or whatever to the footer with a through a simple option on the config file:
+[extra]
+
+footer_tagline = "What if everything is an illusion and nothing exists? In that case, I definitely overpaid for my carpet."
+
+The name arise from two parts:
+The theme is built on Spectre CSS framework, so I found reasonable evoking a spectral species.
+This theme is based on a Pelican theme I originally made for my blog, which was in turn based on the +Grav theme Quark.
+Did you liked this theme? Make a donation and support new features!
+ +Open sourced under the MIT license.
+ + +ZOLA.386 is a port of the BOOTSTRA.386 theme and was based on:
+ZOLA.386 is a theme that refers to the 90s, but with cutting edge features to be fast and responsive.
+The easiest way to install ZOLA.386 is to clone this repository and build your site upon it:
+$ git clone https://github.com/lopes/zola.386
+
+Of course you can install it just as another theme for your site, but ZOLA.386 must be added as a module:
+$ cd themes
+$ git submodule add https://github.com/lopes/zola.386
+
+Configuration is mainly done in config.toml
and here I'll describe the main topics.
config.toml
starts with the global variables. All of these items are important, but it is fundamental to create two taxonomies at least:
taxonomies = [
+ {name="categories", rss=true},
+ {name="tags", rss=true},
+]
+
+Remember that all descriptions (config.description
and page.description
) are shown on the index page, one at the header and the others through the body.
ZOLA.386 comes with a lot of extra variables which eases the creation and maintenance of the site, so it's important to review all of them after installing the theme.
+The zola386_menu
composes the navbar and is created by setting up a path
, which will be appended to the base_url
and the name
will appear on the navbar.
zola386_menu = [
+ {path="/", name="Home"},
+ {path="categories", name="Categories"},
+ {path="tags", name="Tags"},
+ {path="about", name="About"},
+]
+
+ZOLA.386 is also prepared to deal with Google Analytics, Disqus, and Twitter --Open Graph Protocol is welcome. This theme is prepared to use the output of Favicon Generator, to do so, you'll just need to download the output of that site and extract in static/images
.
As said, Disqus is supported, but besides setting the username in config.toml
, you also must to put a comments = true
extra option on the pages where Disqus will be enabled --this gives you the freedom to enable or disable comments on certain posts. You can use the extra option image
on each page, to represent that post.
All JavaScript animations can be set at static/js/zola386.js
. Basically you can disable all animations, use one or two scans, and change the scan speed. Personally, I prefer only one scan with a speed factor of 5.
Under the label_
variables, you can set names to better localize your site. Note that you can change the language of a single page, by using page.extra.lang
, which causes <html lang="">
to change only on that page. A theme to provide information for its owner and SEO-friendly.
Search was implemented according to the official documentation. It uses JavaScript to search on an indexed version of the site based on search_index.LANG.js
, elasticlunr.min.js
, and search.js
--the first two are generated after each build. If you're running your site in other default language other than English, you must change the search_index.LANG.js
line in index.html
, setting up LANG
accordingly.
The content\_index.md
file must be properly configured to provide better experience. Check out this file for more information.
The 404 page is almost hardcoded, so you must edit it directly.
+This theme is released under the MIT license. For more information read the License.
+ + + +Demo: https://easydocs.codeandmedia.com/
+This theme for Zola (static site engine) helps you build and publish your project docs easily and fast. Zola is just one binary that outputs html-pages and additional static assets after building your docs written in Markdown. Thus, you can take the theme, your md-files, Zola and gain flexible and simple website for documentation.
+As you may have heard Zola is quite flexible :) So, the scenario below is one of hundreds possible ways to make things done, feel free to find your best. Also, Zola provides their own mechanism to install and use themes, see the docs.
+title
and when you want to have anchor right of your headers add insert_anchor_links = "right"
to each index. theme.toml
, screenshot and readme may be deleted too. config.toml
change URL and title on your own. In extra section you can specify path to your GitHub API for version below the logo on nav, favicon and logo itself. Or just remove the lines if you don't need it. Also, you can configure or turn on some additional settings related to Zola. Specification is here.These options can be configured in the extra
section of the config.toml.
+If any are not present it has the same behaviour as the default which is shown in the starter config.toml.
index.html
. This functionality was insired by Abridge theme. Note that for this to work it also requries the base URL to be set to the local folder where the site will be stored eg. base_url = file:///home/user/mysite/public/
. Therefore this is not portable and only works with a specific local folder, but does not require a webserver to navigate the site.Enjoy your docs!
+Henry is a single-column Zola theme based on the original Jekyll styles.
+Demo -> https://sirodoht.github.io/zola-henry/
+ + + +First download this theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/sirodoht/zola-henry.git henry
+
+and then enable it in your config.toml
:
theme = "henry"
+
+Set a field in extra
with a key of henry_links
:
[extra]
+henry_links = [
+ {url = "about", name = "About"},
+ {url = "https://github.com/benbalter", name = "GitHub"},
+]
+
+Each link needs to have a url
and a name
.
By default Henry ships with GitHub icon link in the right side of the footer. You can change its link href in your config.toml
.
[extra]
+henry_github = "https://github.com/sirodoht/zola-henry"
+
+Twitter is too mainstream and a bit lame, but 100% of our users have requested, so we offer it.
+[extra]
+henry_twitter = "https://twitter.com/benbalter"
+
+MIT
+ + +Minimal is a Zola theme with the goal of helping you build a light, fast, and SEO ready landing page or website.
+It is based on the Jekyll theme with the same name.
+Check out the demo.
+Before using the theme, you need to install Zola ≥ v0.18.0.
+# 1. Clone the repo
+git clone git@github.com:semanticdata/zola-minimal.git
+
+# 2. Change directory into clone
+cd zola-minimal
+
+# 3. Serve the site locally
+zola serve
+
+# 4. Open http://127.0.0.1:1111/ in the browser
+
+For more detailed instructions, visit the Documentation page about installing and using themes.
+You can change the configuration, templates and content yourself. Refer to the config.toml, and templates for ideas. In most cases you only need to modify the contents of config.toml to customize the appearance of your blog. Make sure to visit the Zola Documentation.
+Adding custom CSS is as easy as adding your styles to sass/_custom.scss. This is made possible because SCSS files are backwards compatible with CSS. This means you can type normal CSS code into a SCSS file and it will be valid.
+We use GitHub Issues as the official bug tracker for Minimal. Please search existing issues. It’s possible someone has already reported the same problem. If your problem or idea is not addressed yet, open a new issue.
+Zola Minimal is a fork of the Jekyll theme Minimal.
+Source code in this repository is available under the MIT License.
+ + +A clean theme inspired from hugo-paper.
+Zola port of Hugo-Paper (with a few tweaks).
+Demo: https://schoenenberg.github.com/zola-paper
++
+The easiest way to install this theme is to either clone it ...
+git clone https://github.com/schoenenberg/zola-paper.git themes/zola-paper
+
+... or to use it as a submodule.
+git submodule add https://github.com/schoenenberg/zola-paper.git themes/zola-paper
+
+Either way, you will have to enable the theme in your config.toml
.
theme = "zola-paper"
+
+This theme has an integration of Open Graph meta tags. These are set based on context and available information. See the following example:
++++
+title = "Lorem ipsum!"
+
+[extra]
+author = "Max Mustermann"
+author_url = "https://www.facebook.com/example.profile.3"
+banner_path = "default-banner"
+
+[taxonomies]
+tags = ["rust", "zola", "blog"]
++++
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc eu feugiat sapien. Aenean ligula nunc, laoreet id sem in, interdum bibendum felis. Donec vel dui neque.
+<!-- more -->
+Ut luctus dolor ut tortor hendrerit, sed hendrerit augue scelerisque. Suspendisse quis sodales dui, at tempus ante. Nulla at tempor metus. Aliquam vitae rutrum diam. Curabitur iaculis massa dui, quis varius nulla finibus a. Praesent eu blandit justo. Suspendisse pharetra, arcu in rhoncus rutrum, magna magna viverra erat, ...
+
+
+Required attributes of the extra
section is author
. All other attributes are optional. The path for the banner_path
attribute has to be relative to the content directory.
First download this theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/lukehsiao/zola-pickles.git
+
+and then enable it in your config.toml
:
theme = "zola-pickles"
+
+The theme requires putting the posts in the root of the content
folder and to enable pagination, for example in content/_index.md
.
+++
+paginate_by = 5
+sort_by = "date"
+insert_anchor_links = "right"
++++
+
+[extra]
+# A line to display underneath the main title
+subtitle = "Example subtitle"
+
+# Text to display in the footer of the page
+copyright = "Copyright authors year"
+
+# Your Google Analytics ID
+analytics = ""
+
+# See below
+katex_enable = false
+
+# See below
+instantpage_enable = false
+
+A full example configuration is included in config.toml.
+Note how pickles also expects title
and description
to also be set in the Zola configuration.
This theme contains math formula support using KaTeX, which can be enabled by setting katex_enable = true
in the extra
section of config.toml
.
After enabling this extension, the katex
short code can be used in documents:
{% katex(block=true) %}\KaTeX{% end %}
to typeset a block of math formulas,
+similar to $$...$$
in LaTeXThe figure shortcode is convenient for captioning figures.
+{% figure(link="https://www.example.com/", src="https://www.example.com/img.jpeg", alt="sample alt text") %}
+Your caption here.
+{% end %}
+
+The table shortcode is convenient for making mobile-friendly tables (centered with overflow scrollbar).
+{% table() %}
+| Item | Price | # In stock |
+| :----------- | ----: | ---------: |
+| Juicy Apples | 1.99 | 739 |
+| Bananas | 1.89 | 6 |
+{% end %}
+
+This theme includes fontawesome, so that fontawesome icons can be directly used.
+The theme contains instant.page prefetching. This can be enabled by setting instantpage_enable = true
in the extra
section of config.toml
.
By default, the theme will use the first 280 characters of your post as a summary, if a proper page summary using <!-- more -->
is not provided.
+For more sensible summaries, we recommend using the manual more indicator.
This theme allows you to publish only courses/tutorials structured in +parts and subparts, using Zola.
+ + +It automatically links pages of the course with the next and previous ones +for easy navigation. There is also a navigation bar at the top of each page +to easily navigate the whole tutorial, and for the reader to never be lost.
+Each page can have an illustration.
+It lets you customize some parts of the site, like the color palette.
+It also features a light/dark mode switcher.
+It also has some SEO features.
+It was made for french courses, so a few parts of the interface may be in french.
+You can easily adapt it to your language by editing the files in themes/zola-theme-course/templates/
.
Create your Zola site, and import this theme:
+zola init NAME
+cd NAME/themes
+git clone https://github.com/elegaanz/zola-theme-course.git
+cd ..
+
+Then update your config.toml
with this line:
theme = "zola-theme-course"
+
+You can also add these lines to customize how the theme behaves:
+[extra]
+site_name = "My course"
+icon = "image.png"
+icon_desc = "Icon of the course"
+description = "A great course!"
+default_illus = "illus.png"
+primary_color = "#FFFFFF"
+accent_color = "#FFFFFF"
+source_url = "https://github.com/me/my-course"
+
+For your course to be displayed correctly, it needs to follow a specific structure.
+content/_index.md
is the text displayed on the homepage_index.md
index.md
in a subfolder)_index.md
files should have sort_by = "weight"
in their frontmatter, and you can then
+order parts and subparts using the weight
option.With this theme, pages can also have extra options:
+[extra]
+# Don't display the page title, useful for the homepage
+no_title = true
+# The name of the image to use as a banner
+illus = "illus.jpg"
+# Adds JSON-LD metadata on this page, useful for the homepage
+jsonld = true
+
+The standard title
and description
fields are also taken into account.
++this is a port of the hikari theme for Zola
+
Hikari is a simple theme perfect for dev-savvy bloggers.
+ + +First download the theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/waynee95/zola-theme-hikari
+
+and then enable it in your config.toml
:
theme = "hikari"
+
+[extra]
+author = "John Doge"
+author_bio = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex, pariatur!"
+twitter = "waynee955"
+github = "waynee95"
+instagram = false
+enable_mathjax = false
+
+Thanks to Mathieu Mayer-Mazzoli for creating this awesome theme!
+ + +See the live demo (of the default configuration) here: +https://pawroman.github.io/zola-theme-terminimal/
+Tested with Zola v0.17.2. Please note that earlier versions might not work because of breaking changes across Zola versions.
+This theme is a fork (not a port) of "Terminal" Hugo theme +by Radosław Kozieł (aka. panr): +https://github.com/panr/hugo-theme-terminal
+Many thanks for that outstanding original theme, Radek!
+For more information about this fork and the differences to the original theme, please see: +Changes compared to the original theme below.
+This theme used to be non-versioned, e.g. you'd pull the master branch, and occasionally new features or fixes would +be released.
+Starting from version v1.0.0, the project adopted Semantic Versioning.
+Please check the GitHub releases to see a change log +and work out if there's any breaking changes.
+Option A: clone the theme directly into your Zola site folder:
+$ git clone https://github.com/pawroman/zola-theme-terminimal.git themes/terminimal
+
+Option B: include it as a git submodule (it's better if you plan to use CI builders):
+$ git submodule add https://github.com/pawroman/zola-theme-terminimal.git themes/terminimal
+
+Then in your config.toml
set:
theme = "terminimal"
+
+# Sass compilation is required
+compile_sass = true
+
+Also see the Zola documentation on using themes: +https://www.getzola.org/documentation/themes/installing-and-using-themes/
+The theme adds two custom shortcodes related to image handling.
+image
Used to show images.
+Required arguments:
+src
Optional arguments:
+alt
position
(center [default] | left | right)style
Example:
+{{ image(src="/img/hello.png", alt="Hello Friend",
+ position="left", style="border-radius: 8px;") }}
+
+figure
Same as image
, but with a few extra optional arguments:
caption
(supports markdown)caption_position
(center [default] | left | right)caption_style
Example:
+{{ figure(src="http://rustacean.net/assets/rustacean-flat-gesture.png",
+ style="width: 25%;",
+ position="right",
+ caption_position="left",
+ caption="**Ferris**, the (unofficial) Rust mascot",
+ caption_style="font-style: italic;") }}
+
+To add an image to a post, set the og_image
extra option to the desired image
+in the same directory of the markdown file:
[extra]
+og_image = "colocated_image.png"
+
+Additionally, for the section pages and for posts to have a fallback image, add
+default_og_image
to the [extra]
section:
[extra]
+default_og_image = "static/ocean.jpg"
+
+On each post you can specify the following:
+description = "test description"
+
+[extra]
+show_only_description = true
+
+This will render test description
under this
+particular post on the homepage instead of a summary.
Both the accent colors and background colors are +configurable.
+By default, both accent and background are set
+to blue
.
To configure menu, add this in [extra]
section
+of your config.toml
:
[extra]
+
+# One of: blue, green, orange, pink, red.
+# Defaults to blue.
+# Append -light for light themes, e.g. blue-light
+# Or append -auto, e.g. blue-auto
+accent_color = "green"
+
+# One of: blue, dark, green, orange, pink, red, light, auto
+# Enabling dark background will also modify primary font color to be darker.
+# Defaults to accent color (or, if not accent color specified, to blue).
+background_color = "dark"
+
+You can set the "logo" text and what it links to,
+by modifying config.toml
like so:
[extra]
+
+# The logo text - defaults to "Terminimal theme"
+logo_text = "My blog"
+
+# The logo link - defaults to base_url.
+logo_home_link = "/take/me/away!"
+
+You can set the footer's copyright author name like this:
+[extra]
+
+# Author name: when specified, modifies the default
+# copyright text. Apart from author, it will
+# contain current year and a link to the theme.
+author = "My Name"
+
+If you don't like the default copyright text, +you can set it to completely custom HTML:
+[extra]
+
+# Copyright text in HTML format. If specified,
+# entirely replaces default copyright and author.
+copyright_html = "My custom <b>copyright</b>"
+
+The menu is optional, static (all items are always shown, +no matter what the screen size) and fully user-configurable.
+To configure menu, add this in [extra]
section
+of your config.toml
:
[extra]
+
+# menu is enabled by adding menu_items (optional)
+menu_items = [
+ # each of these is optional, name and url are required
+ # $BASE_URL is going to be substituted by base_url from configuration
+ {name = "blog", url = "$BASE_URL"},
+
+ # tags should only be enabled if you have "tags" taxonomy
+ # see documentation below for more details
+ {name = "tags", url = "$BASE_URL/tags"},
+ {name = "archive", url = "$BASE_URL/archive"},
+ {name = "about me", url = "$BASE_URL/about"},
+
+ # set newtab to true to make the link open in new tab
+ {name = "github", url = "url-to-your-github", newtab = true},
+]
+
+The theme optionally supports tags. To enable them, create
+a "tags" taxonomy in your config.toml
:
taxonomies = [
+ {name = "tags"},
+]
+
+Enabling tags will create a new /tags
page, and
+cause them to show up in archive
section. Note
+that you still need to create a menu link to the tags
+page manually.
Pagination is fully supported for post list (main site) +and intra-post (you can navigate to earlier and later posts).
+To make sure pagination works properly, you must first configure
+it in content/_index.md
:
+++
+# number of pages to paginate by
+paginate_by = 2
+
+# sorting order for pagination
+sort_by = "date"
++++
+
+Then, tweak the theme's pagination config in config.toml
:
[extra]
+
+# Whether to show links to earlier and later posts
+# on each post page (defaults to true).
+enable_post_view_navigation = true
+
+# The text shown at the bottom of a post,
+# before earlier/later post links.
+# Defaults to "Thanks for reading! Read other posts?"
+post_view_navigation_prompt = "Read more"
+
+Internationalization / translation is not supported +but you can set the HTML language code for your +site:
+default_language = "en"
+
+By default, the theme uses a mixed subset of the Hack font. +Normal weight font uses full character set +(for Unicode icons and special symbols), but all others +(bold, italic etc) use a limited subset.
+This results in much smaller transfer sizes, but the subset +might not contain all the Unicode characters you need.
+You can enable full unicode support in config.toml
:
[extra]
+
+# Use full Hack character set, not just a subset.
+# Switch this to true if you need full unicode support.
+# Defaults to false.
+use_full_hack_font = true
+
+Also see Hack's docs.
+The theme supports adding a global favicon (applies to +all pages) to the site:
+# Optional: Global favicon URL and mimetype.
+# Mimetype defaults to "image/x-icon".
+# The URL should point at a file located
+# in your site's "static" directory.
+favicon = "/favicon.png"
+favicon_mimetype = "image/png"
+
+The theme allows you to configure how the page titles (the <title>
elements) are rendered.
Use "combined"
to render titles as "Page title | Main title"
.
# Optional: Set how <title> elements are rendered.
+# Values:
+# - "main_only" -- only the main title (`config.title`) is rendered.
+# - "page_only" -- only the page title (if defined) is rendered,
+# falling back to `config.title` if not defined or empty.
+# - "combined" -- combine like so: "page_title | main_title",
+# or if page_title is not defined or empty, fall back to `main_title`
+#
+# Note that the main (index) page only has the main title.
+page_titles = "combined"
+
+All the configuration options are also described in
+config.toml
.
Each of the templates defines named blocks, so +it should be quite easy to customize the most common things.
+For example, if you want to add extra <meta>
tags to the
+base template, index.html
, create file like this in templates/index.html
:
{%/* extends "terminimal/templates/index.html" */%}
+
+{%/* block extra_head */%}
+ <meta name="description" content="My awesome website"/>
+ <meta name="keywords" content="Hacking,Programming,Ranting"/>
+{%/* endblock */%}
+
+If you spot any bugs or wish to contribute new features, please create a new +Pull Request.
+This theme has been forked from https://github.com/panr/hugo-theme-terminal
+Slight changes in the layout and styling.
+Absolutely no JavaScript.
+All references to social media (e.g. Twitter) have been removed.
+All references to external URLs (e.g. Google CDN) have been removed. +This theme's static assets are meant to be served from where it's hosted.
+Hack is the default font.
+The default color theme is blue (original uses orange).
+dark
background. See Configuration
+below for details.image
and figure
(See Shortcodes.Copyright © 2019 Paweł Romanowski (pawroman)
+Original theme: Copyright © 2019 Radosław Kozieł (@panr)
+The theme is released under the MIT License. +Check the license file +for more information.
+The license for Hack fonts used is included in +LICENSE-Hack.md.
+ + +Welcome to Zolarwind, the simple Zola blog theme with Tailwind CSS and KaTex support. +This theme is for Zola users aiming to have a nice blog design powered by Tailwind CSS. +It seamlessly integrates with Mermaid, enabling the creation of various diagrams +directly within your blog posts using a Markdown-inspired syntax. +Additionally, the theme smoothly integrates math formulas using KaTex. +Most importantly, while the theme is designed to be easily localizable, +you can choose your preferred language setting for a consistent blog experience.
+Tailwind CSS: Utilize the utility-first CSS framework for rapid UI development.
+Mermaid Integration: Create diverse diagrams using simple text.
+KaTex Integration: Integrate and display math formulas seamlessly in your blog posts.
+Localization Support: All theme-specific strings are available in multiple languages; choose the one that's right for you. +If your language isn't supported yet, just create the resource file with your translations.
+You can see the theme in action on my personal website. +The site uses the German language.
+In order to use the theme, you need some software pre-installed:
+Git, Required for version control.
+Node, an open-source, cross-platform JavaScript runtime environment.
+Zola, a fast static site generator.
+an editor or integrated development environment of your choice - I use JetBrains IDEA, +an IDE that makes development a more productive and enjoyable experience.
+Clone this theme repository with e.g. git@github.com:thomasweitzel/zolarwind.git
.
+Or download it from https://github.com/thomasweitzel/zolarwind
.
Make adjustments to the config.toml
file as needed.
+In order to run the theme as a standalone site, you need to adjust the base_url
to your domain.
+If you want to try it out on your local machine, you can leave it as is.
+Just run zola serve
from the theme's root directory.
Your config.toml
file is crucial in customizing the Zola site.
+Here's a breakdown of the configuration settings tailored for this theme:
base_url: Specifies the URL the site will be built for.
+In this case, the site will be built for https://example.org
.
+Adjust this to your own domain.
compile_sass: Determines whether to automatically compile all Sass files present in the sass
directory.
+Here, it's set to false
, meaning Sass files won't be automatically compiled for this theme.
default_language: Sets the default language for the site.
+The provided config uses English (en
) as the default language.
+As of now, German (de
) is available in the i18n
directory.
theme: The theme used for the site.
+The provided line is commented out, indicating that the themes files are taken from the template
directory.
+If you move the theme to the themes/zolarwind
directory, use zolarwind
for this entry.
build_search_index: If set to true
, a search index will be built from the pages and section content for the default_language
.
+In this configuration and for this theme, it's disabled (false
).
generate_feed: Determines if an Atom feed (file atom.xml
) is automatically generated.
+It's set to true
, meaning a feed will be generated.
taxonomies: An array of taxonomies (classification systems) used for the site.
+Here, a taxonomy for tags
is defined, with a pagination limit of 6 and an enabled feed.
highlight_code: Indicates whether code snippets in Markdown files should be highlighted. Here, it's set to true
.
highlight_theme: Specifies the theme to be used for code highlighting. The chosen theme in this configuration is 1337
.
extra_syntaxes_and_themes: directory for additional syntax highlighting configuration files for languages not directly supported by Zola.
+The [extra]
section is where you can place any custom variables you want to be accessible in your templates.
title: The title of the site. +Here, it's set to "Zolarwind".
+generator: Optional.
+Specifies the generator used for creating the static website.
+This site is generated using Zola v0.18.0
.
path_language_resources: The path to the directory containing language resource files.
+In this config, it's set to i18n/
.
+If you move the theme to the themes/zolarwind
directory, use themes/zolarwind/i18n/
for this entry.
favicon_svg: Provides a path to the site's favicon in SVG format.
+The provided path points to /img/yin-yang.svg
.
copyright: A template for the copyright notice.
+It includes a placeholder {year}
which is dynamically replaced with the current year of your zola build
run.
site_description: A brief description displayed on the site's banner.
+quote: A structure defining a quote and its author. +This quote is from Yoda.
+menu_pages: An array of main navigation menu items.
+Each item has a title
and a url
.
footer_pages: An array of pages that will appear in the site's footer.
+Each item has a title
and a url
.
social_links: An array of social media links. +Each link has a name, a boolean indicating if it's enabled, a URL, and an SVG icon.
+For blog posts (Markdown files in folder content/blog
), this theme uses a directory structure where each post has its own folder.
+This way, I have all resources for a post in one place.
+It can include images, videos, and other files.
Each post is associated with an image, that is displayed on the blog's main page and on the posts detail page.
+If you do not provide an image under extra.image
, a default image is used instead.
date: the date of the blog posts, e.g. 2020-06-11
.
title: the title of the blog posts, e.g. The Game of Fifteen
.
description: the description of the blog posts. It is used as a summary on the blog's main page.
+authors: an optional array of all the posts authors, e.g. ["Thomas Weitzel"]
.
+You can leave it empty, but then the first author will show up as Unknown
in the feed (atom.xml
).
taxonomies: only the optional tags
taxonomy is used by this theme.
+I tend to list programming languages used in the post, e.g. ["rust", "javascript"]
.
+You can omit it, but then the post will not show up under tags
.
extra.math: either false
(default) or true
.
+If set to true
, the post will be rendered with KaTex support for displaying math formulas.
+If the entry is omitted or set to false
, the post will not have KaTex support.
extra.diagram: either false
(default) or true
.
+Controls loading of the necessary JavaScript to render the Mermaid diagram.
+If set to true
, the post will be rendered with Mermaid support for displaying diagrams
+by using the diagram()
shortcode.
extra.image: an optional image for the post. +If omitted, a default image is used instead. +The image is displayed on the blog's main page and on the posts detail page.
+Consider this text on a page where a blog post is published as an example: Published on July 04, 2023; 1,234 words
.
+If your blog is in the German language, you want to have Veröffentlicht am 04. Juli 2023; 1.234 Wörter
instead.
+Not only the text should be translated, but also the date and number formats are different.
+And you want a text like 1 word
or 1 Wort
, because the singular form should be used where applicable.
+This theme takes care of that.
To localize your blog with this theme:
+Pick your desired language by setting the default_language
in config.toml
.
+As of now, English (en
) and German (de
) have language resources available in the i18n
directory.
+If your language is not supported yet, just create a new resource file with your translations.
+Use the file en.toml
as a template for your own translations.
+Use the correct language code for the file name, e.g. eo.toml
for Esperanto.
+Only languages that read from left-to-right (ltr) are supported by this theme.
The theme will automatically display all theme-specific string resources in the chosen language.
+The content that you provide should match this language. +But that is your responsibility. +The theme will not translate your content.
+If you need to define your own date format, look here for supported specifiers.
+This project is structured as a stand-alone Zola site.
+This section is for those who might want to integrate the theme into an existing Zola website.
+You can do so by moving the relevant theme files to the themes/zolarwind
directory.
+All other files stay in the root directory.
+If you have your own files there, you need to merge them with the ones from this theme.
+You also need to adjust the config.toml
and package.json
files in the root accordingly.
I will only show you the relevant directories that need to be moved. +This is the directory structure of the stand-alone site, where the theme is in the root directory:
+/
+├── css
+├── i18n
+├── static
+│ ├── css
+│ ├── img
+│ └── js
+├── syntaxes
+├── templates
+└── theme.toml
+
+Create a new directory themes/zolarwind
and move the following files and directories there:
/
+├── static
+│ └── css
+└── themes
+ └── zolarwind
+ ├── css
+ ├── i18n
+ ├── static
+ │ ├── img
+ │ └── js
+ ├── syntaxes
+ ├── templates
+ └── theme.toml
+
+The static/css
directory is a special case.
+It contains the generated Tailwind CSS file with the name generated.css
.
+It will stay in its original location.
+This file is generated from the file css/main.css
, which is the input for the CSS generation.
+The generation process can be triggered with a script in the package.json
file.
+You only need to adjust and run the script in package.json
if you make changes to the theme's template files or use new Tailwind CSS classes directly in your content files.
+Since the source file css/main.css
has moved to the directory themes/zolarwind/css/main.css
, we need to adjust the script in package.json
accordingly.
This is how the relevant part of it looks like for the stand-alone site:
+"scripts": {
+ "css:build": "npx tailwindcss -i ./css/main.css -o ./static/css/generated.css --minify",
+ "css:watch": "npx tailwindcss -i ./css/main.css -o ./static/css/generated.css --watch",
+ "server": "zola serve"
+}
+
+Now change it so that the input file css/main.css
will be the file themes/zolarwind/css/main.css
:
"scripts": {
+ "css:build": "npx tailwindcss -i ./themes/zolarwind/css/main.css -o ./static/css/generated.css --minify",
+ "css:watch": "npx tailwindcss -i ./themes/zolarwind/css/main.css -o ./static/css/generated.css --watch",
+ "server": "zola serve"
+}
+
+Since you now use Zolarwind as a theme, you need to declare it in the config.toml
file.
+The theme's files have moved to the directory themes/zolarwind
, so you need to adjust the only reference to the theme's files in the config.toml
file accordingly by changing the path_language_resources
entry:
# The site theme to use
+theme = "zolarwind"
+
+# ...
+
+# Path to the language resource files
+path_language_resources = "themes/zolarwind/i18n/"
+
+If you want to adjust the CSS of the theme to your needs, you will need to edit the files in the templates
and css
directories.
+While you do this, you should make sure that the CSS file static/css/generated.css
is up-to-date.
+This file is generated from the file css/main.css
, and all the files that are configured as a pattern in tailwind.config.js
:
css/main.css
themes/**/*.html
templates/**/*.html
content/**/*.md
So whenever one of these files changes, you need to run the script css:build
from the package.json
file.
+To accomplish this, you need to have Node.js
and all dependencies from package.json
installed (with npm install
).
+Then you can run the script with npm run css:watch
.
+It monitors all files mentioned above and triggers the CSS generation whenever a relevant file changes.
+This ensures, that the file static/css/generated.css
is always up-to-date.
I recommend to have two terminals open.
+In one terminal, run zola serve
to start the Zola server.
+In the other terminal, run npm run css:watch
to start the CSS generation whenever a relevant file changes.
That way, your local web browser will automatically reload the page with the updated CSS whenever you change a file.
+I'm not using @tailwindcss/typography
for styling of markdown files.
+I don't like how it looks.
+Instead, I use @apply
in the css/main.css
file.
+The @apply
directive in Tailwind CSS enables you to compose utility classes into custom CSS classes.
+This makes it possible to apply multiple utility styles within a single class, making it efficient to style markdown content.
This approach has pros and cons.
+But it gives me fine-grained control over how the end result looks like.
+While it is time-consuming, I prefer this solution over the @tailwindcss/typography
plugin.
Yes, I'm reinventing the wheel here, because for common typographic patterns, I'm just recreating what's already provided by the typography plugin.
+All KaTex files are included in the static
directory for this theme.
+Using KaTeX (or any other library) by serving it from a Content Delivery Network (CDN) has implications concerning the General Data Protection Regulation (GDPR) and the use of cookies:
Third-Party Requests & Data Privacy: When you load resources from a CDN, it triggers third-party requests to the CDN's servers. +These servers might log your IP address, user agent, and other request-related metadata. +Under GDPR, IP addresses can be considered personal data. +By serving KaTeX from your domain, you reduce third-party data transfers, limiting the amount of personal data you expose to external entities.
+Cookies: Many CDNs set cookies for various reasons, including analytics or performance optimizations. +These cookies can track users across different websites that use the same CDN, potentially infringing on their privacy rights. +By hosting KaTeX on your domain, you have full control over the cookies set and can ensure compliance with GDPR.
+Consent: If you're using a CDN that sets cookies or collects data, you might need to get explicit user consent before loading resources from that CDN. +This can complicate user experience and lead to a reduced site performance for users who opt-out. +By self-hosting, you circumvent this issue.
+Transparency & Control: By self-hosting, you know exactly which version of KaTeX you're using and can ensure there are no modifications or unexpected behaviors. +With CDNs, there's a minor risk of the library being compromised, which could affect all sites using that resource.
+Data Transfer Outside the EU: If the CDN servers are located outside the European Union, you might be transferring data out of the EU, +which adds another layer of GDPR compliance requirements. +By self-hosting, you ensure that user data doesn't leave the region unless you specifically choose a hosting solution outside the EU.
+Contributions are always welcome! +If you see areas of improvement or want to add features, please submit a PR.
+I'm especially interested in more translations.
+See folder i18n
for what's available and what is not.
+Just use the file en.toml
as a template for your own translations.
This theme is under the MIT License. +For details, please refer to the LICENSE file.
+ + +A bootstrap theme for zola
+ +config.toml
[extra] variablesPath of a banner image, use empty string for no banner
+date format expression
+one of the Bootswatch themes
+one of the available backgrounds in
+Bootstrap5
+for navbar
and footer
Invert font for navbar
and footer
in case default choice is bad
Navbar label for themes dropdown.
+This dropdown will allow user to change +Bootswatch theme.
+Use empty string in case you do not want the user choose a theme.
+Navbar label for schemes dropdown.
+This dropdown will allow user to change footer and navbar +background +color.
+Use empty string in case you do not want the user choose a theme.
+Placeholder for navbar search input.
+Remember that to enable and disable search you should set variable +build_search_index.
+Taxonomy tag
single label. Useful for translations.
Taxonomy tag
list label. Useful for translations.
+You can have a nice tag list at the bottom of a page using extra.tags
= true
+in the _index.md
Navbar links. Use an empty array to ignore this.
+Items (object):
+Footer email. Use an empty string to ignore this.
+Footer social icons. Use an empty array to ignore this.
+Items (object):
+utterances repo url.
+Use an empty string to ignore utterances widget.
+utterances widget label.
+utterances widget theme.
+utterances widget pathname.
+Any help is greatly appreciated!
+ + + +Zplit is a single-page, centrally-divided layout designed for a professional online presence. It features a large image or video on the left, accompanied by content on the right. Zplit is a port of Split by One Page Love for Zola.
+ +DEMO: https://zplit.netlify.app/
+Download the theme to your themes
directory:
$ cd themes
+$ git clone https://github.com/gicrisf/zplit.git
+
+Then, enable the theme editing your config.toml
:
theme = "zplit"
+
+The most important file of the theme is located in the root directory and is named =config.toml=. Edit this file to customize your preferences. Look for sections like [extra]
to set variables like author
, or [extra.content]
to modify intro_tagline.
If something is unclear or not obvious, you might have missed the "configuration" section of the Zola official documentation. Even if you're new to static site generators, don't worry and take some time to go through the documentation, as it covers fundamental concepts.
+Here after, we will discuss two specific sections in more detail, because those are unique for the Zplit theme:
+Edit the [extra.visual]
section to set your background image of choice.
[extra.visual]
+
+background = "<your-image-file-path-goes-here>"
+
+You can find this example already written as the default:
+[extra.visual]
+
+background = "images/background.jpg"
+position = "center center"
+
+As you can see, you can edit the relative position of the image, which is centered by default.
+You can set up to 3 lists of links in the [extra.lists]
section of the config.toml
file:
Manipulating them is very easy: just add/remove elements in the TOML list, as showed in this example (also already present in the default file):
+social = [
+ {url = "https://t.me/zwitterio", text = "Telegram"},
+ {url = "https://twitter.com/gicrisf", text = "Twitter"},
+ {url = "https://github.com/gicrisf", text = "Github"},
+]
+
+Do you want another item? Just throw it up to the pile. You have no limits.
+Remember to set the url
field with the link itself you want to direct your user at and a text
to show in the page for the corrisponding URL.
To add new posts, simply place markdown files in the content
directory. In order to sort the post index by date, you need to enable the sort_by
option in the content/_index.md
file within the index section.
sort_by = "date"
+
+This theme was not specifically designed for blogging, but rather as a landing page for professionals. However, if you wish to blog using this theme, you certainly can. To do so, simply add a new section in the content directory and include it in the main menu through the config file. This will make it readily accessible to the user.
+The theme does not offer support for taxonomies or other advanced features. It is focused on providing simple pages. If you wish to enhance the blogging functionality, you are welcome to customize the code or submit a specific request as an issue.
+To make custom changes to the original stylesheets, you can create a custom.css
file in the static
directory. In this file, you can add any modifications or additions you desire.
If you need to make adjustments to the colors or grid dimensions, it may be easier to modify the frontmatter of the _01-content.scss
file directly. In this file, you will find variables conveniently located at the top:
//-------------------------------------------------------------------------------
+// Variables
+//-------------------------------------------------------------------------------
+
+// Colors
+$color-background : #061C30;
+$color-text : #848d96;
+$color-link : #848d96;
+$color-link-hover : #CA486d;
+$color-maverick : #47bec7;
+$color-tagline : #CCCCCC;
+
+// Breakpoints
+$bp-smallish : 1200px;
+$bp-tablet : 800px;
+$bp-mobile : 500px;
+
+Do you love Zplit? Did you find it enjoyable and useful? If so, consider showing your support by making a donation. Your contribution will help fund the development of new features and improvements for this theme.
+ +The original template is released under the Creative Commons Attribution 3.0 License. Please keep the original attribution link when using for your own project. If you'd like to use the template without the attribution, you can check out the license option via the template author's website.
+ + +A Bulma theme for Zola. See a live preview here
+ +First download this theme to your themes
directory:
cd themes
+git clone https://github.com/Worble/Zulma
+
+and then enable it in your config.toml
:
theme = "Zulma"
+
+That's it! No more configuration should be required, however it might look a little basic. Head to the Options section to see what you can set for more customizability.
+All the source javascript files live in javascript/src
. Following is a list of the javascript files, their purpose, and their sources. All files are prefixed with zulma_
to avoid any name clashes.
zulma_search.js
- Used when a user types into the search box on the navbar (if enabled). Taken from Zola's site.zulma_navbar.js
- Used for the mobile navbar toggle. Taken from the bulma template at Bulmaswatchzulma_switchcss.js
- Used for swapping themes (if enabled).The JavaScript files are transpiled by babel, minified by webpack, sourcemaps are generated and then everything placed in static/js
. The repo already contains the transpiled and minified files along with their corrosponding sourcemaps so you don't need to do anything to use these. If you would prefer to build it yourself, feel free to inspect the js files and then run the build process (please ensure that you have node, npm and optionally yarn installed):
cd javascript
+yarn
+yarn webpack
+
+You may get warnings about vulnerabilities from the JavaScript dependencies. These shouldn't be an issue since we only have dev-dependencies and none of the them reach the end-user, but if you don't want to run the buld process yourself, and to stop Github pestering you about security warnings, feel free to delete the top level javascript
folder when committing.
Zulma makes no assumptions about your project. You can freely paginate your content folder or your taxonomies and it will adapt accordingly. For example, editing or creating section (content/_index.md
) and setting pagination:
paginate_by = 5
+
+This is handled internally, no input is needed from the user.
+Zulma has 3 taxonomies already set internally: tags
, cateogories
and authors
. Setting of any these three in your config.toml like so:
taxonomies = [
+ {name = "categories"},
+ {name = "tags", paginate_by = 5, rss = true},
+ {name = "authors", rss = true},
+]
+
+and setting any of them in a content file:
+[taxonomies]
+categories = ["Hello world"]
+tags = ["rust", "ssg", "other", "test"]
+authors = ["Joe Bloggs"]
+
+will cause that metadata to appear on the post, either on the header for the name, or at the bottom for tags and categories, and enable those pages.
+Making your own taxonomies is also designed to be as easy as possible. First, add it to your cargo.toml
+taxonomies = [
+ {name = "links"},
+]
+
+and make the corrosponding folder in your templates, in this case: templates\links
, and the necessary files: templates\links\list.html
and templates\links\single.html
And then for each, just inherit the taxonomy master page for that page. Before rendering the content block, you may optionally set a variable called title
for the hero to display on that page, otherwise it will use the default for that taxonomy.
In single.html
:
{%/* extends "Zulma/templates/taxonomy_single.html" */%}
+
+In list.html
:
{%/* extends "Zulma/templates/taxonomy_list.html" */%}
+
+{%/* block content */%}
+{%/* set title = "These are all the Links"*/%}
+{{ super() }}
+{%/* endblock content */%}
+
+In extra, setting zulma_menu
with a list of items will cause them to render to the top menu bar. It has two paramers, url
and name
. These must be set. If you put $BASE_URL in a url, it will automatically be replaced by the actual site URL. This is the easiest way to allow users to navigate to your taxonomies:
[extra]
+zulma_menu = [
+ {url = "$BASE_URL/categories", name = "Categories"},
+ {url = "$BASE_URL/tags", name = "Tags"},
+ {url = "$BASE_URL/authors", name = "Authors"}
+]
+
+On mobile, a dropdown burger is rendered using javascript. If the page detects javascript is disabled on the clients machine, it will gracefully degrade to always showing the menu (which isn't pretty, but keeps the site functional).
+In extra, setting zulma_brand
will cause a brand image to display in the upper left of the top menu bar. This link will always lead back to the homepage. It has two parameters, image
(optional) and text
(required). image
will set the brand to an image at the location specified, and text
will provide the alt text for this image. If you put $BASE_URL in a url, it will automatically be replaced by the actual site URL. If image
is not set, the brand will simply be the text specified.
[extra]
+zulma_brand = {image = "$BASE_URL/images/bulma.png", text = "Home"}
+
+Zulma provides search built in. So long as build_search_index
is set to true
in config.toml
then a search input will appear on the top navigation bar. This requires javascript to be enabled to function; if the page detects javascript is disabled on the clients machine, it will hide itself.
The search is shamefully stolen from Zola's site. Thanks, Vincent!
+In extra, setting zulma_title
will set a hero banner on the index page to appear with that title inside.
[extra]
+zulma_title = "Blog"
+
+If you want to get fancy with it, you can set an image behind using sass like so:
+.index .hero-body {
+ background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Plum_trees_Kitano_Tenmangu.jpg/1200px-Plum_trees_Kitano_Tenmangu.jpg);
+ background-position: center;
+ background-size: cover;
+ background-repeat: no-repeat;
+ background-color: rgba(0, 0, 0, 0.6);
+ background-blend-mode: overlay;
+}
+
+This will set the image behind the hero, and darken it so the main text can still be easily read.
+In extra, setting zulma_theme
to a valid value will change the current colour scheme to that one. All themes were taken from Bulmaswatch. Valid theme values are:
All valid themes can also be found under the extra.zulma_themes
variable in the theme.toml
. Choosing no theme will set default as the theme. Setting an invalid theme value will cause the site to render improperly.
[extra]
+zulma_theme = "darkly"
+
+Additionally, in extra, you can also set the zulma_allow_theme_selection
boolean. Setting this to true
will allow a menu in the footer to allow users to select their own theme. This option will store their theme choice in their localstorage and apply it on every page, assuming zulma_allow_theme_selection
is still true. This requires javascript to be enabled to function; if the page detects javascript is disabled on the clients machine, it will hide itself.
Each theme contains the entirety of Bulma, and will weigh in at ~180kb. If you're running on a server severely limited on space, then I'd recommend you delete each theme you're not using, either from the source or from /public
. Obviously, doing this will cause zulma_allow_theme_selection
to work improperly, so make sure you either override extra.zulma_themes
in config.toml
to only show themes you have left or to not enable this option at all.
[extra]
+zulma_allow_theme_selection = true
+
+This template is based on the blog template over at Free Bulma Templates. All themes were taken from Bulmaswatch. The code behind from originally adapted from the after-dark zola template.
+