forked from GitHub/quartz
Compare commits
1 Commits
v4
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e96d154772 |
2
.github/workflows/docker-build-push.yaml
vendored
2
.github/workflows/docker-build-push.yaml
vendored
@ -25,7 +25,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Inject slug/short variables
|
||||
uses: rlespinasse/github-slug-action@v5.1.0
|
||||
uses: rlespinasse/github-slug-action@v5.0.0
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
|
||||
160
action.sh
160
action.sh
@ -1,160 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# To fetch and use this script in a GitHub action:
|
||||
#
|
||||
# curl -s -S https://raw.githubusercontent.com/saberzero1/quartz-themes/master/action.sh | bash -s -- <THEME_NAME>
|
||||
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[1;33m'
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[1;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
echo_err() { echo -e "${RED}$1${NC}"; }
|
||||
echo_warn() { echo -e "${YELLOW}$1${NC}"; }
|
||||
echo_ok() { echo -e "${GREEN}$1${NC}"; }
|
||||
echo_info() { echo -e "${BLUE}$1${NC}"; }
|
||||
|
||||
THEME_DIR="themes"
|
||||
QUARTZ_STYLES_DIR="quartz/styles"
|
||||
|
||||
if test -f ${QUARTZ_STYLES_DIR}/custom.scss; then
|
||||
echo_ok "Quartz root succesfully detected..."
|
||||
THEME_DIR="${QUARTZ_STYLES_DIR}/${THEME_DIR}"
|
||||
else
|
||||
echo_warn "Quartz root not detected, checking if we are in the styles directory..."
|
||||
if test -f custom.scss; then
|
||||
echo_ok "Styles directory detected..."
|
||||
else
|
||||
echo_err "Cannot detect Quartz repository. Are you in the correct working directory?" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "Input theme: ${BLUE}$*${NC}"
|
||||
|
||||
echo "Parsing input theme..."
|
||||
|
||||
# Concat parameters
|
||||
result=""
|
||||
|
||||
for param in "$@"; do
|
||||
if [ -n "$result" ]; then
|
||||
result="$result-"
|
||||
fi
|
||||
|
||||
result="$result$param"
|
||||
done
|
||||
|
||||
if "$result" = ""; then
|
||||
echo_warn "No theme provided, defaulting to Tokyo Night..."
|
||||
result="tokyo-night"
|
||||
fi
|
||||
|
||||
# Convert to lowercase
|
||||
THEME=$(echo "$result" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
echo -e "Theme ${BLUE}$*${NC} parsed to $(echo_info ${THEME})"
|
||||
|
||||
echo "Validating theme..."
|
||||
|
||||
GITHUB_URL_BASE="https://raw.githubusercontent.com/saberzero1/quartz-themes/master/__CONVERTER/"
|
||||
GITHUB_OUTPUT_DIR="__OUTPUT/"
|
||||
GITHUB_OVERRIDE_DIR="__OVERRIDES/"
|
||||
GITHUB_THEME_DIR="${THEME}/"
|
||||
CSS_INDEX_URL="${GITHUB_URL_BASE}${GITHUB_OUTPUT_DIR}${GITHUB_THEME_DIR}_index.scss"
|
||||
CSS_FONT_URL="${GITHUB_URL_BASE}${GITHUB_OUTPUT_DIR}${GITHUB_THEME_DIR}_fonts.scss"
|
||||
CSS_DARK_URL="${GITHUB_URL_BASE}${GITHUB_OUTPUT_DIR}${GITHUB_THEME_DIR}_dark.scss"
|
||||
CSS_LIGHT_URL="${GITHUB_URL_BASE}${GITHUB_OUTPUT_DIR}${GITHUB_THEME_DIR}_light.scss"
|
||||
CSS_OVERRIDE_URL="${GITHUB_URL_BASE}${GITHUB_OVERRIDE_DIR}${GITHUB_THEME_DIR}_index.scss"
|
||||
README_URL="${GITHUB_URL_BASE}${GITHUB_OVERRIDE_DIR}${GITHUB_THEME_DIR}README.md"
|
||||
|
||||
PULSE=$(curl -o /dev/null --silent -lw '%{http_code}' "${CSS_INDEX_URL}")
|
||||
|
||||
if [ "${PULSE}" = "200" ]; then
|
||||
echo_ok "Theme '${THEME}' found. Preparing to fetch files..."
|
||||
else
|
||||
if [ "${PULSE}" = "404" ]; then
|
||||
echo_err "Theme '${THEME}' not found. Please check the compatibility list." 1>&2
|
||||
exit 1
|
||||
else
|
||||
echo_err "Something weird happened. If this issue persists, please open an Issue on GitHub." !>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Cleaning theme directory..."
|
||||
|
||||
rm -rf ${THEME_DIR}
|
||||
|
||||
echo "Creating theme directory..."
|
||||
|
||||
mkdir -p ${THEME_DIR}/overrides
|
||||
|
||||
echo "Fetching theme files..."
|
||||
|
||||
curl -s -S -o ${THEME_DIR}/_index.scss "${CSS_INDEX_URL}"
|
||||
curl -s -S -o ${THEME_DIR}/_fonts.scss "${CSS_FONT_URL}"
|
||||
curl -s -S -o ${THEME_DIR}/_dark.scss "${CSS_DARK_URL}"
|
||||
curl -s -S -o ${THEME_DIR}/_light.scss "${CSS_LIGHT_URL}"
|
||||
curl -s -S -o ${THEME_DIR}/overrides/_index.scss "${CSS_OVERRIDE_URL}"
|
||||
|
||||
echo "Fetching README file..."
|
||||
|
||||
curl -s -S -o ${THEME_DIR}/README.md "${README_URL}"
|
||||
|
||||
echo "Checking theme files..."
|
||||
|
||||
if test -f ${THEME_DIR}/_index.scss; then
|
||||
echo_ok "_index.scss exists"
|
||||
else
|
||||
echo_err "_index.scss missing" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -f ${THEME_DIR}/_fonts.scss; then
|
||||
echo_ok "_fonts.scss exists"
|
||||
else
|
||||
echo_err "_fonts.scss missing" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -f ${THEME_DIR}/_dark.scss; then
|
||||
echo_ok "_dark.scss exists"
|
||||
else
|
||||
echo_err "_dark.scss missing" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -f ${THEME_DIR}/_light.scss; then
|
||||
echo_ok "_light.scss exists"
|
||||
else
|
||||
echo_err "_light.scss missing" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -f ${THEME_DIR}/overrides/_index.scss; then
|
||||
echo_ok "overrides/_index.scss exists"
|
||||
else
|
||||
echo_err "overrides/_index.scss missing" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -f ${THEME_DIR}/README.md; then
|
||||
echo_ok "README file exists"
|
||||
else
|
||||
echo_warn "README file missing"
|
||||
fi
|
||||
|
||||
echo "Verifying setup..."
|
||||
|
||||
if grep -q '^@use "./themes";' ${THEME_DIR}/../custom.scss; then
|
||||
# Import already present in custom.scss
|
||||
echo_warn "Theme import line already present in custom.scss. Skipping..."
|
||||
else
|
||||
# Add `@use "./themes";` import to custom.scss
|
||||
sed -ir 's#@use "./base.scss";#@use "./base.scss";\n@use "./themes";#' ${THEME_DIR}/../custom.scss
|
||||
echo_info "Added import line to custom.scss..."
|
||||
fi
|
||||
|
||||
echo_ok "Finished fetching and applying theme '${THEME}'."
|
||||
@ -41,12 +41,11 @@ This part of the configuration concerns anything that can affect the whole site.
|
||||
- `ignorePatterns`: a list of [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>) patterns that Quartz should ignore and not search through when looking for files inside the `content` folder. See [[private pages]] for more details.
|
||||
- `defaultDateType`: whether to use created, modified, or published as the default date to display on pages and page listings.
|
||||
- `theme`: configure how the site looks.
|
||||
- `cdnCaching`: if `true` (default), use Google CDN to cache the fonts. This will generally be faster. Disable (`false`) this if you want Quartz to download the fonts to be self-contained.
|
||||
- `cdnCaching`: If `true` (default), use Google CDN to cache the fonts. This will generally will be faster. Disable (`false`) this if you want Quartz to download the fonts to be self-contained.
|
||||
- `typography`: what fonts to use. Any font available on [Google Fonts](https://fonts.google.com/) works here.
|
||||
- `title`: font for the title of the site (optional, same as `header` by default)
|
||||
- `header`: font to use for headers
|
||||
- `code`: font for inline and block quotes
|
||||
- `body`: font for everything
|
||||
- `header`: Font to use for headers
|
||||
- `code`: Font for inline and block quotes.
|
||||
- `body`: Font for everything
|
||||
- `colors`: controls the theming of the site.
|
||||
- `light`: page background
|
||||
- `lightgray`: borders
|
||||
|
||||
134
package-lock.json
generated
134
package-lock.json
generated
@ -21,7 +21,7 @@
|
||||
"cli-spinner": "^0.2.10",
|
||||
"d3": "^7.9.0",
|
||||
"esbuild-sass-plugin": "^3.3.1",
|
||||
"flexsearch": "0.7.43",
|
||||
"flexsearch": "0.8.103",
|
||||
"github-slugger": "^2.0.0",
|
||||
"globby": "^14.1.0",
|
||||
"gray-matter": "^4.0.3",
|
||||
@ -30,7 +30,7 @@
|
||||
"hast-util-to-string": "^3.0.1",
|
||||
"is-absolute-url": "^4.0.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lightningcss": "^1.29.2",
|
||||
"lightningcss": "^1.29.3",
|
||||
"mdast-util-find-and-replace": "^3.0.2",
|
||||
"mdast-util-to-hast": "^13.2.0",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
@ -46,7 +46,7 @@
|
||||
"rehype-citation": "^2.2.2",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-mathjax": "^7.1.0",
|
||||
"rehype-pretty-code": "^0.14.0",
|
||||
"rehype-pretty-code": "^0.14.1",
|
||||
"rehype-raw": "^7.0.0",
|
||||
"rehype-slug": "^6.0.0",
|
||||
"remark": "^15.0.1",
|
||||
@ -3161,9 +3161,36 @@
|
||||
}
|
||||
},
|
||||
"node_modules/flexsearch": {
|
||||
"version": "0.7.43",
|
||||
"resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.7.43.tgz",
|
||||
"integrity": "sha512-c5o/+Um8aqCSOXGcZoqZOm+NqtVwNsvVpWv6lfmSclU954O3wvQKxxK8zj74fPaSJbXpSLTs4PRhh+wnoCXnKg=="
|
||||
"version": "0.8.103",
|
||||
"resolved": "https://registry.npmjs.org/flexsearch/-/flexsearch-0.8.103.tgz",
|
||||
"integrity": "sha512-uxaAWHT0VDqLAdDuSt0j0w+dfuUc3x45xBfGUmAqN0/ikNb+wkfeUwTejVoeOqwuYU9qIENiJ+SM3FWpvQQ/3w==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/ts-thomas"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/flexsearch"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://patreon.com/user?u=96245532"
|
||||
},
|
||||
{
|
||||
"type": "liberapay",
|
||||
"url": "https://liberapay.com/ts-thomas"
|
||||
},
|
||||
{
|
||||
"type": "paypal",
|
||||
"url": "https://www.paypal.com/donate/?hosted_button_id=GEVR88FC9BWRW"
|
||||
},
|
||||
{
|
||||
"type": "bountysource",
|
||||
"url": "https://salt.bountysource.com/teams/ts-thomas"
|
||||
}
|
||||
],
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/foreground-child": {
|
||||
"version": "3.2.1",
|
||||
@ -3994,9 +4021,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.29.2.tgz",
|
||||
"integrity": "sha512-6b6gd/RUXKaw5keVdSEtqFVdzWnU5jMxTUjA2bVcMNPLwSQ08Sv/UodBVtETLCn7k4S1Ibxwh7k68IwLZPgKaA==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.29.3.tgz",
|
||||
"integrity": "sha512-GlOJwTIP6TMIlrTFsxTerwC0W6OpQpCGuX1ECRLBUVRh6fpJH3xTqjCjRgQHTb4ZXexH9rtHou1Lf03GKzmhhQ==",
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"detect-libc": "^2.0.3"
|
||||
@ -4009,22 +4036,22 @@
|
||||
"url": "https://opencollective.com/parcel"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"lightningcss-darwin-arm64": "1.29.2",
|
||||
"lightningcss-darwin-x64": "1.29.2",
|
||||
"lightningcss-freebsd-x64": "1.29.2",
|
||||
"lightningcss-linux-arm-gnueabihf": "1.29.2",
|
||||
"lightningcss-linux-arm64-gnu": "1.29.2",
|
||||
"lightningcss-linux-arm64-musl": "1.29.2",
|
||||
"lightningcss-linux-x64-gnu": "1.29.2",
|
||||
"lightningcss-linux-x64-musl": "1.29.2",
|
||||
"lightningcss-win32-arm64-msvc": "1.29.2",
|
||||
"lightningcss-win32-x64-msvc": "1.29.2"
|
||||
"lightningcss-darwin-arm64": "1.29.3",
|
||||
"lightningcss-darwin-x64": "1.29.3",
|
||||
"lightningcss-freebsd-x64": "1.29.3",
|
||||
"lightningcss-linux-arm-gnueabihf": "1.29.3",
|
||||
"lightningcss-linux-arm64-gnu": "1.29.3",
|
||||
"lightningcss-linux-arm64-musl": "1.29.3",
|
||||
"lightningcss-linux-x64-gnu": "1.29.3",
|
||||
"lightningcss-linux-x64-musl": "1.29.3",
|
||||
"lightningcss-win32-arm64-msvc": "1.29.3",
|
||||
"lightningcss-win32-x64-msvc": "1.29.3"
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-darwin-arm64": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.29.2.tgz",
|
||||
"integrity": "sha512-cK/eMabSViKn/PG8U/a7aCorpeKLMlK0bQeNHmdb7qUnBkNPnL+oV5DjJUo0kqWsJUapZsM4jCfYItbqBDvlcA==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.29.3.tgz",
|
||||
"integrity": "sha512-fb7raKO3pXtlNbQbiMeEu8RbBVHnpyqAoxTyTRMEWFQWmscGC2wZxoHzZ+YKAepUuKT9uIW5vL2QbFivTgprZg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -4042,9 +4069,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-darwin-x64": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.29.2.tgz",
|
||||
"integrity": "sha512-j5qYxamyQw4kDXX5hnnCKMf3mLlHvG44f24Qyi2965/Ycz829MYqjrVg2H8BidybHBp9kom4D7DR5VqCKDXS0w==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.29.3.tgz",
|
||||
"integrity": "sha512-KF2XZ4ZdmDGGtEYmx5wpzn6u8vg7AdBHaEOvDKu8GOs7xDL/vcU2vMKtTeNe1d4dogkDdi3B9zC77jkatWBwEQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -4062,9 +4089,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-freebsd-x64": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.29.2.tgz",
|
||||
"integrity": "sha512-wDk7M2tM78Ii8ek9YjnY8MjV5f5JN2qNVO+/0BAGZRvXKtQrBC4/cn4ssQIpKIPP44YXw6gFdpUF+Ps+RGsCwg==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.29.3.tgz",
|
||||
"integrity": "sha512-VUWeVf+V1UM54jv9M4wen9vMlIAyT69Krl9XjI8SsRxz4tdNV/7QEPlW6JASev/pYdiynUCW0pwaFquDRYdxMw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -4082,9 +4109,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-linux-arm-gnueabihf": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.29.2.tgz",
|
||||
"integrity": "sha512-IRUrOrAF2Z+KExdExe3Rz7NSTuuJ2HvCGlMKoquK5pjvo2JY4Rybr+NrKnq0U0hZnx5AnGsuFHjGnNT14w26sg==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.29.3.tgz",
|
||||
"integrity": "sha512-UhgZ/XVNfXQVEJrMIWeK1Laj8KbhjbIz7F4znUk7G4zeGw7TRoJxhb66uWrEsonn1+O45w//0i0Fu0wIovYdYg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@ -4102,9 +4129,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-linux-arm64-gnu": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.29.2.tgz",
|
||||
"integrity": "sha512-KKCpOlmhdjvUTX/mBuaKemp0oeDIBBLFiU5Fnqxh1/DZ4JPZi4evEH7TKoSBFOSOV3J7iEmmBaw/8dpiUvRKlQ==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.29.3.tgz",
|
||||
"integrity": "sha512-Pqau7jtgJNmQ/esugfmAT1aCFy/Gxc92FOxI+3n+LbMHBheBnk41xHDhc0HeYlx9G0xP5tK4t0Koy3QGGNqypw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -4122,9 +4149,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-linux-arm64-musl": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.29.2.tgz",
|
||||
"integrity": "sha512-Q64eM1bPlOOUgxFmoPUefqzY1yV3ctFPE6d/Vt7WzLW4rKTv7MyYNky+FWxRpLkNASTnKQUaiMJ87zNODIrrKQ==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.29.3.tgz",
|
||||
"integrity": "sha512-dxakOk66pf7KLS7VRYFO7B8WOJLecE5OPL2YOk52eriFd/yeyxt2Km5H0BjLfElokIaR+qWi33gB8MQLrdAY3A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -4142,9 +4169,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-linux-x64-gnu": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.29.2.tgz",
|
||||
"integrity": "sha512-0v6idDCPG6epLXtBH/RPkHvYx74CVziHo6TMYga8O2EiQApnUPZsbR9nFNrg2cgBzk1AYqEd95TlrsL7nYABQg==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.29.3.tgz",
|
||||
"integrity": "sha512-ySZTNCpbfbK8rqpKJeJR2S0g/8UqqV3QnzcuWvpI60LWxnFN91nxpSSwCbzfOXkzKfar9j5eOuOplf+klKtINg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -4162,9 +4189,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-linux-x64-musl": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.29.2.tgz",
|
||||
"integrity": "sha512-rMpz2yawkgGT8RULc5S4WiZopVMOFWjiItBT7aSfDX4NQav6M44rhn5hjtkKzB+wMTRlLLqxkeYEtQ3dd9696w==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.29.3.tgz",
|
||||
"integrity": "sha512-3pVZhIzW09nzi10usAXfIGTTSTYQ141dk88vGFNCgawIzayiIzZQxEcxVtIkdvlEq2YuFsL9Wcj/h61JHHzuFQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -4182,9 +4209,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-win32-arm64-msvc": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.29.2.tgz",
|
||||
"integrity": "sha512-nL7zRW6evGQqYVu/bKGK+zShyz8OVzsCotFgc7judbt6wnB2KbiKKJwBE4SGoDBQ1O94RjW4asrCjQL4i8Fhbw==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.29.3.tgz",
|
||||
"integrity": "sha512-VRnkAvtIkeWuoBJeGOTrZxsNp4HogXtcaaLm8agmbYtLDOhQdpgxW6NjZZjDXbvGF+eOehGulXZ3C1TiwHY4QQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -4202,9 +4229,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/lightningcss-win32-x64-msvc": {
|
||||
"version": "1.29.2",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.29.2.tgz",
|
||||
"integrity": "sha512-EdIUW3B2vLuHmv7urfzMI/h2fmlnOQBk1xlsDxkN1tCWKjNFjfLhGxYk8C8mzpSfr+A6jFFIi8fU6LbQGsRWjA==",
|
||||
"version": "1.29.3",
|
||||
"resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.29.3.tgz",
|
||||
"integrity": "sha512-IszwRPu2cPnDQsZpd7/EAr0x2W7jkaWqQ1SwCVIZ/tSbZVXPLt6k8s6FkcyBjViCzvB5CW0We0QbbP7zp2aBjQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -5762,9 +5789,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-pretty-code": {
|
||||
"version": "0.14.0",
|
||||
"resolved": "https://registry.npmjs.org/rehype-pretty-code/-/rehype-pretty-code-0.14.0.tgz",
|
||||
"integrity": "sha512-hBeKF/Wkkf3zyUS8lal9RCUuhypDWLQc+h9UrP9Pav25FUm/AQAVh4m5gdvJxh4Oz+U+xKvdsV01p1LdvsZTiQ==",
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmjs.org/rehype-pretty-code/-/rehype-pretty-code-0.14.1.tgz",
|
||||
"integrity": "sha512-IpG4OL0iYlbx78muVldsK86hdfNoht0z63AP7sekQNW2QOTmjxB7RbTO+rhIYNGRljgHxgVZoPwUl6bIC9SbjA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/hast": "^3.0.4",
|
||||
"hast-util-to-string": "^3.0.0",
|
||||
@ -5777,7 +5805,7 @@
|
||||
"node": ">=18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"shiki": "^1.3.0"
|
||||
"shiki": "^1.0.0 || ^2.0.0 || ^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rehype-raw": {
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
"cli-spinner": "^0.2.10",
|
||||
"d3": "^7.9.0",
|
||||
"esbuild-sass-plugin": "^3.3.1",
|
||||
"flexsearch": "0.7.43",
|
||||
"flexsearch": "0.8.103",
|
||||
"github-slugger": "^2.0.0",
|
||||
"globby": "^14.1.0",
|
||||
"gray-matter": "^4.0.3",
|
||||
@ -56,7 +56,7 @@
|
||||
"hast-util-to-string": "^3.0.1",
|
||||
"is-absolute-url": "^4.0.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lightningcss": "^1.29.2",
|
||||
"lightningcss": "^1.29.3",
|
||||
"mdast-util-find-and-replace": "^3.0.2",
|
||||
"mdast-util-to-hast": "^13.2.0",
|
||||
"mdast-util-to-string": "^4.0.0",
|
||||
@ -72,7 +72,7 @@
|
||||
"rehype-citation": "^2.2.2",
|
||||
"rehype-katex": "^7.0.1",
|
||||
"rehype-mathjax": "^7.1.0",
|
||||
"rehype-pretty-code": "^0.14.0",
|
||||
"rehype-pretty-code": "^0.14.1",
|
||||
"rehype-raw": "^7.0.0",
|
||||
"rehype-slug": "^6.0.0",
|
||||
"remark": "^15.0.1",
|
||||
|
||||
@ -8,24 +8,24 @@ import * as Plugin from "./quartz/plugins"
|
||||
*/
|
||||
const config: QuartzConfig = {
|
||||
configuration: {
|
||||
pageTitle: "isuckatcode.lol",
|
||||
pageTitleSuffix: " | isuckatcode.lol",
|
||||
pageTitle: "Quartz 4",
|
||||
pageTitleSuffix: "",
|
||||
enableSPA: true,
|
||||
enablePopovers: true,
|
||||
analytics: {
|
||||
provider: "plausible",
|
||||
},
|
||||
locale: "en-US",
|
||||
baseUrl: "isuckatcode.lol",
|
||||
baseUrl: "quartz.jzhao.xyz",
|
||||
ignorePatterns: ["private", "templates", ".obsidian"],
|
||||
defaultDateType: "created",
|
||||
theme: {
|
||||
fontOrigin: "googleFonts",
|
||||
cdnCaching: true,
|
||||
typography: {
|
||||
header: "Courier Prime",
|
||||
body: "Roboto",
|
||||
code: "Courier Prime",
|
||||
header: "Schibsted Grotesk",
|
||||
body: "Source Sans Pro",
|
||||
code: "IBM Plex Mono",
|
||||
},
|
||||
colors: {
|
||||
lightMode: {
|
||||
@ -57,7 +57,7 @@ const config: QuartzConfig = {
|
||||
transformers: [
|
||||
Plugin.FrontMatter(),
|
||||
Plugin.CreatedModifiedDate({
|
||||
priority: ["frontmatter", "git", "filesystem"],
|
||||
priority: ["git", "frontmatter", "filesystem"],
|
||||
}),
|
||||
Plugin.SyntaxHighlighting({
|
||||
theme: {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { i18n } from "../i18n"
|
||||
import { FullSlug, getFileExtension, joinSegments, pathToRoot } from "../util/path"
|
||||
import { CSSResourceToStyleElement, JSResourceToScriptElement } from "../util/resources"
|
||||
import { googleFontHref, googleFontSubsetHref } from "../util/theme"
|
||||
import { googleFontHref } from "../util/theme"
|
||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||||
import { unescapeHTML } from "../util/escape"
|
||||
import { CustomOgImagesEmitterName } from "../plugins/emitters/ogImage"
|
||||
@ -45,9 +45,6 @@ export default (() => {
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||
<link rel="stylesheet" href={googleFontHref(cfg.theme)} />
|
||||
{cfg.theme.typography.title && (
|
||||
<link rel="stylesheet" href={googleFontSubsetHref(cfg.theme, cfg.pageTitle)} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossOrigin="anonymous" />
|
||||
|
||||
@ -17,7 +17,6 @@ PageTitle.css = `
|
||||
.page-title {
|
||||
font-size: 1.75rem;
|
||||
margin: 0;
|
||||
font-family: var(--titleFont);
|
||||
}
|
||||
`
|
||||
|
||||
|
||||
@ -9,12 +9,7 @@ import styles from "../../styles/custom.scss"
|
||||
import popoverStyle from "../../components/styles/popover.scss"
|
||||
import { BuildCtx } from "../../util/ctx"
|
||||
import { QuartzComponent } from "../../components/types"
|
||||
import {
|
||||
googleFontHref,
|
||||
googleFontSubsetHref,
|
||||
joinStyles,
|
||||
processGoogleFonts,
|
||||
} from "../../util/theme"
|
||||
import { googleFontHref, joinStyles, processGoogleFonts } from "../../util/theme"
|
||||
import { Features, transform } from "lightningcss"
|
||||
import { transform as transpile } from "esbuild"
|
||||
import { write } from "./helpers"
|
||||
@ -216,16 +211,9 @@ export const ComponentResources: QuartzEmitterPlugin = () => {
|
||||
// let the user do it themselves in css
|
||||
} else if (cfg.theme.fontOrigin === "googleFonts" && !cfg.theme.cdnCaching) {
|
||||
// when cdnCaching is true, we link to google fonts in Head.tsx
|
||||
const theme = ctx.cfg.configuration.theme
|
||||
const response = await fetch(googleFontHref(theme))
|
||||
const response = await fetch(googleFontHref(ctx.cfg.configuration.theme))
|
||||
googleFontsStyleSheet = await response.text()
|
||||
|
||||
if (theme.typography.title) {
|
||||
const title = ctx.cfg.configuration.pageTitle
|
||||
const response = await fetch(googleFontSubsetHref(theme, title))
|
||||
googleFontsStyleSheet += `\n${await response.text()}`
|
||||
}
|
||||
|
||||
if (!cfg.baseUrl) {
|
||||
throw new Error(
|
||||
"baseUrl must be defined when using Google Fonts without cfg.theme.cdnCaching",
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import fs from "fs"
|
||||
import path from "path"
|
||||
import { Repository } from "@napi-rs/simple-git"
|
||||
import { QuartzTransformerPlugin } from "../types"
|
||||
import chalk from "chalk"
|
||||
import path from "path"
|
||||
|
||||
export interface Options {
|
||||
priority: ("frontmatter" | "git" | "filesystem")[]
|
||||
@ -35,25 +35,13 @@ export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options>> = (u
|
||||
return [
|
||||
() => {
|
||||
let repo: Repository | undefined = undefined
|
||||
let repositoryWorkdir: string
|
||||
if (opts.priority.includes("git")) {
|
||||
try {
|
||||
repo = Repository.discover(ctx.argv.directory)
|
||||
repositoryWorkdir = repo.workdir() ?? ctx.argv.directory
|
||||
} catch (e) {
|
||||
console.log(
|
||||
chalk.yellow(`\nWarning: couldn't find git repository for ${ctx.argv.directory}`),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return async (_tree, file) => {
|
||||
let created: MaybeDate = undefined
|
||||
let modified: MaybeDate = undefined
|
||||
let published: MaybeDate = undefined
|
||||
|
||||
const fp = file.data.relativePath!
|
||||
const fullFp = file.data.filePath!
|
||||
const fullFp = path.posix.join(ctx.argv.directory, fp)
|
||||
for (const source of opts.priority) {
|
||||
if (source === "filesystem") {
|
||||
const st = await fs.promises.stat(fullFp)
|
||||
@ -63,14 +51,21 @@ export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options>> = (u
|
||||
created ||= file.data.frontmatter.created as MaybeDate
|
||||
modified ||= file.data.frontmatter.modified as MaybeDate
|
||||
published ||= file.data.frontmatter.published as MaybeDate
|
||||
} else if (source === "git" && repo) {
|
||||
} else if (source === "git") {
|
||||
if (!repo) {
|
||||
// Get a reference to the main git repo.
|
||||
// It's either the same as the workdir,
|
||||
// or 1+ level higher in case of a submodule/subtree setup
|
||||
repo = Repository.discover(ctx.argv.directory)
|
||||
}
|
||||
|
||||
try {
|
||||
const relativePath = path.relative(repositoryWorkdir, fullFp)
|
||||
modified ||= await repo.getFileLatestModifiedDateAsync(relativePath)
|
||||
modified ||= await repo.getFileLatestModifiedDateAsync(fullFp)
|
||||
} catch {
|
||||
console.log(
|
||||
chalk.yellow(
|
||||
`\nWarning: ${file.data.filePath!} isn't yet tracked by git, dates will be inaccurate`,
|
||||
`\nWarning: ${file.data
|
||||
.filePath!} isn't yet tracked by git, last modification date is not available for this file`,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
@use "./base.scss";
|
||||
@use "./themes";
|
||||
|
||||
// put your custom CSS here!
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
@use "./base.scss";
|
||||
|
||||
// put your custom CSS here!
|
||||
@ -1 +0,0 @@
|
||||
404: Not Found
|
||||
@ -1,170 +0,0 @@
|
||||
:root[saved-theme="dark"] {
|
||||
--accent-h: 202;
|
||||
--accent-s: 100%;
|
||||
--accent-l: 75%;
|
||||
--bg_dark2_x: 18, 18, 24;
|
||||
--bg_dark2: rgb(var(--bg_dark2_x));
|
||||
--bg_dark_x: 22, 22, 30;
|
||||
--bg_dark: rgb(var(--bg_dark_x));
|
||||
--bg_x: 26, 27, 38;
|
||||
--bg: rgb(var(--bg_x));
|
||||
--bg_highlight_x: 41, 46, 66;
|
||||
--bg_highlight: rgb(var(--bg_highlight_x));
|
||||
--bg_highlight_dark_x: 36, 40, 59;
|
||||
--bg_highlight_dark: rgb(var(--bg_highlight_dark_x));
|
||||
--terminal_black_x: 65, 72, 104;
|
||||
--terminal_black: rgb(var(--terminal_black_x));
|
||||
--fg_x: 192, 202, 245;
|
||||
--fg: rgb(var(--fg_x));
|
||||
--fg_dark_x: 169, 177, 214;
|
||||
--fg_dark: rgb(var(--fg_dark_x));
|
||||
--comment_x: 86, 95, 137;
|
||||
--comment: rgb(var(--comment_x));
|
||||
--blue0_x: 61, 89, 161;
|
||||
--blue0: rgb(var(--blue0_x));
|
||||
--blue_x: 122, 162, 247;
|
||||
--blue: rgb(var(--blue_x));
|
||||
--cyan_hsl: 202 100% 75%;
|
||||
--cyan_x: 125, 207, 255;
|
||||
--cyan: rgb(var(--cyan_x));
|
||||
--magent_hsl: 261 85% 79%;
|
||||
--magenta_x: 187, 154, 247;
|
||||
--magenta: rgb(var(--magenta_x));
|
||||
--orange_x: 255, 158, 100;
|
||||
--orange: rgb(var(--orange_x));
|
||||
--yellow_x: 224, 175, 104;
|
||||
--yellow: rgb(var(--yellow_x));
|
||||
--green_x: 158, 206, 106;
|
||||
--green: rgb(var(--green_x));
|
||||
--teal_x: 26, 188, 156;
|
||||
--teal: rgb(var(--teal_x));
|
||||
--red_x: 255, 117, 127;
|
||||
--red: rgb(var(--red_x));
|
||||
--red1_x: 219, 75, 75;
|
||||
--red1: rgb(var(--red1_x));
|
||||
--unknown: #ffffff;
|
||||
--color_red_rgb: var(--red_x);
|
||||
--color-red: var(--red);
|
||||
--color_purple_rgb: var(--magenta_x);
|
||||
--color-purple: var(--magenta);
|
||||
--color_green_rgb: var(--green_x);
|
||||
--color-green: var(--green);
|
||||
--color_cyan_rgb: var(--cyan_x);
|
||||
--color-cyan: var(--cyan);
|
||||
--color_blue_rgb: var(--blue_x);
|
||||
--color-blue: var(--blue);
|
||||
--color_yellow_rgb: var(--yellow_x);
|
||||
--color-yellow: var(--yellow);
|
||||
--color_orange_rgb: var(--orange_x);
|
||||
--color-orange: var(--orange);
|
||||
--color_pink_rgb: var(--magenta_x);
|
||||
--color-pink: var(--magenta);
|
||||
--background-primary: var(--bg);
|
||||
--background-primary-alt: var(--bg);
|
||||
--background-secondary: var(--bg_dark);
|
||||
--background-secondary-alt: var(--bg_dark);
|
||||
--background-modifier-border: var(--bg_highlight);
|
||||
--background-modifier-border-focus: var(--bg_highlight);
|
||||
--background-modifier-border-hover: var(--bg_highlight);
|
||||
--background-modifier-form-field: var(--bg_dark);
|
||||
--background-modifier-form-field-highlighted: var(--bg_dark);
|
||||
--background-modifier-box-shadow: rgba(0, 0, 0, 0.3);
|
||||
--background-modifier-success: var(--green);
|
||||
--background-modifier-error: var(--red1);
|
||||
--background-modifier-error-hover: var(--red);
|
||||
--background-modifier-cover: rgba(var(--bg_dark_x), 0.8);
|
||||
--background-modifier-hover: var(--bg_highlight);
|
||||
--background-modifier-message: rgba(var(--bg_highlight_x), 0.9);
|
||||
--background-modifier-active-hover: var(--bg_highlight);
|
||||
--text-normal: var(--fg);
|
||||
--text-faint: var(--comment);
|
||||
--text-muted: var(--fg_dark);
|
||||
--text-error: var(--red);
|
||||
--text-accent: var(--magenta);
|
||||
--text-accent-hover: var(--cyan);
|
||||
--text-error: var(--red1);
|
||||
--text-error-hover: var(--red);
|
||||
--text-selection: var(--unknown);
|
||||
--text-on-accent: var(--bg);
|
||||
--text-highlight-bg: rgba(var(--orange_x), 0.4);
|
||||
--text-selection: rgba(var(--blue0_x), 0.6);
|
||||
--bold-color: var(--cyan);
|
||||
--italic-color: var(--cyan);
|
||||
--interactive-normal: var(--bg_dark);
|
||||
--interactive-hover: var(--bg);
|
||||
--interactive-success: var(--green);
|
||||
--interactive-accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
|
||||
--interactive-accent-hover: var(--blue);
|
||||
--scrollbar-bg: var(--bg_dark2);
|
||||
--scrollbar-thumb-bg: var(--comment);
|
||||
--scrollbar-active-thumb-bg: var(--bg_dark);
|
||||
--scrollbar-width: 0px;
|
||||
--h1-color: var(--red);
|
||||
--h2-color: var(--yellow);
|
||||
--h3-color: var(--green);
|
||||
--h4-color: var(--cyan);
|
||||
--h5-color: var(--blue);
|
||||
--h6-color: var(--magenta);
|
||||
--border-width: 2px;
|
||||
--tag-color: var(--magenta);
|
||||
--tag-background: rgba(var(--magenta_x), 0.15);
|
||||
--tag-color-hover: var(--cyan);
|
||||
--tag-background-hover: rgba(var(--cyan_x), 0.15);
|
||||
--link-color: var(--magenta);
|
||||
--link-color-hover: var(--cyan);
|
||||
--link-external-color: var(--magenta);
|
||||
--link-external-color-hover: var(--cyan);
|
||||
--checkbox-radius: var(--radius-l);
|
||||
--checkbox-color: var(--green);
|
||||
--checkbox-color-hover: var(--green);
|
||||
--checkbox-marker-color: var(--bg);
|
||||
--checkbox-border-color: var(--comment);
|
||||
--checkbox-border-color-hover: var(--comment);
|
||||
--table-header-background: var(--bg_dark2);
|
||||
--table-header-background-hover: var(--bg_dark2);
|
||||
--flashing-background: rgba(var(--blue0_x), 0.3);
|
||||
--code-normal: var(--fg);
|
||||
--code-background: var(--bg_highlight_dark);
|
||||
--mermaid-note: var(--blue0);
|
||||
--mermaid-actor: var(--fg_dark);
|
||||
--mermaid-loopline: var(--blue);
|
||||
--blockquote-background-color: var(--bg_dark);
|
||||
--callout-default: var(--blue_x);
|
||||
--callout-info: var(--blue_x);
|
||||
--callout-summary: var(--cyan_x);
|
||||
--callout-tip: var(--cyan_x);
|
||||
--callout-todo: var(--cyan_x);
|
||||
--callout-bug: var(--red_x);
|
||||
--callout-error: var(--red1_x);
|
||||
--callout-fail: var(--red1_x);
|
||||
--callout-example: var(--magenta_x);
|
||||
--callout-important: var(--green_x);
|
||||
--callout-success: var(--teal_x);
|
||||
--callout-question: var(--yellow_x);
|
||||
--callout-warning: var(--orange_x);
|
||||
--callout-quote: var(--fg_dark_x);
|
||||
--icon-color-hover: var(--blue);
|
||||
--icon-color-focused: var(--magenta);
|
||||
--icon-color-active: var(--magenta);
|
||||
--nav-item-color-hover: var(--fg);
|
||||
--nav-item-background-hover: var(--bg_highlight);
|
||||
--nav-item-color-active: var(--red);
|
||||
--nav-item-background-active: var(--bg_highlight);
|
||||
--nav-file-tag: rgba(var(--yellow_x), 0.9);
|
||||
--nav-indentation-guide-color: var(--bg_highlight);
|
||||
--indentation-guide-color: var(--comment);
|
||||
--indentation-guide-color-active: var(--comment);
|
||||
--graph-line: var(--comment);
|
||||
--graph-node: var(--fg);
|
||||
--graph-node-tag: var(--orange);
|
||||
--graph-node-attachment: var(--blue);
|
||||
--tab-text-color-focused-active: rgba(var(--red_x), 0.8);
|
||||
--tab-text-color-focused-active-current: var(--red);
|
||||
--modal-border-color: var(--bg_highlight);
|
||||
--prompt-border-color: var(--bg_highlight);
|
||||
--slider-track-background: var(--bg_highlight);
|
||||
--embed-background: var(--bg_dark);
|
||||
--embed-padding: 1.5rem 1.5rem 0.5rem;
|
||||
--canvas-color: var(--bg_highlight_x);
|
||||
--toggle-thumb-color: var(--bg);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,169 +0,0 @@
|
||||
:root[saved-theme="light"] {
|
||||
--accent-h: 202;
|
||||
--accent-s: 86%;
|
||||
--accent-l: 43%;
|
||||
--bg_dark2_x: 188, 189, 194;
|
||||
--bg_dark2: rgb(var(--bg_dark2_x));
|
||||
--bg_dark_x: 203, 204, 209;
|
||||
--bg_dark: rgb(var(--bg_dark_x));
|
||||
--bg_x: 213, 214, 219;
|
||||
--bg: rgb(var(--bg_x));
|
||||
--bg_highlight_x: 220, 222, 226;
|
||||
--bg_highlight: rgb(var(--bg_highlight_x));
|
||||
--bg_highlight_dark_x: 195, 197, 201;
|
||||
--bg_highlight_dark: rgb(var(--bg_highlight_dark_x));
|
||||
--terminal_black_x: 15, 15, 20;
|
||||
--terminal_black: rgb(var(--terminal_black_x));
|
||||
--fg_x: 52, 59, 88;
|
||||
--fg: rgb(var(--fg_x));
|
||||
--fg_dark_x: 39, 46, 75;
|
||||
--fg_dark: rgb(var(--fg_dark_x));
|
||||
--comment_x: 150, 153, 163;
|
||||
--comment: rgb(var(--comment_x));
|
||||
--blue0_x: 39, 71, 125;
|
||||
--blue0: rgb(var(--blue0_x));
|
||||
--blue_x: 52, 84, 138;
|
||||
--blue: rgb(var(--blue_x));
|
||||
--cyan_x: 15, 75, 110;
|
||||
--cyan: rgb(var(--cyan_x));
|
||||
--magent_hsl: 261 24% 38%;
|
||||
--magenta_x: 90, 74, 120;
|
||||
--magenta: rgb(var(--magenta_x));
|
||||
--orange_x: 150, 80, 39;
|
||||
--orange: rgb(var(--orange_x));
|
||||
--yellow_x: 143, 94, 21;
|
||||
--yellow: rgb(var(--yellow_x));
|
||||
--green_x: 51, 99, 92;
|
||||
--green: rgb(var(--green_x));
|
||||
--teal_x: 22, 103, 117;
|
||||
--teal: rgb(var(--teal_x));
|
||||
--red_x: 140, 67, 81;
|
||||
--red: rgb(var(--red_x));
|
||||
--red1_x: 115, 42, 56;
|
||||
--red1: rgb(var(--red1_x));
|
||||
--unknown: #000000;
|
||||
--color_red_rgb: var(--red_x);
|
||||
--color-red: var(--red);
|
||||
--color_purple_rgb: var(--magenta_x);
|
||||
--color-purple: var(--magenta);
|
||||
--color_green_rgb: var(--green_x);
|
||||
--color-green: var(--green);
|
||||
--color_cyan_rgb: var(--cyan_x);
|
||||
--color-cyan: var(--cyan);
|
||||
--color_blue_rgb: var(--blue_x);
|
||||
--color-blue: var(--blue);
|
||||
--color_yellow_rgb: var(--yellow_x);
|
||||
--color-yellow: var(--yellow);
|
||||
--color_orange_rgb: var(--orange_x);
|
||||
--color-orange: var(--orange);
|
||||
--color_pink_rgb: var(--magenta_x);
|
||||
--color-pink: var(--magenta);
|
||||
--background-primary: var(--bg);
|
||||
--background-primary-alt: var(--bg);
|
||||
--background-secondary: var(--bg_dark);
|
||||
--background-secondary-alt: var(--bg_dark);
|
||||
--background-modifier-border: var(--bg_highlight);
|
||||
--background-modifier-border-focus: var(--bg_highlight);
|
||||
--background-modifier-border-hover: var(--bg_highlight);
|
||||
--background-modifier-form-field: var(--bg_dark);
|
||||
--background-modifier-form-field-highlighted: var(--bg_dark);
|
||||
--background-modifier-box-shadow: rgba(0, 0, 0, 0.3);
|
||||
--background-modifier-success: var(--green);
|
||||
--background-modifier-error: var(--red1);
|
||||
--background-modifier-error-hover: var(--red);
|
||||
--background-modifier-cover: rgba(var(--bg_dark_x), 0.8);
|
||||
--background-modifier-hover: var(--bg_highlight);
|
||||
--background-modifier-message: rgba(var(--bg_highlight_x), 0.9);
|
||||
--background-modifier-active-hover: var(--bg_highlight);
|
||||
--text-normal: var(--fg);
|
||||
--text-faint: var(--comment);
|
||||
--text-muted: var(--fg_dark);
|
||||
--text-error: var(--red);
|
||||
--text-accent: var(--magenta);
|
||||
--text-accent-hover: var(--cyan);
|
||||
--text-error: var(--red1);
|
||||
--text-error-hover: var(--red);
|
||||
--text-selection: var(--unknown);
|
||||
--text-on-accent: var(--bg);
|
||||
--text-highlight-bg: rgba(var(--orange_x), 0.4);
|
||||
--text-selection: rgba(var(--blue0_x), 0.6);
|
||||
--bold-color: var(--cyan);
|
||||
--italic-color: var(--cyan);
|
||||
--interactive-normal: var(--bg_dark);
|
||||
--interactive-hover: var(--bg);
|
||||
--interactive-success: var(--green);
|
||||
--interactive-accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
|
||||
--interactive-accent-hover: var(--blue);
|
||||
--scrollbar-bg: var(--bg_dark2);
|
||||
--scrollbar-thumb-bg: var(--comment);
|
||||
--scrollbar-active-thumb-bg: var(--bg_dark);
|
||||
--scrollbar-width: 0px;
|
||||
--h1-color: var(--red);
|
||||
--h2-color: var(--yellow);
|
||||
--h3-color: var(--green);
|
||||
--h4-color: var(--cyan);
|
||||
--h5-color: var(--blue);
|
||||
--h6-color: var(--magenta);
|
||||
--border-width: 2px;
|
||||
--tag-color: var(--magenta);
|
||||
--tag-background: rgba(var(--magenta_x), 0.15);
|
||||
--tag-color-hover: var(--cyan);
|
||||
--tag-background-hover: rgba(var(--cyan_x), 0.15);
|
||||
--link-color: var(--magenta);
|
||||
--link-color-hover: var(--cyan);
|
||||
--link-external-color: var(--magenta);
|
||||
--link-external-color-hover: var(--cyan);
|
||||
--checkbox-radius: var(--radius-l);
|
||||
--checkbox-color: var(--green);
|
||||
--checkbox-color-hover: var(--green);
|
||||
--checkbox-marker-color: var(--bg);
|
||||
--checkbox-border-color: var(--comment);
|
||||
--checkbox-border-color-hover: var(--comment);
|
||||
--table-header-background: var(--bg_dark2);
|
||||
--table-header-background-hover: var(--bg_dark2);
|
||||
--flashing-background: rgba(var(--blue0_x), 0.3);
|
||||
--code-normal: var(--fg);
|
||||
--code-background: var(--bg_highlight_dark);
|
||||
--mermaid-note: var(--blue0);
|
||||
--mermaid-actor: var(--fg_dark);
|
||||
--mermaid-loopline: var(--blue);
|
||||
--blockquote-background-color: var(--bg_dark);
|
||||
--callout-default: var(--blue_x);
|
||||
--callout-info: var(--blue_x);
|
||||
--callout-summary: var(--cyan_x);
|
||||
--callout-tip: var(--cyan_x);
|
||||
--callout-todo: var(--cyan_x);
|
||||
--callout-bug: var(--red_x);
|
||||
--callout-error: var(--red1_x);
|
||||
--callout-fail: var(--red1_x);
|
||||
--callout-example: var(--magenta_x);
|
||||
--callout-important: var(--green_x);
|
||||
--callout-success: var(--teal_x);
|
||||
--callout-question: var(--yellow_x);
|
||||
--callout-warning: var(--orange_x);
|
||||
--callout-quote: var(--fg_dark_x);
|
||||
--icon-color-hover: var(--blue);
|
||||
--icon-color-focused: var(--magenta);
|
||||
--icon-color-active: var(--magenta);
|
||||
--nav-item-color-hover: var(--fg);
|
||||
--nav-item-background-hover: var(--bg_highlight);
|
||||
--nav-item-color-active: var(--red);
|
||||
--nav-item-background-active: var(--bg_highlight);
|
||||
--nav-file-tag: rgba(var(--yellow_x), 0.9);
|
||||
--nav-indentation-guide-color: var(--bg_highlight);
|
||||
--indentation-guide-color: var(--comment);
|
||||
--indentation-guide-color-active: var(--comment);
|
||||
--graph-line: var(--comment);
|
||||
--graph-node: var(--fg);
|
||||
--graph-node-tag: var(--orange);
|
||||
--graph-node-attachment: var(--blue);
|
||||
--tab-text-color-focused-active: rgba(var(--red_x), 0.8);
|
||||
--tab-text-color-focused-active-current: var(--red);
|
||||
--modal-border-color: var(--bg_highlight);
|
||||
--prompt-border-color: var(--bg_highlight);
|
||||
--slider-track-background: var(--bg_highlight);
|
||||
--embed-background: var(--bg_dark);
|
||||
--embed-padding: 1.5rem 1.5rem 0.5rem;
|
||||
--canvas-color: var(--bg_highlight_x);
|
||||
--toggle-thumb-color: var(--bg);
|
||||
}
|
||||
@ -25,7 +25,6 @@ export type FontSpecification =
|
||||
|
||||
export interface Theme {
|
||||
typography: {
|
||||
title?: FontSpecification
|
||||
header: FontSpecification
|
||||
body: FontSpecification
|
||||
code: FontSpecification
|
||||
@ -49,10 +48,7 @@ export function getFontSpecificationName(spec: FontSpecification): string {
|
||||
return spec.name
|
||||
}
|
||||
|
||||
function formatFontSpecification(
|
||||
type: "title" | "header" | "body" | "code",
|
||||
spec: FontSpecification,
|
||||
) {
|
||||
function formatFontSpecification(type: "header" | "body" | "code", spec: FontSpecification) {
|
||||
if (typeof spec === "string") {
|
||||
spec = { name: spec }
|
||||
}
|
||||
@ -86,19 +82,12 @@ function formatFontSpecification(
|
||||
}
|
||||
|
||||
export function googleFontHref(theme: Theme) {
|
||||
const { header, body, code } = theme.typography
|
||||
const { code, header, body } = theme.typography
|
||||
const headerFont = formatFontSpecification("header", header)
|
||||
const bodyFont = formatFontSpecification("body", body)
|
||||
const codeFont = formatFontSpecification("code", code)
|
||||
|
||||
return `https://fonts.googleapis.com/css2?family=${headerFont}&family=${bodyFont}&family=${codeFont}&display=swap`
|
||||
}
|
||||
|
||||
export function googleFontSubsetHref(theme: Theme, text: string) {
|
||||
const title = theme.typography.title || theme.typography.header
|
||||
const titleFont = formatFontSpecification("title", title)
|
||||
|
||||
return `https://fonts.googleapis.com/css2?family=${titleFont}&text=${encodeURIComponent(text)}&display=swap`
|
||||
return `https://fonts.googleapis.com/css2?family=${bodyFont}&family=${headerFont}&family=${codeFont}&display=swap`
|
||||
}
|
||||
|
||||
export interface GoogleFontFile {
|
||||
@ -146,7 +135,6 @@ ${stylesheet.join("\n\n")}
|
||||
--highlight: ${theme.colors.lightMode.highlight};
|
||||
--textHighlight: ${theme.colors.lightMode.textHighlight};
|
||||
|
||||
--titleFont: "${getFontSpecificationName(theme.typography.title || theme.typography.header)}", ${DEFAULT_SANS_SERIF};
|
||||
--headerFont: "${getFontSpecificationName(theme.typography.header)}", ${DEFAULT_SANS_SERIF};
|
||||
--bodyFont: "${getFontSpecificationName(theme.typography.body)}", ${DEFAULT_SANS_SERIF};
|
||||
--codeFont: "${getFontSpecificationName(theme.typography.code)}", ${DEFAULT_MONO};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user