加入留言系統到 blog 中

前言 仔細看了一下 stack 這個主題還能加入什麼小工具,發現它支援很多不同的留言系統,在簡單比較之後決定使用 Utterances ,最簡單也可以整合到 GitHub 上。 步驟 建立一個 Public GitHub Repo 在 config.yaml or hugo.toml 中修改以下內容 params: comments: enabled: true provider: utterances utterances: repo: <github-username>/<github-repo-name> issueTerm: og:title theme: github-dark [params.comments] enabled = true provider = "utterances" [params.comments.utterances] repo = "<github-username>/<github-repo-name>" issueTerm = "og:title" theme = "github-dark" 參考資源 Utteranc 官方網站

2023-11-30 · 51 words · SekiXu

在 Blog 中加入搜尋的小工具

前言 在我使用的 Stack Theme 中可以使用各種小工具,像是文章類別或是標籤雲等等,但是加入文章搜尋器需要多幾個步驟,稍微研究了一下,簡單記錄一下如何加入。 步驟 建立 content/page/search 的資料夾。 在 content/page/search 中建立 index.md 輸入以下內容 --- title: "Search" layout: "search" outputs: - html - json # 如果想在 sidebar 下面加上 search page link # 把下面這段取消註解 # menu: # main: # weight: -60 # params: # icon: search --- 修改 themes/hugo-theme-stack/config.yaml 如下 params: widgets: homepage: - type: search 最後重新開啟伺服器就可以看到小工具加成功了🎉

2023-11-30 · 56 words · SekiXu

hugo 主題設定檔

前言 原本以為設定檔只能在主題的 config.yaml 中設定,後來發現可以統一併到 hugo.toml 裡面,但是 stack 這個主題好像沒有提供 toml 語法的設定檔,所以我修改好了一份 toml 格式的設定檔。 範本 baseURL = "https://sample.base-url.com/" languageCode = "zh-tw" title = "sample title" theme = "hugo-theme-stack" [params] mainSections = ["posts"] featuredImageField = "image" rssFullContent = true [params.footer] since = 2023 [params.dateFormat] published = "2006-01-02" lastUpdated = "2006-01-02" [params.sidebar] compact = false emoji = "" subtitle = "" [params.sidebar.avatar] enabled = true local = true src = "images/avatar.png" [params.article] readingTime = true [params....

2023-11-30 · 135 words · SekiXu

用 Hugo 建立個人技術部落格

目的 只透過 notion 寫筆記好像沒辦法讓自己的筆記有人看到,所以想試試看用 hugo 會不會比較有動力 選擇 我參考的是這位大大提供的比較,由於只需要最簡單的 Markdown,也不需要其他多餘的功能,所以就選擇目前最多星星的 Hugo 了 步驟 先到 Hugo 的官網安裝好 hugo 和 git 痾.. 就這樣 😀 指令 建立新網站 hugo new site quickstart cd quickstart git init run local server 本來想說想打中文,但是”運行本地伺服器”實在太怪了 🤣 # run server without draft hugo server # run server with draft hugo server -D 新增主題 # sample command git submodule add <github-url> themes/<theme-name> echo "theme = '<theme-name>'" >> hugo.toml # sample git submodule add https://github....

2023-11-30 · 120 words · SekiXu