cydave / zola-theme-papermod

https://cydave.github.io/zola-theme-papermod/
MIT License
50 stars 8 forks source link

Issues with initial installation #5

Open oschrenk opened 6 months ago

oschrenk commented 6 months ago

Thank you for the theme! I had some issue setting up papermod from the given instructions. These were the three things tripping me up:

  1. Missing taxonomy definition
Error: Failed to serve the site
Error: Page `/Users/oliver/Projects/personal/oschrenk.dev/content/content/posts/papermod-installation.md` has taxonomy `tags` which is not defined in config.toml

This was solved by adding

taxonomies = [
  { name = "tags", feed = true},
]

to the main body of the config

  1. Missing Extra config
Error: Failed to serve the site
Error: Failed to render pager 1
Error: Reason: Failed to render 'section.html' (error happened in 'index.html').
Error: Reason: Variable `config.extra.papermod.language_direction` not found in context while rendering 'section.html'

The installation procedure does mention to copy sample files, which makes the extra config required. But the extra config is missing in the installation procedure.

This was solved by adding the [extra.papermod] section of the sample config to my config.

  1. Section posts/_index.md not found
Error: Failed to serve the site
Error: Failed to render section '/Users/oliver/Projects/personal/oschrenk.dev/content/_index.md'
Error: Reason: Failed to render 'index.html' (error happened in a parent template)
Error: Reason: Function call 'get_section' failed
Error: Reason: Section `posts/_index.md` not found.

This is a misunderstanding between an initial empty setup of zola and the theme.

a) zola init creates an empty content directory already b) cp -r themes/papermod/content content as outlined in the installation procedure actually actually then copies the content into the existing content, resulting in a directory structure like

content/
  content/
    _index.md
    ...

This was solved via

rm -rf content/content
cp -r themes/papermod/content/* content/
yanniskatsaros commented 1 month ago

I'm on zola --version: 0.19.1 and it appears that the configuration schema has changed regarding feeds, specifically:

# ...

# When set to "true", a feed is automatically generated.
generate_feeds = false

# The filenames to use for the feeds. Used as the template filenames, 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_filenames = ["atom.xml"]

# ...

this change causes building the site with PaperMod to break in a variety of places, specifically in the following templates that reference the generate_feed and feed_filename attribute which no longer appears to be valid:

Aside from overriding these templates in my own project, is there a known-workaround for dealing with this issue?

Would you be open to PR's to fix the templates in this repo directly?

cydave commented 1 month ago

Sure thing, please feel free! I'm unfortunately no longer using zola - but I'll gladly accept PRs so that people who like this theme can profit from eachothers fixes.

Thanks!