From cbb9b577eab2656425dcd4d66df14af5b5d8e950 Mon Sep 17 00:00:00 2001 From: Kreee Date: Tue, 12 Dec 2023 11:53:55 +0800 Subject: [PATCH 01/12] Feat: migrate theme to v4 --- .github/workflows/publish-site.yml | 2 +- .github/workflows/test-build.yml | 41 ++++++ .gitignore | 4 +- .gitmodules | 3 - config.toml | 118 ++++++++++-------- content/archive.md | 1 - .../article/migrate-to-ubuntu-server/index.md | 4 +- .../article/openwrt-under-qemu-arm/index.md | 4 +- .../index.md | 2 +- .../setup-tun2socks-in-opnsense/index.md | 2 +- content/page/about.md | 2 +- content/page/donate.md | 2 +- content/page/is-furry.md | 1 - content/page/more-articles.md | 2 +- go.mod | 5 + themes/bilberry-hugo-theme | 1 - 16 files changed, 124 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/test-build.yml delete mode 100644 .gitmodules create mode 100644 go.mod delete mode 160000 themes/bilberry-hugo-theme diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml index 0e507132..3de0ac9d 100644 --- a/.github/workflows/publish-site.yml +++ b/.github/workflows/publish-site.yml @@ -20,7 +20,7 @@ jobs: uses: peaceiris/actions-hugo@v2 with: hugo-version: 'latest' - # extended: true + extended: true - name: Build run: hugo --minify diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml new file mode 100644 index 00000000..bbee22fc --- /dev/null +++ b/.github/workflows/test-build.yml @@ -0,0 +1,41 @@ +name: Publish site to Cloudflare Pages + +on: + workflow_dispatch: + +jobs: + + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + submodules: true + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' + extended: true + + - name: Build + run: hugo --minify + + - name: Upload Build Artifact + if: success() + uses: actions/upload-artifact@v3 + with: + name: build-result + path: public + if-no-files-found: error + + - name: Deploy to Cloudflare Pages + if: success() + uses: cloudflare/pages-action@v1.5.0 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: d73a30412652351305e3f89fd125f690 + projectName: blog + directory: public + branch: dev \ No newline at end of file diff --git a/.gitignore b/.gitignore index 50bdd7bd..d348586c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ public rafts build-res resources -.hugo_build.lock \ No newline at end of file +.hugo_build.lock +go.sum +_vendor \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c3dcc133..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "themes/bilberry-hugo-theme"] - path = themes/bilberry-hugo-theme - url = https://github.com/Lednerb/bilberry-hugo-theme diff --git a/config.toml b/config.toml index ba71cb4d..00354cd0 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,11 @@ title = "Kreee's Blog" baseURL = "https://blog.ohmykreee.top" -theme = "bilberry-hugo-theme" + +# Option 1 (recommended): adding the theme as a Hugo module +theme = "github.com/Lednerb/bilberry-hugo-theme/v4" + +# Options 2 and 3: cloning/copying the theme files +# theme = "bilberry-hugo-theme/v4" # Generate the robots.txt file for SEO enableRobotsTXT = true @@ -9,17 +14,13 @@ enableRobotsTXT = true DefaultContentLanguage = "zh-cn" # Enable / Disable Google Analytics statistics for your site -# googleAnalytics = "UA-198973792-1" +googleAnalytics = "" # Enable / Disable comments on the articles via Disqus. -# disqusShortname = "" - -# Enable / Disable open link with a new tab. -[blackfriday] - hrefTargetBlank = true +disqusShortname = "" [params] - # Custom CSS / JS modules that will be imported by the template. + # Custom CSS/JS modules that will be imported by the template. # Files are relative to the static/ directory or a URL. # Files are imported in the order they appear here, after # theme.css and theme.js, respectively. @@ -29,7 +30,7 @@ DefaultContentLanguage = "zh-cn" # Description and meta data for the search engines author = "Kreee" description = "A Kreee's Blog, powered by GitHub Pages, Hugo and Bilberry Premium Theme for Hugo." - keywords = "kreee,blog,personal,responsive,font awesome,pages,posts,highlight.js,syntax highlighting,hugo" + keywords = "kreee,blog,personal,responsive,search,font awesome,pages,posts,syntax highlighting,shortcuts" # How many articles should be displayed at once? paginate = 7 @@ -42,7 +43,7 @@ DefaultContentLanguage = "zh-cn" algolia_appId = "BYCFQKEA4W" algolia_apiKey = "5b8f1a1d7557fc3b1bc0d99efbaa22ce" algolia_indexName = "kreee-blog" - # Set this option to false if you want to search within all articles in all languages at once + # Set this option to false if you want to search within all articles in all languages at once algolia_currentLanguageOnly = false # Enable / Disable comments on the articles via commento @@ -62,13 +63,13 @@ DefaultContentLanguage = "zh-cn" giscusLanguage = "zh-CN" giscusCrossOrigin = "anonymous" - # Enable / Disable Utterances comments - utterances = false - utterancesJsUrl = "https://utteranc.es/client.js" - utterancesRepository = "ohmykreee/kreee-blog" - utterancesIssueTerm = "og:title" - utterancesLabel = "Comment" - utterancesTheme = "github-light" + # Enable / Disable Utterances comments + utterances = false + utterancesJsUrl = "https://utteranc.es/client.js" + utterancesRepository = "[ENTER REPO HERE]" + utterancesIssueTerm = "pathname" + utterancesLabel = "Comment" + utterancesTheme = "github-light" utterancesCrossOrigin = "anonymous" # Media configuration @@ -82,7 +83,7 @@ DefaultContentLanguage = "zh-cn" subtitle = "Code with love ❤ and paws 🐾!" # if you want to use libravatar or gravatar for the header image - # avatarEmail = "code@lednerb.de" + avatarEmail = "" # set an path to the image file you want to use | overwrites avatar by email customImage = "https://avatars.githubusercontent.com/u/76862878" @@ -106,10 +107,10 @@ DefaultContentLanguage = "zh-cn" # Set to true to pin only to the first page, false to all pages pinOnlyToFirstPage = true - # enable automatic localization of the article's PublishedDate with momentjs + # enable automatic localization of the article's published date using Moment.js enableMomentJs = true - # customize the date format | only works if momentjs is disabled | only works with English month names + # customize the date format | only works if Moment.js is disabled | only works with English month names # you can customize it with the options you find here: # https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference dateFormat = "2006-01-02" @@ -137,22 +138,22 @@ DefaultContentLanguage = "zh-cn" # social media profile urls for the footer links showSocialMedia = true - # show an archive link in the footer - showArchive = false - - # archive grouping: "2006" by year, "2006-01" by month - archiveDateGrouping = "2006年01月" - # define your links with FontAwesome 5 (only free icons are supported) # all icons https://fontawesome.com/icons?d=gallery&m=free # brand icons https://fontawesome.com/icons?d=gallery&s=brands&m=free socialMediaLinks = [ { link = "https://github.com/ohmykreee", icon = "fab fa-github", rel = "me" }, { link = "https://twitter.com/kre_pow3", icon = "fab fa-twitter", rel = "me" }, - { link = "https://space.bilibili.com/361507684", icon = "fas fa-video", rel = "me" }, - { link = "https://www.ohmykreee.top", icon = "fas fa-book", rel = "me" }, + { link = "https://space.bilibili.com/361507684", icon = "fab fa-bilibili", rel = "me" }, + { link = "https://www.ohmykreee.top", icon = "fas fa-globe", rel = "me" }, ] + # show an archive link in the footer + showArchive = false + + # archive grouping: "2006" by year, "2006-01" by month + archiveDateGrouping = "2006-01" + # credits line configuration copyrightBy = "by Kreee" copyrightUseCurrentYear = false # set to true to always display the current year in the copyright @@ -163,36 +164,47 @@ DefaultContentLanguage = "zh-cn" # customize your available languages for your multi-lingual site -# or delete the [Languages] blog to use the theme with only one supported language -#[Languages] -# [Languages.en] -# weight = 1 -# [Languages.de] -# weight = 2 -# title = "Mein cooler neuer Blog" -# subtitle = "Hallo Welt! Dies ist der epischste Untertitel aller Zeiten." - -# don't change anything below -[taxonomies] - author = "author" - tag = "tags" - category = "categories" - series = "series" - -[outputs] - home = [ "HTML", "JSON", "RSS" ] - page = [ "HTML" ] +# or delete one of the [Languages.xx] blocks to use the theme with only one supported language +[Languages] + [Languages.zh-cn] + weight = 1 + # [Languages.de] + # weight = 2 + # title = "Mein cooler neuer Blog" + # subtitle = "Hallo Welt! Dies ist der epischste Untertitel aller Zeiten." [markup] - defaultMarkdownHandler = "goldmark" - [markup.goldmark] + defaultMarkdownHandler = 'goldmark' + [markup.goldmark] [markup.goldmark.renderer] - # Change to 'true' if you need to render raw HTML whithin your markdown content - hardWraps = false + # change to 'true' if you need to render raw HTML within your markdown content unsafe = true - xhtml = false - + [markup.highlight] + anchorLineNos = false + codeFences = true + guessSyntax = false + hl_Lines = '' + hl_inline = false + lineAnchors = '' + lineNoStart = 1 + lineNos = false + lineNumbersInTable = true + noClasses = true + noHl = false + style = 'monokai' + tabWidth = 4 [markup.tableOfContents] endLevel = 5 ordered = false startLevel = 2 + +# do NOT change anything below +[taxonomies] + author = "author" + tag = "tags" + category = "categories" + series = "series" + +[outputs] + home = [ "HTML", "JSON", "RSS" ] + page = [ "HTML" ] \ No newline at end of file diff --git a/content/archive.md b/content/archive.md index 97a78216..5ad71aed 100644 --- a/content/archive.md +++ b/content/archive.md @@ -1,5 +1,4 @@ --- title: "文章列表" type: archive -excludeFromIndex: true --- diff --git a/content/article/migrate-to-ubuntu-server/index.md b/content/article/migrate-to-ubuntu-server/index.md index b5debe2c..ba7d2539 100644 --- a/content/article/migrate-to-ubuntu-server/index.md +++ b/content/article/migrate-to-ubuntu-server/index.md @@ -86,7 +86,7 @@ sudo apt install linux-wifi-hotspot apt install dnsmasq ``` 编辑 `/etc/create_ap.conf` ([示例文件](https://github.com/lakinduakash/linux-wifi-hotspot/blob/master/src/scripts/create_ap.conf)) -```conf +```bash GATEWAY=192.168.6.1 SHARE_METHOD=nat COUNTRY=CN @@ -195,7 +195,7 @@ sudo bash ./kickstart.sh --local-files /tmp/netdata/netdata-(version-number-here > 参考:https://ehang-io.github.io/ 先将提前下好的 npc 文件复制到 `/tmp/npc` 下,并创建配置文件 `/etc/np-client.conf` : -```conf +```bash [common] server_addr=cloud.ip:8024 conn_type=kcp diff --git a/content/article/openwrt-under-qemu-arm/index.md b/content/article/openwrt-under-qemu-arm/index.md index e734339c..ffa0d8e9 100644 --- a/content/article/openwrt-under-qemu-arm/index.md +++ b/content/article/openwrt-under-qemu-arm/index.md @@ -59,7 +59,7 @@ dmesg | grep -e DMAR -e IOMMU ``` 启用 IOMMU: 更改 `/etc/default/grub` 添加内核启动参数: -```conf +```bash GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on" ``` 应用更改: @@ -88,7 +88,7 @@ IOMMU Group 19: ``` 这里可以看到 Wi-Fi 卡在单独的一个 IOMMU Group 里,所以就不需要进行分离。 解绑并绑定到 vfio-pci 上(通过添加内核启动参数): -```conf +```bash # 两个参数之间只需要一个空格隔开就行,不同设备 ID 只需要用逗号隔开 GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on vfio-pci.ids=8086:2723" ``` diff --git a/content/article/setup-pve-with-opnsense-ubuntu-notes/index.md b/content/article/setup-pve-with-opnsense-ubuntu-notes/index.md index 7b4e3c03..85cc3260 100644 --- a/content/article/setup-pve-with-opnsense-ubuntu-notes/index.md +++ b/content/article/setup-pve-with-opnsense-ubuntu-notes/index.md @@ -60,7 +60,7 @@ done; 由于我有一张无线网卡,想要直通到 OPNsense 所在的虚拟机中。而直接设置直通的话 qemu 会报错:`failed to add PCI capability 0x11[0x70]@0x90: table & pba overlap, or they don't fit in BARs, or don't align`。 这里就需要多做一步:修改 pve 的 `/etc/pve/qemu-server/[虚拟机ID].conf`,在文件一行加上: -```conf +```bash # 这里无线网卡在虚拟机中分配到的是 hostpci4,按需修改 args: -set device.hostpci4.x-msix-relocation=bar2 ``` diff --git a/content/article/setup-tun2socks-in-opnsense/index.md b/content/article/setup-tun2socks-in-opnsense/index.md index 1db98ce1..b44ca003 100644 --- a/content/article/setup-tun2socks-in-opnsense/index.md +++ b/content/article/setup-tun2socks-in-opnsense/index.md @@ -100,7 +100,7 @@ tun2socks_enable="YES" ----- ## 新建 configd 文件 新建文件 `/usr/local/opnsense/service/conf/actions.d/actions_tun2socks.conf` 并填写以下内容: -```conf +```bash [start] command:/usr/local/etc/rc.d/tun2socks start parameters: diff --git a/content/page/about.md b/content/page/about.md index cc2a0eb5..b18c33ff 100644 --- a/content/page/about.md +++ b/content/page/about.md @@ -2,7 +2,7 @@ title: "关于我" date: 2021-06-05T23:05:37+08:00 draft: false -excludeFromTopNav: false +menu: "topnav" weight: 1 # set the link if you want to redirect the user. diff --git a/content/page/donate.md b/content/page/donate.md index 90851630..2e1b9a70 100644 --- a/content/page/donate.md +++ b/content/page/donate.md @@ -2,7 +2,7 @@ title: "❤❤❤" date: 2021-06-06T17:20:33+08:00 draft: false -excludeFromTopNav: false +menu: "topnav" weight: 4 # set the link if you want to redirect the user. diff --git a/content/page/is-furry.md b/content/page/is-furry.md index 78a74fa2..26752bc6 100644 --- a/content/page/is-furry.md +++ b/content/page/is-furry.md @@ -2,7 +2,6 @@ title: "福瑞控?" date: 2021-06-05T23:15:12+08:00 draft: false -excludeFromTopNav: true icon: "fas fa-paw" # set the link if you want to redirect the user. diff --git a/content/page/more-articles.md b/content/page/more-articles.md index 6c4f036f..e5263d8b 100644 --- a/content/page/more-articles.md +++ b/content/page/more-articles.md @@ -2,7 +2,7 @@ title: "文章列表" date: 2021-06-06T11:10:41+08:00 draft: false -excludeFromTopNav: false +menu: "topnav" weight: 2 # set the link if you want to redirect the user. diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..97e79cb4 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/ohmykreee/kreee-blog + +go 1.21.5 + +require github.com/Lednerb/bilberry-hugo-theme/v4 v4.2.1 // indirect diff --git a/themes/bilberry-hugo-theme b/themes/bilberry-hugo-theme deleted file mode 160000 index df5da506..00000000 --- a/themes/bilberry-hugo-theme +++ /dev/null @@ -1 +0,0 @@ -Subproject commit df5da5062e6b101e65efca1294f8d4e875128497 From 0f5736c3de3a0c07074b509342323768c0fc6bf4 Mon Sep 17 00:00:00 2001 From: Kreee Date: Tue, 12 Dec 2023 11:55:06 +0800 Subject: [PATCH 02/12] Fix: change new test workflow name --- .github/workflows/test-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index bbee22fc..fe8805b5 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -1,4 +1,4 @@ -name: Publish site to Cloudflare Pages +name: Test building site on: workflow_dispatch: From dacaa1dc2b481cba2e64a77089ab4ac7befe9a9d Mon Sep 17 00:00:00 2001 From: Kreee Date: Tue, 12 Dec 2023 12:03:06 +0800 Subject: [PATCH 03/12] Fix: change go version in go.mod --- archetypes/page.md | 12 +++++++++--- go.mod | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/archetypes/page.md b/archetypes/page.md index 68015447..14e945b4 100644 --- a/archetypes/page.md +++ b/archetypes/page.md @@ -2,10 +2,16 @@ title: "{{ replace .Name "-" " " | title }}" date: {{ .Date }} draft: true -excludeFromTopNav: false +# comment out the menu and weight variables +# if you don't want to display this page in the top navigation bar +menu: topnav +weight: 10 -# set the link if you want to redirect the user. +# set the link variable if you want to redirect +# to another URL either relative or absolute link: "" -# set the html target parameter if you want to change default behavior +# set the target variable if you want to change default behavior, +# that is to open this page in a new tab; +# the target will be ignored if the link is empty target: "_blank" --- diff --git a/go.mod b/go.mod index 97e79cb4..eb669a32 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/ohmykreee/kreee-blog -go 1.21.5 +go 1.19 require github.com/Lednerb/bilberry-hugo-theme/v4 v4.2.1 // indirect From 68e953fa00b161b57e7f0e9d4e315a44ee8fec6e Mon Sep 17 00:00:00 2001 From: Kreee Date: Tue, 12 Dec 2023 19:27:18 +0800 Subject: [PATCH 04/12] Feat: enable dark mode --- config.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.toml b/config.toml index 00354cd0..f594829c 100644 --- a/config.toml +++ b/config.toml @@ -20,6 +20,8 @@ googleAnalytics = "" disqusShortname = "" [params] + enableLightDarkTheme = true + # Custom CSS/JS modules that will be imported by the template. # Files are relative to the static/ directory or a URL. # Files are imported in the order they appear here, after From 510544dd1d2456264868ecd515f2bb35414ddc7c Mon Sep 17 00:00:00 2001 From: Kreee Date: Tue, 12 Dec 2023 21:59:49 +0800 Subject: [PATCH 05/12] Fix: fetch module before build in test-build --- .github/workflows/test-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index fe8805b5..20d46f7b 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -20,7 +20,9 @@ jobs: extended: true - name: Build - run: hugo --minify + run: | + hugo mod get + hugo --minify - name: Upload Build Artifact if: success() From 430d4c3a4353567014ebc972edc84b8b99457448 Mon Sep 17 00:00:00 2001 From: Kreee Date: Wed, 13 Dec 2023 09:29:53 +0800 Subject: [PATCH 06/12] Revert "Fix: change go version in go.mod" This reverts commit dacaa1dc2b481cba2e64a77089ab4ac7befe9a9d. --- archetypes/page.md | 12 +++--------- go.mod | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/archetypes/page.md b/archetypes/page.md index 14e945b4..68015447 100644 --- a/archetypes/page.md +++ b/archetypes/page.md @@ -2,16 +2,10 @@ title: "{{ replace .Name "-" " " | title }}" date: {{ .Date }} draft: true -# comment out the menu and weight variables -# if you don't want to display this page in the top navigation bar -menu: topnav -weight: 10 +excludeFromTopNav: false -# set the link variable if you want to redirect -# to another URL either relative or absolute +# set the link if you want to redirect the user. link: "" -# set the target variable if you want to change default behavior, -# that is to open this page in a new tab; -# the target will be ignored if the link is empty +# set the html target parameter if you want to change default behavior target: "_blank" --- diff --git a/go.mod b/go.mod index eb669a32..97e79cb4 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/ohmykreee/kreee-blog -go 1.19 +go 1.21.5 require github.com/Lednerb/bilberry-hugo-theme/v4 v4.2.1 // indirect From e46d73e2d37b396446169fe3a04ac12e57a00050 Mon Sep 17 00:00:00 2001 From: Kreee Date: Wed, 13 Dec 2023 09:31:10 +0800 Subject: [PATCH 07/12] Chore: update archetypes/page --- archetypes/page.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/archetypes/page.md b/archetypes/page.md index 68015447..14e945b4 100644 --- a/archetypes/page.md +++ b/archetypes/page.md @@ -2,10 +2,16 @@ title: "{{ replace .Name "-" " " | title }}" date: {{ .Date }} draft: true -excludeFromTopNav: false +# comment out the menu and weight variables +# if you don't want to display this page in the top navigation bar +menu: topnav +weight: 10 -# set the link if you want to redirect the user. +# set the link variable if you want to redirect +# to another URL either relative or absolute link: "" -# set the html target parameter if you want to change default behavior +# set the target variable if you want to change default behavior, +# that is to open this page in a new tab; +# the target will be ignored if the link is empty target: "_blank" --- From d3d330b106284e6c673c0e9464c0200cf45be8a9 Mon Sep 17 00:00:00 2001 From: Kreee Date: Wed, 13 Dec 2023 10:16:53 +0800 Subject: [PATCH 08/12] Fix: upload go.sum to resolve build error --- .gitignore | 1 - config.toml | 7 ++++--- go.sum | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 go.sum diff --git a/.gitignore b/.gitignore index d348586c..1d8b6c54 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ rafts build-res resources .hugo_build.lock -go.sum _vendor \ No newline at end of file diff --git a/config.toml b/config.toml index f594829c..e03e5ae5 100644 --- a/config.toml +++ b/config.toml @@ -4,6 +4,7 @@ baseURL = "https://blog.ohmykreee.top" # Option 1 (recommended): adding the theme as a Hugo module theme = "github.com/Lednerb/bilberry-hugo-theme/v4" + # Options 2 and 3: cloning/copying the theme files # theme = "bilberry-hugo-theme/v4" @@ -14,7 +15,7 @@ enableRobotsTXT = true DefaultContentLanguage = "zh-cn" # Enable / Disable Google Analytics statistics for your site -googleAnalytics = "" +# googleAnalytics = "" # Enable / Disable comments on the articles via Disqus. disqusShortname = "" @@ -185,8 +186,8 @@ disqusShortname = "" anchorLineNos = false codeFences = true guessSyntax = false - hl_Lines = '' - hl_inline = false + # hl_Lines = '' + # hl_inline = false lineAnchors = '' lineNoStart = 1 lineNos = false diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..a9de93ea --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/Lednerb/bilberry-hugo-theme/v4 v4.2.1 h1:CVOXBzRhN+mmECQahX+fgdgKmChrxWlPdtLuSLwezDQ= +github.com/Lednerb/bilberry-hugo-theme/v4 v4.2.1/go.mod h1:EuKUIrQ8i/a2uxVuqZiUUK7FuoKsJ4UcolM1FYmLewM= From 0a22cea2229a4d910fdb2c68de78b9cf590fb4bc Mon Sep 17 00:00:00 2001 From: Kreee Date: Wed, 13 Dec 2023 10:20:12 +0800 Subject: [PATCH 09/12] Fix: setup golang in test-build --- .github/workflows/test-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 20d46f7b..2b444cc5 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -13,12 +13,16 @@ jobs: with: submodules: true + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: hugo-version: 'latest' extended: true - + - name: Build run: | hugo mod get From 06f1194d0e8ecbd536a0b1327f8f68229ee385a2 Mon Sep 17 00:00:00 2001 From: Kreee Date: Wed, 13 Dec 2023 20:08:56 +0800 Subject: [PATCH 10/12] Fix: use submodule to import theme --- .github/workflows/test-build.yml | 7 +------ .gitmodules | 3 +++ config.toml | 4 ++-- go.mod | 5 ----- go.sum | 2 -- themes/bilberry-hugo-theme | 1 + 6 files changed, 7 insertions(+), 15 deletions(-) create mode 100644 .gitmodules delete mode 100644 go.mod delete mode 100644 go.sum create mode 160000 themes/bilberry-hugo-theme diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 2b444cc5..f30e8057 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -13,10 +13,6 @@ jobs: with: submodules: true - - uses: actions/setup-go@v4 - with: - go-version-file: 'go.mod' - - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: @@ -25,7 +21,6 @@ jobs: - name: Build run: | - hugo mod get hugo --minify - name: Upload Build Artifact @@ -36,7 +31,7 @@ jobs: path: public if-no-files-found: error - - name: Deploy to Cloudflare Pages + - name: Deploy dev page to Cloudflare Pages if: success() uses: cloudflare/pages-action@v1.5.0 with: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..c3dcc133 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/bilberry-hugo-theme"] + path = themes/bilberry-hugo-theme + url = https://github.com/Lednerb/bilberry-hugo-theme diff --git a/config.toml b/config.toml index e03e5ae5..6c47b69d 100644 --- a/config.toml +++ b/config.toml @@ -2,11 +2,11 @@ title = "Kreee's Blog" baseURL = "https://blog.ohmykreee.top" # Option 1 (recommended): adding the theme as a Hugo module -theme = "github.com/Lednerb/bilberry-hugo-theme/v4" +# theme = "github.com/Lednerb/bilberry-hugo-theme/v4" # Options 2 and 3: cloning/copying the theme files -# theme = "bilberry-hugo-theme/v4" +theme = "bilberry-hugo-theme/v4" # Generate the robots.txt file for SEO enableRobotsTXT = true diff --git a/go.mod b/go.mod deleted file mode 100644 index 97e79cb4..00000000 --- a/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/ohmykreee/kreee-blog - -go 1.21.5 - -require github.com/Lednerb/bilberry-hugo-theme/v4 v4.2.1 // indirect diff --git a/go.sum b/go.sum deleted file mode 100644 index a9de93ea..00000000 --- a/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/Lednerb/bilberry-hugo-theme/v4 v4.2.1 h1:CVOXBzRhN+mmECQahX+fgdgKmChrxWlPdtLuSLwezDQ= -github.com/Lednerb/bilberry-hugo-theme/v4 v4.2.1/go.mod h1:EuKUIrQ8i/a2uxVuqZiUUK7FuoKsJ4UcolM1FYmLewM= diff --git a/themes/bilberry-hugo-theme b/themes/bilberry-hugo-theme new file mode 160000 index 00000000..4112324f --- /dev/null +++ b/themes/bilberry-hugo-theme @@ -0,0 +1 @@ +Subproject commit 4112324f6717038cb6775941022e31829b6652df From ce923fe41826a0ff6db00eba3c8f5da63dc2d957 Mon Sep 17 00:00:00 2001 From: Kreee Date: Wed, 13 Dec 2023 20:47:14 +0800 Subject: [PATCH 11/12] Fix: change hugo version to 0.109.0 in test-build --- .github/workflows/test-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index f30e8057..5fbf6c26 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: 'latest' + hugo-version: '0.109.0' extended: true - name: Build From 1259328d25cf7443d5d30c79ec84eeb26377398c Mon Sep 17 00:00:00 2001 From: Kreee Date: Wed, 13 Dec 2023 20:56:06 +0800 Subject: [PATCH 12/12] Revert "Fix: change hugo version to 0.109.0 in test-build" This reverts commit ce923fe41826a0ff6db00eba3c8f5da63dc2d957. --- .github/workflows/test-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 5fbf6c26..f30e8057 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.109.0' + hugo-version: 'latest' extended: true - name: Build