Compare commits

...
46 Commits
Author SHA1 Message Date
Jimmy Cai 72e3b16638 release: 3.34.2 2026-02-17 15:00:23 +01:00
JimmyandGitHub 60e2ad9201 fix: error when no page is available in the current list (#1263) 2026-02-17 14:59:30 +01:00
Jimmy Cai 6f0b4be72c release: 3.34.1 2026-01-26 10:39:57 +01:00
JimmyandGitHub 7a09b136bb fix: avoid site name appearing twice in the title (#1240) 2026-01-26 10:39:34 +01:00
Jimmy Cai ffab83a637 release: 3.34.0 2026-01-25 17:55:45 +01:00
JimmyandGitHub 9add062300 refactor: centralize pagination logic (#1227)
* refactor: centralize pagination logic into a new helper partial used for page titles and index display

* fix: list.html does not exclude hidden pages

* refactor: Simplify title generation logic
2026-01-25 17:54:13 +01:00
JimmyandGitHub 12daa8c9fc feat: dynamically generate background color for category links (#1225)
* chore: add +x to run.sh

* feat: dynamically generate background color for category links using hash

* feat: allow category styles to be overridden by term parameters

* refactor: remove default tag background and color variables
2026-01-25 17:35:40 +01:00
JimmyandGitHub f804db2c80 fix: load mermaid partial without cache (#1226) 2026-01-25 16:50:33 +01:00
Jimmy Cai 090378e4da ci: move to cloudflare worker 2026-01-25 12:09:53 +01:00
Jimmy d6ced60f51 release: 3.33.0 2025-12-22 16:17:42 +00:00
JimmyandGitHub dc36aa60a9 fix: remove hidden posts using where keyword (#1212) 2025-12-22 17:12:34 +01:00
JimmyandGitHub 475d01b046 fix: adjust padding and width for article list tiles in subsection list (#1211) 2025-12-22 16:51:39 +01:00
5a5876e3ea refactor(scss): remove--zh-font-family (#1183)
* fix(scss): limit `--zh-font-family` to only simplified Chinese

* feat(sampleSite): add test page for Japanese & Traditional Chinese

* Remove `--zh-font-family` variable

---------

Co-authored-by: Jimmy <[email protected]>
2025-12-22 16:28:58 +01:00
ba9a5caa16 feat: add support for Mermaid diagrams in Markdown content (#1186)
* Add support for Mermaid diagrams in markdown content

This commit introduces native Mermaid diagram rendering to the theme.

Following Hugo’s official documentation, a new custom code block renderer
(`render-codeblock-mermaid.html`) was added under `layouts/_default/` to
detect Mermaid code blocks and inject the necessary script flag into the
page context.

Additionally, the `baseof.html` template now conditionally includes the
Mermaid JS module from the CDN when a page contains a Mermaid diagram:

  {{ if .Store.Get "hasMermaid" }}
    <script type="module">
      import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
      mermaid.initialize({ startOnLoad: true, theme: 'neutral' });
    </script>
  {{ end }}

This enables rendering of fenced code blocks using the `mermaid` language
in markdown files without requiring any external preprocessing.

* Create article/components/mermaid and fix script version

---------

Co-authored-by: Jimmy <[email protected]>
2025-12-22 13:40:33 +01:00
47db505228 feat: pagination improvements to maximize space utilization (#1165)
* Minor improvements to pagination functions

* Update pagination styles with enhanced UI/UX design

- Implemented full-width layout with flexible page numbers
- Added fixed-width arrow buttons for consistent navigation
- Enhanced hover and active states for better user interaction
- Improved responsive design with proper flex layout
- Added comprehensive styling for disabled and ellipsis states

* Simplify pagination logic and use SVG files to avoid repeated definition

* Remove change to jsconfig.json

* Remove comments and classes

---------

Co-authored-by: delize <[email protected]>
Co-authored-by: Jimmy <[email protected]>
2025-12-22 00:21:02 +01:00
AiratTopandGitHub dc94a29617 fix(i18n): category widget title in ru.yaml (#1199)
Fix category widget title in ru.yaml
2025-12-21 20:59:59 +01:00
7df31001af fix(theme): Adjust Cusdis widget scrollbar and background to match Stack theme (#1204)
* fix: adjust cusdis scrollbar styling and background for stack theme

* feat: dynamically set cusdis background color

---------

Co-authored-by: Jimmy <[email protected]>
2025-12-21 20:55:09 +01:00
Jimmy 73ccacec4d release: 3.32.0 2025-11-01 21:15:56 +00:00
JimmyandGitHub 2612ca87dc feat: allow specify alt for link's image (#1198) 2025-11-01 22:14:52 +01:00
CelesteandGitHub e8fc315ead fix: decode special characters in the search bar on 404 pages (#1098)
An extremely simple fix to decode special characters
2025-11-01 22:01:24 +01:00
Jerry KimandGitHub 145cda7d45 feat: use ResizeObserver to detect changes in the size of .article-content (#1105)
* Use ResizeObserver to detect changes in the size of .article-content

This code is for handling changes in position caused by content rendered as part of post-processing, such as Mermaid diagrams

* Add debounced to resizeHandler
2025-11-01 21:59:30 +01:00
Gleb A.andGitHub d507f2ef7c fix(i18n): minor translation changes for Italian (#1127) 2025-11-01 21:57:12 +01:00
Gleb A.andGitHub 8f7eeb7de6 fix: Uncaught TypeError: link is null in buildIdToNavigationElementMap (#1133)
fix: Uncaught TypeError: link is null in buildIdToNavigationElementMap (#1132)
2025-11-01 21:57:02 +01:00
AMomentandGitHub dd3bb1ea13 feat: render math formula for the table of contents (#1137)
Add math formula render to table of contents

Add element (.widget--toc) to be rendered by KaTeX
2025-11-01 21:54:06 +01:00
Andreas DeiningerandGitHub 291fe5fd7e feat: remove deprecated Hugo templates and shortcode usage (#1150)
Adapt site to latest hugo version 0.147.1
2025-11-01 21:49:15 +01:00
JimmyandGitHub 512a9ab625 feat: upgrade Hugo version in Netlify and DevContainer file (#1197)
* feat: upgrade Netlify Hugo version to 0.152.2

* feat: update to newer Hugo DevContainer file
2025-11-01 21:45:48 +01:00
AradielandGitHub 5a10223f4c fix: modify sidebar link active conditions (needs to be the same page URL) (#1153)
Sidebar link active conditions - needs to be the same page
2025-11-01 21:41:10 +01:00
stanolandGitHub 0b22c0a293 fix(i18n): missing translation for title of categories widget in uk.yaml (#1162) 2025-11-01 21:36:29 +01:00
powerfullzandGitHub c413980b89 fix(twikoo): certain Twikoo elements wouldn’t automatically switch colours in dark mode and update to Twikoo version 1.6.44 (#1163) 2025-11-01 21:35:09 +01:00
Christian Martínez de la RosaandGitHub 6d98e8463f fix: use localized title for categories taxonomy in archives page (#1158)
closes #1157
2025-11-01 21:30:37 +01:00
-Zonbi@TR~$andGitHub 50a42f28c0 feat(i18n/tr): add missing translations for tr language (#1160) 2025-11-01 21:28:26 +01:00
Terence EdenandGitHub f824d08f6f fix: semantic <time> by adding datetime attribute (#1184)
Fix semantic <time>

The HTML validator was throwing an error because there was no valid datetime attribute.
2025-11-01 20:53:37 +01:00
JimmyandGitHub 2f47d14a8a fix: add missing object-fit: cover to section-image (#1196) 2025-11-01 20:43:19 +01:00
KonnyakuandGitHub 2d1d6727f5 feat(scss): Enhance text rendering with autospace properties (#1188)
* Enhance text rendering with autospace properties

Added text autospace properties for better text rendering for CJK characters.

* Update text-autospace and text-spacing properties
2025-11-01 19:33:23 +01:00
JimmyandGitHub 8cb1646198 style: remove unused count class in tag cloud (#1195) 2025-10-31 23:48:40 +01:00
Jimmy 9e96c6e975 release: 3.31.0 2025-09-10 10:14:29 +00:00
Gleb A.andGitHub 47832083d8 refactor(comments): use includes instead of indexOf to improve readability (#1128)
* fix(disqusjs): refactor local DisqusJS loading check for improved readability

* fix(gitalk): refactor local Gitalk loading check for improved readability
2025-05-21 12:52:47 +02:00
LparksiandGitHub d9acd77015 feat(comment/waline): add support for Waline's turnstileKey (#1140)
* fix: Added support for waline's turnstileKey

* style: remove extra space in waline.html
2025-05-21 12:31:22 +02:00
Bernat Borràs CivilandGitHub 06aa627d3c fix(article): date translation on compact mode (#1149)
* Fix translation

* Revert jsconfig
2025-05-21 12:25:11 +02:00
Jimmy Cai 9e6b7b22a9 release: 3.30.0 2025-01-23 22:55:27 +01:00
JimmyandGitHub f1ab6c6aba fix(giscus): no longer use $.Language.LanguageCode for the language of Giscus (#1118)
fix(giscus): rollback https://github.com/CaiJimmy/hugo-theme-stack/pull/1075

User can still customize the language used for Giscus using `.Site.Params.comments.giscus.lang` parameter.
2025-01-23 22:54:37 +01:00
HamzaandGitHub 087989e427 chore(i18n): fix a tiny typo in the footer (#1099) 2024-12-22 14:53:10 +01:00
fsj2009yxandGitHub 0991f61d49 fix(comment/waline): cannot read property ‘insertBefore’ of null (#1103)
* fix: resolve issue with comments not displaying due to KaTeX and Waline render order

* Fix the problem that comment data couldn't be pulled successfully and raise Error "Cannot read property ‘insertBefore’ of null""
2024-12-22 12:44:13 +01:00
Jimmy Cai 839fbd0ecb release: 3.29.0 2024-10-20 08:05:45 +00:00
Jimmy CaiandGitHub 5175ac5ae3 fix(giscus): fallback to en if no language code is set (#1084) 2024-10-20 10:04:59 +02:00
Jimmy CaiandGitHub 37f1541c20 feat: search box in 404 page (#1081) 2024-10-20 00:26:59 +02:00
83 changed files with 583 additions and 241 deletions
+68
View File
@@ -0,0 +1,68 @@
#!/usr/bin/env bash
#------------------------------------------------------------------------------
# @file
# Builds a Hugo site hosted on a Cloudflare Worker.
#
# The Cloudflare Worker automatically installs Node.js dependencies.
#------------------------------------------------------------------------------
main() {
DART_SASS_VERSION=1.97.1
GO_VERSION=1.25.5
HUGO_VERSION=0.154.5
NODE_VERSION=24.12.0
export TZ=Europe/Oslo
# Install Dart Sass
echo "Installing Dart Sass ${DART_SASS_VERSION}..."
curl -sLJO "https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
tar -C "${HOME}/.local" -xf "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
rm "dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz"
export PATH="${HOME}/.local/dart-sass:${PATH}"
# Install Go
echo "Installing Go ${GO_VERSION}..."
curl -sLJO "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz"
tar -C "${HOME}/.local" -xf "go${GO_VERSION}.linux-amd64.tar.gz"
rm "go${GO_VERSION}.linux-amd64.tar.gz"
export PATH="${HOME}/.local/go/bin:${PATH}"
# Install Hugo
echo "Installing Hugo ${HUGO_VERSION}..."
curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
mkdir "${HOME}/.local/hugo"
tar -C "${HOME}/.local/hugo" -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
rm "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz"
export PATH="${HOME}/.local/hugo:${PATH}"
# Install Node.js
echo "Installing Node.js ${NODE_VERSION}..."
curl -sLJO "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz"
tar -C "${HOME}/.local" -xf "node-v${NODE_VERSION}-linux-x64.tar.xz"
rm "node-v${NODE_VERSION}-linux-x64.tar.xz"
export PATH="${HOME}/.local/node-v${NODE_VERSION}-linux-x64/bin:${PATH}"
# Verify installations
echo "Verifying installations..."
echo Dart Sass: "$(sass --version)"
echo Go: "$(go version)"
echo Hugo: "$(hugo version)"
echo Node.js: "$(node --version)"
# Configure Git
echo "Configuring Git..."
git config core.quotepath false
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
git fetch --unshallow
fi
# Build the site
echo "Building the site..."
cd demo
hugo --gc --minify --themesDir=/opt/buildhome --theme=repo
}
set -euo pipefail
main "$@"
+39 -14
View File
@@ -1,31 +1,56 @@
# Update the NODE_VERSION arg in docker-compose.yml to pick a Node version: 10, 12, 14 # syntax=docker/dockerfile:1
ARG NODE_VERSION=14 FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${NODE_VERSION}
ARG USER=vscode
ARG DEBIAN_FRONTEND=noninteractive
RUN usermod -s /usr/bin/zsh ${USER}
# VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version. # VARIANT can be either 'hugo' for the standard version or 'hugo_extended' for the extended version.
ARG VARIANT=hugo ARG VARIANT=hugo_extended
# VERSION can be either 'latest' or a specific version number # VERSION can be either 'latest' or a specific version number
ARG VERSION=latest ARG VERSION=latest
# Download Hugo # Download Hugo
RUN apt-get update && apt-get install -y ca-certificates openssl git curl && \ RUN case ${VERSION} in \
rm -rf /var/lib/apt/lists/* && \
case ${VERSION} in \
latest) \ latest) \
export VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') ;;\ export VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}') ;;\
esac && \ esac && \
echo ${VERSION} && \ echo ${VERSION} && \
wget -O ${VERSION}.tar.gz https://github.com/gohugoio/hugo/releases/download/v${VERSION}/${VARIANT}_${VERSION}_Linux-64bit.tar.gz && \ case $(uname -m) in \
aarch64) \
export ARCH=ARM64 ;; \
*) \
export ARCH=64bit ;; \
esac && \
echo ${ARCH} && \
wget -O ${VERSION}.tar.gz https://github.com/gohugoio/hugo/releases/download/v${VERSION}/${VARIANT}_${VERSION}_Linux-${ARCH}.tar.gz && \
tar xf ${VERSION}.tar.gz && \ tar xf ${VERSION}.tar.gz && \
mv hugo /usr/bin/hugo mv hugo /usr/bin/hugo
# Hugo dev server port # Hugo dev server port
EXPOSE 1313 EXPOSE 1313
# [Optional] Uncomment this section to install additional OS packages you may want.
#
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment if you want to install more global node packages USER ${USER}
# RUN sudo -u node npm install -g <your-package-list-here> ARG HOME=/home/${USER}
WORKDIR ${HOME}
ARG PNPM_HOME=${HOME}/.local/share/pnpm
ENV PATH="${PNPM_HOME}:$PATH"
RUN <<EOT
wget -qO- https://get.pnpm.io/install.sh | ENV="${HOME}/.zshrc" SHELL=/bin/zsh sh -
pnpm env use -g lts
EOT
ARG OHMYZSH_HOME=${HOME}/.oh-my-zsh
# ARG OHMYZSH_THEME=${OHMYZSH_HOME}/custom/themes
# RUN <<EOT
# git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${OHMYZSH_THEME}/powerlevel10k
# sed -i 's|ZSH_THEME="devcontainers"|ZSH_THEME="powerlevel10k/powerlevel10k"|g' .zshrc
# echo 'POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true' >> .zshrc
# EOT
RUN <<EOT
hugo completion zsh > ${OHMYZSH_HOME}/plugins/git/_hugo
EOT
+44 -38
View File
@@ -1,45 +1,51 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/hugo
{ {
"name": "Hugo (Community)", "name": "Hugo & pnpm",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update VARIANT to pick hugo variant.
// Example variants: hugo, hugo_extended
// Rebuild the container if it already exists to update.
"VARIANT": "hugo_extended",
// Update VERSION to pick a specific hugo version.
// Example versions: latest, 0.73.0, 0,71.1
// Rebuild the container if it already exists to update.
"VERSION": "latest",
// Update NODE_VERSION to pick the Node.js version: 12, 14
"NODE_VERSION": "14",
}
},
// Set *default* container specific settings.json values on container create. "build": {
"settings": { "dockerfile": "Dockerfile"
"html.format.templating": true, },
},
// Add the IDs of extensions you want installed when the container is created. // 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
"extensions": [ // "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": {} },
"bungcip.better-toml",
"davidanson.vscode-markdownlint"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally. // 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [ // "forwardPorts": [],
1313
],
// Use 'postCreateCommand' to run commands after the container is created. // Configure tool-specific properties.
// "postCreateCommand": "uname -a", "customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"html.format.templating": true
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
// https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter
"eliostruyf.vscode-front-matter",
// https://marketplace.visualstudio.com/items?itemName=rusnasonov.vscode-hugo
"rusnasonov.vscode-hugo",
// https://marketplace.visualstudio.com/items?itemName=budparr.language-hugo-vscode
"budparr.language-hugo-vscode",
// https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hugo-themer
"eliostruyf.vscode-hugo-themer",
// https://marketplace.visualstudio.com/items?itemName=kaellarkin.hugo-shortcode-syntax
"kaellarkin.hugo-shortcode-syntax",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. // "csstools.postcss",
"remoteUser": "node",
"features": { // "esbenp.prettier-vscode",
"golang": "latest" // "tamasfe.even-better-toml",
} // "naumovs.color-highlight",
// "GitHub.vscode-pull-request-github",
// "eamodio.gitlens",
"davidanson.vscode-markdownlint",
"streetsidesoftware.code-spell-checker"
]
}
},
"remoteUser": "vscode",
"postCreateCommand": "pnpm install-completion zsh"
} }
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-left"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 6l-6 6l6 6" /></svg>

After

Width:  |  Height:  |  Size: 336 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-chevron-right"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 6l6 6l-6 6" /></svg>

After

Width:  |  Height:  |  Size: 336 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-dots"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg>

After

Width:  |  Height:  |  Size: 459 B

-9
View File
@@ -33,15 +33,6 @@
} }
} }
} }
@for $i from 1 through length($defaultTagBackgrounds) {
&:nth-child(#{length($defaultTagBackgrounds)}n + #{$i}) {
.article-category a {
background: nth($defaultTagBackgrounds, $i);
color: nth($defaultTagColors, $i);
}
}
}
} }
} }
+3
View File
@@ -12,6 +12,9 @@ body {
margin: 0; margin: 0;
font-family: var(--base-font-family); font-family: var(--base-font-family);
font-size: 1.6rem; font-size: 1.6rem;
text-autospace: ideograph-alpha ideograph-numeric punctuation insert;
text-spacing-trim: trim-start allow-end;
-ms-text-autospace: ideograph-alpha;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
+4 -1
View File
@@ -33,6 +33,7 @@
img { img {
width: 60px; width: 60px;
height: 60px; height: 60px;
object-fit: cover;
} }
} }
@@ -47,10 +48,12 @@
.subsection-list { .subsection-list {
overflow-x: auto; overflow-x: auto;
margin-left: -24px;
.article-list--tile { .article-list--tile {
display: flex; display: flex;
padding-bottom: 15px; padding: 8px 0 34px 24px;
width: max-content;
article { article {
width: 250px; width: 250px;
+37 -8
View File
@@ -4,18 +4,47 @@
box-shadow: var(--shadow-l1); box-shadow: var(--shadow-l1);
border-radius: var(--card-border-radius); border-radius: var(--card-border-radius);
overflow: hidden; overflow: hidden;
flex-wrap: wrap;
.page-link { .page-link {
padding: 16px 32px; padding: 16px 0;
display: inline-flex; margin: 0;
border-radius: 0;
display: flex;
align-items: center;
justify-content: center;
flex: 1 1 auto;
min-width: 48px;
color: var(--card-text-color-secondary);
text-decoration: none;
&.current { &:first-child,
font-weight: bold; &:last-child {
background-color: var(--card-background-selected); flex: 0 0 48px;
color: var(--card-text-color-main); padding: 16px;
} }
color: var(--card-text-color-secondary); &:hover:not(.current):not(.disabled) {
background-color: var(--card-background-selected);
opacity: 0.8;
}
&.current {
background-color: var(--card-background-selected);
color: var(--card-text-color-main);
font-weight: bold;
cursor: default;
}
&.disabled {
opacity: 0.3;
cursor: not-allowed;
pointer-events: none;
color: var(--card-text-color-secondary);
}
svg {
width: 20px;
height: 20px;
}
} }
} }
+2 -7
View File
@@ -1,6 +1,3 @@
$defaultTagBackgrounds: #8ea885, #df7988, #0177b8, #ffb900, #6b69d6;
$defaultTagColors: #fff, #fff, #fff, #fff, #fff;
/* /*
* Global style * Global style
*/ */
@@ -41,10 +38,8 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff;
*/ */
:root { :root {
--sys-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Droid Sans", "Helvetica Neue"; --sys-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Droid Sans", "Helvetica Neue";
--zh-font-family: "PingFang SC", "Hiragino Sans GB", "Droid Sans Fallback", "Microsoft YaHei"; --base-font-family: "Lato", var(--sys-font-family), sans-serif;
--code-font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
--base-font-family: "Lato", var(--sys-font-family), var(--zh-font-family), sans-serif;
--code-font-family: Menlo, Monaco, Consolas, "Courier New", var(--zh-font-family), monospace;
} }
/* /*
+12 -3
View File
@@ -32,9 +32,11 @@ function buildIdToNavigationElementMap(navigation: NodeListOf<Element>): IdToEle
const sectionLinkRef: IdToElementMap = {}; const sectionLinkRef: IdToElementMap = {};
navigation.forEach((navigationElement: HTMLElement) => { navigation.forEach((navigationElement: HTMLElement) => {
const link = navigationElement.querySelector("a"); const link = navigationElement.querySelector("a");
const href = link.getAttribute("href"); if (link) {
if (href.startsWith("#")) { const href = link.getAttribute("href");
sectionLinkRef[href.slice(1)] = navigationElement; if (href.startsWith("#")) {
sectionLinkRef[href.slice(1)] = navigationElement;
}
} }
}); });
@@ -125,6 +127,13 @@ function setupScrollspy() {
scrollHandler(); scrollHandler();
} }
// Use ResizeObserver to detect changes in the size of .article-content
const articleContent = document.querySelector(".article-content");
if (articleContent) {
const resizeObserver = new ResizeObserver(debounced(resizeHandler));
resizeObserver.observe(articleContent);
}
window.addEventListener("resize", debounced(resizeHandler)); window.addEventListener("resize", debounced(resizeHandler));
} }
+8 -1
View File
@@ -53,7 +53,14 @@ class Search {
this.resultTitle = resultTitle; this.resultTitle = resultTitle;
this.resultTitleTemplate = resultTitleTemplate; this.resultTitleTemplate = resultTitleTemplate;
this.handleQueryString(); /// Check if there's already value in the search input
if (this.input.value.trim() !== '') {
this.doSearch(this.input.value.split(' '));
}
else {
this.handleQueryString();
}
this.bindQueryStringChange(); this.bindQueryStringChange();
this.bindSearchForm(); this.bindSearchForm();
} }
-1
View File
@@ -1 +0,0 @@
cd exampleSite && hugo server --gc --themesDir=../..
+8
View File
@@ -0,0 +1,8 @@
---
menu:
main:
name: ホーム
weight: -100
params:
icon: home
---
+8
View File
@@ -0,0 +1,8 @@
---
menu:
main:
name: 主頁
weight: -100
params:
icon: home
---

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

@@ -0,0 +1,26 @@
---
title: Japanese Test
description: これはサブタイトル
date: 2020-09-09
slug: test-chinese
image: helena-hertz-wWZzXlDpMog-unsplash.jpg
categories:
- Test
- テスト
---
## 本文テスト(フォント)
返扇花週認契適違込遷雇述請曜藤突扉直角
## 引用
> 国破れて山河在り\
> 城春にして草木深し\
> 時に感じては花にも涙を濺ぎ\
> 別れを恨んでは鳥にも心を驚かす
>
> 烽火三月に連なり\
> 家書万金に抵たる\
> 白頭掻けば更に短く\
> 渾べて簪に勝へざらんと欲す
@@ -37,3 +37,7 @@ categories:
``` ```
相册语法来自 [Typlog](https://typlog.com/) 相册语法来自 [Typlog](https://typlog.com/)
## 字体
返扇花週認契適違込遷雇述請曜藤突扉直角
@@ -0,0 +1,14 @@
---
title: Chinese Test
description: 這是一個副標題
date: 2020-09-09
slug: test-chinese
image: helena-hertz-wWZzXlDpMog-unsplash.jpg
categories:
- Test
- 測試
---
## 正文測試(字體)
返扇花週認契適違込遷雇述請曜藤突扉直角

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

@@ -21,7 +21,7 @@ To enable emoji globally, set `enableEmoji` to `true` in your site's [configurat
<p><span class="nowrap"><span class="emojify">🙈</span> <code>:see_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙉</span> <code>:hear_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙊</span> <code>:speak_no_evil:</code></span></p> <p><span class="nowrap"><span class="emojify">🙈</span> <code>:see_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙉</span> <code>:hear_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙊</span> <code>:speak_no_evil:</code></span></p>
<br> <br>
The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. The [Emoji cheat sheet](https://www.webfx.com/tools/emoji-cheat-sheet/) is a useful reference for emoji shorthand codes.
*** ***

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@@ -21,9 +21,9 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
--- ---
## Twitter Simple Shortcode ## X Simple Shortcode
{{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}} {{< x user="DesignReviewed" id="1085870671291310081" >}}
<br> <br>
@@ -37,10 +37,6 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
{{< bilibili av498363026 >}} {{< bilibili av498363026 >}}
## Gist Shortcode
{{< gist spf13 7896402 >}}
## Gitlab Snippets Shortcode ## Gitlab Snippets Shortcode
{{< gitlab 2349278 >}} {{< gitlab 2349278 >}}
+17 -1
View File
@@ -21,12 +21,28 @@ languages:
sidebar: sidebar:
subtitle: Example description subtitle: Example description
zh-cn: zh-cn:
languageName: 中文 languageName: 简体中文
title: 演示站点 title: 演示站点
weight: 2 weight: 2
params: params:
sidebar: sidebar:
subtitle: 演示说明 subtitle: 演示说明
zh-tw:
languageName: 正體中文
title: 演示站點
weight: 2
params:
sidebar:
subtitle: 演示說明
ja:
languageName: 日本語
title: サンプルサイト
weight: 2
params:
sidebar:
subtitle: サンプル説明
ar: ar:
languageName: عربي languageName: عربي
languagedirection: rtl languagedirection: rtl
Executable
+1
View File
@@ -0,0 +1 @@
hugo server --gc --themesDir=../..
View File
+1 -1
View File
@@ -68,7 +68,7 @@ search:
footer: footer:
builtWith: builtWith:
other: "مبني بستخدام {{ .Generator }}" other: "مبني باستخدام {{ .Generator }}"
designedBy: designedBy:
other: "قالب {{ .Theme }} مصمم من {{ .DesignedBy }}" other: "قالب {{ .Theme }} مصمم من {{ .DesignedBy }}"
+2 -2
View File
@@ -2,7 +2,7 @@ toggleMenu:
other: Toggle Menu other: Toggle Menu
darkMode: darkMode:
other: Dark Mode other: Modalità scura
list: list:
page: page:
@@ -49,7 +49,7 @@ widget:
tagCloud: tagCloud:
title: title:
other: Tags other: Tag
categoriesCloud: categoriesCloud:
title: title:
+3
View File
@@ -47,6 +47,9 @@ widget:
tagCloud: tagCloud:
title: title:
other: Теги other: Теги
categoriesCloud:
title:
other: Категории
search: search:
title: title:
+15 -1
View File
@@ -17,11 +17,22 @@ list:
other: Alt bölümler other: Alt bölümler
article: article:
back:
other: Geri
tableOfContents:
other: İçindekiler
relatedContent: relatedContent:
other: Alakalı içerikler other: Benzer içerikler
lastUpdatedOn: lastUpdatedOn:
other: Son güncelleme other: Son güncelleme
readingTime:
one: "{{ .Count }} dakika okuma süresi"
other: "{{ .Count }} dakika okuma süresi"
notFound: notFound:
title: title:
other: Bulunamadı other: Bulunamadı
@@ -37,6 +48,9 @@ widget:
tagCloud: tagCloud:
title: title:
other: Etiketler other: Etiketler
categoriesCloud:
title:
other: Kategoriler
search: search:
title: title:
+3
View File
@@ -52,6 +52,9 @@ widget:
tagCloud: tagCloud:
title: title:
other: Теґи other: Теґи
categoriesCloud:
title:
other: Категорії
search: search:
title: title:
+38
View File
@@ -3,5 +3,43 @@
<h1 class="article-title">{{ T "notFound.title" }}</h1> <h1 class="article-title">{{ T "notFound.title" }}</h1>
<h2 class="article-subtitle">{{ T "notFound.subtitle" }}</h2> <h2 class="article-subtitle">{{ T "notFound.subtitle" }}</h2>
</div> </div>
{{- $query := first 1 (where .Site.Pages "Layout" "==" "search") -}}
{{- $searchPage := index $query 0 -}}
{{- with $searchPage -}}
<form action="{{ $searchPage.RelPermalink }}" class="search-form widget" {{ with .OutputFormats.Get "json" -}}data-json="{{ .Permalink }}" {{- end }}>
<p>
<label>{{ T "search.title" }}</label>
<input id="searchInput" name="keyword" required placeholder="{{ T `search.placeholder` }}" />
<button title="{{ T `search.title` }}">
{{ partial "helper/icon" "search" }}
</button>
</p>
</form>
<div class="search-result">
<h3 class="search-result--title section-title"></h3>
<div class="search-result--list article-list--compact"></div>
</div>
<script>
window.searchResultTitleTemplate = "{{ T `search.resultTitle` }}"
</script>
{{- $opts := dict "minify" hugo.IsProduction "JSXFactory" "createElement" -}}
{{- $searchScript := resources.Get "ts/search.tsx" | js.Build $opts -}}
<script type="text/javascript" src="{{ $searchScript.RelPermalink }}" defer></script>
<script>
const wrongUrl = new URL(window.location.href);
/// Get the search keyword from the wrong URL by removing all slashes and dashes
const searchKeyword = decodeURIComponent(wrongUrl.pathname).split(/[/|-]/).join(' ').trim();
document.getElementById('searchInput').setAttribute('value', searchKeyword);
</script>
{{- end -}}
{{ partialCached "footer/footer" . }} {{ partialCached "footer/footer" . }}
{{ end }} {{ end }}
@@ -0,0 +1,4 @@
<pre class="mermaid">
{{ .Inner | htmlEscape | safeHTML }}
</pre>
{{ .Page.Store.Set "hasMermaid" true }}
+2 -3
View File
@@ -4,7 +4,7 @@
{{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}} {{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}}
{{- $terms := $taxonomy.Pages -}} {{- $terms := $taxonomy.Pages -}}
{{ if $terms }} {{ if $terms }}
<h2 class="section-title">{{ $taxonomy.Title }}</h2> <h2 class="section-title">{{ T "widget.categoriesCloud.title" }}</h2>
<div class="subsection-list"> <div class="subsection-list">
<div class="article-list--tile"> <div class="article-list--tile">
{{ range $terms }} {{ range $terms }}
@@ -16,8 +16,7 @@
</header> </header>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} {{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} {{ $filtered := where $pages "Params.hidden" "!=" true }}
{{ $filtered := ($pages | intersect $notHidden) }}
{{ range $filtered.GroupByDate "2006" }} {{ range $filtered.GroupByDate "2006" }}
{{ $id := lower (replace .Key " " "-") }} {{ $id := lower (replace .Key " " "-") }}
+9 -6
View File
@@ -46,6 +46,7 @@
{{- $subsections := .Sections -}} {{- $subsections := .Sections -}}
{{- $pages := .Pages | complement $subsections -}} {{- $pages := .Pages | complement $subsections -}}
{{- $pages = where $pages "Params.hidden" "!=" true -}}
{{- if eq (len $pages) 0 -}} {{- if eq (len $pages) 0 -}}
{{/* If there are no normal pages, display subsections in list style, with pagination */}} {{/* If there are no normal pages, display subsections in list style, with pagination */}}
@@ -68,12 +69,14 @@
{{- end -}} {{- end -}}
{{/* List only pages that are not a subsection */}} {{/* List only pages that are not a subsection */}}
{{ $paginator := .Paginate $pages }} {{ $paginator := partial "helper/paginator.html" . }}
<section class="article-list--compact"> {{ with $paginator }}
{{ range $paginator.Pages }} <section class="article-list--compact">
{{ partial "article-list/compact" . }} {{ range .Pages }}
{{ end }} {{ partial "article-list/compact" . }}
</section> {{ end }}
</section>
{{ end }}
{{- partial "pagination.html" . -}} {{- partial "pagination.html" . -}}
+1
View File
@@ -39,6 +39,7 @@
{{ partialCached "footer/footer" . }} {{ partialCached "footer/footer" . }}
{{ partialCached "article/components/photoswipe" . }} {{ partialCached "article/components/photoswipe" . }}
{{ partial "article/components/mermaid" . }}
{{ end }} {{ end }}
{{ define "right-sidebar" }} {{ define "right-sidebar" }}
+2 -5
View File
@@ -1,11 +1,8 @@
{{ define "main" }} {{ define "main" }}
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }} {{- $paginator := partial "helper/paginator.html" . -}}
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
{{ $filtered := ($pages | intersect $notHidden) }}
{{ $pag := .Paginate ($filtered) }}
<section class="article-list"> <section class="article-list">
{{ range $index, $element := $pag.Pages }} {{ range $index, $element := $paginator.Pages }}
{{ partial "article-list/default" . }} {{ partial "article-list/default" . }}
{{ end }} {{ end }}
</section> </section>
+1 -2
View File
@@ -1,6 +1,5 @@
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}} {{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
{{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}} {{- $filtered := where $pages "Params.hidden" "!=" true -}}
{{- $filtered := ($pages | intersect $notHidden) -}}
{{- $result := slice -}} {{- $result := slice -}}
+1 -1
View File
@@ -6,7 +6,7 @@
</h2> </h2>
<footer class="article-time"> <footer class="article-time">
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'> <time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}} {{- .Date | time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
</time> </time>
</footer> </footer>
</div> </div>
@@ -2,7 +2,10 @@
{{ if .Params.categories }} {{ if .Params.categories }}
<header class="article-category"> <header class="article-category">
{{ range (.GetTerms "categories") }} {{ range (.GetTerms "categories") }}
<a href="{{ .RelPermalink }}" {{ with .Params.style }}style="background-color: {{ .background }}; color: {{ .color }};"{{ end }}> {{ $color := partial "helper/color-from-str" .LinkTitle }}
{{ $BackgroundColor := default $color.BackgroundColor .Params.style.background }}
{{ $TextColor := default $color.TextColor .Params.style.color }}
<a href="{{ .RelPermalink }}" style="background-color: {{ $BackgroundColor | safeCSS }}; color: {{ $TextColor | safeCSS }};">
{{ .LinkTitle }} {{ .LinkTitle }}
</a> </a>
{{ end }} {{ end }}
@@ -31,7 +34,7 @@
{{ if $showDate }} {{ if $showDate }}
<div> <div>
{{ partial "helper/icon" "date" }} {{ partial "helper/icon" "date" }}
<time class="article-time--published"> <time class="article-time--published" datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
{{- .Date | time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}} {{- .Date | time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
</time> </time>
</div> </div>
@@ -21,7 +21,7 @@
{{ $permalink = .RelPermalink }} {{ $permalink = .RelPermalink }}
{{ end }} {{ end }}
<div class="article-image"> <div class="article-image">
<img src="{{ $permalink }}" loading="lazy"> <img src="{{ $permalink }}" loading="lazy"{{ with $link.alt }} alt="{{ . }}"{{ end }}>
</div> </div>
{{ end }} {{ end }}
</a> </a>
+17 -9
View File
@@ -1,13 +1,21 @@
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}} {{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
<script> <script>
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
renderMathInElement(document.body, { const elementsToRender = [".main-article", ".widget--toc"];
delimiters: [
{ left: "$$", right: "$$", display: true }, elementsToRender.forEach(selector => {
{ left: "$", right: "$", display: false }, const element = document.querySelector(selector);
{ left: "\\(", right: "\\)", display: false }, if (element) {
{ left: "\\[", right: "\\]", display: true } renderMathInElement(element, {
], delimiters: [
ignoredClasses: ["gist"] { left: "$$", right: "$$", display: true },
});}) { left: "$", right: "$", display: false },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\[", right: "\\]", display: true }
],
ignoredClasses: ["gist"]
});
}
});
});
</script> </script>
@@ -0,0 +1,9 @@
{{ if .Store.Get "hasMermaid" }}
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';
mermaid.initialize({
startOnLoad: true,
theme: 'neutral',
});
</script>
{{ end }}
+14 -8
View File
@@ -1,20 +1,26 @@
{{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}} {{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}}
<div id="cusdis_thread" <div id="cusdis_thread" data-host="{{ $host }}" data-app-id="{{ .Site.Params.comments.cusdis.id }}"
data-host="{{ $host }}" data-page-id="{{ .File.UniqueID }}" data-page-url="{{ .Permalink }}" data-page-title="{{ .Title }}"></div>
data-app-id="{{ .Site.Params.comments.cusdis.id }}"
data-page-id="{{ .File.UniqueID }}"
data-page-url="{{ .Permalink }}"
data-page-title="{{ .Title }}"></div>
<script async defer src="{{ $host }}/js/cusdis.es.js"></script> <script async defer src="{{ $host }}/js/cusdis.es.js"></script>
<script> <script>
function setCusdisTheme(theme) { function setCusdisTheme(theme) {
let cusdis = document.querySelector('#cusdis_thread iframe'); let cusdis = document.querySelector('#cusdis_thread iframe');
if (cusdis) { if (cusdis) {
window.CUSDIS.setTheme(theme) window.CUSDIS.setTheme(theme);
cusdis.contentWindow.document.body.style.backgroundColor = window.getComputedStyle(document.body).backgroundColor;
} }
} }
window.addEventListener('load', function () {
let iframe = document.querySelector("#cusdis_thread iframe");
if (iframe) {
let observer = new MutationObserver(() => {
let scrollHeight = iframe.contentWindow.document.body.scrollHeight;
iframe.style.height = scrollHeight + "px";
});
observer.observe(iframe.contentWindow.document.body, { childList: true, subtree: true });
}
});
window.addEventListener('onColorSchemeChange', (e) => { window.addEventListener('onColorSchemeChange', (e) => {
setCusdisTheme(e.detail) setCusdisTheme(e.detail)
}) })
@@ -1,5 +1,5 @@
<div class="disqus-container"> <div class="disqus-container">
{{ template "_internal/disqus.html" . }} {{ partial "disqus.html" . }}
</div> </div>
<style> <style>
@@ -21,8 +21,12 @@
} }
function lazyLoadDisqusJS() { function lazyLoadDisqusJS() {
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) { const excludedHosts = ["localhost", "127.0.0.1"];
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.'; const hostname = window.location.hostname;
if (excludedHosts.includes(hostname)) {
document.getElementById('disqus_thread').innerHTML =
'Disqus comments not available by default when the website is previewed locally.';
return; return;
} }
@@ -11,7 +11,7 @@
data-emit-metadata="{{- default 0 .emitMetadata -}}" data-emit-metadata="{{- default 0 .emitMetadata -}}"
data-input-position="{{- default `top` .inputPosition -}}" data-input-position="{{- default `top` .inputPosition -}}"
data-theme="{{- default `light` .lightTheme -}}" data-theme="{{- default `light` .lightTheme -}}"
data-lang="{{- default $.Language.LanguageCode .lang -}}" data-lang="{{- default `en` .lang -}}"
data-loading="{{- .loading -}}" data-loading="{{- .loading -}}"
crossorigin="anonymous" crossorigin="anonymous"
async async
@@ -18,9 +18,10 @@
proxy: {{- .proxy -}}, proxy: {{- .proxy -}},
}); });
(function () { (function () {
if ( const excludedHosts = ["localhost", "127.0.0.1"];
["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1 const hostname = window.location.hostname;
) {
if (excludedHosts.includes(hostname)) {
document.getElementById("gitalk-container").innerHTML = document.getElementById("gitalk-container").innerHTML =
"Gitalk comments not available by default when the website is previewed locally."; "Gitalk comments not available by default when the website is previewed locally.";
return; return;
@@ -1,4 +1,4 @@
<script src="//cdn.jsdelivr.net/npm/[email protected].39/dist/twikoo.all.min.js"></script> <script src="//cdn.jsdelivr.net/npm/[email protected].44/dist/twikoo.all.min.js"></script>
<div id="tcomment"></div> <div id="tcomment"></div>
<style> <style>
.twikoo { .twikoo {
@@ -24,8 +24,11 @@
.twikoo .tk-preview-container, .twikoo .tk-preview-container,
.twikoo .tk-content, .twikoo .tk-content,
.twikoo .tk-nick, .twikoo .tk-nick,
.twikoo .tk-send { .twikoo .tk-send,
color: var(--twikoo-body-text-color-main); .twikoo .tk-comments-no,
.twikoo .el-input__count,
.twikoo .tk-submit-action-icon {
color: var(--twikoo-body-text-color-main)!important;
} }
.twikoo .el-button{ .twikoo .el-button{
color: var(--twikoo-body-text-color)!important; color: var(--twikoo-body-text-color)!important;
@@ -16,7 +16,7 @@
{{- with .Site.Params.comments.waline -}} {{- with .Site.Params.comments.waline -}}
{{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}} {{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}}
{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" -}} {{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" "turnstilekey" "turnstileKey" -}}
{{- range $key, $val := . -}} {{- range $key, $val := . -}}
{{- if ne $val nil -}} {{- if ne $val nil -}}
+9 -33
View File
@@ -1,38 +1,14 @@
{{- $title := .Title -}} {{- $pageTitle := .Title -}}
{{- $siteTitle := .Site.Title -}} {{- $siteTitle := .Site.Title -}}
{{- $paginator := partial "helper/paginator.html" . -}}
{{- if .IsHome -}} {{- $title := slice -}}
<!-- Homepage, and it's pagination -->
<!-- Build paginator --> {{- if and $paginator $paginator.HasPrev -}}
{{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }} <!-- Add page number-->
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} {{ $title = $title | append (printf "Page %d" $paginator.PageNumber) }}
{{ $filtered := ($pages | intersect $notHidden) }}
{{ $pag := .Paginate ($filtered) }}
{{ if .Paginator.HasPrev }}
<!-- Paginated. Append page number to title -->
{{ $title = printf "%s - %s" .Paginator $siteTitle }}
{{ else }}
{{ $title = $siteTitle}}
{{ end }}
{{- else if eq .Kind "term" -}}
<!-- Taxonomy page -->
<!-- Build paginator -->
{{ $notHidden := where .Pages "Params.hidden" "!=" true }}
{{ $pag := .Paginate ($notHidden) }}
<!-- {TAXONOMY_TYPE}: {TAXONOMY_TERM} -->
{{ $title = slice (title .Data.Singular) ": " $title }}
{{ if .Paginator.HasPrev }}
<!-- Add page number-->
{{ $title = $title | append " - " .Paginator }}
{{ end }}
{{ $title = $title | append " - " $siteTitle }}
{{ $title = delimit $title "" }}
{{- end -}} {{- end -}}
{{ return $title }} {{- $title = $title | append (default $siteTitle $pageTitle) -}}
{{ return delimit $title " - " }}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- $ThemeVersion := "3.28.0" -}} {{- $ThemeVersion := "3.34.2" -}}
<footer class="site-footer"> <footer class="site-footer">
<section class="copyright"> <section class="copyright">
&copy; &copy;
+1 -1
View File
@@ -22,5 +22,5 @@
<link rel="shortcut icon" href="{{ . | relURL }}" /> <link rel="shortcut icon" href="{{ . | relURL }}" />
{{ end }} {{ end }}
{{- template "_internal/google_analytics.html" . -}} {{- partial "google_analytics.html" . -}}
{{- partial "head/custom.html" . -}} {{- partial "head/custom.html" . -}}
@@ -0,0 +1,13 @@
{{/*
This helper is used to generate a background color and text color from a string
Used to generate deterministic colors for tags, categories, etc.
*/}}
{{- $str := . -}}
{{- $hash := hash.FNV32a $str -}}
{{- $h := mod $hash 360 -}}
{{- $backgroundColor := printf "hsl(%d, 60%%, 84%%)" $h -}}
{{- $textColor := printf "hsl(%d, 60%%, 15%%)" $h -}}
{{- return dict "BackgroundColor" $backgroundColor "TextColor" $textColor "Hue" $h -}}
+21
View File
@@ -0,0 +1,21 @@
{{- $pages := slice -}}
{{- if .IsHome -}}
{{ $pages = where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
{{ $pages = where $pages "Params.hidden" "!=" true }}
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") (eq .Kind "term") -}}
{{ $subsections := .Sections }}
{{ $pages = .Pages | complement $subsections }}
{{ $pages = where $pages "Params.hidden" "!=" true }}
{{- if eq (len $pages) 0 -}}
{{/* See complete logic in list.html */}}
{{- $pages = $subsections -}}
{{- end -}}
{{- end -}}
{{- if or .IsHome (eq .Kind "section") (eq .Kind "taxonomy") (eq .Kind "term") -}}
{{ $pages = .Paginate $pages }}
{{- end -}}
{{ return $pages }}
+69 -25
View File
@@ -1,26 +1,70 @@
{{ if gt .Paginator.TotalPages 1 }} {{- $pag := $.Paginator -}}
<nav class='pagination'> {{- if gt $pag.TotalPages 1 -}}
{{ $.Scratch.Set "hasPrevDots" false }} <nav class="pagination" role="navigation" aria-label="pagination">
{{ $.Scratch.Set "hasNextDots" false }} {{- /* Previous page button */ -}}
<a class="page-link {{ if not $pag.Prev }}disabled{{ end }}"
{{- if $pag.Prev -}}href="{{ $pag.Prev.URL }}" {{- end -}}
aria-label="Previous page"
{{- if not $pag.Prev -}}aria-disabled="true"{{- end -}}>
{{ partial "helper/icon" "chevron-left" }}
</a>
{{ range .Paginator.Pagers }} {{- /* Page numbers logic */ -}}
{{ if eq . $.Paginator }} {{- $window := 4 -}}
<span class='page-link current'> {{- $showFirst := true -}}
{{- .PageNumber -}} {{- $showLast := true -}}
</span>
{{ else if or (or (eq . $.Paginator.First) (eq . $.Paginator.Prev)) (or (eq . $.Paginator.Next) (eq . $.Paginator.Last )) }} {{- /* First page */ -}}
<a class='page-link' href='{{ .URL }}'> <a class="page-link {{ if eq $pag.PageNumber 1 }}current{{ end }}" aria-label="Page 1"
{{- .PageNumber -}} {{- if eq $pag.PageNumber 1 -}}aria-current="page" {{- end -}}
</a> {{- if ne $pag.PageNumber 1 -}}href="{{ $pag.First.URL }}"{{- end -}}>
{{ else }} 1
{{ if and (not ($.Scratch.Get "hasPrevDots")) (lt .PageNumber $.Paginator.PageNumber) }} </a>
{{ $.Scratch.Set "hasPrevDots" true }}
<span class='page-link dots'>&hellip;</span> {{- /* Left ellipsis - show if current page is > 3 */ -}}
{{ else if and (not ($.Scratch.Get "hasNextDots")) (gt .PageNumber $.Paginator.PageNumber) }} {{- if gt $pag.PageNumber 3 -}}
{{ $.Scratch.Set "hasNextDots" true }} <span class="page-link pagination-link">
<span class='page-link dots'>&hellip;</span> {{ partial "helper/icon" "dots" }}
{{ end }} </span>
{{ end }} {{- end -}}
{{ end }}
</nav> {{- /* Middle pages - show current and neighbors */ -}}
{{ end }} {{- range $pag.Pagers -}}
{{- if and (gt .PageNumber 1) (lt .PageNumber $pag.TotalPages) -}}
{{- if and (ge .PageNumber (sub $pag.PageNumber $window)) (le .PageNumber (add $pag.PageNumber $window)) -}}
<a class="page-link {{ if eq .PageNumber $pag.PageNumber }}current{{ end }}"
{{- if eq .PageNumber $pag.PageNumber -}}aria-current="page" {{- end -}} href="{{ .URL }}"
aria-label="Page {{ .PageNumber }}">
{{ .PageNumber }}
</a>
{{- end -}}
{{- end -}}
{{- end -}}
{{- /* Right ellipsis - show if current page is < last-2 */ -}}
{{- if lt $pag.PageNumber (sub $pag.TotalPages 2) -}}
<span class="page-link pagination-link">
{{ partial "helper/icon" "dots" }}
</span>
{{- end -}}
{{- /* Last page (if more than 1 page total) */ -}}
{{- if gt $pag.TotalPages 1 -}}
<a class="page-link {{ if eq $pag.PageNumber $pag.TotalPages }}current{{ end }}"
{{- if ne $pag.PageNumber $pag.TotalPages -}}href="{{ $pag.Last.URL }}" {{- end -}}
aria-label="Page {{ $pag.TotalPages }}"
{{- if eq $pag.PageNumber $pag.TotalPages -}}aria-current="page"{{- end -}}>
{{ $pag.TotalPages }}
</a>
{{- end -}}
{{- /* Next page button */ -}}
<a class="page-link {{ if not $pag.Next }}disabled{{ end }}"
{{- if $pag.Next -}}href="{{ $pag.Next.URL }}" {{- end -}}
aria-label="Next page"
{{- if not $pag.Next -}}aria-disabled="true"{{- end -}}>
{{ partial "helper/icon" "chevron-right" }}
</a>
</nav>
{{- end -}}
+1 -1
View File
@@ -60,7 +60,7 @@
<ol class="menu" id="main-menu"> <ol class="menu" id="main-menu">
{{ $currentPage := . }} {{ $currentPage := . }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }} {{ $active := or (eq $currentPage.RelPermalink .URL) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
<li {{ if $active }} class='current' {{ end }}> <li {{ if $active }} class='current' {{ end }}>
<a href='{{ .URL }}' {{ if eq .Params.newTab true }}target="_blank"{{ end }}> <a href='{{ .URL }}' {{ if eq .Params.newTab true }}target="_blank"{{ end }}>
{{ $icon := default .Pre .Params.Icon }} {{ $icon := default .Pre .Params.Icon }}
+1 -2
View File
@@ -10,8 +10,7 @@
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2> <h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
{{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }} {{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }}
{{ $notHidden := where $context.Site.RegularPages "Params.hidden" "!=" true }} {{ $filtered := where $pages "Params.hidden" "!=" true }}
{{ $filtered := ($pages | intersect $notHidden) }}
{{ $archives := $filtered.GroupByDate "2006" }} {{ $archives := $filtered.GroupByDate "2006" }}
<div class="widget-archive--list"> <div class="widget-archive--list">
+1 -1
View File
@@ -8,7 +8,7 @@
<div class="tagCloud-tags"> <div class="tagCloud-tags">
{{ range first $limit $context.Site.Taxonomies.tags.ByCount }} {{ range first $limit $context.Site.Taxonomies.tags.ByCount }}
<a href="{{ .Page.RelPermalink }}" class="font_size_{{ .Count }}"> <a href="{{ .Page.RelPermalink }}">
{{ .Page.Title }} {{ .Page.Title }}
</a> </a>
{{ end }} {{ end }}
-26
View File
@@ -1,26 +0,0 @@
[build]
publish = "exampleSite/public"
[build.environment]
HUGO_VERSION = "0.124.0"
HUGO_THEME = "repo"
[context.production]
command = "cd exampleSite && hugo --gc --themesDir ../.. -b ${URL}"
[context.production.environment]
HUGO_ENV = "production"
[context.branch-deploy]
command = "cd exampleSite && hugo --gc --themesDir ../.. -b ${DEPLOY_PRIME_URL}"
[context.deploy-preview]
command = "cd exampleSite && hugo --gc --themesDir ../.. -b ${DEPLOY_PRIME_URL}"
[[plugins]]
package = "netlify-plugin-hugo-cache-resources"
[plugins.inputs]
# If it should show more verbose logs (optional, default = true)
debug = true
# Relative path to source directory in case you use Hugo's "--s" option
srcdir = "exampleSite"
+9
View File
@@ -0,0 +1,9 @@
name = "hugo-theme-stack"
compatibility_date = "2026-01-25"
[build]
command = "chmod a+x ./.ci/build.sh && ./.ci/build.sh"
[assets]
directory = "demo/public"
not_found_handling = "404-page"