From a3fa903a3eaa2e32ed5f23ecfbdf7eef78354101 Mon Sep 17 00:00:00 2001 From: geekifan Date: Sun, 20 Apr 2025 14:29:17 +0800 Subject: [PATCH] add sidebar --- hugo.toml | 16 ++++++++++++++++ layouts/_default/baseof.html | 4 ++-- layouts/partials/sidebar.html | 36 +++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/sidebar.html diff --git a/hugo.toml b/hugo.toml index 7e568b8..7ceaaa4 100644 --- a/hugo.toml +++ b/hugo.toml @@ -1,3 +1,19 @@ baseURL = 'https://example.org/' languageCode = 'en-us' title = 'My New Hugo Site' + +[module] +[[module.imports]] +path = "github.com/gohugoio/hugo-mod-bootstrap-scss/v5" + +[[menu.main]] + name = "首页" + url = "/" + weight = 10 + pre = "fa-solid fa-house" + +[[menu.main]] + name = "关于" + url = "/about/" + weight = 20 + pre = "fa-solid fa-house" \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 19480e6..3b5a68d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -5,13 +5,13 @@ "targetPath" "css/main.css" "enableSourceMap" true }} - {{ $sass := resources.Get "sass/main.scss" }} + {{ $sass := resources.Get "scss/main.bundle.scss" }} {{ $style := $sass | toCSS $opts | minify | fingerprint }} - + {{ partial "sidebar.html" . }}
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..2829f5e --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,36 @@ + + + \ No newline at end of file