zola
zola copied to clipboard
A Clarification of my issue
Does zola
require one to publish in the root of the server? I have multiple blogs I would like to host under one domain name.
See #1497
It shouldn't
Does zola require one to publish in the root of the server? I have multiple blogs I would like to host under one domain name.
Nope, just make sure to configure your web server properly. In Apache, it means that you set the DocumentRoot
variable in your site's virtual host declaration to wherever the web root should be.
(cc @Keats— this should be closable)
I'm using Github Pages (without the TLD option).
I'm also using path
in the front matter.
Maybe this is the solution I'm looking for, but it seems doubtful.
In theory, if you use seperate folders for each site, you'd be fine. You can change the base_url
variable to reflect wherever you are on a site (eg. tripleo1.github.io/sitea
or tripeo1.github.io/siteb
, et al)
Right, that's in my config.toml
, but all links are still being generated in complete ignorance of this.
Make sure your base_url has http(s) otherwise it will generate relative links.
all links are still being generated in complete ignorance of this.
In zola build
or zola serve
? It's normal for zola serve
to override the links
In zola build or zola serve? It's normal for zola serve to override the links
That does remind me to make sure that you are using zola build
. zola serve
won't work with GitHub Pages; rather you need to build the site with something like Travis or GitHub Actions.
I use zola serve
to edit locally, and I use https://github.com/shalzz/zola-deploy-action to deploy to github pages. Works like a charm except for the issue I'm describing.
And I am using https
in base_url
. zola serve
indeed ignores the base url.
Which url does it use?
The deploy-action makes all links relative to root. I would expect (as I'm guessing you all are describing) that this would use the base_url, but it doesn't.
And zola serve
makes all links relative to root.
The deploy-action makes all links relative to root. I would expect (as I'm guessing you all are describing) that this would use the base_url, but it doesn't.
I'm a bit confused, in zola build
all links by Zola are prefixed with the base_url. It does not inspect random links in HTML or Markdown to prefix them though.
I just tried a zola build
on my local machine and it doesn't generate links prefixed by base_url, so the plugin is not to blame, which I thought at first.
Are there any requirements of base_url
, because mine is prefixed by https://
.
Can you show an example of links not being prefixed? Where it's defined etc
The last line in this file, for example:
https://raw.githubusercontent.com/elijah-team/programming-with-elijah/main/blog/content/edition-2/posts/01-freestanding-rust-binary/index.md
which points to
https://elijah-team.github.io/programming-with-elijah/namespaces-and-packages/
But only after massaging with command line tools.
Note that I am using path
s in the front matter. Could this be the source?
The first link is a 404 for me
Sorry, I did some reorganization
Here
https://raw.githubusercontent.com/elijah-team/programming-with-elijah/main/blog/content/edition-2/posts/01-organizing-classes/index.md
That just shows @/path/.../xyz.md
I took the file on an empty new zola project and it seems to work for me? I'm using the next
branch so it might be in some bug already fixed?
Try to build the whole project with next. It fails.
Failed to build the site
Error: invalid type: sequence, expected a map for key `languages` at line 37 column 1
The config has been changed for the next version for languages since there are now more language specific options. See https://github.com/getzola/zola/blob/next/test_site_i18n/config.toml#L19-L27 for an example of the new way to define them.
Thanks for your help.
What about this one:
Error: invalid type: map, expected a string for key `translations.en`
I searched the website and the repository sample sites and didn't find anything.
Translations are now nested on their language definitions: https://github.com/getzola/zola/blob/next/components/config/src/config/mod.rs#L501-L511
I'm having a hard time using the translations in a template.
How would you render description
dynamically in this case?
[translations]
description = "Une description"
[languages.en]
[languages.en.translations]
description = "A description"
This does not work:
<meta name="description" content="{{config.languages[lang].description}}" />
Error:
Variable `config.languages[lang].description` not found in context while rendering 'page.html': the evaluated version was `config.languages.en.description`. Maybe the index is out of bounds?
Config are now language aware in the templates, so you just need to do config.translations.description
The new error:
Reason: Failed to render 'page.html' (error happened in 'index.html').
Reason: Variable `config.translations.description` not found in context while rendering 'page.html'
Sorry, I forgot the translations are not passed to the templates. You have to use https://www.getzola.org/documentation/templates/overview/#trans
Translations are now nested on their language definitions: https://github.com/getzola/zola/blob/next/components/config/src/config/mod.rs#L501-L511
I think this should be documented, unless I missed that when reading the documentation site. I was breaking my head trying to figure this out until I stumbled upon this issue. Also this documentation page https://www.getzola.org/documentation/content/multilingual/ seems to be outdated.
Ah damn I forgot this needed updating as well.
On 8/31/21 10:36 AM, Yaroslav wrote:
Translations are now nested on their language definitions: https://github.com/getzola/zola/blob/next/components/config/src/config/mod.rs#L501-L511 <https://github.com/getzola/zola/blob/next/components/config/src/config/mod.rs#L501-L511>
I think this should be documented, unless I missed that when reading the documentation site. I was breaking my head trying to figure this out until I stumbled upon this issue. Also this documentation page https://www.getzola.org/documentation/content/multilingual/ https://www.getzola.org/documentation/content/multilingual/ seems to be outdated.
So what exactly is the syntax? (And where does it go?)
I've been meaning to ask this for weeks but just never got around to it...
On 21/09/03 01:12AM, tripleo1 wrote:
So what exactly is the syntax? (And where does it go?)
I've been meaning to ask this for weeks but just never got around to it... You can take look at my website's
config.toml
if it's of any help: https://git.yaroslavps.com/yaroslavps.com/tree/config.toml
https://www.getzola.org/documentation/content/multilingual/ has been updated