Skip to content

Commit

Permalink
Upgrade (#2)
Browse files Browse the repository at this point in the history
* docs: i can't type

* feat: Handling cssclasses properties in Quartz (#711)

* Add cssclasses to article

* Prettier

* Update quartz/components/pages/Content.tsx

* Update quartz/components/pages/Content.tsx

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* fix: generalize frontmatter parsing and coercing

* feat: enable dependabot

* chore(deps): bump rehype-pretty-code from 0.12.3 to 0.12.6 (#741)

Bumps [rehype-pretty-code](https://github.com/atomiks/rehype-pretty-code) from 0.12.3 to 0.12.6.
- [Release notes](https://github.com/atomiks/rehype-pretty-code/releases)
- [Commits](https://github.com/atomiks/rehype-pretty-code/compare/v0.12.3...v0.12.6)

---
updated-dependencies:
- dependency-name: rehype-pretty-code
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump tsx from 4.6.2 to 4.7.0 (#743)

Bumps [tsx](https://github.com/privatenumber/tsx) from 4.6.2 to 4.7.0.
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/develop/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.6.2...v4.7.0)

---
updated-dependencies:
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @napi-rs/simple-git from 0.1.9 to 0.1.11 (#746)

Bumps [@napi-rs/simple-git](https://github.com/Brooooooklyn/simple-git) from 0.1.9 to 0.1.11.
- [Release notes](https://github.com/Brooooooklyn/simple-git/releases)
- [Commits](https://github.com/Brooooooklyn/simple-git/compare/v0.1.9...v0.1.11)

---
updated-dependencies:
- dependency-name: "@napi-rs/simple-git"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump rehype-mathjax from 5.0.0 to 6.0.0 (#745)

Bumps [rehype-mathjax](https://github.com/remarkjs/remark-math) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/remarkjs/remark-math/releases)
- [Commits](https://github.com/remarkjs/remark-math/compare/rehype-mathjax@5.0.0...rehype-mathjax@6.0.0)

---
updated-dependencies:
- dependency-name: rehype-mathjax
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump shikiji from 0.9.9 to 0.10.2 (#742)

Bumps [shikiji](https://github.com/antfu/shikiji/tree/HEAD/packages/shikiji) from 0.9.9 to 0.10.2.
- [Release notes](https://github.com/antfu/shikiji/releases)
- [Commits](https://github.com/antfu/shikiji/commits/v0.10.2/packages/shikiji)

---
updated-dependencies:
- dependency-name: shikiji
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* deps: bump flexsearch

* fix: revert bad tsconfig change

* feat: Option to mask folder count (#734)

* Option to mask folder count

* Update quartz/components/pages/FolderContent.tsx

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* fix: fmt

* fix: allow alt to be defined in wikilinks alongside dims

* style: remove redundant webkit prefix

* docs: improve first-time git setup

* fix: revert parsing dates in frontmatter

* fix: content-disposition inline should apply to all resource types (closes #728)

* fix: `cssclasses` was not applied on folder note (index) (#749)

* docs: improve first-time git setup

* fix: cssClasses was not applied on index page

* refactor: remove vscode files

* fix: format

* fix: cssClasses should be applied on the entire div, not only the article

* feat: support cssClasses for tag-listing

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* feat: allow to config a translation for date (#739)

* fix: alt error mix with height/width

More granular detection of alt and resize in image

* fix: format

* feat: allow to translate the date displayed

* style: format

* fix: rename to fusion dateLocale with locale (i18n support)

* Update quartz/components/PageList.tsx

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* remove default key as it was already set

* add docstring for locale

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* feat: div that encapsulate PageList component (#750)

* feat: div that encapsulate PageList component

* change class to follow review

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* apply page-listing div to TagContent

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* feat(icon): update content for gfm links (#751)

* feat(icon): update content for gfm links

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: remove unused var

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: inherit display to remove additional spacing

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* revert: remove redundant svg attribute

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: attempt to merge cached folder state between builds (closes #691)

* fix: implement regex fix for alt in image wikilinks (closes #753)

* fix: fmt

* chore(deps): bump @napi-rs/simple-git from 0.1.11 to 0.1.14 (#756)

Bumps [@napi-rs/simple-git](https://github.com/Brooooooklyn/simple-git) from 0.1.11 to 0.1.14.
- [Release notes](https://github.com/Brooooooklyn/simple-git/releases)
- [Commits](https://github.com/Brooooooklyn/simple-git/compare/v0.1.11...v0.1.14)

---
updated-dependencies:
- dependency-name: "@napi-rs/simple-git"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump rfdc from 1.3.0 to 1.3.1 (#759)

Bumps [rfdc](https://github.com/davidmarkclements/rfdc) from 1.3.0 to 1.3.1.
- [Commits](https://github.com/davidmarkclements/rfdc/compare/v1.3.0...v1.3.1)

---
updated-dependencies:
- dependency-name: rfdc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump remark-rehype from 11.0.0 to 11.1.0 (#758)

Bumps [remark-rehype](https://github.com/remarkjs/remark-rehype) from 11.0.0 to 11.1.0.
- [Release notes](https://github.com/remarkjs/remark-rehype/releases)
- [Commits](https://github.com/remarkjs/remark-rehype/compare/11.0.0...11.1.0)

---
updated-dependencies:
- dependency-name: remark-rehype
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump workerpool from 8.0.0 to 9.1.0 (#757)

* chore(deps): bump workerpool from 8.0.0 to 9.1.0

Bumps [workerpool](https://github.com/josdejong/workerpool) from 8.0.0 to 9.1.0.
- [Changelog](https://github.com/josdejong/workerpool/blob/master/HISTORY.md)
- [Commits](https://github.com/josdejong/workerpool/compare/v8.0.0...v9.1.0)

---
updated-dependencies:
- dependency-name: workerpool
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* remove @types/workerpool

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* fix(type): make sure dispatchEvent also accept UIEvent (#760)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(div): update class name to remove weird space afterwards (#763)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(type): annotate event for nav (#761)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(css): improve wrapping when right sidebar has more than two items (#762)

* improve wrapping when right sidebar has more than two items, particularly on mobile

* Adjusted min-width

* feat: support selfhost umami (#764)

* feat: support selfhsot umami

* Update quartz/plugins/emitters/componentResources.ts

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* Update quartz/plugins/emitters/componentResources.ts

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* chore(deps-dev): bump prettier from 3.1.1 to 3.2.4 (#768)

* chore(deps-dev): bump prettier from 3.1.1 to 3.2.4

Bumps [prettier](https://github.com/prettier/prettier) from 3.1.1 to 3.2.4.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.1.1...3.2.4)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* format

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* chore(deps-dev): bump @types/node from 20.3.3 to 20.11.11 (#767)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.3.3 to 20.11.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @floating-ui/dom from 1.5.3 to 1.6.1 (#766)

Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.5.3 to 1.6.1.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Changelog](https://github.com/floating-ui/floating-ui/blob/master/packages/dom/CHANGELOG.md)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.6.1/packages/dom)

---
updated-dependencies:
- dependency-name: "@floating-ui/dom"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump lightningcss from 1.22.1 to 1.23.0 (#765)

Bumps [lightningcss](https://github.com/parcel-bundler/lightningcss) from 1.22.1 to 1.23.0.
- [Release notes](https://github.com/parcel-bundler/lightningcss/releases)
- [Commits](https://github.com/parcel-bundler/lightningcss/compare/v1.22.1...v1.23.0)

---
updated-dependencies:
- dependency-name: lightningcss
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: Feature/custom callout icon (#727)

* Add icons as masks

To handle a simple way to add custom icons, i made it pure css. Icon are now a mask for the callout-icon div, so they always follow the --color form the current callout.

Now to add a custom icon, you simply add

```css
.callout {
  &[data-callout="custom"] {
    --color: #customcolor;
    --border: #custombordercolor;
    --bg: #custombg;
    --callout-icon: url('data:image/svg+xml; utf8, <custom formatted svg>');

  }
```

to custom.scss

* remove now unused code

* Make callouts an enum

* docs: update instructions for custom callouts

* Prettier & run format

* dynamic matching

For maintainability, make dynamic mathching. If we or Obsidian want to support more callouts, we simply add it to the enum

* callout mapping const

Getting ride of the enum entierly as it's not worth here?

* fix callout icon styling

* Add forgotten icons

* Rebase

* harmonize callout icon and fold icon

* fix docs + prettier

* Update docs/features/callouts.md

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* Update quartz/plugins/transformers/ofm.ts

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* Suggestions fix

* remove unecessary rules

* comment is always nice

* Update docs/features/callouts.md

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* fix: properly parse tags in body

* feat(search): experimental telescope layout (closes #718) (#722)

* feat(search): telescope-style search

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore(search): cleanup some basis and borders

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(search): make sure to set overflow-y

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* feat(search): shows preview on desktop only search

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* perf: add options to control layout through config

cache memoize results to avoid fetching

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: use the default configuration

* fix: correct minor type for search

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: use datasets to query for preview

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: layout changes

show preview on normal layout, and only show previous layout in list page.

* fix(type): annotate search with types

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: apply jacky's suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* chore: using map API and scss

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: styling on search container view on phones

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* Update quartz.layout.ts

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* chore(deps): bump katex to 0.16.9 (#772)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* feat(usability): update functions for search (#774)

* feat(usability): update functions for search

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* perf: slightly cleaner variables

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(style): search preview consistency

* pkg: bump to 4.1.6

* fix: allow formatting in callout titles

* docs: fix outdated comment on rebuild debounce behaviour

* fix: fmt

* fix(search): remove background with mouseEvent (#775)

* fix(search): remove background with mouseEvent

make sure when mouseenter we remove all existing background

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: update logics from suggestions

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* revert: class is evicted

* fix: address correct type

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* fix: regression in formatted callout titles

* deps: reduce dependabot frequency

* chore(deps-dev): bump @types/node from 20.11.11 to 20.11.14 (#779)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.11 to 20.11.14.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump async-mutex from 0.4.0 to 0.4.1 (#777)

Bumps [async-mutex](https://github.com/DirtyHairy/async-mutex) from 0.4.0 to 0.4.1.
- [Changelog](https://github.com/DirtyHairy/async-mutex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DirtyHairy/async-mutex/compare/v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: async-mutex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump mdast-util-to-hast from 13.0.2 to 13.1.0 (#776)

Bumps [mdast-util-to-hast](https://github.com/syntax-tree/mdast-util-to-hast) from 13.0.2 to 13.1.0.
- [Release notes](https://github.com/syntax-tree/mdast-util-to-hast/releases)
- [Commits](https://github.com/syntax-tree/mdast-util-to-hast/compare/13.0.2...13.1.0)

---
updated-dependencies:
- dependency-name: mdast-util-to-hast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @types/hast from 3.0.3 to 3.0.4 (#780)

Bumps [@types/hast](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/hast) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/hast)

---
updated-dependencies:
- dependency-name: "@types/hast"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(search): improve more general usability (closes #781) (#782)

* fix(search): improve more general usability

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: revert naming

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: correct check for enter event on no-match cases

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* Update quartz/components/scripts/search.inline.ts

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* chore: remove unecessary class for tracking mouse

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* feat(search): highlight on preview (#783)

* feat: primitive full-text search on preview

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: remove invalid regex and unused code path

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(search): increase size on fullPageWidth viewport (#784)

* fix(search): increase size on fullPageWidth viewport

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: fix width size to be consistent on multiple views

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: set layout to 0 if there is no term

remove flashing by setting max-height

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore(search): check for input type and assignment of focus (#785)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* docs: clarity for `RecentNotes` (#786)

- Removed a word for clarity
- added reference to layout file

* chore: add window.addCleanup() for cleaning up handlers

* feat: improve search preview styling and tokenization

* fix: border radius on search preview

* fix: index setup, styling fixes

* chore(cleanup): misc refactoring for cleanup, fix some search bugs

* pkg: bump to 4.2.0

* chore: fmt

* fix: flatmap children when highlighting rich preview to avoid body

* fix: be more eager about constructing search index

* fix(style): reasonable page width for rich search preview

* fix(search): set correct attribute on hover icon (#787)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: parallelize search indexing

* fix: font weight consistency

* fix: font smoothing defaults

* fix(revert): font aliasing

* fix: use display instead of visibility for click handling pasthrough

* fix: search async ordering, scroll offset

* fix(style): remove redundant selector

* pkg: bump to 4.2.1

* fix(style): correctly collapse on mobile

* fix: properly handle absolute paths in `CreatedModifiedDate` (#790)

When providing an absolute path to the content directory (e.g. when using an Obsidian Vault in another directory), the build step would fail with

    Failed to process `/absolute/path/to/file.md`: ENOENT: no such file or directory, stat '/current/working/directory/absolute/path/'

This problem originated in the `CreatedModifiedDate` transformer which tries to construct a native filesystem path to the file to call `fs.stat` on. It did not however, account for the original file path contained in the received `VFile` being an absolute path and so, just concatenated the current working directory with the absolute path producing a nonexistent one.

This patch adds a simple fix for this issue by checking if the original file path is already absolute before concatenating with the current working directory.

* fix(search): null checks and focus fixes

* fix(style): prevent callout icon from shrinking on long titles (closes #792)

* fix(search): dont rely on mouse to manipulate focus

* fix(search): oops restore ability to preview on hover lol

* fix(search): flex basis and card highlighting

* fix: calculate heading after latex (closes #719)

* feat: Adding support for i18n (closes #462) (#738)

* fix: alt error mix with height/width

More granular detection of alt and resize in image

* fix: format

* feat: init i18n

* feat: add translation

* style: prettier for test

* fix: build-up the locale to fusion with dateLocale

* style: run prettier

* remove cursed file

* refactor: remove i18n library and use locale way instead

* format with prettier

* forgot to remove test

* prevent merging error

* format

* format

* fix: allow string for locale
- Check during translation if valid / existing locale
- Allow to use "en" and "en-US" for example
- Add fallback directly in the function
- Add default key in the function
- Add docstring to cfg.ts

* forgot item translation

* remove unused locale variable

* forgot to remove fr-FR testing

* format

* feat(ofm): parsing all type of arrow (#797)

* feat(ofm): parsing all type of arrow

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: use html value instead of decimal

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: skip parsing arrow if it is not a valid supported mapping

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(i18n): backlinks naming in mapping (#800)

* chore(i18n): refactor and cleanup (#805)

* checkpoint

* finish

* docs

* fix(path): properly path encode &

* pkg: bump to 4.2.2

* style(search): increase width on mobile view (#796)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* feat: support checkbox (closes #646) (#799)

* feat: support checkbox

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: apply review from jacky

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* feat(i18n): German translation (#808)

* feat(i18n): Add Japanese to i18n (#809)

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* feat(i18n): Add Dutch to i18n (#813)

* Create nl-NL.ts

* Update index.ts

* Update nl-NL.ts

* chore(deps): bump @napi-rs/simple-git from 0.1.14 to 0.1.16 (#810)

Bumps [@napi-rs/simple-git](https://github.com/Brooooooklyn/simple-git) from 0.1.14 to 0.1.16.
- [Release notes](https://github.com/Brooooooklyn/simple-git/releases)
- [Commits](https://github.com/Brooooooklyn/simple-git/compare/v0.1.14...v0.1.16)

---
updated-dependencies:
- dependency-name: "@napi-rs/simple-git"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @types/node from 20.11.14 to 20.11.16 (#811)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.14 to 20.11.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(i18n): add default locale

* fix(i18n): forgot a string

* perf: don't load mermaid if its not on the page

* fix(search): set background-color for icon within preview panel (#815)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(links): show backdrop on links highlighted in headers alias (#816)

* fix: assign specific classes based on parent node

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: use custom role for anchor icone

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: allow color on links 😄

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: unify search inner container

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* feat(i18n): add Romanian to i18n (#821)

* chore(lang): lang element based on frontmatter or default locale (#819)

default locale

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* add Spanish translations (#822)

* add Spanish translations

* format with prettier

* clears npm ci, formatted w/ prettier

* feat(fonts): fetch before build (#817)

* feat: fetch google fonts before build

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* Update quartz/plugins/emitters/componentResources.ts

* fix: fetching wolff2

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: remove request stylesheet

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: race condition

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: remove preconnect for static fonts

since we are already downloading fonts into public folder

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: remove deadcode

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: add options to gate for cdn caching

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* chore: apply jacky's suggestion

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* chore: add docs and only use one promise

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: fmt

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: remove deadcode

* chore: final touches

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* revert: changes in theme.ts

* fix: styles and remove deadcode

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* fix(umami): format correct string from custom hosts (#826)

* added Ukrainian to i18n (#829)

* feat(i18n): use Romanian translation for `ro-MD` locale (#828)

* fix: set default locale for lang attribute

* feat(experimental): partial rebuilds (#716)

* feat(i18n): add Arabic translation (#837)

* feat(i18n): add Arabic translation

* chore: format

* feat(i18n): support parsing callouts (#834)

* feat(i18n): support parsing callouts

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: move callout into components

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: update arabic translation

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: make sure to use correct items

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: move fonts all into static folder (#835)

* chore: move fonts all into static folder

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* chore: update formatter

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* chore(callouts): remove unnecessary whitespaces after class name (#833)

Though we should have a plugins that just strip whitespace in all node
class.

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* feat(i18n): localize the min read string (#838)

* feat(i18n): localize the min read string fixes #825

* chore: format

* docs: add documentation for Umami analytics integration (#846)

* chore: refactor out and export endsWith

* fix: breadcrumbs displayName issue for file names ending with index (#839)

* feat(i18n): localize the `min read` string for the `ro-RO` locale (#847)

* feat(i18n): localize `min read` string for `ro-RO` locale

* chore: run Prettier on `quartz/i18n/locales/ro-RO.ts`

* fix(breadcrumbs): folder index by full path rather than folder name (closes #676)

* chore(deps): bump esbuild-sass-plugin from 2.16.0 to 2.16.1 (#778)

Bumps [esbuild-sass-plugin](https://github.com/glromeo/esbuild-sass-plugin) from 2.16.0 to 2.16.1.
- [Release notes](https://github.com/glromeo/esbuild-sass-plugin/releases)
- [Commits](https://github.com/glromeo/esbuild-sass-plugin/compare/v2.16.0...v2.16.1)

---
updated-dependencies:
- dependency-name: esbuild-sass-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(ofm): allow diacretic marks in tag regex (closes #830)

* fix(fast rebuild): call only required emitters, don't always copy assets (#845)

* fix(fast rebuild): call only required emitters, don't always copy assets

* Type function

* feat: add transclude-src to transclude 'link to original'

* feat(i18n): localize the min read string for the nl-NL locale (#850)

* Update min read translation

* Added nl_BE to Dutch

Added Flemish (nl_BE) to point to nl.

* Removed period to match other translations

* fix(analytics): umami custom host should be a string (closes #852)

* chore(deps-dev): bump tsx from 4.7.0 to 4.7.1 (#859)

Bumps [tsx](https://github.com/privatenumber/tsx) from 4.7.0 to 4.7.1.
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/develop/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.7.0...v4.7.1)

---
updated-dependencies:
- dependency-name: tsx
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump preact from 10.19.3 to 10.19.4 (#858)

Bumps [preact](https://github.com/preactjs/preact) from 10.19.3 to 10.19.4.
- [Release notes](https://github.com/preactjs/preact/releases)
- [Commits](https://github.com/preactjs/preact/compare/10.19.3...10.19.4)

---
updated-dependencies:
- dependency-name: preact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @floating-ui/dom from 1.6.1 to 1.6.3 (#857)

Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.6.1 to 1.6.3.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Changelog](https://github.com/floating-ui/floating-ui/blob/master/packages/dom/CHANGELOG.md)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.6.3/packages/dom)

---
updated-dependencies:
- dependency-name: "@floating-ui/dom"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: incorrect link resolution for transclusion in root index file (#853)

Co-authored-by: Lauréline Nevin <laureline.nevin@unicaen.fr>

* fix: base.com not being resolved properly with joinSegments

* chore(types): add additional hint for LSP support (#864)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* docs: workaround for shallow clones on Cloudflare Pages (#868)

Rather than recommend a different hosting provider, Cloudflare Pages
users that prioritize the `git` method for their `CreatedModifiedDate`
configuration can preface the build command with a means of fetching the
required repository history.

See:
- https://gohugo.io/methods/page/gitinfo/#hosting-considerations

* Add support for image popovers (#854)

* feat(popover): Add support for images

* fix: run prettier

* feat(popover): use switch logic for content types & adjust styles

* feat(popover): Add content type data tag for popover-inner class

* feat: implement getDependencyGraph for FolderPage (#849)

* feat: implement getDependencyGraph for AliasRedirects emitter (#860)

* fix/feat(fast rebuild): re-render transclusions in normal and fastRebuild mode (#842)

* Re-render transclusions in normal watch mode

* Include transclusions in ContentPage getDependencyGraph

* Address PR comments

* feat: add user-defined config for syntax highlighting plugin (#869)

* feat: add user-defined options to syntax highlighting plugin

* feat: add default syntax highlighting config to `quartz.config.ts`

* chore: refactor according to @aarnphm's review

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* chore: run Prettier on `quartz/plugins/transformers/syntax.ts`

* Update quartz/plugins/transformers/syntax.ts

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* Update syntax.ts

---------

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* fix(style): introduce semiBoldWeight and various improvements to reduce CLS

* fix(style): bold should use semibold

* fix(breadcrumbs): calculate trailing slash for tag hierarchies (closes #873)

* feat(i18n): add Russian (#886)

* feat(i18n): add Korean (#889)

* feat(i18n): add Korean

* feat(i18n): add Korean

* perf(cdn): CDNJS instead of JSDelivr (#891)

* fix(frontmatter): delimiters parameter was not passed (#885)

* fix: delimiters parameter was not passed

Signed-off-by: Eiko Wagenknecht <git@eiko-wagenknecht.de>

* fix: remove unneeded undefined

---------

Signed-off-by: Eiko Wagenknecht <git@eiko-wagenknecht.de>

* feat(i18n): Add Italian (#893)

Signed-off-by: Leonardo Ledda <leonardoledda@gmail.com>

* docs: add self-hosting section (#883)

* Add Self-Hosting section
Add Nginx section

* run prettier

* feat(i18n): add Simplified Chinese (#896)

* feat: implement getDependencyGraph for TagPage (#872)

* feat: implement getDependencyGraph for TagPage

* Only add file to dg if it has at least 1 tag

* fix: remove assets via globs to avoid volume mount lock (#877)

* Fix docker volume lock issue by altering asset cleanup method
Modified build process to prevent the deletion of the output directory.

* Add fsOps utility for filesystem operations

* Use cleanDirectory in build process to fix volume lock issue

* applied prettier

* handle ENOENT error when output dir does not exist

* remove native function in favor of rimraf

* use path.join to concatenate paths

* chore(deps-dev): bump @types/node from 20.11.16 to 20.11.19 (#899)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.16 to 20.11.19.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump globby from 14.0.0 to 14.0.1 (#897)

Bumps [globby](https://github.com/sindresorhus/globby) from 14.0.0 to 14.0.1.
- [Release notes](https://github.com/sindresorhus/globby/releases)
- [Commits](https://github.com/sindresorhus/globby/compare/v14.0.0...v14.0.1)

---
updated-dependencies:
- dependency-name: globby
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump preact from 10.19.4 to 10.19.5 (#898)

Bumps [preact](https://github.com/preactjs/preact) from 10.19.4 to 10.19.5.
- [Release notes](https://github.com/preactjs/preact/releases)
- [Commits](https://github.com/preactjs/preact/compare/10.19.4...10.19.5)

---
updated-dependencies:
- dependency-name: preact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: correctly parse falsy js as title (#900)

* feat(i18n): change itemsUnderFolder, itemsUnderTag translation of ko-KR (#905)

* feat(i18n): add Korean

* feat(i18n): add Korean

* feat(i18n): change itemsUnderFolder, itemsUnderTag translation of ko-KR

* fix: add space and missing dot for listing pages (#907)

* fix(toc): correct type for minEntries param (#909)

* docs: Fix in explorer.md (#911)

* docs: Add Aster's notebook to showcase.md (#912)

* chore: passing additional buildCtx to componentData (#914)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* feat(popover): add support for PDF (#913)

* feat(popover): add support for PDF

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore: split pdf by ';'

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: remove unnecessary check

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore(img): return targetUrl as given href (#916)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* deps(highlighting): migrate to shiki as shikiji has been archived (#918)

* fix(docs): make docs accurate to callout behaviour (closes #920)

* fix(callouts): use user provided title instead of canonical for default title

* docs: update plugin documentation (#888)

* docs: first few plugins documented

* docs: move plugin info

* docs: move plugin docs to tag based system

* docs: update latex example code snippet

* docs: fix spelling of latex in title

* docs: add missing linebreak

* docs: remove plugin tag from feature pages

* docs: shorten titles

* docs: refine wording

* docs: move plugin details for frontmatter

* docs: add features/* tags

* docs: update latex example

* docs: make references more explicit

* docs: add stubs for the remaining plugins

* docs: more descriptions

* docs: fix feature tags

* docs: descriptions

* docs: new plugin pages

* docs: update configuration page

* docs: more plugin work

* docs: run prettier

* docs: remove comments in config file and add link to docs

* docs: minor fixes

* docs: run prettier

* docs: spelling

* docs: update docs/plugins/AliasRedirects.md

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* docs: update docs/plugins/Assets.md

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* docs: update docs/plugins/CNAME.md

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* docs: update docs/plugins/Static.md

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* docs: update docs

* docs: update docs/features/Mermaid diagrams.md

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* docs: update docs/plugins/RemoveDrafts.md

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* docs: update docs/plugins/Assets.md

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* docs: update docs/configuration.md

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* docs: update docs/configuration.md

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* docs: update docs/configuration.md

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* docs: some updates

* docs: work in review comments

---------

Signed-off-by: Eiko Wagenknecht <git@eiko-wagenknecht.de>
Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* docs(latex): mhchem

* fix(fast rebuild): handle added an deleted markdown correctly (#921)

* Handle added files correctly

* Handle deletes properly

* addGraph renamed to mergeGraph

* fix(ci): autotag

* pkg: bump to 4.2.3

* ci: fix autotag

* ci: tag as a separate step

* ci: fix typo in runs-on

* ci: also checkout and install node before tagging

* docs: fix tag page oops (#925)

* chore(types): update correct annotations for pages (#928)

* chore(type): export attribute for theme key (#933)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore(deps): bump preact from 10.19.5 to 10.19.6 (#935)

Bumps [preact](https://github.com/preactjs/preact) from 10.19.5 to 10.19.6.
- [Release notes](https://github.com/preactjs/preact/releases)
- [Commits](https://github.com/preactjs/preact/compare/10.19.5...10.19.6)

---
updated-dependencies:
- dependency-name: preact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump chokidar from 3.5.3 to 3.6.0 (#937)

Bumps [chokidar](https://github.com/paulmillr/chokidar) from 3.5.3 to 3.6.0.
- [Release notes](https://github.com/paulmillr/chokidar/releases)
- [Commits](https://github.com/paulmillr/chokidar/compare/3.5.3...3.6.0)

---
updated-dependencies:
- dependency-name: chokidar
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: Clarifications in the Explorer Docs (#938)

add example to filter by tags.

* fix: correct umami host for self-hosted (#939)

* fixed umami script path for self-hosted version

* Update quartz/plugins/emitters/componentResources.ts

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

---------

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* feat(i18n): add Vietnamese translation (#950)

* fix(callout): reorder the plugins to render latex on callout title (closes #952) (#934)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore(deps): bump remark-smartypants from 2.0.0 to 2.1.0 (#755)

Bumps [remark-smartypants](https://github.com/silvenon/remark-smartypants) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/silvenon/remark-smartypants/releases)
- [Commits](https://github.com/silvenon/remark-smartypants/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: remark-smartypants
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: support transcluding codeblocks and blockquotes (closes #940)

* fix(docs): correct ExplicitPublish as filters instead of transformers (#953)

* feat(frontmatter): configure max length for description (#946)

* Sentence length check

* Replace external links with domain name.

* Updated documentation.

* Updated replacement values.

* Updated Regex based on feedback.

* Check description for undefined

* Updated external url transform regex.

* Updated formatting

* feat(graph): focusOnHover (#954)

by default, globalGraph will enable focusOnHover, similar to Obsidian.

---------

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* chore(deps): bump lightningcss from 1.23.0 to 1.24.0 (#961)

Bumps [lightningcss](https://github.com/parcel-bundler/lightningcss) from 1.23.0 to 1.24.0.
- [Release notes](https://github.com/parcel-bundler/lightningcss/releases)
- [Commits](https://github.com/parcel-bundler/lightningcss/compare/v1.23.0...v1.24.0)

---
updated-dependencies:
- dependency-name: lightningcss
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump preact-render-to-string from 6.3.1 to 6.4.0 (#960)

Bumps [preact-render-to-string](https://github.com/developit/preact-render-to-string) from 6.3.1 to 6.4.0.
- [Release notes](https://github.com/developit/preact-render-to-string/releases)
- [Changelog](https://github.com/preactjs/preact-render-to-string/blob/main/CHANGELOG.md)
- [Commits](https://github.com/developit/preact-render-to-string/compare/v6.3.1...6.4.0)

---
updated-dependencies:
- dependency-name: preact-render-to-string
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump shiki from 1.1.6 to 1.1.7 (#959)

Bumps [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki) from 1.1.6 to 1.1.7.
- [Release notes](https://github.com/shikijs/shiki/releases)
- [Changelog](https://github.com/shikijs/shiki/blob/main/CHANGELOG.md)
- [Commits](https://github.com/shikijs/shiki/commits/v1.1.7/packages/shiki)

---
updated-dependencies:
- dependency-name: shiki
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* revert: "fix(callout): reorder the plugins to render latex on callout… (#965)

This reverts commit 018c6358c4c00be319ccc00df84f9be02e7845b4.

* fix: transclude all subsections for embedded call (closes #963) (#964)

* chore(deps-dev): bump @types/node from 20.11.19 to 20.11.24 (#958)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.19 to 20.11.24.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: transclude subsection without dynamic regex construction

* feat: support youtube playlist iframe (#968)

* feat: support youtube playlist iframe

* chore: updated Youtube embed documentation to include playlists

* fix(tag): move hash to sass styling only (#930)

* fix(tag): remove hash on main page (#969)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix: remove extra # from tag content

* feat(analytics): Goatcounter support (#956)

* Add options to support goatcounter analytics

* goatcounter: support self-hosted

* Add to configuration docs for goatcounter settings

* use https instead of protocol-relative link for goatcounter js

* fix(description): make sure to we join space correctly (#970)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(description): counts characters instead of words (#972)

* fix(description): make sure description counts characters instead of words

* ref: removed duplicate ternary

* fix(i18n): make sure to use correct fileData for manual localization (#975)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(description): first sentence no longer repeats until max length (#981)

* fix(resources): Use full path to font when cdnCache is false (#976)

* fix(transclusion): prevent duplicate transclusion if multiple transclusions are present. (#982)

* feat(perf:fast-rebuilds): Stop mutating resources param in ComponentResources emitter (#977)

* Stop mutating resources param in ComponentResources emitter

* Add done rebuilding log for fast rebuilds

* Move google font loading to Head component

* Simplify code and fix comment

* feat: separated content meta (#929)

to allow for CSS styling

* fix: spelling error (#987)

I really don't know why I translated this like that into "pas trouvé", and it bugged me a lot. I finally fixed it…

Signed-off-by: Mara-Li <lili.simonetti@outlook.fr>

* chore(deps-dev): bump typescript from 5.3.3 to 5.4.2 (#989)

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.3.3 to 5.4.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.3.3...v5.4.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump async-mutex from 0.4.1 to 0.5.0 (#991)

Bumps [async-mutex](https://github.com/DirtyHairy/async-mutex) from 0.4.1 to 0.5.0.
- [Changelog](https://github.com/DirtyHairy/async-mutex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DirtyHairy/async-mutex/compare/v0.4.1...v0.5.0)

---
updated-dependencies:
- dependency-name: async-mutex
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(plugin): citations (#984)

* feat: add rehype-citations

* feat: add citations transformer plugin

* feat: add rehype-rewrite

* feat: add csl option and add no-popover to citation links

* revert: add rehype-rewrite

04b2692 'feat: add rehype-rewrite'

* feat: use existing package for html manipulation

* fix: remove `console.log()`

* fix: wikiLink in table (#993)

* fix: wikiLink in table

- update regexp to make '\' to group in alias
- handle alias using block_id

* style: format with prettier

* style: add comment for block_ref(without alias) in table

---------

Co-authored-by: hulinjiang <hulinjiang@58.com>

* feat(i18n): Add French translation for reading time (#998)

Signed-off-by: Mara-Li <lili.simonetti@outlook.fr>

* chore(deps-dev): bump @types/node from 20.11.24 to 20.11.25 (#990)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.24 to 20.11.25.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(ofm): remove unused (#999)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>

* fix(wikilinks): only escape alias in wikilinks inside tables (#1000)

* docs: add config for Caddy server (#1002)

* feat(search): add search by title/content index and tag at the same time (#978)

* feat(search): add search by title/content index and tag at the same time

* fix(search): set search type to basic and remove tag from term for proper highlightning and scroll when searched by tag and title/content index

* fix(search): use indexOf to find space so it is easier to read

* fix(search): trim trailing whitespaces before splitting

* fix(search): set limit to 10000 for combined search mode (to make filter by tag more accurate)

* feat: support rich descriptions in tag listing page (closes #908)

* fix: format

* fix(wikilinks): handle wikilinks inside tables seperately from other wikilinks (#1005)

* fix(wikilinks): handle wikilinks inside tables seperately from other wikilinks

* Prettier

* Cleaned up duplicate code

* Remove test logging

* Refactored and fixed for non-aliased wikilinks inside table

* Updated naming and comments

* Updated comment of wikilink regex

* Updated regex to match previous formatting

* Match table even if EOF is immediately after the table.

* Update quartz/plugins/transformers/ofm.ts

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* Change table escape replace to non-regex version

* Prettier

* Prettier

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* chore(deps): bump lightningcss from 1.24.0 to 1.24.1 (#1012)

Bumps [lightningcss](https://github.com/parcel-bundler/lightningcss) from 1.24.0 to 1.24.1.
- [Release notes](https://github.com/parcel-bundler/lightningcss/releases)
- [Commits](https://github.com/parcel-bundler/lightningcss/compare/v1.24.0...v1.24.1)

---
updated-dependencies:
- dependency-name: lightningcss
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump shiki from 1.1.7 to 1.2.0 (#1011)

Bumps [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki) from 1.1.7 to 1.2.0.
- [Release notes](https://github.com/shikijs/shiki/releases)
- [Changelog](https://github.com/shikijs/shiki/blob/main/CHANGELOG.md)
- [Commits](https://github.com/shikijs/shiki/commits/v1.2.0/packages/shiki)

---
updated-dependencies:
- dependency-name: shiki
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @types/node from 20.11.25 to 20.11.29 (#1010)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.25 to 20.11.29.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: Update showcase.md (#1031)

* i18n: add Hungarian translations (#1023)

* add Hungarian translations

* typo: _ instead of - in hu-HU

* run prettier

* revert prettier messing up tsconfig

* Update hu-HU.ts

* i18n: pt-BR translation (#1024)

* i18n: pt-br

* i18n: pt-br translation

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>

* fix(style): LaTex/KaTeX overflow (#1027)

* LaTex/KaTeX overflow fix

* prettier

* Add !important modifier

* Added overflow-x override

* Refactor without !important

* Refactor scss notation

* Formatting scss

* simpler katex fix

* fix(assets): pdf page linking support. (#1025)

* github-slugger pdf workaround

* Skip sluggifying on pdf file extension

* Account for pdf files without anchor

* Address feedback

* chore(deps-dev): bump typescript from 5.4.2 to 5.4.3 (#1036)

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.2...v5.4.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump preact from 10.19.6 to 10.20.1 (#1035)

Bumps [preact](https://github.com/preactjs/preact) from 10.19.6 to 10.20.1.
- [Release notes](https://github.com/preactjs/preact/releases)
- [Commits](https://github.com/preactjs/preact/compare/10.19.6...10.20.1)

---
updated-dependencies:
- dependency-name: preact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: do not render <p> inside FolderContent article (#1044)

it can lead to nested <p>'s which is actually [invalid html](https://www.w3.org/TR/html401/struct/text.html#h-9.3.1:~:text=The%20P%20element%20represents%20a%20paragraph.%20It%20cannot%20contain%20block%2Dlevel%20elements%20(including%20P%20itself).)

* fix(wikilinks): proper escaping of pipe character in wikilinks inside tables (#1040)

* chore(deps): bump shiki from 1.2.0 to 1.2.3 (#1048)

Bumps [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki) from 1.2.0 to 1.2.3.
- [Release notes](https://github.com/shikijs/shiki/releases)
- [Changelog](https://github.com/shikijs/shiki/blob/main/CHANGELOG.md)
- [Commits](https://github.com/shikijs/shiki/commits/v1.2.3/packages/shiki)

---
updated-dependencies:
- dependency-name: shiki
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: broken doc links on /plugins/* (#1053)

* Update Assets.md

* expand fix for every /plugins page

* chore(deps): bump d3 from 7.8.5 to 7.9.0 (#1047)

Bumps [d3](https://github.com/d3/d3) from 7.8.5 to 7.9.0.
- [Release notes](https://github.com/d3/d3/releases)
- [Changelog](https://github.com/d3/d3/blob/main/CHANGES.md)
- [Commits](https://github.com/d3/d3/compare/v7.8.5...v7.9.0)

---
updated-dependencies:
- dependency-name: d3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat(analytics): PostHog support (#1072)

* chore(deps-dev): bump @types/node from 20.11.29 to 20.12.5 (#1074)

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.11.29 to 20.12.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump workerpool from 9.1.0 to 9.1.1 (#1073)

Bumps [workerpool](https://github.com/josdejong/workerpool) from 9.1.0 to 9.1.1.
- [Changelog](https://github.com/josdejong/workerpool/blob/master/HISTORY.md)
- [Commits](https://github.com/josdejong/workerpool/compare/v9.1.0...v9.1.1)

---
updated-dependencies:
- dependency-name: workerpool
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: unnecessery 'm' letter removed in pt-BR (#1100)

* Allow pnpm quartz (#1078)

Co-authored-by: iacore <noreply+gpg-stub@1a-insec.net>

* chore(deps): bump preact-render-to-string from 6.4.0 to 6.4.2 (#1094)

Bumps [preact-render-to-string](https://github.com/preactjs/preact-render-to-string) from 6.4.0 to 6.4.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/6.4.0...v6.4.2)

---
updated-dependencies:
- dependency-name: preact-render-to-string
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: update link to hosting page (#1054)

* fix: update link to hosting page

* chore: update correct path with using alias

---------

Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>

* feat(analytics): Tinylytics support (#1118)

* add ti…
  • Loading branch information
Show file tree
Hide file tree
Showing 161 changed files with 5,932 additions and 2,153 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
24 changes: 21 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,26 @@ jobs:
- name: Ensure Quartz builds, check bundle info
run: npx quartz build --bundleInfo

publish-tag:
if: ${{ github.repository == 'jackyzha0/quartz' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Get package version
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
- name: Create release tag
uses: Klemensas/action-autotag@stable
uses: pkgdeps/git-tag-action@v2
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
tag_prefix: "v"
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
version: ${{ env.PACKAGE_VERSION }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
Quartz is a set of tools that helps you publish your [digital garden](https://jzhao.xyz/posts/networked-thought) and notes as a website for free.
Quartz v4 features a from-the-ground rewrite focusing on end-user extensibility and ease-of-use.

**If you are looking for Quartz v3, you can find it on the [`hugo` branch](https://github.com/jackyzha0/quartz/tree/hugo).**

🔗 Read the documentation and get started: https://quartz.jzhao.xyz/

[Join the Discord Community](https://discord.gg/cRFFHYye7t)
Expand Down
5 changes: 3 additions & 2 deletions docs/advanced/creating components.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,13 @@ document.addEventListener("nav", () => {
// do page specific logic here
// e.g. attach event listeners
const toggleSwitch = document.querySelector("#switch") as HTMLInputElement
toggleSwitch.removeEventListener("change", switchTheme)
toggleSwitch.addEventListener("change", switchTheme)
window.addCleanup(() => toggleSwitch.removeEventListener("change", switchTheme))
})
```

It is best practice to also unmount any existing event handlers to prevent memory leaks.
It is best practice to track any event handlers via `window.addCleanup` to prevent memory leaks.
This will get called on page navigation.

#### Importing Code

Expand Down
29 changes: 15 additions & 14 deletions docs/advanced/making plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ All transformer plugins must define at least a `name` field to register the plug
Normally for both `remark` and `rehype`, you can find existing plugins that you can use to . If you'd like to create your own `remark` or `rehype` plugin, checkout the [guide to creating a plugin](https://unifiedjs.com/learn/guide/create-a-plugin/) using `unified` (the underlying AST parser and transformer library).
A good example of a transformer plugin that borrows from the `remark` and `rehype` ecosystems is the [[Latex]] plugin:
A good example of a transformer plugin that borrows from the `remark` and `rehype` ecosystems is the [[plugins/Latex|Latex]] plugin:
```ts title="quartz/plugins/transformers/latex.ts"
import remarkMath from "remark-math"
import rehypeKatex from "rehype-katex"
import rehypeMathjax from "rehype-mathjax/svg.js"
import rehypeMathjax from "rehype-mathjax/svg"
import { QuartzTransformerPlugin } from "../types"

interface Options {
Expand All @@ -84,10 +84,14 @@ export const Latex: QuartzTransformerPlugin<Options> = (opts?: Options) => {
externalResources() {
if (engine === "katex") {
return {
css: ["https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css"],
css: [
// base css
"https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/katex.min.css",
],
js: [
{
src: "https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/contrib/copy-tex.min.js",
// fix copy behaviour: https://github.com/KaTeX/KaTeX/blob/main/contrib/copy-tex/README.md
src: "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.9/contrib/copy-tex.min.js",
loadTime: "afterDOMReady",
contentType: "external",
},
Expand Down Expand Up @@ -216,22 +220,19 @@ export type QuartzEmitterPlugin<Options extends OptionType = undefined> = (

export type QuartzEmitterPluginInstance = {
name: string
emit(
ctx: BuildCtx,
content: ProcessedContent[],
resources: StaticResources,
emitCallback: EmitCallback,
): Promise<FilePath[]>
emit(ctx: BuildCtx, content: ProcessedContent[], resources: StaticResources): Promise<FilePath[]>
getQuartzComponents(ctx: BuildCtx): QuartzComponent[]
}
```
An emitter plugin must define a `name` field an `emit` function and a `getQuartzComponents` function. `emit` is responsible for looking at all the parsed and filtered content and then appropriately creating files and returning a list of paths to files the plugin created.
An emitter plugin must define a `name` field, an `emit` function, and a `getQuartzComponents` function. `emit` is responsible for looking at all the parsed and filtered content and then appropriately creating files and returning a list of paths to files the plugin created.
Creating new files can be done via regular Node [fs module](https://nodejs.org/api/fs.html) (i.e. `fs.cp` or `fs.writeFile`) or via the `emitCallback` if you are creating files that contain text. The `emitCallback` function is the 4th argument of the emit function. Its interface looks something like this:
Creating new files can be done via regular Node [fs module](https://nodejs.org/api/fs.html) (i.e. `fs.cp` or `fs.writeFile`) or via the `write` function in `quartz/plugins/emitters/helpers.ts` if you are creating files that contain text. `write` has the following signature:
```ts
export type EmitCallback = (data: {
export type WriteOptions = (data: {
// the build context
ctx: BuildCtx
// the name of the file to emit (not including the file extension)
slug: ServerSlug
// the file extension
Expand Down Expand Up @@ -281,7 +282,7 @@ export const ContentPage: QuartzEmitterPlugin = () => {
allFiles,
}

const content = renderPage(slug, componentData, opts, externalResources)
const content = renderPage(cfg, slug, componentData, opts, externalResources)
const fp = await emit({
content,
slug: file.data.slug!,
Expand Down
22 changes: 9 additions & 13 deletions docs/authoring content.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Authoring Content
---

All of the content in your Quartz should go in the `/content` folder. The content for the home page of your Quartz lives in `content/index.md`. If you've [[index#🪴 Get Started|setup Quartz]] already, this folder should already be initailized. Any Markdown in this folder will get processed by Quartz.
All of the content in your Quartz should go in the `/content` folder. The content for the home page of your Quartz lives in `content/index.md`. If you've [[index#🪴 Get Started|setup Quartz]] already, this folder should already be initialized. Any Markdown in this folder will get processed by Quartz.

It is recommended that you use [Obsidian](https://obsidian.md/) as a way to edit and maintain your Quartz. It comes with a nice editor and graphical interface to preview, edit, and link your local files and attachments.

Expand All @@ -28,21 +28,17 @@ The rest of your content lives here. You can use **Markdown** here :)
Some common frontmatter fields that are natively supported by Quartz:

- `title`: Title of the page. If it isn't provided, Quartz will use the name of the file as the title.
- `description`: Description of the page used for link previews.
- `aliases`: Other names for this note. This is a list of strings.
- `tags`: Tags for this note.
- `draft`: Whether to publish the page or not. This is one way to make [[private pages|pages private]] in Quartz.
- `date`: A string representing the day the note was published. Normally uses `YYYY-MM-DD` format.

## Syncing your Content

When your Quartz is at a point you're happy with, you can save your changes to GitHub by doing `npx quartz sync`.

> [!hint] Flags and options
> For full help options, you can run `npx quartz sync --help`.
>
> Most of these have sensible defaults but you can override them if you have a custom setup:
>
> - `-d` or `--directory`: the content folder. This is normally just `content`
> - `-v` or `--verbose`: print out extra logging information
> - `--commit` or `--no-commit`: whether to make a `git` commit for your changes
> - `--push` or `--no-push`: whether to push updates to your GitHub fork of Quartz
> - `--pull` or `--no-pull`: whether to try and pull in any updates from your GitHub fork (i.e. from other devices) before pushing
When your Quartz is at a point you're happy with, you can save your changes to GitHub.
First, make sure you've [[setting up your GitHub repository|already setup your GitHub repository]] and then do `npx quartz sync`.

## Customization

Frontmatter parsing for `title`, `tags`, `aliases` and `cssclasses` is a functionality of the [[Frontmatter]] plugin, `date` is handled by the [[CreatedModifiedDate]] plugin and `description` by the [[Description]] plugin. See the plugin pages for customization options.
52 changes: 38 additions & 14 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ This part of the configuration concerns anything that can affect the whole site.
- `enablePopovers`: whether to enable [[popover previews]] on your site.
- `analytics`: what to use for analytics on your site. Values can be
- `null`: don't use analytics;
- `{ provider: 'plausible' }`: use [Plausible](https://plausible.io/), a privacy-friendly alternative to Google Analytics; or
- `{ provider: 'google', tagId: <your-google-tag> }`: use Google Analytics
- `{ provider: 'google', tagId: '<your-google-tag>' }`: use Google Analytics;
- `{ provider: 'plausible' }` (managed) or `{ provider: 'plausible', host: '<your-plausible-host>' }` (self-hosted): use [Plausible](https://plausible.io/);
- `{ provider: 'umami', host: '<your-umami-host>', websiteId: '<your-umami-website-id>' }`: use [Umami](https://umami.is/);
- `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id' }` (managed) or `{ provider: 'goatcounter', websiteId: 'my-goatcounter-id', host: 'my-goatcounter-domain.com', scriptSrc: 'https://my-url.to/counter.js' }` (self-hosted) use [GoatCounter](https://goatcounter.com);
- `{ provider: 'posthog', apiKey: '<your-posthog-project-apiKey>', host: '<your-posthog-host>' }`: use [Posthog](https://posthog.com/);
- `{ provider: 'tinylytics', siteId: '<your-site-id>' }`: use [Tinylytics](https://tinylytics.app/);
- `locale`: used for [[i18n]] and date formatting
- `baseUrl`: this is used for sitemaps and RSS feeds that require an absolute URL to know where the canonical 'home' of your site lives. This is normally the deployed URL of your site (e.g. `quartz.jzhao.xyz` for this site). Do not include the protocol (i.e. `https://`) or any leading or trailing slashes.
- This should also include the subpath if you are [[hosting]] on GitHub pages without a custom domain. For example, if my repository is `jackyzha0/quartz`, GitHub pages would deploy to `https://jackyzha0.github.io/quartz` and the `baseUrl` would be `jackyzha0.github.io/quartz`
- This should also include the subpath if you are [[hosting]] on GitHub pages without a custom domain. For example, if my repository is `jackyzha0/quartz`, GitHub pages would deploy to `https://jackyzha0.github.io/quartz` and the `baseUrl` would be `jackyzha0.github.io/quartz`.
- Note that Quartz 4 will avoid using this as much as possible and use relative URLs whenever it can to make sure your site works no matter _where_ you end up actually deploying it.
- `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 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.
- `header`: Font to use for headers
- `code`: Font for inline and block quotes.
Expand All @@ -53,30 +59,48 @@ You can think of Quartz plugins as a series of transformations over content.

![[quartz transform pipeline.png]]

```ts
```ts title="quartz.config.ts"
plugins: {
transformers: [...],
filters: [...],
emitters: [...],
}
```

- [[making plugins#Transformers|Transformers]] **map** over content (e.g. parsing frontmatter, generating a description)
- [[making plugins#Filters|Filters]] **filter** content (e.g. filtering out drafts)
- [[making plugins#Emitters|Emitters]] **reduce** over content (e.g. creating an RSS feed or pages that list all files with a specific tag)
- [[tags/plugin/transformer|Transformers]] **map** over content (e.g. parsing frontmatter, generating a description)
- [[tags/plugin/filter|Filters]] **filter** content (e.g. filtering out drafts)
- [[tags/plugin/emitter|Emitters]] **reduce** over content (e.g. creating an RSS feed or pages that list all files with a specific tag)

By adding, removing, and reordering plugins from the `tranformers`, `filters`, and `emitters` fields, you can customize the behaviour of Quartz.
You can customize the behaviour of Quartz by adding, removing and reordering plugins in the `transformers`, `filters` and `emitters` fields.

> [!note]
> Each node is modified by every transformer _in order_. Some transformers are position-sensitive so you may need to take special note of whether it needs come before or after any other particular plugins.
> Each node is modified by every transformer _in order_. Some transformers are position sensitive, so you may need to pay particular attention to whether they need to come before or after certain other plugins.
You should take care to add the plugin to the right entry corresponding to its plugin type. For example, to add the [[ExplicitPublish]] plugin (a [[tags/plugin/filter|Filter]]), you would add the following line:

```ts title="quartz.config.ts"
filters: [
...
Plugin.ExplicitPublish(),
...
],
```

Additionally, plugins may also have their own configuration settings that you can pass in. For example, the [[Latex]] plugin allows you to pass in a field specifying the `renderEngine` to choose between Katex and MathJax.
To remove a plugin, you should remove all occurrences of it in the `quartz.config.ts`.

```ts
To customize plugins further, some plugins may also have their own configuration settings that you can pass in. If you do not pass in a configuration, the plugin will use its default settings.

For example, the [[plugins/Latex|Latex]] plugin allows you to pass in a field specifying the `renderEngine` to choose between Katex and MathJax.

```ts title="quartz.config.ts"
transformers: [
Plugin.FrontMatter(), // uses default options
Plugin.Latex({ renderEngine: "katex" }), // specify some options
Plugin.FrontMatter(), // use default options
Plugin.Latex({ renderEngine: "katex" }), // set some custom options
]
```

If you'd like to make your own plugins, read the guide on [[making plugins]] for more information.
Some plugins are included by default in the[ `quartz.config.ts`](https://github.com/jackyzha0/quartz/blob/v4/quartz.config.ts), but there are more available.

You can see a list of all plugins and their configuration options [[tags/plugin|here]].

If you'd like to make your own plugins, see the [[making plugins|making custom plugins]] guide.
29 changes: 24 additions & 5 deletions docs/features/Latex.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: LaTeX
tags:
- plugin/transformer
- feature/transformer
---

Quartz uses [Katex](https://katex.org/) by default to typeset both inline and block math expressions at build time.
Expand Down Expand Up @@ -38,6 +39,20 @@ a & b & c
\end{bmatrix}
$$

$$
\begin{array}{rll}
E \psi &= H\psi & \text{Expanding the Hamiltonian Operator} \\
&= -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2} \psi + \frac{1}{2}m\omega x^2 \psi & \text{Using the ansatz $\psi(x) = e^{-kx^2}f(x)$, hoping to cancel the $x^2$ term} \\
&= -\frac{\hbar^2}{2m} [4k^2x^2f(x)+2(-2kx)f'(x) + f''(x)]e^{-kx^2} + \frac{1}{2}m\omega x^2 f(x)e^{-kx^2} &\text{Removing the $e^{-kx^2}$ term from both sides} \\
& \Downarrow \\
Ef(x) &= -\frac{\hbar^2}{2m} [4k^2x^2f(x)-4kxf'(x) + f''(x)] + \frac{1}{2}m\omega x^2 f(x) & \text{Choosing $k=\frac{im}{2}\sqrt{\frac{\omega}{\hbar}}$ to cancel the $x^2$ term, via $-\frac{\hbar^2}{2m}4k^2=\frac{1}{2}m \omega$} \\
&= -\frac{\hbar^2}{2m} [-4kxf'(x) + f''(x)] \\
\end{array}
$$

> [!warn]
> Due to limitations in the [underlying parsing library](https://github.com/remarkjs/remark-math), block math in Quartz requires the `$$` delimiters to be on newlines like above.
### Inline Math

Similarly, inline math can be rendered by delimiting math expression with a single `$`. For example, `$e^{i\pi} = -1$` produces $e^{i\pi} = -1$
Expand All @@ -53,11 +68,15 @@ For example:
- Incorrect: `I have $1 and you have $2` produces I have $1 and you have $2
- Correct: `I have \$1 and you have \$2` produces I have \$1 and you have \$2

## MathJax
### Using mhchem

Add the following import to the top of `quartz/plugins/transformers/latex.ts` (before all the other
imports):

In `quartz.config.ts`, you can configure Quartz to use [MathJax SVG rendering](https://docs.mathjax.org/en/latest/output/svg.html) by replacing `Plugin.Latex({ renderEngine: 'katex' })` with `Plugin.Latex({ renderEngine: 'mathjax' })`
```ts title="quartz/plugins/transformers/latex.ts"
import "katex/contrib/mhchem"
```

## Customization

- Removing Latex support: remove all instances of `Plugin.Latex()` from `quartz.config.ts`.
- Plugin: `quartz/plugins/transformers/latex.ts`
Latex parsing is a functionality of the [[plugins/Latex|Latex]] plugin. See the plugin page for customization options.
8 changes: 7 additions & 1 deletion docs/features/Mermaid diagrams.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
---
title: "Mermaid Diagrams"
tags:
- feature/transformer
---

Quartz supports Mermaid which allows you to add diagrams and charts to your notes. Mermaid supports a range of diagrams, such as [flow charts](https://mermaid.js.org/syntax/flowchart.html)[sequence diagrams](https://mermaid.js.org/syntax/sequenceDiagram.html), and [timelines](https://mermaid.js.org/syntax/timeline.html). This is enabled as a part of [[Obsidian compatibility]] and can be configured and enabled/disabled from that plugin.

By default, Quartz will render Mermaid diagrams to match the site theme.

> [!warning]
> Wondering why Mermaid diagrams may not be showing up even if you have them enabled? You may need to reorder your plugins so that `Plugin.ObsidianFlavoredMarkdown()` is _after_ `Plugin.SyntaxHighlighting()`.
> Wondering why Mermaid diagrams may not be showing up even if you have them enabled? You may need to reorder your plugins so that [[ObsidianFlavoredMarkdown]] is _after_ [[SyntaxHighlighting]].
## Syntax

Expand Down
Loading

0 comments on commit 1e0b3d2

Please sign in to comment.