Compare commits

...

12 Commits

Author SHA1 Message Date
16ac065be5 changes
Some checks failed
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (ubuntu-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / publish-tag (push) Has been cancelled
Docker build & push image / build (push) Has been cancelled
2025-10-25 21:07:18 -04:00
master
7f268bb227 initial
Some checks failed
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (ubuntu-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / publish-tag (push) Has been cancelled
Docker build & push image / build (push) Has been cancelled
2025-10-25 21:05:16 -04:00
dependabot[bot]
b4805a1031 chore(deps): bump the production-dependencies group with 3 updates (#2159)
Some checks failed
Build and Test / build-and-test (macos-latest) (push) Has been cancelled
Build and Test / build-and-test (ubuntu-latest) (push) Has been cancelled
Build and Test / build-and-test (windows-latest) (push) Has been cancelled
Build and Test / publish-tag (push) Has been cancelled
Docker build & push image / build (push) Has been cancelled
Bumps the production-dependencies group with 3 updates: [preact-render-to-string](https://github.com/preactjs/preact-render-to-string), [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [typescript](https://github.com/microsoft/TypeScript).


Updates `preact-render-to-string` from 6.6.1 to 6.6.2
- [Release notes](https://github.com/preactjs/preact-render-to-string/releases)
- [Changelog](https://github.com/preactjs/preact-render-to-string/blob/main/CHANGELOG.md)
- [Commits](https://github.com/preactjs/preact-render-to-string/compare/v6.6.1...v6.6.2)

Updates `@types/node` from 24.6.0 to 24.7.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `typescript` from 5.9.2 to 5.9.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.9.2...v5.9.3)

---
updated-dependencies:
- dependency-name: preact-render-to-string
  dependency-version: 6.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: "@types/node"
  dependency-version: 24.7.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
- dependency-name: typescript
  dependency-version: 5.9.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 13:16:57 -07:00
martyone
f14260b2ba fix(oxhugo): Do not discard embedded HTML (#2151)
In 'processors/parse.ts' the 'remarkRehype' plugin is used with
'allowDangerousHtml' enabled, but that needs to be combined with (e.g.)
'rehypeRaw' to have any effect on the output.
2025-10-02 10:51:40 -07:00
dependabot[bot]
9ad3481da6 chore(deps): bump the production-dependencies group with 4 updates (#2146)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-29 22:41:50 -04:00
dependabot[bot]
3ff7ca4155 chore(deps): bump sigstore/cosign-installer in the ci-dependencies group (#2135)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-28 16:45:18 -04:00
dependabot[bot]
eb6cc6ff8e chore(deps): bump the production-dependencies group with 9 updates (#2134)
Bumps the production-dependencies group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [is-absolute-url](https://github.com/sindresorhus/is-absolute-url) | `4.0.1` | `5.0.0` |
| [pixi.js](https://github.com/pixijs/pixijs) | `8.13.1` | `8.13.2` |
| [preact](https://github.com/preactjs/preact) | `10.27.1` | `10.27.2` |
| [pretty-bytes](https://github.com/sindresorhus/pretty-bytes) | `7.0.1` | `7.1.0` |
| [satori](https://github.com/vercel/satori) | `0.18.2` | `0.18.3` |
| [sharp](https://github.com/lovell/sharp) | `0.34.3` | `0.34.4` |
| [workerpool](https://github.com/josdejong/workerpool) | `9.3.3` | `9.3.4` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `24.3.1` | `24.5.2` |
| [esbuild](https://github.com/evanw/esbuild) | `0.25.9` | `0.25.10` |


Updates `is-absolute-url` from 4.0.1 to 5.0.0
- [Release notes](https://github.com/sindresorhus/is-absolute-url/releases)
- [Commits](https://github.com/sindresorhus/is-absolute-url/compare/v4.0.1...v5.0.0)

Updates `pixi.js` from 8.13.1 to 8.13.2
- [Release notes](https://github.com/pixijs/pixijs/releases)
- [Commits](https://github.com/pixijs/pixijs/compare/v8.13.1...v8.13.2)

Updates `preact` from 10.27.1 to 10.27.2
- [Release notes](https://github.com/preactjs/preact/releases)
- [Commits](https://github.com/preactjs/preact/compare/10.27.1...10.27.2)

Updates `pretty-bytes` from 7.0.1 to 7.1.0
- [Release notes](https://github.com/sindresorhus/pretty-bytes/releases)
- [Commits](https://github.com/sindresorhus/pretty-bytes/compare/v7.0.1...v7.1.0)

Updates `satori` from 0.18.2 to 0.18.3
- [Release notes](https://github.com/vercel/satori/releases)
- [Commits](https://github.com/vercel/satori/compare/0.18.2...0.18.3)

Updates `sharp` from 0.34.3 to 0.34.4
- [Release notes](https://github.com/lovell/sharp/releases)
- [Commits](https://github.com/lovell/sharp/compare/v0.34.3...v0.34.4)

Updates `workerpool` from 9.3.3 to 9.3.4
- [Changelog](https://github.com/josdejong/workerpool/blob/master/HISTORY.md)
- [Commits](https://github.com/josdejong/workerpool/commits)

Updates `@types/node` from 24.3.1 to 24.5.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `esbuild` from 0.25.9 to 0.25.10
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.9...v0.25.10)

---
updated-dependencies:
- dependency-name: is-absolute-url
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: production-dependencies
- dependency-name: pixi.js
  dependency-version: 8.13.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: preact
  dependency-version: 10.27.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: pretty-bytes
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
- dependency-name: satori
  dependency-version: 0.18.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: sharp
  dependency-version: 0.34.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: workerpool
  dependency-version: 9.3.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: "@types/node"
  dependency-version: 24.5.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
- dependency-name: esbuild
  dependency-version: 0.25.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-22 13:11:44 -07:00
Emile Bangma
4923affa77 fix(callouts)!: match callout DOM to Obsidian (#2104)
* fix(callouts): match callout DOM to Obsidian

* use new transition curve for all callout transitions

* chore!: bump version to 4.5.2
2025-09-21 19:14:03 +02:00
Jacky Zhao
4c78d29c13 fix(search): css min padding 2025-09-18 13:45:17 -07:00
Amir Pourmand
7a77f54e50 fix(i18n): Add RTL Detection based on Config Set Language (#2100)
* Add rtl automatic detection to base.scss

* Implement RTL support for Arabic and Persian locales and update HTML direction attribute in renderPage component

* Update HTML direction attribute in renderPage component to prioritize frontmatter dir value

* Refactor renderPage component to simplify HTML direction attribute assignment by removing frontmatter dir fallback
2025-09-17 16:04:22 -07:00
Amir Pourmand
03ccac2872 feat: Update FlexSearch and Add Support for All Languages (#2108)
* chore(deps): update flexsearch to version 0.8.205 and adjust search encoder.

* refactor(search): enhance search encoder and update search results type

- Improved the encoder function to filter out empty tokens.
- Updated the search results type from a specific FlexSearch type to a more generic 'any' type for flexibility.
- Removed redundant rtl property from the index configuration.

* refactor(search): remove rtl property from search index configuration

* refactor(search): improve encoder function formatting

- Updated the encoder function to use consistent arrow function syntax for better readability.

* refactor(search): update search results type to DefaultDocumentSearchResults

- Imported DefaultDocumentSearchResults from FlexSearch for improved type safety.
- Changed the type of searchResults from 'any' to DefaultDocumentSearchResults<Item> for better clarity and maintainability.
2025-09-17 15:39:30 -07:00
Jacky Zhao
6add0c837e fix(style): layout flow, search restyle 2025-09-17 15:26:49 -07:00
19 changed files with 511 additions and 477 deletions

View File

@@ -37,7 +37,7 @@ jobs:
network=host
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.9.2
uses: sigstore/cosign-installer@v3.10.0
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'

2
.gitignore vendored
View File

@@ -9,3 +9,5 @@ tsconfig.tsbuildinfo
private/
.replit
replit.nix
content/
public/

View File

46
deploy.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
# Define the directory to search in
BUILD_DIR="$HOME/quartz/"
CONTENT_DIR="$HOME/quartz/content"
# Find all .md files in the directory and remove all instances of `Blog/` to fix pathing
# Needed since all my articles are in the /Blog folder and it's subolfers in Obsidian instread of the base directory
find "$CONTENT_DIR" -type f -name "*.md" -print0 | while IFS= read -r -d $'\0' file; do
# Replace 'Blog/' with nothing in each file
sed -i 's|Blog/||g' "$file"
echo "Processed: $file"
done
# Find all markdown files in the content directory
find "$CONTENT_DIR" -name "*.md" -type f | while read -r file; do
echo "Processing: $file"
# Check if the file contains the Private section
if grep -q "^# Private$" "$file"; then
# Create a temporary file for processing
temp_file=$(mktemp)
# Use sed to remove content between # Private and # /Private inclusive
sed '/^# Private$/,/^# \/Private$/d' "$file" > "$temp_file"
# Replace original file with processed content
mv "$temp_file" "$file"
echo "Removed Private section from: $file"
else
echo "No Private section found in: $file"
fi
done
# echo "Processing complete!"
echo "All .md files have been processed."
cd "${BUILD_DIR}"
# build the html files
npx quartz build
# copy the files to the apache serve directory using a script
sudo /usr/local/bin/sync-quartz-site

800
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"name": "@jackyzha0/quartz",
"description": "🌱 publish your digital garden and notes as a website",
"private": true,
"version": "4.5.1",
"version": "4.5.2",
"type": "module",
"author": "jackyzha0 <j.zhao2k19@gmail.com>",
"license": "MIT",
@@ -46,25 +46,25 @@
"cli-spinner": "^0.2.10",
"d3": "^7.9.0",
"esbuild-sass-plugin": "^3.3.1",
"flexsearch": "0.7.43",
"flexsearch": "^0.8.205",
"github-slugger": "^2.0.0",
"globby": "^14.1.0",
"globby": "^15.0.0",
"gray-matter": "^4.0.3",
"hast-util-to-html": "^9.0.5",
"hast-util-to-jsx-runtime": "^2.3.6",
"hast-util-to-string": "^3.0.1",
"is-absolute-url": "^4.0.1",
"is-absolute-url": "^5.0.0",
"js-yaml": "^4.1.0",
"lightningcss": "^1.30.1",
"lightningcss": "^1.30.2",
"mdast-util-find-and-replace": "^3.0.2",
"mdast-util-to-hast": "^13.2.0",
"mdast-util-to-string": "^4.0.0",
"micromorph": "^0.4.5",
"minimatch": "^10.0.3",
"pixi.js": "^8.13.1",
"preact": "^10.27.1",
"preact-render-to-string": "^6.6.1",
"pretty-bytes": "^7.0.1",
"pixi.js": "^8.13.2",
"preact": "^10.27.2",
"preact-render-to-string": "^6.6.2",
"pretty-bytes": "^7.1.0",
"pretty-time": "^1.1.0",
"reading-time": "^1.5.0",
"rehype-autolink-headings": "^7.1.0",
@@ -83,9 +83,9 @@
"remark-rehype": "^11.1.2",
"remark-smartypants": "^3.0.2",
"rfdc": "^1.4.1",
"satori": "^0.18.2",
"satori": "^0.18.3",
"serve-handler": "^6.1.6",
"sharp": "^0.34.3",
"sharp": "^0.34.4",
"shiki": "^1.26.2",
"source-map-support": "^0.5.21",
"to-vfile": "^8.0.0",
@@ -93,7 +93,7 @@
"unified": "^11.0.5",
"unist-util-visit": "^5.0.0",
"vfile": "^6.0.3",
"workerpool": "^9.3.3",
"workerpool": "^9.3.4",
"ws": "^8.18.3",
"yargs": "^18.0.0"
},
@@ -101,14 +101,14 @@
"@types/d3": "^7.4.3",
"@types/hast": "^3.0.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "^24.3.1",
"@types/node": "^24.7.0",
"@types/pretty-time": "^1.1.5",
"@types/source-map-support": "^0.5.10",
"@types/ws": "^8.18.1",
"@types/yargs": "^17.0.33",
"esbuild": "^0.25.9",
"esbuild": "^0.25.10",
"prettier": "^3.6.2",
"tsx": "^4.20.5",
"typescript": "^5.9.2"
"tsx": "^4.20.6",
"typescript": "^5.9.3"
}
}

View File

@@ -8,7 +8,7 @@ import * as Plugin from "./quartz/plugins"
*/
const config: QuartzConfig = {
configuration: {
pageTitle: "Quartz 4",
pageTitle: "Yuriy's Notes",
pageTitleSuffix: "",
enableSPA: true,
enablePopovers: true,
@@ -16,12 +16,12 @@ const config: QuartzConfig = {
provider: "plausible",
},
locale: "en-US",
baseUrl: "quartz.jzhao.xyz",
baseUrl: "zinchuk.xyz",
ignorePatterns: ["private", "templates", ".obsidian"],
defaultDateType: "modified",
theme: {
fontOrigin: "googleFonts",
cdnCaching: true,
cdnCaching: false,
typography: {
header: "Schibsted Grotesk",
body: "Source Sans Pro",

View File

@@ -8,8 +8,6 @@ export const sharedPageComponents: SharedLayout = {
afterBody: [],
footer: Component.Footer({
links: {
GitHub: "https://github.com/jackyzha0/quartz",
"Discord Community": "https://discord.gg/cRFFHYye7t",
},
}),
}

View File

@@ -20,7 +20,6 @@ export default ((userOpts?: Partial<SearchOptions>) => {
return (
<div class={classNames(displayClass, "search")}>
<button class="search-button">
<p>{i18n(cfg.locale).components.search.title}</p>
<svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.9 19.7">
<title>Search</title>
<g class="search-path" fill="none">
@@ -28,6 +27,7 @@ export default ((userOpts?: Partial<SearchOptions>) => {
<circle cx="8" cy="8" r="7" />
</g>
</svg>
<p>{i18n(cfg.locale).components.search.title}</p>
</button>
<div class="search-container">
<div class="search-space">

View File

@@ -231,8 +231,9 @@ export function renderPage(
)
const lang = componentData.fileData.frontmatter?.lang ?? cfg.locale?.split("-")[0] ?? "en"
const direction = i18n(cfg.locale).direction ?? "ltr"
const doc = (
<html lang={lang}>
<html lang={lang} dir={direction}>
<Head {...componentData} />
<body data-slug={slug}>
<div id="quartz-root" class="page">

View File

@@ -1,4 +1,4 @@
import FlexSearch from "flexsearch"
import FlexSearch, { DefaultDocumentSearchResults } from "flexsearch"
import { ContentDetails } from "../../plugins/emitters/contentIndex"
import { registerEscapeHandler, removeAllChildren } from "./util"
import { FullSlug, normalizeRelativeURLs, resolveRelative } from "../../util/path"
@@ -9,15 +9,21 @@ interface Item {
title: string
content: string
tags: string[]
[key: string]: any
}
// Can be expanded with things like "term" in the future
type SearchType = "basic" | "tags"
let searchType: SearchType = "basic"
let currentSearchTerm: string = ""
const encoder = (str: string) => str.toLowerCase().split(/([^a-z]|[^\x00-\x7F])/)
const encoder = (str: string) => {
return str
.toLowerCase()
.split(/\s+/)
.filter((token) => token.length > 0)
}
let index = new FlexSearch.Document<Item>({
charset: "latin:extra",
encode: encoder,
document: {
id: "id",
@@ -397,7 +403,7 @@ async function setupSearch(searchElement: Element, currentSlug: FullSlug, data:
searchLayout.classList.toggle("display-results", currentSearchTerm !== "")
searchType = currentSearchTerm.startsWith("#") ? "tags" : "basic"
let searchResults: FlexSearch.SimpleDocumentSearchResultSetUnit[]
let searchResults: DefaultDocumentSearchResults<Item>
if (searchType === "tags") {
currentSearchTerm = currentSearchTerm.substring(1).trim()
const separatorIndex = currentSearchTerm.indexOf(" ")
@@ -410,7 +416,7 @@ async function setupSearch(searchElement: Element, currentSlug: FullSlug, data:
// return at least 10000 documents, so it is enough to filter them by tag (implemented in flexsearch)
limit: Math.max(numSearchResults, 10000),
index: ["title", "content"],
tag: tag,
tag: { tags: tag },
})
for (let searchResult of searchResults) {
searchResult.result = searchResult.result.slice(0, numSearchResults)

View File

@@ -8,24 +8,23 @@
}
& > .search-button {
background-color: color-mix(in srgb, var(--lightgray) 60%, var(--light));
border: none;
background-color: transparent;
border: 1px var(--lightgray) solid;
border-radius: 4px;
font-family: inherit;
font-size: inherit;
height: 2rem;
padding: 0;
padding: 0 1rem 0 0;
display: flex;
align-items: center;
text-align: inherit;
cursor: pointer;
white-space: nowrap;
width: 100%;
justify-content: space-between;
& > p {
display: inline;
padding: 0 1rem;
color: var(--gray);
}
& svg {
@@ -36,7 +35,7 @@
.search-path {
stroke: var(--darkgray);
stroke-width: 2px;
stroke-width: 1.5px;
transition: stroke 0.5s ease;
}
}

View File

@@ -5,6 +5,7 @@ export default {
title: "غير معنون",
description: "لم يتم تقديم أي وصف",
},
direction: "rtl" as const,
components: {
callout: {
note: "ملاحظة",

View File

@@ -21,6 +21,7 @@ export interface Translation {
title: string
description: string
}
direction?: "ltr" | "rtl"
components: {
callout: CalloutTranslation
backlinks: {

View File

@@ -5,6 +5,7 @@ export default {
title: "بدون عنوان",
description: "توضیح خاصی اضافه نشده است",
},
direction: "rtl" as const,
components: {
callout: {
note: "یادداشت",

View File

@@ -488,16 +488,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
{
data: { hProperties: { className: ["callout-content"] }, hName: "div" },
type: "blockquote",
children: [
{
data: {
hProperties: { className: ["callout-content-inner"] },
hName: "div",
},
type: "blockquote",
children: [...calloutContent],
},
],
children: [...calloutContent],
},
]
}

View File

@@ -1,4 +1,6 @@
import { QuartzTransformerPlugin } from "../types"
import rehypeRaw from "rehype-raw"
import { PluggableList } from "unified"
export interface Options {
/** Replace {{ relref }} with quartz wikilinks []() */
@@ -102,5 +104,9 @@ export const OxHugoFlavouredMarkdown: QuartzTransformerPlugin<Partial<Options>>
}
return src
},
htmlPlugins() {
const plugins: PluggableList = [rehypeRaw]
return plugins
},
}
}

View File

@@ -44,22 +44,8 @@ ul,
.typst-doc * {
color: var(--darkgray);
fill: var(--darkgray);
hyphens: auto;
}
p,
ul,
text,
a,
li,
ol,
ul,
.katex,
.math,
.typst-doc,
.typst-doc * {
overflow-wrap: anywhere;
/* tr and td removed from list of selectors for overflow-wrap, allowing them to use default 'normal' property value */
overflow-wrap: break-word;
text-wrap: pretty;
}
.math {
@@ -225,7 +211,7 @@ a {
}
& .sidebar {
gap: 2rem;
gap: 1.2rem;
top: 0;
box-sizing: border-box;
padding: $topSpacing 2rem 2rem 2rem;

View File

@@ -11,14 +11,11 @@
& > .callout-content {
display: grid;
transition: grid-template-rows 0.3s ease;
transition: grid-template-rows 0.1s cubic-bezier(0.02, 0.01, 0.47, 1);
overflow: hidden;
& > .callout-content-inner {
overflow: hidden;
& > :first-child {
margin-top: 0;
}
& > :first-child {
margin-top: 0;
}
}
@@ -121,8 +118,19 @@
--callout-icon: var(--callout-icon-quote);
}
&.is-collapsed > .callout-title > .fold-callout-icon {
transform: rotateZ(-90deg);
&.is-collapsed {
& > .callout-title > .fold-callout-icon {
transform: rotateZ(-90deg);
}
.callout-content > :first-child {
transition:
height 0.1s cubic-bezier(0.02, 0.01, 0.47, 1),
margin 0.1s cubic-bezier(0.02, 0.01, 0.47, 1);
overflow-y: clip;
height: 0;
margin-top: -1rem;
}
}
}