getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.76k stars 956 forks source link

Installing after-dark theme #544

Closed happysalada closed 5 years ago

happysalada commented 5 years ago

Documentation issue

Just by following the instructions, I couldn't install the theme after dark successfully

I followed the instructions on the theme's page

Whether to automatically compile all Sass files in the sass directory

compile_sass = true

Whether to do syntax highlighting

Theme can be customised by setting the highlight_theme variable to a theme supported by Zola

highlight_code = true

Whether to build a search index to be used later on by a JavaScript library

build_search_index = true

[extra]

Put all your custom variables here

theme = "after-dark"

taxonomies = [

You can enable/disable RSS

{name = "categories", rss = true},
{name = "tags", rss = true},

]


I added an _index.md to the content folder with the following

+++ paginated_by=5 +++



I run zola build, then zola serve
then it shows me the default error page saying that there is a missing template.

Am I supposed to copy the files from the after-dark/templates folder into my own template folder?

## Summary
documentation for installing after-dark theme is unclear

## Proposed solution
I think there is one missing step.
Keats commented 5 years ago

theme = "after-dark" goes outside of [extra]. If you put it on the line blow build_search_index for example, it should work

happysalada commented 5 years ago

thank you for your fast response!

after doing so, I got the following error on zola build

Building site...
-> Creating 0 pages (0 orphan), 0 sections, and processing 0 images
Failed to build the site
Error: Failed to render section '/Users/Raphael/Documents/Projects/my_site/content/_index.md'
Reason: Failed to render 'after-dark/templates/index.html'
Reason: Variable `paginator.pages` not found in context while rendering 'after-dark/templates/index.html'

my _index.md file is just under the content folder, perhaps it should be somewhere else?

Keats commented 5 years ago

Look at the after-dark repo https://github.com/getzola/after-dark it has a fully working site. For that error, it seems that you are not paginating your index, which the after-dark theme is expecting: https://github.com/getzola/after-dark/blob/master/content/_index.md

happysalada commented 5 years ago

I didn't know that the repo was an implementation of the theme. That makes things much easier, thank you!

I had a typo, in my _index.md, I wrote paginated_by instead of paginate_by. Thank you for the help!