From 942f9d91bfdb94f4ee2699c7525ef582c0a7f79e Mon Sep 17 00:00:00 2001 From: Chen Xianmin Date: Tue, 6 Sep 2022 20:25:56 +0800 Subject: fix: menu active see: https://github.com/gohugoio/hugo/issues/9150#issuecomment-965798975 --- dev-config.toml | 18 +++++++++--------- exampleSite/config.toml | 12 ++++++------ exampleSite/full-config.toml | 12 ++++++------ layouts/partials/header.html | 2 +- theme.toml | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/dev-config.toml b/dev-config.toml index 8f9006a..3018eb3 100644 --- a/dev-config.toml +++ b/dev-config.toml @@ -39,13 +39,13 @@ defaultContentLanguage = "en" # Default language to use (if you setup multiling name = "Home" weight = 10 identifier = "home" - url = "/" + pageref = "/" [[languages.en.menu.main]] name = "Docs" weight = 11 identifier = "docs" - url = "/categories/docs/" + pageref = "/categories/docs/" # docs submenu #[[languages.en.menu.main]] @@ -58,17 +58,17 @@ defaultContentLanguage = "en" # Default language to use (if you setup multiling name = "Archives" weight = 20 identifier = "archives" - url = "/post/" + pageref = "/post/" [[languages.en.menu.main]] name = "Tags" weight = 30 identifier = "tags" - url = "/tags/" + pageref = "/tags/" [[languages.en.menu.main]] name = "Categories" weight = 40 identifier = "categories" - url = "/categories/" + pageref = "/categories/" [[languages.en.menu.main]] name = "external-link" weight = 50 @@ -78,22 +78,22 @@ defaultContentLanguage = "en" # Default language to use (if you setup multiling name = "主页" weight = 10 identifier = "home" - url = "zh-cn/" + pageref = "zh-cn/" [[languages.zh-cn.menu.main]] name = "归档" weight = 20 identifier = "archives" - url = "zh-cn/post/" + pageref = "zh-cn/post/" [[languages.zh-cn.menu.main]] name = "标签" weight = 30 identifier = "tags" - url = "zh-cn/tags/" + pageref = "zh-cn/tags/" [[languages.zh-cn.menu.main]] name = "分类" weight = 40 identifier = "categories" - url = "zh-cn/categories/" + pageref = "zh-cn/categories/" [[languages.zh-cn.menu.main]] name = "外部链接" weight = 50 diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 11b08fe..a43eaae 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -32,26 +32,26 @@ defaultContentLanguage = "en" # Default language to use name = "This is Home" weight = 10 identifier = "home" - url = "/" + pageref = "/" [[menu.main]] name = "Archives" weight = 20 identifier = "archives" - url = "/post/" + pageref = "/post/" [[menu.main]] name = "Tags" weight = 30 identifier = "tags" - url = "/tags/" + pageref = "/tags/" [[menu.main]] name = "Categories" weight = 40 identifier = "categories" - url = "/categories/" + pageref = "/categories/" [[menu.main]] name = "external-link" weight = 50 - url = "https://gohugo.io" + pageref = "https://gohugo.io" [params] @@ -72,7 +72,7 @@ defaultContentLanguage = "en" # Default language to use toc = true # 是否开启目录 photoswipe = true # see https://github.com/dimsemenov/PhotoSwipe # 是否启用PhotoSwipe(图片可点击) contentCopyright = 'CC BY-NC-ND 4.0' - + # Link custom CSS and JS assets # (relative to /static/css and /static/js respectively) customCSS = [] # if ['custom.css'], load '/static/css/custom.css' file diff --git a/exampleSite/full-config.toml b/exampleSite/full-config.toml index 2f847de..9642a6e 100644 --- a/exampleSite/full-config.toml +++ b/exampleSite/full-config.toml @@ -43,26 +43,26 @@ defaultContentLanguage = "en" # Default language to use name = "Home" weight = 10 identifier = "home" - url = "/" + pageref = "/" [[menu.main]] name = "Archives" weight = 20 identifier = "archives" - url = "/post/" + pageref = "/post/" [[menu.main]] name = "Tags" weight = 30 identifier = "tags" - url = "/tags/" + pageref = "/tags/" [[menu.main]] name = "Categories" weight = 40 identifier = "categories" - url = "/categories/" + pageref = "/categories/" [[menu.main]] name = "external-link" weight = 50 - url = "https://gohugo.io" + pageref = "https://gohugo.io" [params] @@ -94,7 +94,7 @@ defaultContentLanguage = "en" # Default language to use showMenuLanguageChooser = true showAuthorInfo = true # show author info below the article - + # Optional custom wallpaper image URL. Can be a remote image or local /static/img/wallpaper.jpg (make sure it has a small filesize for quick site painting) # wallpaper = "/static/img/wallpaper.jpg" wallpaper = "https://followingmyfeet.com/wp-content/uploads/2018/02/825_2229-HDR.jpg" diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 0895ca2..f9e1d97 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -12,7 +12,7 @@