Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72e3b16638 | ||
|
|
60e2ad9201 | ||
|
|
6f0b4be72c | ||
|
|
7a09b136bb | ||
|
|
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 | ||
|
|
9e6b7b22a9 | ||
|
|
f1ab6c6aba | ||
|
|
087989e427 | ||
|
|
0991f61d49 | ||
|
|
839fbd0ecb | ||
|
|
5175ac5ae3 | ||
|
|
37f1541c20 | ||
|
|
f4eb5d3e99 | ||
|
|
788dd497b3 | ||
|
|
8a7fb33163 | ||
|
|
2a18a92901 | ||
|
|
245b0f2810 | ||
|
|
0fb25c808b | ||
|
|
048a000f17 | ||
|
|
5f157478aa | ||
|
|
8556681b7c | ||
|
|
fa760d70cb | ||
|
|
bdcab89d86 | ||
|
|
b3907acdae | ||
|
|
23ff70d41a | ||
|
|
41a3e5ee13 | ||
|
|
0558108e30 | ||
|
|
12f31dfd8a | ||
|
|
374b25a60f | ||
|
|
fcd56dd21c | ||
|
|
fddab05362 | ||
|
|
f3783856ad | ||
|
|
130e2f6607 | ||
|
|
ce798a32a9 | ||
|
|
609d43b088 | ||
|
|
797949b37f | ||
|
|
539c39d69a | ||
|
|
f8466d94d2 | ||
|
|
43e074364c | ||
|
|
b2157bdf78 | ||
|
|
23607527e4 | ||
|
|
54a8ace564 | ||
|
|
b3fbe78ca5 | ||
|
|
2cb5ba683b | ||
|
|
5a8607e4a8 | ||
|
|
eafcf894c8 | ||
|
|
0b9f6c36ad | ||
|
|
04bf1956b9 | ||
|
|
6c7d42d45a | ||
|
|
2cda779706 | ||
|
|
4948a3723e | ||
|
|
43224bd39a | ||
|
|
4e7865c185 |
@@ -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
|
||||
ARG NODE_VERSION=14
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${NODE_VERSION}
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
|
||||
|
||||
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.
|
||||
ARG VARIANT=hugo
|
||||
ARG VARIANT=hugo_extended
|
||||
# VERSION can be either 'latest' or a specific version number
|
||||
ARG VERSION=latest
|
||||
|
||||
# Download Hugo
|
||||
RUN apt-get update && apt-get install -y ca-certificates openssl git curl && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
case ${VERSION} in \
|
||||
RUN case ${VERSION} in \
|
||||
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)}') ;;\
|
||||
esac && \
|
||||
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 && \
|
||||
mv hugo /usr/bin/hugo
|
||||
|
||||
# Hugo dev server port
|
||||
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
|
||||
# RUN sudo -u node npm install -g <your-package-list-here>
|
||||
USER ${USER}
|
||||
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)",
|
||||
"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",
|
||||
}
|
||||
},
|
||||
"name": "Hugo & pnpm",
|
||||
|
||||
// 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": [
|
||||
"bungcip.better-toml",
|
||||
"davidanson.vscode-markdownlint"
|
||||
],
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [
|
||||
1313
|
||||
],
|
||||
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
|
||||
// "features": { "ghcr.io/devcontainers/features/docker-in-docker:2": {} },
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "uname -a",
|
||||
// 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "node",
|
||||
"features": {
|
||||
"golang": "latest"
|
||||
}
|
||||
// Configure tool-specific properties.
|
||||
"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",
|
||||
|
||||
// "csstools.postcss",
|
||||
|
||||
// "esbenp.prettier-vscode",
|
||||
// "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"
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report! Please provide as much information as possible and make sure you have checked the [documentation](https://stack.jimmycai.com/).
|
||||
Thanks for taking the time to fill out this bug report! Please provide as much information as possible and make sure you have checked the [documentation](https://stack.jimmycai.com/guide/).
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,6 +122,7 @@
|
||||
.article-tags {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
|
||||
a {
|
||||
color: var(--accent-color-text);
|
||||
|
||||
@@ -12,6 +12,9 @@ body {
|
||||
margin: 0;
|
||||
font-family: var(--base-font-family);
|
||||
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;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
@@ -35,4 +38,4 @@ body {
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: transparent;
|
||||
}
|
||||
/**/
|
||||
/**/
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
}
|
||||
|
||||
.article-tags {
|
||||
flex-wrap: wrap;
|
||||
text-transform: unset;
|
||||
}
|
||||
|
||||
@@ -222,6 +221,28 @@
|
||||
margin-inline-start: calc((var(--card-padding)) * -1);
|
||||
padding-inline-start: calc(var(--card-padding) - var(--heading-border-size));
|
||||
border-inline-start: var(--heading-border-size) solid var(--accent-color);
|
||||
position: relative;
|
||||
|
||||
a.header-anchor {
|
||||
transition: opacity 0.3s ease;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: var(--card-padding);
|
||||
text-align: center;
|
||||
color: var(--accent-color);
|
||||
|
||||
&:before {
|
||||
content: "#";
|
||||
}
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
a.header-anchor {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
figure {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
img {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,10 +48,12 @@
|
||||
|
||||
.subsection-list {
|
||||
overflow-x: auto;
|
||||
margin-left: -24px;
|
||||
|
||||
.article-list--tile {
|
||||
display: flex;
|
||||
padding-bottom: 15px;
|
||||
padding: 8px 0 34px 24px;
|
||||
width: max-content;
|
||||
|
||||
article {
|
||||
width: 250px;
|
||||
@@ -68,4 +71,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,10 +127,8 @@
|
||||
}
|
||||
|
||||
/* Menu style */
|
||||
.menu {
|
||||
padding-left: 0;
|
||||
#main-menu {
|
||||
list-style: none;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
flex-grow: 1;
|
||||
font-size: 1.4rem;
|
||||
@@ -141,13 +139,15 @@
|
||||
margin: 0 calc(var(--container-padding) * -1);
|
||||
|
||||
padding: 30px 30px;
|
||||
|
||||
@include respond(xl) {
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
&,
|
||||
.menu-bottom-section {
|
||||
&, .menu-bottom-section ol {
|
||||
flex-direction: column;
|
||||
gap: 30px;
|
||||
|
||||
@include respond(xl) {
|
||||
gap: 25px;
|
||||
}
|
||||
@@ -200,17 +200,19 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.menu-bottom-section {
|
||||
margin-top: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
&.menu-bottom-section {
|
||||
margin-top: auto;
|
||||
|
||||
ol {
|
||||
display: flex;
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.social-menu {
|
||||
.menu-social {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
@@ -4,18 +4,47 @@
|
||||
box-shadow: var(--shadow-l1);
|
||||
border-radius: var(--card-border-radius);
|
||||
overflow: hidden;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.page-link {
|
||||
padding: 16px 32px;
|
||||
display: inline-flex;
|
||||
padding: 16px 0;
|
||||
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 {
|
||||
font-weight: bold;
|
||||
background-color: var(--card-background-selected);
|
||||
color: var(--card-text-color-main);
|
||||
&:first-child,
|
||||
&:last-child {
|
||||
flex: 0 0 48px;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
$defaultTagBackgrounds: #8ea885, #df7988, #0177b8, #ffb900, #6b69d6;
|
||||
$defaultTagColors: #fff, #fff, #fff, #fff, #fff;
|
||||
|
||||
/*
|
||||
* Global style
|
||||
*/
|
||||
@@ -41,10 +38,8 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff;
|
||||
*/
|
||||
:root {
|
||||
--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), var(--zh-font-family), sans-serif;
|
||||
--code-font-family: Menlo, Monaco, Consolas, "Courier New", var(--zh-font-family), monospace;
|
||||
--base-font-family: "Lato", var(--sys-font-family), sans-serif;
|
||||
--code-font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,6 +8,10 @@ class StackColorScheme {
|
||||
constructor(toggleEl: HTMLElement) {
|
||||
this.bindMatchMedia();
|
||||
this.currentScheme = this.getSavedScheme();
|
||||
if (window.matchMedia('(prefers-color-scheme: dark)').matches === true)
|
||||
this.systemPreferScheme = 'dark'
|
||||
else
|
||||
this.systemPreferScheme = 'light';
|
||||
|
||||
this.dispatchEvent(document.documentElement.dataset.scheme as colorScheme);
|
||||
|
||||
|
||||
@@ -32,9 +32,11 @@ function buildIdToNavigationElementMap(navigation: NodeListOf<Element>): IdToEle
|
||||
const sectionLinkRef: IdToElementMap = {};
|
||||
navigation.forEach((navigationElement: HTMLElement) => {
|
||||
const link = navigationElement.querySelector("a");
|
||||
const href = link.getAttribute("href");
|
||||
if (href.startsWith("#")) {
|
||||
sectionLinkRef[href.slice(1)] = navigationElement;
|
||||
if (link) {
|
||||
const href = link.getAttribute("href");
|
||||
if (href.startsWith("#")) {
|
||||
sectionLinkRef[href.slice(1)] = navigationElement;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -125,7 +127,14 @@ function setupScrollspy() {
|
||||
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));
|
||||
}
|
||||
|
||||
export { setupScrollspy };
|
||||
export { setupScrollspy };
|
||||
|
||||
@@ -53,7 +53,14 @@ class Search {
|
||||
this.resultTitle = resultTitle;
|
||||
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.bindSearchForm();
|
||||
}
|
||||
|
||||
@@ -21,17 +21,17 @@ PhotoSwipe:
|
||||
type: style
|
||||
|
||||
KaTeX:
|
||||
- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.css
|
||||
integrity: sha256-J+iAE0sgH8QSz9hpcDxXIftnj65JEZgNhGcgReTTK9s=
|
||||
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css
|
||||
integrity: sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV
|
||||
type: style
|
||||
|
||||
- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/katex.min.js
|
||||
integrity: sha256-InsNdER1b2xUewP+pKCUJpkhiqwHgqiPXDlIk7GzBu4=
|
||||
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js
|
||||
integrity: sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8
|
||||
type: script
|
||||
defer: true
|
||||
|
||||
- src: https://cdn.jsdelivr.net/npm/katex@0.15.6/dist/contrib/auto-render.min.js
|
||||
integrity: sha256-y39Mpg7V3D4lhBX4x6O0bUqTV4pSrfgwEfGKfxkOdgI=
|
||||
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js
|
||||
integrity: sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05
|
||||
type: script
|
||||
defer: true
|
||||
|
||||
|
||||
@@ -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 |
@@ -15,7 +15,7 @@ menu:
|
||||
icon: user
|
||||
---
|
||||
|
||||
Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
|
||||
Written in Go, Hugo is an open source static site generator available under the [Apache License 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
|
||||
|
||||
Hugo makes use of a variety of open source projects including:
|
||||
|
||||
@@ -29,6 +29,6 @@ Hugo is ideal for blogs, corporate websites, creative portfolios, online magazin
|
||||
|
||||
Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases.
|
||||
|
||||
Websites built with Hugo are extremelly fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.
|
||||
Websites built with Hugo are extremely fast, secure and can be deployed anywhere including, AWS, GitHub Pages, Heroku, Netlify and any other hosting provider.
|
||||
|
||||
Learn more and contribute on [GitHub](https://github.com/gohugoio).
|
||||
|
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
|
||||
- テスト
|
||||
---
|
||||
|
||||
## 本文テスト(フォント)
|
||||
|
||||
返扇花週認契適違込遷雇述請曜藤突扉直角
|
||||
|
||||
## 引用
|
||||
|
||||
> 国破れて山河在り\
|
||||
> 城春にして草木深し\
|
||||
> 時に感じては花にも涙を濺ぎ\
|
||||
> 別れを恨んでは鳥にも心を驚かす
|
||||
>
|
||||
> 烽火三月に連なり\
|
||||
> 家書万金に抵たる\
|
||||
> 白頭掻けば更に短く\
|
||||
> 渾べて簪に勝へざらんと欲す
|
||||
@@ -36,4 +36,8 @@ 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>
|
||||
<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 |
@@ -21,17 +21,17 @@ In this example we will be using [KaTeX](https://katex.org/)
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
- To enable KaTex globally set the parameter `math` to `true` in a project's configuration
|
||||
- To enable KaTex on a per page basis include the parameter `math: true` in content files
|
||||
- To enable KaTeX globally set the parameter `math` to `true` in a project's configuration
|
||||
- To enable KaTeX on a per page basis include the parameter `math: true` in content files
|
||||
|
||||
**Note:** Use the online reference of [Supported TeX Functions](https://katex.org/docs/supported.html)
|
||||
|
||||
{{< math.inline >}}
|
||||
{{ if or .Page.Params.math .Site.Params.math }}
|
||||
<!-- KaTeX -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
|
||||
{{ end }}
|
||||
{{</ math.inline >}}
|
||||
|
||||
|
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>
|
||||
|
||||
@@ -37,10 +37,6 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
|
||||
|
||||
{{< bilibili av498363026 >}}
|
||||
|
||||
## Gist Shortcode
|
||||
|
||||
{{< gist spf13 7896402 >}}
|
||||
|
||||
## Gitlab Snippets Shortcode
|
||||
|
||||
{{< gitlab 2349278 >}}
|
||||
@@ -1,7 +1,6 @@
|
||||
baseurl: https://example.com
|
||||
baseurl: https://example.com/
|
||||
languageCode: en-us
|
||||
theme: hugo-theme-stack
|
||||
paginate: 3
|
||||
title: Example Site
|
||||
copyright: Example Person
|
||||
|
||||
@@ -19,20 +18,39 @@ languages:
|
||||
title: Example Site
|
||||
weight: 1
|
||||
params:
|
||||
description: Example description
|
||||
sidebar:
|
||||
subtitle: Example description
|
||||
zh-cn:
|
||||
languageName: 中文
|
||||
languageName: 简体中文
|
||||
title: 演示站点
|
||||
weight: 2
|
||||
params:
|
||||
description: 演示说明
|
||||
sidebar:
|
||||
subtitle: 演示说明
|
||||
|
||||
zh-tw:
|
||||
languageName: 正體中文
|
||||
title: 演示站點
|
||||
weight: 2
|
||||
params:
|
||||
sidebar:
|
||||
subtitle: 演示說明
|
||||
|
||||
ja:
|
||||
languageName: 日本語
|
||||
title: サンプルサイト
|
||||
weight: 2
|
||||
params:
|
||||
sidebar:
|
||||
subtitle: サンプル説明
|
||||
ar:
|
||||
languageName: عربي
|
||||
languagedirection: rtl
|
||||
title: موقع تجريبي
|
||||
weight: 3
|
||||
params:
|
||||
description: وصف تجريبي
|
||||
sidebar:
|
||||
subtitle: وصف تجريبي
|
||||
|
||||
services:
|
||||
# Change it to your Disqus shortname before using
|
||||
@@ -42,6 +60,9 @@ services:
|
||||
googleAnalytics:
|
||||
id:
|
||||
|
||||
pagination:
|
||||
pagerSize: 3
|
||||
|
||||
permalinks:
|
||||
post: /p/:slug/
|
||||
page: /:slug/
|
||||
@@ -97,7 +118,7 @@ params:
|
||||
repo:
|
||||
issueTerm: pathname
|
||||
label:
|
||||
theme:
|
||||
theme:
|
||||
|
||||
remark42:
|
||||
host:
|
||||
@@ -156,6 +177,7 @@ params:
|
||||
repo:
|
||||
clientID:
|
||||
clientSecret:
|
||||
proxy:
|
||||
|
||||
cusdis:
|
||||
host:
|
||||
@@ -203,7 +225,7 @@ params:
|
||||
enabled: true
|
||||
|
||||
### Custom menu
|
||||
### See https://docs.stack.jimmycai.com/configuration/custom-menu.html
|
||||
### See https://stack.jimmycai.com/config/menu
|
||||
### To remove about, archive and search page menu item, remove `menu` field from their FrontMatter
|
||||
menu:
|
||||
main: []
|
||||
@@ -234,6 +256,18 @@ related:
|
||||
|
||||
markup:
|
||||
goldmark:
|
||||
extensions:
|
||||
passthrough:
|
||||
enable: true
|
||||
delimiters:
|
||||
block:
|
||||
- - \[
|
||||
- \]
|
||||
- - $$
|
||||
- $$
|
||||
inline:
|
||||
- - \(
|
||||
- \)
|
||||
renderer:
|
||||
## Set to true if you have HTML content inside Markdown
|
||||
unsafe: true
|
||||
@@ -0,0 +1 @@
|
||||
hugo server --gc --themesDir=../..
|
||||
@@ -28,6 +28,7 @@ params:
|
||||
src: img/avatar.png
|
||||
|
||||
article:
|
||||
headingAnchor: false
|
||||
math: false
|
||||
toc: true
|
||||
readingTime: true
|
||||
@@ -68,7 +68,7 @@ search:
|
||||
|
||||
footer:
|
||||
builtWith:
|
||||
other: "مبني بستخدام {{ .Generator }}"
|
||||
other: "مبني باستخدام {{ .Generator }}"
|
||||
|
||||
designedBy:
|
||||
other: "قالب {{ .Theme }} مصمم من {{ .DesignedBy }}"
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
toggleMenu:
|
||||
other: Покажи Меню
|
||||
|
||||
darkMode:
|
||||
other: Тъмен Режим
|
||||
|
||||
list:
|
||||
page:
|
||||
one: "{{ .Count }} страница"
|
||||
other: "{{ .Count }} страници"
|
||||
|
||||
section:
|
||||
other: Секция
|
||||
|
||||
subsection:
|
||||
one: Подсекция
|
||||
other: Подсекции
|
||||
|
||||
article:
|
||||
back:
|
||||
other: Назад
|
||||
|
||||
tableOfContents:
|
||||
other: Съдържание
|
||||
|
||||
relatedContent:
|
||||
other: Свързано Съдържание
|
||||
|
||||
lastUpdatedOn:
|
||||
other: Последна промяна на
|
||||
|
||||
readingTime:
|
||||
one: "{{ .Count }} minute read"
|
||||
other: "{{ .Count }} minute read"
|
||||
|
||||
notFound:
|
||||
title:
|
||||
other: Не е намерено
|
||||
|
||||
subtitle:
|
||||
other: Страницата която търсите не е открита
|
||||
|
||||
widget:
|
||||
archives:
|
||||
title:
|
||||
other: Архиви
|
||||
|
||||
more:
|
||||
other: Повече
|
||||
|
||||
tagCloud:
|
||||
title:
|
||||
other: Тагове
|
||||
categoriesCloud:
|
||||
title:
|
||||
other: Категории
|
||||
|
||||
search:
|
||||
title:
|
||||
other: Търсене
|
||||
|
||||
placeholder:
|
||||
other: Напишете нещо...
|
||||
|
||||
resultTitle:
|
||||
other: "#PAGES_COUNT страници (#TIME_SECONDS секунди)"
|
||||
|
||||
footer:
|
||||
builtWith:
|
||||
other: Създадено с {{ .Generator }}
|
||||
|
||||
designedBy:
|
||||
other: Тема {{ .Theme }} създадена от {{ .DesignedBy }}
|
||||
@@ -50,6 +50,9 @@ widget:
|
||||
tagCloud:
|
||||
title:
|
||||
other: Mots clés
|
||||
categoriesCloud:
|
||||
title:
|
||||
other: Catégories
|
||||
|
||||
search:
|
||||
title:
|
||||
|
||||
@@ -2,7 +2,7 @@ toggleMenu:
|
||||
other: Toggle Menu
|
||||
|
||||
darkMode:
|
||||
other: Dark Mode
|
||||
other: Modalità scura
|
||||
|
||||
list:
|
||||
page:
|
||||
@@ -49,7 +49,7 @@ widget:
|
||||
|
||||
tagCloud:
|
||||
title:
|
||||
other: Tags
|
||||
other: Tag
|
||||
|
||||
categoriesCloud:
|
||||
title:
|
||||
|
||||
@@ -4,6 +4,16 @@ toggleMenu:
|
||||
darkMode:
|
||||
other: ダークモード
|
||||
|
||||
list:
|
||||
page:
|
||||
other: "{{ .Count }} ページ目"
|
||||
|
||||
section:
|
||||
other: セクション
|
||||
|
||||
subsection:
|
||||
other: サブセクション
|
||||
|
||||
article:
|
||||
back:
|
||||
other: 前のページ
|
||||
@@ -54,7 +64,7 @@ search:
|
||||
|
||||
footer:
|
||||
builtWith:
|
||||
other: Built with {{ .Generator }}
|
||||
other: "{{ .Generator }} で構築されています。"
|
||||
|
||||
designedBy:
|
||||
other: テーマ {{ .Theme }} は {{ .DesignedBy }} によって設計されています。
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
toggleMenu:
|
||||
other: Alternar menú
|
||||
|
||||
darkMode:
|
||||
other: Mòde fosc
|
||||
|
||||
list:
|
||||
page:
|
||||
one: "{{ .Count }} pagina"
|
||||
other: "{{ .Count }} paginas"
|
||||
|
||||
section:
|
||||
other: Seccion
|
||||
|
||||
subsection:
|
||||
one: Josseccion
|
||||
other: Josseccions
|
||||
|
||||
article:
|
||||
back:
|
||||
other: Tornar
|
||||
|
||||
tableOfContents:
|
||||
other: Taula de contengut
|
||||
|
||||
relatedContent:
|
||||
other: Contenguts relacionats
|
||||
|
||||
lastUpdatedOn:
|
||||
other: Darrièra actualizacion
|
||||
readingTime:
|
||||
one: "{{ .Count }} minuta de lectura"
|
||||
other: "{{ .Count }} minutas de lectura"
|
||||
|
||||
notFound:
|
||||
title:
|
||||
other: Non trobat
|
||||
|
||||
subtitle:
|
||||
other: Aquesta pagina existís pas
|
||||
|
||||
widget:
|
||||
archives:
|
||||
title:
|
||||
other: Archiu
|
||||
|
||||
more:
|
||||
other: Mai
|
||||
|
||||
tagCloud:
|
||||
title:
|
||||
other: Etiquetas
|
||||
categoriesCloud:
|
||||
title:
|
||||
other: Categorias
|
||||
|
||||
search:
|
||||
title:
|
||||
other: Cercar
|
||||
|
||||
placeholder:
|
||||
other: Picatz quicòm...
|
||||
|
||||
resultTitle:
|
||||
other: "#PAGES_COUNT paginas dins (#TIME_SECONDS segons)"
|
||||
|
||||
footer:
|
||||
builtWith:
|
||||
other: Creat amb {{ .Generator }}
|
||||
|
||||
designedBy:
|
||||
other: Tàma {{ .Theme }} concebut per {{ .DesignedBy }}
|
||||
@@ -47,6 +47,9 @@ widget:
|
||||
tagCloud:
|
||||
title:
|
||||
other: Теги
|
||||
categoriesCloud:
|
||||
title:
|
||||
other: Категории
|
||||
|
||||
search:
|
||||
title:
|
||||
|
||||
@@ -17,11 +17,22 @@ list:
|
||||
other: Alt bölümler
|
||||
|
||||
article:
|
||||
back:
|
||||
other: Geri
|
||||
|
||||
tableOfContents:
|
||||
other: İçindekiler
|
||||
|
||||
relatedContent:
|
||||
other: Alakalı içerikler
|
||||
other: Benzer içerikler
|
||||
|
||||
lastUpdatedOn:
|
||||
other: Son güncelleme
|
||||
|
||||
readingTime:
|
||||
one: "{{ .Count }} dakika okuma süresi"
|
||||
other: "{{ .Count }} dakika okuma süresi"
|
||||
|
||||
notFound:
|
||||
title:
|
||||
other: Bulunamadı
|
||||
@@ -37,6 +48,9 @@ widget:
|
||||
tagCloud:
|
||||
title:
|
||||
other: Etiketler
|
||||
categoriesCloud:
|
||||
title:
|
||||
other: Kategoriler
|
||||
|
||||
search:
|
||||
title:
|
||||
|
||||
@@ -52,6 +52,9 @@ widget:
|
||||
tagCloud:
|
||||
title:
|
||||
other: Теґи
|
||||
categoriesCloud:
|
||||
title:
|
||||
other: Категорії
|
||||
|
||||
search:
|
||||
title:
|
||||
|
||||
@@ -4,6 +4,13 @@ toggleMenu:
|
||||
darkMode:
|
||||
other: 暗色模式
|
||||
|
||||
list:
|
||||
page: "{{ .Count }} 个页面"
|
||||
|
||||
section: 章节
|
||||
|
||||
subsection: 子章节
|
||||
|
||||
article:
|
||||
back:
|
||||
other: 返回
|
||||
@@ -54,7 +61,7 @@ search:
|
||||
|
||||
footer:
|
||||
builtWith:
|
||||
other: Built with {{ .Generator }}
|
||||
other: 使用 {{ .Generator }} 构建
|
||||
|
||||
designedBy:
|
||||
other: 主题 {{ .Theme }} 由 {{ .DesignedBy }} 设计
|
||||
|
||||
@@ -3,5 +3,43 @@
|
||||
<h1 class="article-title">{{ T "notFound.title" }}</h1>
|
||||
<h2 class="article-subtitle">{{ T "notFound.subtitle" }}</h2>
|
||||
</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" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<pre class="mermaid">
|
||||
{{ .Inner | htmlEscape | safeHTML }}
|
||||
</pre>
|
||||
{{ .Page.Store.Set "hasMermaid" true }}
|
||||
@@ -0,0 +1,6 @@
|
||||
<h{{ .Level }} id="{{ .Anchor }}">
|
||||
{{- if site.Params.Article.HeadingAnchor -}}
|
||||
<a href="#{{ .Anchor }}" class="header-anchor"></a>
|
||||
{{- end -}}
|
||||
{{ .Text | safeHTML }}
|
||||
</h{{ .Level }}>
|
||||
@@ -4,7 +4,7 @@
|
||||
{{- $taxonomy := $.Site.GetPage "taxonomyTerm" "categories" -}}
|
||||
{{- $terms := $taxonomy.Pages -}}
|
||||
{{ if $terms }}
|
||||
<h2 class="section-title">{{ $taxonomy.Title }}</h2>
|
||||
<h2 class="section-title">{{ T "widget.categoriesCloud.title" }}</h2>
|
||||
<div class="subsection-list">
|
||||
<div class="article-list--tile">
|
||||
{{ range $terms }}
|
||||
@@ -16,8 +16,7 @@
|
||||
</header>
|
||||
|
||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
||||
{{ $filtered := where $pages "Params.hidden" "!=" true }}
|
||||
|
||||
{{ range $filtered.GroupByDate "2006" }}
|
||||
{{ $id := lower (replace .Key " " "-") }}
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
|
||||
{{- $subsections := .Sections -}}
|
||||
{{- $pages := .Pages | complement $subsections -}}
|
||||
{{- $pages = where $pages "Params.hidden" "!=" true -}}
|
||||
|
||||
{{- if eq (len $pages) 0 -}}
|
||||
{{/* If there are no normal pages, display subsections in list style, with pagination */}}
|
||||
@@ -68,12 +69,14 @@
|
||||
{{- end -}}
|
||||
|
||||
{{/* List only pages that are not a subsection */}}
|
||||
{{ $paginator := .Paginate $pages }}
|
||||
<section class="article-list--compact">
|
||||
{{ range $paginator.Pages }}
|
||||
{{ partial "article-list/compact" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ $paginator := partial "helper/paginator.html" . }}
|
||||
{{ with $paginator }}
|
||||
<section class="article-list--compact">
|
||||
{{ range .Pages }}
|
||||
{{ partial "article-list/compact" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
{{- partial "pagination.html" . -}}
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
||||
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<language>{{.}}</language>{{end}}{{ with .Site.Params.Author.email }}
|
||||
<managingEditor>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Params.Author.email }}
|
||||
<webMaster>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
<lastBuildDate>{{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
{{- with .OutputFormats.Get "RSS" -}}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{- end -}}
|
||||
@@ -35,7 +35,7 @@
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
{{ with .Site.Params.Author.email }}<author>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>
|
||||
{{- $image := partial "helper/image" (dict "Context" . "Type" "rss") -}}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
{{ partialCached "footer/footer" . }}
|
||||
|
||||
{{ partialCached "article/components/photoswipe" . }}
|
||||
{{ partial "article/components/mermaid" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "right-sidebar" }}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{{ define "main" }}
|
||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
||||
{{ $pag := .Paginate ($filtered) }}
|
||||
{{- $paginator := partial "helper/paginator.html" . -}}
|
||||
|
||||
<section class="article-list">
|
||||
{{ range $index, $element := $pag.Pages }}
|
||||
{{ range $index, $element := $paginator.Pages }}
|
||||
{{ partial "article-list/default" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
|
||||
{{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}}
|
||||
{{- $filtered := ($pages | intersect $notHidden) -}}
|
||||
{{- $filtered := where $pages "Params.hidden" "!=" true -}}
|
||||
|
||||
{{- $result := slice -}}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</h2>
|
||||
<footer class="article-time">
|
||||
<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>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
{{ if .Params.categories }}
|
||||
<header class="article-category">
|
||||
{{ 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 }}
|
||||
</a>
|
||||
{{ end }}
|
||||
@@ -31,8 +34,8 @@
|
||||
{{ if $showDate }}
|
||||
<div>
|
||||
{{ partial "helper/icon" "date" }}
|
||||
<time class="article-time--published">
|
||||
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
||||
<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") -}}
|
||||
</time>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<section class="article-lastmod">
|
||||
{{ partial "helper/icon" "clock" }}
|
||||
<span>
|
||||
{{ T "article.lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
|
||||
{{ T "article.lastUpdatedOn" }} {{ .Lastmod | time.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
|
||||
</span>
|
||||
</section>
|
||||
{{- end -}}
|
||||
|
||||
@@ -16,8 +16,12 @@
|
||||
</div>
|
||||
|
||||
{{ with $link.image }}
|
||||
{{ $permalink := . }}
|
||||
{{ with ($.Resources.GetMatch (printf "%s" (. | safeURL))) }}
|
||||
{{ $permalink = .RelPermalink }}
|
||||
{{ end }}
|
||||
<div class="article-image">
|
||||
<img src="{{ . }}" loading="lazy">
|
||||
<img src="{{ $permalink }}" loading="lazy"{{ with $link.alt }} alt="{{ . }}"{{ end }}>
|
||||
</div>
|
||||
{{ end }}
|
||||
</a>
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
|
||||
<script>
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
renderMathInElement(document.querySelector(`.article-content`), {
|
||||
delimiters: [
|
||||
{ left: "$$", right: "$$", display: true },
|
||||
{ left: "$", right: "$", display: false },
|
||||
{ left: "\\(", right: "\\)", display: false },
|
||||
{ left: "\\[", right: "\\]", display: true }
|
||||
],
|
||||
ignoredClasses: ["gist"]
|
||||
});})
|
||||
const elementsToRender = [".main-article", ".widget--toc"];
|
||||
|
||||
elementsToRender.forEach(selector => {
|
||||
const element = document.querySelector(selector);
|
||||
if (element) {
|
||||
renderMathInElement(element, {
|
||||
delimiters: [
|
||||
{ left: "$$", right: "$$", display: true },
|
||||
{ left: "$", right: "$", display: false },
|
||||
{ left: "\\(", right: "\\)", display: false },
|
||||
{ left: "\\[", right: "\\]", display: true }
|
||||
],
|
||||
ignoredClasses: ["gist"]
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
{{ if .Store.Get "hasMermaid" }}
|
||||
<script type="module">
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11.12.2/+esm';
|
||||
mermaid.initialize({
|
||||
startOnLoad: true,
|
||||
theme: 'neutral',
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
@@ -1,21 +1,27 @@
|
||||
{{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}}
|
||||
<div id="cusdis_thread"
|
||||
data-host="{{ $host }}"
|
||||
data-app-id="{{ .Site.Params.comments.cusdis.id }}"
|
||||
data-page-id="{{ .File.UniqueID }}"
|
||||
data-page-url="{{ .Permalink }}"
|
||||
data-page-title="{{ .Title }}"></div>
|
||||
<div id="cusdis_thread" data-host="{{ $host }}" 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>
|
||||
function setCusdisTheme(theme) {
|
||||
let cusdis = document.querySelector('#cusdis_thread iframe');
|
||||
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) => {
|
||||
setCusdisTheme(e.detail)
|
||||
})
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="disqus-container">
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
{{ partial "disqus.html" . }}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{- $disqusjs := .Site.Params.Comments.disqusjs -}}
|
||||
{{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}}
|
||||
|
||||
{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | resources.ToCSS | minify -}}
|
||||
{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | toCSS | minify -}}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||
|
||||
<div class="disqus-container">
|
||||
@@ -21,8 +21,12 @@
|
||||
}
|
||||
|
||||
function lazyLoadDisqusJS() {
|
||||
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
|
||||
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
|
||||
const excludedHosts = ["localhost", "127.0.0.1"];
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
data-input-position="{{- default `top` .inputPosition -}}"
|
||||
data-theme="{{- default `light` .lightTheme -}}"
|
||||
data-lang="{{- default `en` .lang -}}"
|
||||
data-loading="{{- .loading -}}"
|
||||
crossorigin="anonymous"
|
||||
async
|
||||
></script>
|
||||
|
||||
@@ -15,11 +15,13 @@
|
||||
admin: ["{{- .admin -}}"],
|
||||
distractionFreeMode: false, // Facebook-like distraction free mode
|
||||
id: md5(location.pathname), // Max Location.pathname Legth:75 https://github.com/gitalk/gitalk/issues/102
|
||||
proxy: {{- .proxy -}},
|
||||
});
|
||||
(function () {
|
||||
if (
|
||||
["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1
|
||||
) {
|
||||
const excludedHosts = ["localhost", "127.0.0.1"];
|
||||
const hostname = window.location.hostname;
|
||||
|
||||
if (excludedHosts.includes(hostname)) {
|
||||
document.getElementById("gitalk-container").innerHTML =
|
||||
"Gitalk comments not available by default when the website is previewed locally.";
|
||||
return;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script src="//cdn.jsdelivr.net/npm/twikoo@1.6.21/dist/twikoo.all.min.js"></script>
|
||||
<script src="//cdn.jsdelivr.net/npm/twikoo@1.6.44/dist/twikoo.all.min.js"></script>
|
||||
<div id="tcomment"></div>
|
||||
<style>
|
||||
.twikoo {
|
||||
@@ -24,8 +24,11 @@
|
||||
.twikoo .tk-preview-container,
|
||||
.twikoo .tk-content,
|
||||
.twikoo .tk-nick,
|
||||
.twikoo .tk-send {
|
||||
color: var(--twikoo-body-text-color-main);
|
||||
.twikoo .tk-send,
|
||||
.twikoo .tk-comments-no,
|
||||
.twikoo .el-input__count,
|
||||
.twikoo .tk-submit-action-icon {
|
||||
color: var(--twikoo-body-text-color-main)!important;
|
||||
}
|
||||
.twikoo .el-button{
|
||||
color: var(--twikoo-body-text-color)!important;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
{{- with .Site.Params.comments.waline -}}
|
||||
{{- $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 := . -}}
|
||||
{{- if ne $val nil -}}
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
{{ $description = .Summary }}
|
||||
{{ end }}
|
||||
|
||||
{{ return ($description | plainify)}}
|
||||
{{ return (replaceRE "\n" " " $description | plainify) }}
|
||||
@@ -1,38 +1,14 @@
|
||||
{{- $title := .Title -}}
|
||||
{{- $pageTitle := .Title -}}
|
||||
{{- $siteTitle := .Site.Title -}}
|
||||
{{- $paginator := partial "helper/paginator.html" . -}}
|
||||
|
||||
{{- if .IsHome -}}
|
||||
<!-- Homepage, and it's pagination -->
|
||||
{{- $title := slice -}}
|
||||
|
||||
<!-- Build paginator -->
|
||||
{{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
|
||||
{{ $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 "" }}
|
||||
{{- if and $paginator $paginator.HasPrev -}}
|
||||
<!-- Add page number-->
|
||||
{{ $title = $title | append (printf "Page %d" $paginator.PageNumber) }}
|
||||
{{- end -}}
|
||||
|
||||
{{ return $title }}
|
||||
{{- $title = $title | append (default $siteTitle $pageTitle) -}}
|
||||
|
||||
{{ return delimit $title " - " }}
|
||||
@@ -1,12 +1,12 @@
|
||||
{{- partial "helper/external" (dict "Context" . "Namespace" "Vibrant") -}}
|
||||
|
||||
{{- $opts := dict "minify" hugo.IsProduction -}}
|
||||
{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}}
|
||||
{{- $script := resources.Get "ts/main.ts" | js.Build $opts | fingerprint -}}
|
||||
|
||||
<script type="text/javascript" src="{{ $script.RelPermalink }}" defer></script>
|
||||
|
||||
{{- with resources.Get "ts/custom.ts" -}}
|
||||
{{/* Place your custom script in HUGO_SITE_FOLDER/assets/ts/custom.ts */}}
|
||||
{{- $customScript := . | js.Build $opts -}}
|
||||
{{- $customScript := . | js.Build $opts | fingerprint -}}
|
||||
<script type="text/javascript" src="{{ $customScript.RelPermalink }}" defer></script>
|
||||
{{- end -}}
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- $ThemeVersion := "3.23.0" -}}
|
||||
{{- $ThemeVersion := "3.34.2" -}}
|
||||
<footer class="site-footer">
|
||||
<section class="copyright">
|
||||
©
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1'>
|
||||
|
||||
{{- $description := partialCached "data/description" . .RelPermalink -}}
|
||||
<meta name='description' content='{{ $description }}'>
|
||||
<meta name='description' {{ printf "content=%q" $description | safeHTMLAttr }}>
|
||||
{{ with .Params.Keywords }}<meta name="keywords" content="{{ delimit . ", " }}">{{ end }}
|
||||
|
||||
{{- $title := partial "data/title" . -}}
|
||||
@@ -19,8 +19,8 @@
|
||||
{{- end -}}
|
||||
|
||||
{{ with .Site.Params.favicon }}
|
||||
<link rel="shortcut icon" href="{{ . }}" />
|
||||
<link rel="shortcut icon" href="{{ . | relURL }}" />
|
||||
{{ end }}
|
||||
|
||||
{{- template "_internal/google_analytics.html" . -}}
|
||||
{{- partial "google_analytics.html" . -}}
|
||||
{{- partial "head/custom.html" . -}}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{{- $title := partialCached "data/title" . .RelPermalink -}}
|
||||
{{- $description := partialCached "data/description" . .RelPermalink -}}
|
||||
|
||||
<meta property='og:title' content='{{ $title }}'>
|
||||
<meta property='og:description' content='{{ $description }}'>
|
||||
<meta property='og:title' {{ printf "content=%q" $title | safeHTMLAttr }}>
|
||||
<meta property='og:description' {{ printf "content=%q" $description | safeHTMLAttr }}>
|
||||
<meta property='og:url' content='{{ .Permalink }}'>
|
||||
<meta property='og:site_name' content='{{ .Site.Title }}'>
|
||||
<meta property='og:type' content='
|
||||
@@ -32,8 +32,8 @@
|
||||
<meta property='article:modified_time' content='{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if not .Site.LastChange.IsZero -}}
|
||||
<meta property='og:updated_time' content='{{ .Site.LastChange.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
|
||||
{{- if not .Site.Lastmod.IsZero -}}
|
||||
<meta property='og:updated_time' content='{{ .Site.Lastmod.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
{{- $title := partialCached "data/title" . .RelPermalink -}}
|
||||
{{- $description := partialCached "data/description" . .RelPermalink -}}
|
||||
|
||||
<meta name="twitter:title" content="{{ $title }}">
|
||||
<meta name="twitter:description" content="{{ $description }}">
|
||||
<meta name="twitter:title" {{ printf "content=%q" $title | safeHTMLAttr }}>
|
||||
<meta name="twitter:description" {{ printf "content=%q" $description | safeHTMLAttr }}>
|
||||
|
||||
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}}
|
||||
{{- if $image.exists -}}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{{ $sass := resources.Get "scss/style.scss" }}
|
||||
{{ $style := $sass | resources.ToCSS | minify | resources.Fingerprint "sha256" }}
|
||||
{{ $style := $sass | toCSS | minify | resources.Fingerprint "sha256" }}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||
@@ -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,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 }}
|
||||
@@ -1,26 +1,70 @@
|
||||
{{ if gt .Paginator.TotalPages 1 }}
|
||||
<nav class='pagination'>
|
||||
{{ $.Scratch.Set "hasPrevDots" false }}
|
||||
{{ $.Scratch.Set "hasNextDots" false }}
|
||||
{{- $pag := $.Paginator -}}
|
||||
{{- if gt $pag.TotalPages 1 -}}
|
||||
<nav class="pagination" role="navigation" aria-label="pagination">
|
||||
{{- /* 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 }}
|
||||
{{ if eq . $.Paginator }}
|
||||
<span class='page-link current'>
|
||||
{{- .PageNumber -}}
|
||||
</span>
|
||||
{{ else if or (or (eq . $.Paginator.First) (eq . $.Paginator.Prev)) (or (eq . $.Paginator.Next) (eq . $.Paginator.Last )) }}
|
||||
<a class='page-link' href='{{ .URL }}'>
|
||||
{{- .PageNumber -}}
|
||||
</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>
|
||||
{{ end }}
|
||||
{{- /* 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>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 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>
|
||||
</nav>
|
||||
{{- end -}}
|
||||
@@ -38,7 +38,7 @@
|
||||
</header>
|
||||
|
||||
{{- with .Site.Menus.social -}}
|
||||
<ol class="social-menu">
|
||||
<ol class="menu-social">
|
||||
{{ range . }}
|
||||
<li>
|
||||
<a
|
||||
@@ -60,12 +60,12 @@
|
||||
<ol class="menu" id="main-menu">
|
||||
{{ $currentPage := . }}
|
||||
{{ 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 }}>
|
||||
<a href='{{ .URL }}' {{ if eq .Params.newTab true }}target="_blank"{{ end }}>
|
||||
{{ $icon := default .Pre .Params.Icon }}
|
||||
{{ if .Pre }}
|
||||
{{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://docs.stack.jimmycai.com/configuration/custom-menu.html" .URL }}
|
||||
{{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://stack.jimmycai.com/config/menu" .URL }}
|
||||
{{ end }}
|
||||
{{ with $icon }}
|
||||
{{ partial "helper/icon" . }}
|
||||
@@ -74,30 +74,30 @@
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ol>
|
||||
<div class="menu-bottom-section">
|
||||
<ol class="menu">
|
||||
{{- $currentLanguageCode := .Language.Lang -}}
|
||||
{{ if ( compare.Gt .Site.Home.AllTranslations.Len 1 ) }}
|
||||
{{ with .Site.Home.AllTranslations }}
|
||||
<li id="i18n-switch">
|
||||
{{ partial "helper/icon" "language" }}
|
||||
<select name="language" title="language" onchange="window.location.href = this.selectedOptions[0].value">
|
||||
{{ range . }}
|
||||
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
|
||||
{{ end }}
|
||||
</select>
|
||||
<li class="menu-bottom-section">
|
||||
<ol class="menu">
|
||||
{{- $currentLanguageCode := .Language.Lang -}}
|
||||
{{ if ( compare.Gt .Site.Home.AllTranslations.Len 1 ) }}
|
||||
{{ with .Site.Home.AllTranslations }}
|
||||
<li id="i18n-switch">
|
||||
{{ partial "helper/icon" "language" }}
|
||||
<select name="language" title="language" onchange="window.location.href = this.selectedOptions[0].value">
|
||||
{{ range . }}
|
||||
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
|
||||
{{ end }}
|
||||
</select>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (default false .Site.Params.colorScheme.toggle) }}
|
||||
<li id="dark-mode-toggle">
|
||||
{{ partial "helper/icon" "toggle-left" }}
|
||||
{{ partial "helper/icon" "toggle-right" }}
|
||||
<span>{{ T "darkMode" }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (default false .Site.Params.colorScheme.toggle) }}
|
||||
<li id="dark-mode-toggle">
|
||||
{{ partial "helper/icon" "toggle-left" }}
|
||||
{{ partial "helper/icon" "toggle-right" }}
|
||||
<span>{{ T "darkMode" }}</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ol>
|
||||
</div>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</aside>
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
|
||||
|
||||
{{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }}
|
||||
{{ $notHidden := where $context.Site.RegularPages "Params.hidden" "!=" true }}
|
||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
||||
{{ $filtered := where $pages "Params.hidden" "!=" true }}
|
||||
{{ $archives := $filtered.GroupByDate "2006" }}
|
||||
|
||||
<div class="widget-archive--list">
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
<div class="tagCloud-tags">
|
||||
{{ range first $limit $context.Site.Taxonomies.tags.ByCount }}
|
||||
<a href="{{ .Page.RelPermalink }}" class="font_size_{{ .Count }}">
|
||||
<a href="{{ .Page.RelPermalink }}">
|
||||
{{ .Page.Title }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
[build]
|
||||
publish = "exampleSite/public"
|
||||
|
||||
[build.environment]
|
||||
HUGO_VERSION = "0.117.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"
|
||||