Skip to content

Commit

Permalink
deps: hugoplate 從 1.7.6 升級至 1.13.6
Browse files Browse the repository at this point in the history
  • Loading branch information
chugiau committed Apr 20, 2024
1 parent 812e5bf commit 73f43ef
Show file tree
Hide file tree
Showing 51 changed files with 739 additions and 552 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ permissions:
# Environment variables available to all jobs and steps in this workflow
env:
HUGO_ENV: production
HUGO_VERSION: "0.118.2"
GO_VERSION: "1.21.0"
NODE_VERSION: "18.15.0"
HUGO_VERSION: "0.124.1"
GO_VERSION: "1.22.2"
NODE_VERSION: "20.0.0"
TINA_CLIENT_ID: ${{ vars.TINA_CLIENT_ID }}
TINA_TOKEN: ${{ vars.TINA_TOKEN }}

Expand All @@ -28,24 +28,24 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-hugo
with:
path: /usr/local/bin/hugo
key: ${{ runner.os }}-hugo-${{ hashFiles('/usr/local/bin/hugo') }}
restore-keys: |
${{ runner.os }}-hugo
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-go
with:
path: /usr/local/go/bin/go
Expand All @@ -62,7 +62,7 @@ jobs:
rm hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz
hugo version
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
Expand All @@ -86,7 +86,7 @@ jobs:
- name: Install npm dependencies
run: npm install

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
Expand All @@ -97,7 +97,7 @@ jobs:
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: ./public

Expand All @@ -111,4 +111,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ stages:

variables:
HUGO_ENV: production
HUGO_VERSION: "0.118.2"
GO_VERSION: "1.20.5"
HUGO_VERSION: "0.124.1"
GO_VERSION: "1.22.2"
NODE_VERSION: "18.16.1"

cache:
Expand Down
25 changes: 25 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"label": "Development",
"type": "shell",
"command": "yarn dev:example",
"isBackground": true,
"group": {
"kind": "test",
"isDefault": true
},
},
{
"label": "Build",
"type": "shell",
"command": "yarn build:example",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
1 change: 1 addition & 0 deletions _redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /zh-tw/404.html 404
16 changes: 8 additions & 8 deletions amplify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ frontend:
preBuild:
commands:
- yum install -y curl
- curl -LO "https://github.com/gohugoio/hugo/releases/download/v0.118.2/hugo_extended_0.118.2_Linux-64bit.tar.gz"
- tar -xvf hugo_extended_0.118.2_Linux-64bit.tar.gz
- curl -LO "https://github.com/gohugoio/hugo/releases/download/v0.124.1/hugo_extended_0.124.1_Linux-64bit.tar.gz"
- tar -xvf hugo_extended_0.124.1_Linux-64bit.tar.gz
- mv hugo /usr/local/bin/
- rm hugo_extended_0.118.2_Linux-64bit.tar.gz
- echo "HUGO 0.118.2 INSTALLED"
- curl -LO "https://dl.google.com/go/go1.20.5.linux-amd64.tar.gz"
- tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz
- rm hugo_extended_0.124.1_Linux-64bit.tar.gz
- echo "HUGO 0.124.1 INSTALLED"
- curl -LO "https://dl.google.com/go/go1.22.2.linux-amd64.tar.gz"
- tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz
- export PATH=$PATH:/usr/local/go/bin
- rm go1.20.5.linux-amd64.tar.gz
- echo "GO 1.20.5 INSTALLED"
- rm go1.22.2.linux-amd64.tar.gz
- echo "GO 1.22.2 INSTALLED"
- npm install
build:
commands:
Expand Down
2 changes: 1 addition & 1 deletion assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

dropdownMenuToggler.forEach((toggler) => {
toggler?.addEventListener("click", (e) => {
e.target.parentElement.classList.toggle("active");
e.target.closest('.nav-item').classList.toggle("active");
});
});

Expand Down
12 changes: 6 additions & 6 deletions assets/scss/base.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
html {
@apply text-base;
@apply text-base-sm md:text-base;
}

body {
@apply bg-body font-primary text-text dark:bg-darkmode-body dark:text-darkmode-text font-normal leading-relaxed;
@apply bg-body dark:bg-darkmode-body font-primary font-normal leading-relaxed text-text dark:text-darkmode-text;
}

h1,
Expand All @@ -12,7 +12,7 @@ h3,
h4,
h5,
h6 {
@apply font-secondary text-dark dark:text-darkmode-dark font-bold leading-tight;
@apply font-secondary font-bold leading-tight text-dark dark:text-darkmode-dark;
}

h1,
Expand All @@ -32,17 +32,17 @@ h3,

h4,
.h4 {
@apply text-h4 font-medium;
@apply text-h4;
}

h5,
.h5 {
@apply text-h5 font-medium;
@apply text-h5;
}

h6,
.h6 {
@apply text-h6 font-medium;
@apply text-h6;
}

b,
Expand Down
4 changes: 2 additions & 2 deletions assets/scss/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
}

.btn-primary {
@apply border-primary bg-primary dark:border-darkmode-primary dark:text-dark text-white dark:bg-white;
@apply border-primary bg-primary dark:border-darkmode-primary dark:text-dark text-white dark:bg-darkmode-primary;
}

.btn-outline-primary {
@apply border-dark text-dark hover:bg-dark dark:hover:text-dark bg-transparent hover:text-white dark:border-white dark:text-white dark:hover:bg-white;
@apply border-dark text-dark hover:bg-dark dark:hover:text-dark bg-transparent hover:text-white dark:border-darkmode-primary dark:text-white dark:hover:bg-darkmode-primary;
}
8 changes: 4 additions & 4 deletions assets/scss/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ main {

// swiper pagination
.swiper-pagination-bullet {
@apply bg-theme-light dark:bg-darkmode-theme-light h-2.5 w-2.5 opacity-100;
@apply bg-theme-light dark:bg-darkmode-theme-light h-2.5 w-2.5 opacity-100 mx-1.5 #{!important};

&-active {
@apply bg-primary dark:bg-darkmode-primary h-4 w-4;
@apply bg-primary dark:bg-darkmode-primary h-4 w-4 #{!important};
}
}

// content style
.content {
@apply prose max-w-none;
@apply prose-headings:mb-[.3em] prose-headings:mt-[.6em];
@apply prose-headings:mb-[.3em] prose-headings:mt-[.6em] prose-headings:text-dark prose-headings:dark:text-darkmode-dark;
@apply prose-h1:text-h1-sm md:prose-h1:text-h1;
@apply prose-h2:text-h2-sm md:prose-h2:text-h2;
@apply prose-h3:text-h3-sm md:prose-h3:text-h3;
Expand All @@ -59,7 +59,7 @@ main {
@apply prose-p:text-base prose-p:text-text prose-p:dark:text-darkmode-text;
@apply prose-blockquote:rounded-lg prose-blockquote:border prose-blockquote:border-l-[10px] prose-blockquote:border-primary prose-blockquote:bg-theme-light prose-blockquote:px-8 prose-blockquote:py-10 prose-blockquote:font-secondary prose-blockquote:text-2xl prose-blockquote:not-italic prose-blockquote:text-dark prose-blockquote:dark:border-darkmode-primary prose-blockquote:dark:bg-darkmode-theme-light prose-blockquote:dark:text-darkmode-light;
@apply prose-pre:rounded-lg prose-pre:bg-theme-light prose-pre:dark:bg-darkmode-theme-light;
@apply prose-code:px-1;
@apply prose-code:px-1 prose-code:dark:text-darkmode-light;
@apply prose-strong:text-dark prose-strong:dark:text-darkmode-text;
@apply prose-a:text-text prose-a:underline hover:prose-a:text-primary prose-a:dark:text-darkmode-text hover:prose-a:dark:text-darkmode-primary;
@apply prose-li:text-text prose-li:dark:text-darkmode-text;
Expand Down
44 changes: 8 additions & 36 deletions assets/scss/module-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
}
}

// notice
.notice {
@apply rounded-lg;
}

// tab
.tab {
@apply border-border dark:border-darkmode-border overflow-hidden rounded-lg border;
Expand Down Expand Up @@ -47,40 +52,7 @@
@apply rounded-lg #{!important};
}

// search
.search-wrapper {
.search-wrapper-content {
@apply dark:bg-darkmode-body;
}
input {
@apply dark:bg-darkmode-theme-light dark:text-darkmode-text dark:border-darkmode-border dark:focus:border-darkmode-primary focus:ring-0;
}
kbd {
@apply dark:bg-darkmode-theme-light;
}
.search-wrapper-body {
@apply dark:bg-darkmode-theme-light dark:shadow-none;
}
&.search-page {
.search-wrapper-body {
@apply dark:bg-transparent;
}
}
.search-result-info em {
@apply dark:text-white;
}
.search-result-item {
@apply dark:bg-darkmode-body dark:border-darkmode-border p-4;
.search-title {
@apply dark:text-darkmode-dark;
}
u {
@apply dark:text-darkmode-primary;
}
&:focus,
&.search-item-selected,
&:hover {
@apply dark:bg-darkmode-primary/10;
}
}
// slider
.gallery-slider {
@apply ml-0 #{!important};
}
2 changes: 1 addition & 1 deletion assets/scss/navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ input#nav-toggle:checked ~ #nav-menu {
// }

.nav-link {
@apply text-dark hover:text-primary dark:text-darkmode-dark block p-3 font-semibold transition lg:px-2 lg:py-3;
@apply text-dark hover:text-primary dark:text-darkmode-dark dark:hover:text-darkmode-primary block p-3 cursor-pointer font-semibold transition lg:px-2 lg:py-3;
}

.nav-dropdown {
Expand Down
38 changes: 29 additions & 9 deletions config/_default/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,24 @@ timeZone = "Asia/Taipei"
paginate = 6 # see https://gohugo.io/extras/pagination/
# post excerpt
summaryLength = 70 # see https://gohugo.io/content-management/excerpts/
# google analytics
# googleAnalytics = "" # see https://gohugo.io/templates/internal/#configure-google-analytics
# disqus short name
# disqusShortname = "" # we use disqus to show comments in blog posts . To install disqus please follow this tutorial https://portfolio.peter-baumgartner.net/2017/09/10/how-to-install-disqus-on-hugo/
# disable language
disableLanguages = [
"en",
] # example: ["fr"] for disable french language. see https://gohugo.io/content-management/multilingual/
hasCJKLanguage = true # If hasCJKLanguage true, auto-detect Chinese/Japanese/Korean Languages in the content. see: https://gohugo.io/getting-started/configuration/#hascjklanguage

languageCode = "zh-tw"
# default language
defaultContentLanguage = "zh-tw"
# defaultContentLanguageInSubdir need to be true if you want to use the language code as a subdirectory and language specific 404 page
defaultContentLanguageInSubdir = false
languageCode = "zh-tw"

########################### Services #############################
[services]
[services.googleAnalytics]
ID = '' # see https://gohugo.io/templates/internal/#configure-google-analytics

[services.disqus]
shortname = '' # we use disqus to show comments in blog posts . To install disqus please follow this tutorial https://portfolio.peter-baumgartner.net/2017/09/10/how-to-install-disqus-on-hugo/

########################## Permalinks ############################
[permalinks.page]
Expand Down Expand Up @@ -73,7 +79,7 @@ defaultContentLanguage = "zh-tw"
[imaging]
# See https://github.com/disintegration/imaging
# Default JPEG or WebP quality setting. Default is 75.
quality = 90
quality = 80
resampleFilter = "Lanczos"

############################ Caches ##############################
Expand Down Expand Up @@ -124,34 +130,48 @@ defaultContentLanguage = "zh-tw"
# CSS Plugins
[[params.plugins.css]]
link = "plugins/swiper/swiper-bundle.css"
lazy = true
[[params.plugins.css]]
link = "plugins/glightbox/glightbox.css"
lazy = true
[[params.plugins.css]]
link = "plugins/font-awesome/v6/brands.css"
lazy = true
[[params.plugins.css]]
link = "plugins/font-awesome/v6/solid.css"
lazy = true
[[params.plugins.css]]
link = "plugins/font-awesome/v6/icons.css"
lazy = true

# JS Plugins
[[params.plugins.js]]
link = "js/search.js"
lazy = false
[[params.plugins.js]]
link = "plugins/swiper/swiper-bundle.js"
lazy = false
[[params.plugins.js]]
link = "plugins/cookie.js"
lazy = false
[[params.plugins.js]]
link = "plugins/glightbox/glightbox.js"
lazy = true
[[params.plugins.js]]
link = "js/gallery-slider.js"
lazy = true
[[params.plugins.js]]
link = "js/accordion.js"
lazy = true
[[params.plugins.js]]
link = "js/tab.js"
lazy = true
[[params.plugins.js]]
link = "js/modal.js"
[[params.plugins.js]]
link = "plugins/cookie.js"
lazy = true
[[params.plugins.js]]
link = "plugins/youtube-lite.js"
lazy = true


############################# Privacy ##############################
Expand Down
Loading

0 comments on commit 73f43ef

Please sign in to comment.