Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffab83a637 | ||
|
|
9add062300 | ||
|
|
12daa8c9fc | ||
|
|
f804db2c80 | ||
|
|
090378e4da | ||
|
|
d6ced60f51 | ||
|
|
dc36aa60a9 | ||
|
|
475d01b046 | ||
|
|
5a5876e3ea | ||
|
|
ba9a5caa16 | ||
|
|
47db505228 | ||
|
|
dc94a29617 | ||
|
|
7df31001af | ||
|
|
73ccacec4d | ||
|
|
2612ca87dc | ||
|
|
e8fc315ead | ||
|
|
145cda7d45 | ||
|
|
d507f2ef7c | ||
|
|
8f7eeb7de6 | ||
|
|
dd3bb1ea13 | ||
|
|
291fe5fd7e | ||
|
|
512a9ab625 | ||
|
|
5a10223f4c | ||
|
|
0b22c0a293 | ||
|
|
c413980b89 | ||
|
|
6d98e8463f | ||
|
|
50a42f28c0 | ||
|
|
f824d08f6f | ||
|
|
2f47d14a8a | ||
|
|
2d1d6727f5 | ||
|
|
8cb1646198 | ||
|
|
9e96c6e975 | ||
|
|
47832083d8 | ||
|
|
d9acd77015 | ||
|
|
06aa627d3c |
@@ -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 "$@"
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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": {
|
"build": {
|
||||||
"dockerfile": "Dockerfile",
|
"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",
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
|
||||||
|
// "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": {} },
|
||||||
|
|
||||||
|
// 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [],
|
||||||
|
|
||||||
|
// Configure tool-specific properties.
|
||||||
|
"customizations": {
|
||||||
|
// Configure properties specific to VS Code.
|
||||||
|
"vscode": {
|
||||||
// Set *default* container specific settings.json values on container create.
|
// Set *default* container specific settings.json values on container create.
|
||||||
"settings": {
|
"settings": {
|
||||||
"html.format.templating": true,
|
"html.format.templating": true
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add the IDs of extensions you want installed when the container is created.
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"bungcip.better-toml",
|
// https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter
|
||||||
"davidanson.vscode-markdownlint"
|
"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",
|
||||||
|
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// "csstools.postcss",
|
||||||
"forwardPorts": [
|
|
||||||
1313
|
|
||||||
],
|
|
||||||
|
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// "esbenp.prettier-vscode",
|
||||||
// "postCreateCommand": "uname -a",
|
// "tamasfe.even-better-toml",
|
||||||
|
// "naumovs.color-highlight",
|
||||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
// "GitHub.vscode-pull-request-github",
|
||||||
"remoteUser": "node",
|
// "eamodio.gitlens",
|
||||||
"features": {
|
"davidanson.vscode-markdownlint",
|
||||||
"golang": "latest"
|
"streetsidesoftware.code-spell-checker"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"remoteUser": "vscode",
|
||||||
|
|
||||||
|
"postCreateCommand": "pnpm install-completion zsh"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
&:first-child,
|
||||||
|
&:last-child {
|
||||||
|
flex: 0 0 48px;
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover:not(.current):not(.disabled) {
|
||||||
|
background-color: var(--card-background-selected);
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
&.current {
|
&.current {
|
||||||
font-weight: bold;
|
|
||||||
background-color: var(--card-background-selected);
|
background-color: var(--card-background-selected);
|
||||||
color: var(--card-text-color-main);
|
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);
|
color: var(--card-text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -32,10 +32,12 @@ 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");
|
||||||
|
if (link) {
|
||||||
const href = link.getAttribute("href");
|
const href = link.getAttribute("href");
|
||||||
if (href.startsWith("#")) {
|
if (href.startsWith("#")) {
|
||||||
sectionLinkRef[href.slice(1)] = navigationElement;
|
sectionLinkRef[href.slice(1)] = navigationElement;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return sectionLinkRef;
|
return sectionLinkRef;
|
||||||
@@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
menu:
|
||||||
|
main:
|
||||||
|
name: ホーム
|
||||||
|
weight: -100
|
||||||
|
params:
|
||||||
|
icon: home
|
||||||
|
---
|
||||||
@@ -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: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
|
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 >}}
|
||||||
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
hugo server --gc --themesDir=../..
|
||||||
@@ -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:
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ widget:
|
|||||||
tagCloud:
|
tagCloud:
|
||||||
title:
|
title:
|
||||||
other: Теги
|
other: Теги
|
||||||
|
categoriesCloud:
|
||||||
|
title:
|
||||||
|
other: Категории
|
||||||
|
|
||||||
search:
|
search:
|
||||||
title:
|
title:
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ widget:
|
|||||||
tagCloud:
|
tagCloud:
|
||||||
title:
|
title:
|
||||||
other: Теґи
|
other: Теґи
|
||||||
|
categoriesCloud:
|
||||||
|
title:
|
||||||
|
other: Категорії
|
||||||
|
|
||||||
search:
|
search:
|
||||||
title:
|
title:
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
const wrongUrl = new URL(window.location.href);
|
const wrongUrl = new URL(window.location.href);
|
||||||
|
|
||||||
/// Get the search keyword from the wrong URL by removing all slashes and dashes
|
/// Get the search keyword from the wrong URL by removing all slashes and dashes
|
||||||
const searchKeyword = wrongUrl.pathname.split(/[/|-]/).join(' ').trim();
|
const searchKeyword = decodeURIComponent(wrongUrl.pathname).split(/[/|-]/).join(' ').trim();
|
||||||
|
|
||||||
document.getElementById('searchInput').setAttribute('value', searchKeyword);
|
document.getElementById('searchInput').setAttribute('value', searchKeyword);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<pre class="mermaid">
|
||||||
|
{{ .Inner | htmlEscape | safeHTML }}
|
||||||
|
</pre>
|
||||||
|
{{ .Page.Store.Set "hasMermaid" true }}
|
||||||
@@ -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 " " "-") }}
|
||||||
|
|||||||
@@ -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" . }}
|
||||||
|
{{ with $paginator }}
|
||||||
<section class="article-list--compact">
|
<section class="article-list--compact">
|
||||||
{{ range $paginator.Pages }}
|
{{ range .Pages }}
|
||||||
{{ partial "article-list/compact" . }}
|
{{ partial "article-list/compact" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{- partial "pagination.html" . -}}
|
{{- partial "pagination.html" . -}}
|
||||||
|
|
||||||
|
|||||||
@@ -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" }}
|
||||||
|
|||||||
@@ -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,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 -}}
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
|
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener("DOMContentLoaded", () => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
const mainArticleElement = document.querySelector(".main-article");
|
const elementsToRender = [".main-article", ".widget--toc"];
|
||||||
renderMathInElement(mainArticleElement, {
|
|
||||||
|
elementsToRender.forEach(selector => {
|
||||||
|
const element = document.querySelector(selector);
|
||||||
|
if (element) {
|
||||||
|
renderMathInElement(element, {
|
||||||
delimiters: [
|
delimiters: [
|
||||||
{ left: "$$", right: "$$", display: true },
|
{ left: "$$", right: "$$", display: true },
|
||||||
{ left: "$", right: "$", display: false },
|
{ left: "$", right: "$", display: false },
|
||||||
@@ -10,5 +14,8 @@
|
|||||||
{ left: "\\[", right: "\\]", display: true }
|
{ left: "\\[", right: "\\]", display: true }
|
||||||
],
|
],
|
||||||
ignoredClasses: ["gist"]
|
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 }}
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 -}}
|
||||||
|
|||||||
@@ -1,38 +1,20 @@
|
|||||||
{{- $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 $pageTitle }}
|
||||||
{{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
{{- $title = slice $pageTitle -}}
|
||||||
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
|
||||||
{{ $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 }}
|
{{- if and $paginator $paginator.HasPrev -}}
|
||||||
|
<!-- Add page number-->
|
||||||
|
{{ $title = $title | append (printf "Page %d" $paginator.PageNumber) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- if not .IsPage -}}
|
||||||
|
{{ $title = $title | append $siteTitle }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ return delimit $title " - " }}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{{- $ThemeVersion := "3.30.0" -}}
|
{{- $ThemeVersion := "3.34.0" -}}
|
||||||
<footer class="site-footer">
|
<footer class="site-footer">
|
||||||
<section class="copyright">
|
<section class="copyright">
|
||||||
©
|
©
|
||||||
|
|||||||
@@ -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 -}}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{{- $pages := "" -}}
|
||||||
|
|
||||||
|
{{- if .IsHome -}}
|
||||||
|
{{ $pages = where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
||||||
|
{{ $pages = where $pages "Params.hidden" "!=" true }}
|
||||||
|
{{- else if eq .Kind "term" -}}
|
||||||
|
{{ $pages = where .Pages "Params.hidden" "!=" true }}
|
||||||
|
{{- else if or (eq .Kind "section") (eq .Kind "taxonomy") -}}
|
||||||
|
{{ $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 $pages -}}
|
||||||
|
{{ $pages = .Paginate $pages }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{ return $pages }}
|
||||||
@@ -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 }}"
|
||||||
{{ range .Paginator.Pagers }}
|
{{- if $pag.Prev -}}href="{{ $pag.Prev.URL }}" {{- end -}}
|
||||||
{{ if eq . $.Paginator }}
|
aria-label="Previous page"
|
||||||
<span class='page-link current'>
|
{{- if not $pag.Prev -}}aria-disabled="true"{{- end -}}>
|
||||||
{{- .PageNumber -}}
|
{{ partial "helper/icon" "chevron-left" }}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{{- /* Page numbers logic */ -}}
|
||||||
|
{{- $window := 4 -}}
|
||||||
|
{{- $showFirst := true -}}
|
||||||
|
{{- $showLast := true -}}
|
||||||
|
|
||||||
|
{{- /* First page */ -}}
|
||||||
|
<a class="page-link {{ if eq $pag.PageNumber 1 }}current{{ end }}" aria-label="Page 1"
|
||||||
|
{{- if eq $pag.PageNumber 1 -}}aria-current="page" {{- end -}}
|
||||||
|
{{- if ne $pag.PageNumber 1 -}}href="{{ $pag.First.URL }}"{{- end -}}>
|
||||||
|
1
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{{- /* Left ellipsis - show if current page is > 3 */ -}}
|
||||||
|
{{- if gt $pag.PageNumber 3 -}}
|
||||||
|
<span class="page-link pagination-link">
|
||||||
|
{{ partial "helper/icon" "dots" }}
|
||||||
</span>
|
</span>
|
||||||
{{ else if or (or (eq . $.Paginator.First) (eq . $.Paginator.Prev)) (or (eq . $.Paginator.Next) (eq . $.Paginator.Last )) }}
|
{{- end -}}
|
||||||
<a class='page-link' href='{{ .URL }}'>
|
|
||||||
{{- .PageNumber -}}
|
{{- /* Middle pages - show current and neighbors */ -}}
|
||||||
|
{{- 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>
|
</a>
|
||||||
{{ else }}
|
|
||||||
{{ if and (not ($.Scratch.Get "hasPrevDots")) (lt .PageNumber $.Paginator.PageNumber) }}
|
|
||||||
{{ $.Scratch.Set "hasPrevDots" true }}
|
|
||||||
<span class='page-link dots'>…</span>
|
|
||||||
{{ else if and (not ($.Scratch.Get "hasNextDots")) (gt .PageNumber $.Paginator.PageNumber) }}
|
|
||||||
{{ $.Scratch.Set "hasNextDots" true }}
|
|
||||||
<span class='page-link dots'>…</span>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
</nav>
|
</nav>
|
||||||
{{ end }}
|
{{- end -}}
|
||||||
@@ -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 }}
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|||||||
@@ -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 }}
|
||||||
|
|||||||
@@ -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"
|
|
||||||
@@ -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"
|
||||||