Alan's BLOG
  • archives
  • posts
  • tags
  • about
  • quote
  • search
Home » Tags

hugo

Hugo Setup

紀錄一下hugo的建置過程 1. 安裝hugo windows安裝 Chocolatey choco install hugo -confirm Scoop scoop install hugo macos安裝 brew install hugo linux安裝 sudo apt-get install hugo 2. 建立網站 hugo new site myblog -f yaml 3. 下載主題 git clone https://github.com/adityatelange/hugo-PaperMod themes/PaperMod --depth=1 4. 建立about, tags page 建立about page hugo new about.md 修改config檔 menu: main: - identifier: tags name: tags url: /tags/ weight: 1 - identifier: about name: about url: /about/ weight: 2 5. 依照需求美化版面 Hugo PaperMod 優化...

2022-10-30 · 1 min · 86 words · Alan

Hugo PaperMod 優化

簡單紀錄一下papermod主題的優化,持續更新… 1. 目錄放側邊 替換以下路徑的code layouts/partials/toc.html {{- $headers := findRE "<h[1-6].*?>(.|\n])+?</h[1-6]>" .Content -}} {{- $has_headers := ge (len $headers) 1 -}} {{- if $has_headers -}} <aside id="toc-container" class="toc-container wide"> <div class="toc"> <details {{if (.Param "TocOpen") }} open{{ end }}> <summary accesskey="c" title="(Alt + C)"> <span class="details">{{- i18n "toc" | default "Table of Contents" }}</span> </summary> <div class="inner"> {{- $largest := 6 -}} {{- range $headers -}} {{- $headerLevel := index (findRE "[1-6]" ....

2022-10-30 · 6 min · 1067 words · Alan
© 2024 艾倫的程式之旅 Powered by Hugo & PaperMod