Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Themes Results in Failure to Serve #1623

Closed
joesan opened this issue Sep 17, 2021 · 5 comments
Closed

Using Themes Results in Failure to Serve #1623

joesan opened this issue Sep 17, 2021 · 5 comments

Comments

@joesan
Copy link

joesan commented Sep 17, 2021

Bug Report

I created a new Zola project and in the themes folder, I downloaded a Github repo of a theme that I'm interested in, but upon doing zola serve, I run into errors.

Environment

Ubuntu 20.04
rustc 1.50.0 (cb75ad5db 2021-02-10)

Zola version:
zola 0.14.1

Expected Behavior

I would have expected that the blog uses the theme and renders

Current Behavior

joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/github-docs/my-blog$ zola serve
Building site...
Checking all internal links with anchors.

Successfully checked 0 internal link(s) with anchors.
-> Creating 0 pages (0 orphan), 0 sections, and processing 0 images
Error: Failed to render section '/home/joesan/Projects/Private/github-docs/my-blog/content/_index.md'
Reason: Failed to render 'index.html' (error happened in a parent template)
Reason: Variable config.extra.navbar_items not found in context while rendering 'index.html'
joesan@joesan-InfinityBook-S-14-v5:~/Projects/Private/github-docs/my-blog$

Step to reproduce

$ zola init myblog
$ cd themes
$ git clone https://github.com/RatanShreshtha/DeepThought.git
$ cd ..
$ zola serve

@Keats
Copy link
Collaborator

Keats commented Sep 17, 2021

You need to have a look at the theme README: https://github.com/RatanShreshtha/DeepThought#how-to-serve
Every theme can have some require config

@Keats Keats closed this as completed Sep 17, 2021
@joesan
Copy link
Author

joesan commented Sep 17, 2021

I did follow the documentation and the associated README, but something is wrong. I have also given the steps to reproduce and I have also added the theme to config.toml, but still it results in this failure.

@Keats
Copy link
Collaborator

Keats commented Sep 17, 2021

You need to put navbar_items in the [extra] section like so:

[extra]
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" },
 ]},
]

@joesan
Copy link
Author

joesan commented Sep 17, 2021

Ok now the confusion is where this extra should be placed. I have it in the config.toml which is located inside the themes&DeepThought folder, but I need to bring it out in the config.toml of the top level folder.

@joesan
Copy link
Author

joesan commented Sep 17, 2021

There is some fundamental documentation missing. Could this be because of the fact that I have git cloned the DeepThought theme inside the themes folder. My understanding was this is how I should do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants