From 7653cfed544c18f99b2a24acf2ebd97ca17055d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Romanowski?= Date: Tue, 5 Feb 2019 19:13:23 +0000 Subject: [PATCH] Fix relative URL handling --- README.md | 9 +++++---- config.toml | 10 ++++++---- templates/macros/menu.html | 12 +++++++----- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4eaa0f0..e8ef6f9 100644 --- a/README.md +++ b/README.md @@ -204,13 +204,14 @@ of your `config.toml`: # menu is enabled by adding menu_items (optional) menu_items = [ # each of these is optional, name and url are required - {name = "blog", url = "/"}, + # $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 = "/tags"}, - {name = "archive", url = "/archive"}, - {name = "about me", url = "/about"}, + {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}, diff --git a/config.toml b/config.toml index 424cb48..49188f5 100644 --- a/config.toml +++ b/config.toml @@ -1,3 +1,4 @@ +# Be sure to change these! base_url = "https://pawroman.github.io/zola-theme-terminimal" title = "Zola Terminimal theme" @@ -43,13 +44,14 @@ logo_text = "Terminimal theme" # menu is enabled by adding menu_items (optional) menu_items = [ # each of these is optional, name and url are required - {name = "blog", url = "/"}, + # $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 = "/tags"}, - {name = "archive", url = "/archive"}, - {name = "about me", url = "/about"}, + {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 = "https://github.com/pawroman/zola-theme-terminimal", newtab = true}, diff --git a/templates/macros/menu.html b/templates/macros/menu.html index ffbdfae..b7604f3 100644 --- a/templates/macros/menu.html +++ b/templates/macros/menu.html @@ -5,9 +5,11 @@