Merge branch 'main' into allow-sharing-without-description

This commit is contained in:
Yassine Zouggari
2024-12-03 22:08:02 +00:00
19 changed files with 166 additions and 60 deletions

View File

@ -1,2 +0,0 @@
duckquill.daudix.one
duckquill.daudix.codeberg.page

1
.gitignore vendored
View File

@ -1 +1,2 @@
public/
.vercel

View File

@ -1,53 +1,32 @@
# Exclude the pipeline to run on the pages branch
when:
branch:
exclude: pages
# Taken from https://www.markpitblado.me/blog/deploying-to-vercel-from-codeberg
steps:
# Check for typos
typos:
image: alpine:edge
preview:
image: node
environment:
VERCEL_TOKEN:
from_secret: vercel_token
VERCEL_ORG_ID:
from_secret: vercel_org_id
VERCEL_PROJECT_ID:
from_secret: vercel_project_id
commands:
- apk add curl jq
- curl -s "https://api.github.com/repos/crate-ci/typos/releases/latest" | jq -r '.assets[] | select(.name | contains("unknown-linux-musl")) | .browser_download_url' | xargs -n 1 curl -L -o typos.tar.gz
- tar -zxvf typos.tar.gz ./typos
- ./typos
failure: ignore
- npm install --global vercel@latest
- vercel deploy --token=$VERCEL_TOKEN
when:
event: [push, pull_request, manual]
event: [pull_request]
# Build Zola static files
build:
image: alpine:edge
deploy:
image: node
environment:
VERCEL_TOKEN:
from_secret: vercel_token
VERCEL_ORG_ID:
from_secret: vercel_org_id
VERCEL_PROJECT_ID:
from_secret: vercel_project_id
commands:
- apk add zola
- zola build
when:
event: [push, pull_request, manual]
publish:
image: bitnami/git
# Must be set in Woodpecker configuration
# mail: Your email address used by Codeberg
# codeberg_token: Codeberg access token with "write:repository" permission
secrets: [mail, codeberg_token]
commands:
# Configure Git
- git config --global user.email $MAIL
- git config --global user.name "Woodpecker CI"
# Clone the output branch
- git clone --branch pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME
# Enter the output branch
- cd $CI_REPO_NAME
# Remove old files
- git rm -r "*" || true # Don't fail if there's nothing to remove
# Copy the output of the build step
- cp -ar ../public/. .
# Copy .domains in place (Duckquill specific. you should just place it in ./static/)
- cp ../.domains .
# Commit and push all static files with the source commit hash
- git add --all
- git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" --allow-empty
- git push
- npm install --global vercel@latest
- vercel deploy --prod --token=$VERCEL_TOKEN
when:
event: [push, manual]

View File

@ -5,14 +5,31 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased](https://codeberg.org/daudix/duckquill/compare/v6.0.0...main)
## [Unreleased](https://codeberg.org/daudix/duckquill/compare/v6.1.1...main)
## [v6.1.1](https://codeberg.org/daudix/duckquill/compare/v6.1.0...v6.1.1)
### Fixed
- Fix translation of table of contents heading.
## [v6.1.0](https://codeberg.org/daudix/duckquill/compare/v6.0.0...v6.1.0)
### Added
- Add `toc_sidebar` page/section variable for turning table of contents to a sidebar.
### Changed
- Don't scale down article cards when clicking on tags in them.
- Improve performance of the page when navbar is hidden by using the `config.extra.nav.auto_hide` config variable.
- Improve tab title generation.
- Replace `config.extra.debug_*` config variables with variables under the `config.extra.debug` section.
### Fixed
- Fix navbar not scrolling with content on mobile (#109).
## [6.0.0](https://codeberg.org/daudix/duckquill/compare/v5.4.0...v6.0.0)
### Added

View File

@ -181,7 +181,7 @@ csp = [
[extra.nav]
# Whether to automatically hide nav when not hovered or focused
auto_hide = true
# auto_hide = true
# Whether to show the Atom/RSS feed button in the nav
show_feed = true
# Whether to show the manual theme switcher in the nav

View File

@ -66,7 +66,7 @@ It is highly recommended to switch from the `main` branch to the latest release:
```bash
cd themes/duckquill
git checkout tags/v6.0.0
git checkout tags/v6.1.1
```
Then, enable it in your `config.toml`:
@ -80,7 +80,7 @@ To update the theme, simply switch to a new tag:
```bash
git submodule update --remote --merge
cd themes/duckquill
git checkout tags/v6.0.0
git checkout tags/v6.1.1
```
{% alert(important=true) %}
@ -111,6 +111,7 @@ Configuration variables from `config.toml` that can be set/overriden per page/se
- `toc`: Enables table of contents. Only first 2 levels of headings are listed.
- `toc_inline`: Whether to render inline table of contents at the top of all pages, in addition to floating quick navigation buttons.
- `toc_ordered`: Whether to use numbered (ordered) list for table of contents.
- `toc_sidebar`: Whether to display table of contents as a sidebar (useful for long pages).
Other variables:

View File

@ -2,6 +2,7 @@
title = "Mods"
[extra]
toc = true
toc_sidebar = true
+++
Mods enhance/change some Duckquill visuals. They are updated alongside Duckquill to ensure that you don't need to manually update them every release.

View File

@ -53,7 +53,7 @@ minutes_read = "阅读需要 $NUMBER 分钟"
more_matches = "$MATCHES 更多匹配"
next = "下一篇"
no_comments = "目前没有评论 :/"
note = "注"
note = "注"
one_posts = "共有 $NUMBER 篇文章"
one_tags = "共有 $NUMBER 个标签"
open_post = "打开帖子"

View File

@ -1,4 +1,5 @@
#site-footer {
grid-area: footer;
margin-block-end: 2rem;
text-align: center;

View File

@ -13,6 +13,10 @@ body {
text-wrap: pretty;
display: grid; // Put footer at the bottom for short pages, such as the 404
grid-template-rows: auto minmax(auto, 1fr) auto; // Header, stuff, footer
grid-template-areas:
"nav"
"main"
"footer";
margin: 0;
background-color: var(--bg-color);
min-height: 100vh;
@ -20,6 +24,21 @@ body {
line-height: 1.5;
font-family: var(--font-system-ui), var(--font-emoji);
overflow-wrap: break-word;
&:has(#sidebar) {
grid-template-columns: 1fr min(var(--container-width), 90%) 1fr;
grid-template-areas:
"nav nav nav"
"sidebar main ."
"footer footer footer";
@media only screen and (max-width: 1200px) {
grid-template-areas:
"nav nav nav"
". sidebar ."
". main ."
"footer footer footer";
}
}
}
// Style text selection to use accent color
@ -67,7 +86,52 @@ main {
width: min(var(--container-width), 90%);
}
#sidebar {
display: flex;
position: sticky;
top: 0;
grid-area: sidebar;
opacity: 0.2;
transition: var(--transition);
padding: 1rem;
height: 100vh;
&:hover {
opacity: 1;
}
@media only screen and (max-width: 1200px) {
position: static;
opacity: 1;
margin-block-start: 4.25rem;
margin-block-end: -4.25rem;
padding: 0;
height: auto;
}
& > div {
--mask: linear-gradient(to bottom,
transparent,
black 1rem,
black calc(100% - 1rem),
transparent);
-webkit-mask-image: var(--mask);
flex: 1;
mask-image: var(--mask);
overflow: auto;
}
& + main {
grid-area: main;
margin: 0;
margin-block-start: 4.25rem;
margin-block-end: 4rem;
width: auto;
}
}
@media (prefers-reduced-motion) {
*,
*::before,
*::after {

View File

@ -64,6 +64,7 @@
#site-nav {
position: sticky;
grid-area: nav;
z-index: 999;
margin: 1rem auto 0;
inset-block-start: 1rem;
@ -72,6 +73,11 @@
border-radius: 1.625rem;
max-width: min(var(--container-width), 90%);
@media only screen and (max-width: 480px) {
position: relative;
margin: 0 auto;
}
&::before {
-webkit-backdrop-filter: var(--blur);
position: absolute;

View File

@ -1,5 +1,5 @@
/*!
* Duckquill v6.0.0 (https://duckquill.daudix.one)
* Duckquill v6.1.1 (https://duckquill.daudix.one)
* Copyright 2024 David "Daudix" Lapshin
* Licensed under MIT (https://codeberg.org/daudix/duckquill/src/branch/main/LICENSE)
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 171 KiB

View File

@ -15,6 +15,13 @@
{%- if config.extra.nav.links %}
{% include "partials/nav.html" %}
{%- endif %}
{%- if page.extra.toc_sidebar or section.extra.toc_sidebar -%}
<div id="sidebar">
<div>
{%- include "partials/toc.html" -%}
</div>
</div>
{%- endif -%}
<main id="main-content">
{% block custom %}{% endblock custom %}
{% block content %}{% endblock content %}

View File

@ -3,6 +3,8 @@
{% block content %}
<h1>{{ page.title }}</h1>
{%- include "partials/statements.html" -%}
{%- if page.extra.toc and not page.extra.toc_sidebar -%}
{%- include "partials/toc.html" -%}
{%- endif -%}
{{ page.content | safe }}
{% endblock content %}

View File

@ -60,7 +60,6 @@
</small>
{%- endfor -%}
{%- endif %}
</small>
</div>
{%- endif -%}
</article>

View File

@ -1,7 +1,35 @@
{%- if page.title -%}
{{- page.title }} {{ config.extra.title_separator | default(value="-") }} {{ config.title -}}
{%- elif section.title -%}
{{- section.title }} {{ config.extra.title_separator | default(value="-") }} {{ config.title -}}
{# Taken from https://github.com/welpo/tabi/blob/69713c973c11d7646c8fe56476261d96cc1978d8/templates/partials/title.html #}
{#- Setup -#}
{%- set suffix = config.title | safe -%}
{%- set custom_separator = config.extra.title_separator | default(value="-") -%}
{%- set separator = " " ~ custom_separator ~ " " -%}
{#- Get the base path for the current language -#}
{%- if lang != config.default_language %}
{%- set base_path = "/" ~ lang ~ "/" %}
{%- else -%}
{{- config.title -}}
{%- set base_path = "/" %}
{%- endif %}
{%- if current_path and current_path == base_path -%}
{%- set prefix = "" -%}
{%- set separator = "" -%}
{% elif title %}
{%- set prefix = title -%}
{% elif section.title -%}
{%- set prefix = section.title -%}
{% elif page.title %}
{%- set prefix = page.title -%}
{% elif term.name %}
{#- Individual tags -#}
{%- set prefix = term.name -%}
{% elif taxonomy.name %}
{#- List of tags -#}
{%- set prefix = macros_translate::translate(key=taxonomy.name, language_strings=language_strings) | capitalize -%}
{% else %}
{%- set prefix = "404" %}
{%- endif -%}
{#- Return the final concatenated string -#}
{{- prefix ~ separator ~ suffix -}}

View File

@ -12,7 +12,7 @@
{%- if page.extra.toc or section.extra.toc -%}
{%- if toc | length > 0 -%}
<h2>{{ macros_translate::translate(key="toc", default="Table of Contents", language_strings=language_strings) }}</h2>
<h2>{{ macros_translate::translate(key="table_of_contents", default="Table of Contents", language_strings=language_strings) }}</h2>
<{{ list_element }}>
{%- for h1 in toc -%}
<li>

View File

@ -3,6 +3,8 @@
{% block content %}
<h1>{{ section.title }}</h1>
{%- include "partials/statements.html" -%}
{%- if section.extra.toc and not section.extra.toc_sidebar -%}
{%- include "partials/toc.html" -%}
{%- endif -%}
{{ section.content | safe }}
{% endblock content %}