- [Major] Changed `hash` passed to `querySelector` to `decodeURIComponent(hash)` to fix the issue where non-English anchors were not correctly positioning the popover content to the corresponding title.
- [Minor] Updated the type hint from `HTMLLinkElement` to `HTMLAnchorElement` as the passed element is an `<a>` element, not a `<link>` element (reference: https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement).
* replace .gitlab-ci.yml example with more reliable and faster ci job
* literally removing 1 space, inside a code block, in docs, just to make prettier not cry
simplifies slug from FullSlug to SimpleSlug before storing it in the visited pages list in memory
this leads to "index" page and "folder/index", "tags/tag/index" being stored a "/", "folder/" and "tags/tag/" respectively in the list of visited pages.
this ensures that the homepage is rightfully coloured as a visited page in the "color" function of the graph
* Tags appear as hollow circles on the graph
Added a few lines to make tags appear as hollow circles on the graph, as opposed to pages which are plain circles, for better visual separation.
* Applied Prettier code style
* fix: change callout metadata regex to include non-letter characters
* fix: make metadata regex non-greedy
This allows for users to have callouts such as
> [!NOTE|left foo-bar 123] a ]+ title with square brackets [s] a
> Contents
* Add homepage link with internationalization
* Construct pathname from baseUrl config value
* More robust URL manipulation
* Add Farsi (#1133)
* Fix bad rebase
* fix: update link to hosting page
* chore: update correct path with using alias
---------
Co-authored-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
* 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>
* 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)
* 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>
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>
* 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
* 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 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
* 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
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
* 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: 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
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): 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* fix(search): use anchor element
This addresses #698 to allow search title to include links for SPA
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
* fix: formatter
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
* chore: move itemTile to `a`
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
* chore: remove nested a title
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
* chore(search): remove spaNavigate
since now searchResult is an `a` item
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
---------
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
* add an option to display or not reading time from notes
* Prettier (?)
* Remove ContentMeta override from quartz.layout.ts
* Make it positive ! 🌞
* Update quartz/components/ContentMeta.tsx
---------
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
* fix: allow publish property to be a string (ExplicitPublish)
Previously, the ExplicitPublish filter would publish if the `publish`
property was truthy.
The filter expects the `publish` property to be a boolean:
```
---
publish: true
---
```
However, Obsidian only shows the above if you are viewing a page in
“Source” mode.
If you are not in Source view, and you choose Three Dots Menu (...),
“Add file property”, you will get a string, not a boolean. It seems
likely that many users will do this and get:
```
publish: "true"
```
Notice that `"true"` is a string, not the boolean value `true`. If the
user changes this to `"false"`, the page will still be published:
```
publish: "false"
```
That is because the string value `"false"` is truthy.
This PR does the following:
- Allows the `publish` property to be either a boolean or a string.
- If it’s a string, it’s considered `true` if the string is `"true"`
(not case-sensitive; it will also work if it is `"True"`, `"TRUE"`,
etc.)
- Guarantees that the returned value from `shouldPublish` is a `boolean`
-- previously it could be any truthy value even though it was cast to
`boolean`
* style: use double-quotes everywhere
* style: format according to project style guide
* Add option to allow embedding YouTube videos with Obsidian Markdown syntax
* Update Obsidian compatability doc page
* Switch to converting YT links as an html plugin
* Continue setup even if a file to delete is not found
For various reasons, `.gitkeep` may be deleted already.
(In my case, even though I followed the [Getting Started](https://quartz.jzhao.xyz) instructions exactly, my first run resulted in an `fatal: 'upstream' does not appear to be a git repository`)
If we try to delete `.gitkeep` again and don't ignore `ENOENT`, then the whole setup fails.
* Use fs.existsSync
* Added doc example to explorer sortFn
* Prettier fixed formatting
* Let Prettier fix the formatting of the entire markdown file
* Updated example
* Added extra commentary and fixed example
* Update docs/features/explorer.md
* doc fixes
* docs: remove leftover TODO
* docs: move example to `advanced`
---------
Co-authored-by: Sidney <85735034+Epicrex@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
Co-authored-by: Ben Schlegel <ben5.schlegel@gmail.com>
* use slugs instead of title as basis for explorer
* fix folder persist state, better default behaviour
* use relative path instead of full path as full path is affected by -d
* dont use title in breadcrumb if it's just index lol
Quartz also has the ability to hook into various providers to enable readers to leave comments on your site.
![[giscus-example.png]]
As of today, only [Giscus](https://giscus.app/) is supported out of the box but PRs to support other providers are welcome!
## Providers
### Giscus
First, make sure that the [[setting up your GitHub repository|GitHub]] repository you are using for your Quartz meets the following requirements:
1. The**repository is[public](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/setting-repository-visibility#making-a-repository-public)**, otherwise visitors will not be able to view the discussion.
2. The**[giscus](https://github.com/apps/giscus)app is installed**, otherwise visitors will not be able to comment and react.
3. The**Discussions feature is turned on**by[enabling it for your repository](https://docs.github.com/en/github/administering-a-repository/managing-repository-settings/enabling-or-disabling-github-discussions-for-a-repository).
Then, use the [Giscus site](https://giscus.app/#repository) to figure out what your `repoId` and `categoryId` should be. Make sure you select `Announcements` for the Discussion category.
![[giscus-repo.png]]
![[giscus-discussion.png]]
After entering both your repository and selecting the discussion category, Giscus will compute some IDs that you'll need to provide back to Quartz. You won't need to manually add the script yourself as Quartz will handle that part for you but will need these values in the next step!
![[giscus-results.png]]
Finally, in `quartz.layout.ts`, edit the `afterBody` field of `sharedPageComponents` to include the following options but with the values you got from above:
```ts title="quartz.layout.ts"
afterBody: [
Component.Comments({
provider: 'giscus',
options: {
// from data-repo
repo: 'jackyzha0/quartz',
// from data-repo-id
repoId: 'MDEwOlJlcG9zaXRvcnkzODcyMTMyMDg',
// from data-category
category: 'Announcements',
// from data-category-id
categoryId: 'DIC_kwDOFxRnmM4B-Xg6',
}
}),
],
```
### Customization
Quartz also exposes a few of the other Giscus options as well and you can provide them the same way `repo`, `repoId`, `category`, and `categoryId` are provided.
Internationalization allows users to translate text in the Quartz interface into various supported languages without needing to make extensive code changes. This can be changed via the `locale` [[configuration]] field in `quartz.config.ts`.
The locale field generally follows a certain format: `{language}-{REGION}`
- `{language}` is usually a [2-letter lowercase language code](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
- `{REGION}` is usually a [2-letter uppercase region code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
> [!tip] Interested in contributing?
> We [gladly welcome translation PRs](https://github.com/jackyzha0/quartz/tree/v4/quartz/i18n/locales)! To contribute a translation, do the following things:
>
> 1. In the `quartz/i18n/locales` folder, copy the `en-US.ts` file.
> 2. Rename it to `{language}-{REGION}.ts` so it matches a locale of the format shown above.
> 3. Fill in the translations!
> 4. Add the entry under `TRANSLATIONS` in `quartz/i18n/index.ts`.
This plugin emits all non-Markdown static assets in your content folder (like images, videos, HTML, etc). The plugin respects the `ignorePatterns` in the global [[configuration]].
Note that all static assets will then be accessible through its path on your generated site, i.e: `host.me/path/to/static.pdf`
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin manages and emits the static resources required for the Quartz framework. This includes CSS stylesheets and JavaScript scripts that enhance the functionality and aesthetics of the generated site. See also the `cdnCaching` option in the `theme` section of the [[configuration]].
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin emits both RSS and an XML sitemap for your site. The [[RSS Feed]] allows users to subscribe to content on your site and the sitemap allows search engines to better index your site. The plugin also emits a `contentIndex.json` file which is used by dynamic frontend components like search and graph.
This plugin emits a comprehensive index of the site's content, generating additional resources such as a sitemap, an RSS feed, and a
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `enableSiteMap`: If `true` (default), generates a sitemap XML file (`sitemap.xml`) listing all site URLs for search engines in content discovery.
- `enableRSS`: If `true` (default), produces an RSS feed (`index.xml`) with recent content updates.
- `rssLimit`: Defines the maximum number of entries to include in the RSS feed, helping to focus on the most recent or relevant content. Defaults to `10`.
- `rssFullHtml`: If `true`, the RSS feed includes full HTML content. Otherwise it includes just summaries.
- `includeEmptyFiles`: If `true` (default), content files with no body text are included in the generated index and resources.
This plugin is a core component of the Quartz framework. It generates the HTML pages for each piece of Markdown content. It emits the full-page [[layout]], including headers, footers, and body content, among others.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin parses links and processes them to point to the right places. It is also needed for embedded links (like images). See [[Obsidian compatibility]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `markdownLinkResolution`: Sets the strategy for resolving Markdown paths, can be `"absolute"` (default), `"relative"` or `"shortest"`. You should use the same setting here as in [[Obsidian compatibility|Obsidian]].
- `absolute`: Path relative to the root of the content folder.
- `relative`: Path relative to the file you are linking from.
- `shortest`: Name of the file. If this isn't enough to identify the file, use the full absolute path.
- `prettyLinks`: If `true` (default), simplifies links by removing folder paths, making them more user friendly (e.g. `folder/deeply/nested/note` becomes `note`).
- `openLinksInNewTab`: If `true`, configures external links to open in a new tab. Defaults to `false`.
- `lazyLoad`: If `true`, adds lazy loading to resource elements (`img`, `video`, etc.) to improve page load performance. Defaults to `false`.
- `externalLinkIcon`: Adds an icon next to external links when `true` (default) to visually distinguishing them from internal links.
> [!warning]
> Removing this plugin is _not_ recommended and will likely break the page.
This plugin determines the created, modified, and published dates for a document using three potential data sources: frontmatter metadata, Git history, and the filesystem. See [[authoring content#Syntax]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `priority`: The data sources to consult for date information. Highest priority first. Possible values are `"frontmatter"`, `"git"`, and `"filesystem"`. Defaults to `["frontmatter", "git", "filesystem"]`.
> [!warning]
> If you rely on `git` for dates, make sure `defaultDateType` is set to `modified` in `quartz.config.ts`.
>
> Depending on how you [[hosting|host]] your Quartz, the `filesystem` dates of your local files may not match the final dates. In these cases, it may be better to use `git` or `frontmatter` to guarantee correct dates.
This plugin generates descriptions that are used as metadata for the HTML `head`, the [[RSS Feed]] and in [[folder and tag listings]] if there is no main body content, the description is used as the text between the title and the listing.
If the frontmatter contains a `description` property, it is used (see [[authoring content#Syntax]]). Otherwise, the plugin will do its best to use the first few sentences of the content to reach the target description length.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `descriptionLength`: the maximum length of the generated description. Default is 150 characters. The cut off happens after the first _sentence_ that ends after the given length.
- `replaceExternalLinks`: If `true` (default), replace external links with their domain and path in the description (e.g. `https://domain.tld/some_page/another_page?query=hello&target=world` is replaced with `domain.tld/some_page/another_page`).
This plugin filters content based on an explicit `publish` flag in the frontmatter, allowing only content that is explicitly marked for publication to pass through. It's the opt-in version of [[RemoveDrafts]]. See [[private pages]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin generates index pages for folders, creating a listing page for each folder that contains multiple content files. See [[folder and tag listings]] for more information.
Example: [[advanced/|Advanced]]
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
The pages are displayed using the `defaultListPageLayout` in `quartz.layouts.ts`. For the content, the `FolderContent` component is used. If you want to modify the layout, you must edit it directly (`quartz/components/pages/FolderContent.tsx`).
This plugin accepts the following configuration options:
- `sort`: A function of type `(f1: QuartzPluginData, f2: QuartzPluginData) => number{:ts}` used to sort entries. Defaults to sorting by date and tie-breaking on lexographical order.
This plugin parses the frontmatter of the page using the [gray-matter](https://github.com/jonschlinkert/gray-matter) library. See [[authoring content#Syntax]], [[Obsidian compatibility]] and [[OxHugo compatibility]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `delimiters`: the delimiters to use for the frontmatter. Can have one value (e.g. `"---"`) or separate values for opening and closing delimiters (e.g. `["---", "~~~"]`). Defaults to `"---"`.
- `language`: the language to use for parsing the frontmatter. Can be `yaml` (default) or `toml`.
> [!warning]
> This plugin must not be removed, otherwise Quartz will break.
This plugin enhances Markdown processing to support GitHub Flavored Markdown (GFM) which adds features like autolink literals, footnotes, strikethrough, tables and tasklists.
In addition, this plugin adds optional features for typographic refinement (such as converting straight quotes to curly quotes, dashes to en-dashes/em-dashes, and ellipses) and automatic heading links as a symbol that appears next to the heading on hover.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `enableSmartyPants`: When true, enables typographic enhancements. Default is true.
- `linkHeadings`: When true, automatically adds links to headings. Default is true.
## API
- Category: Transformer
- Function name: `Plugin.GitHubFlavoredMarkdown()`.
This plugin automatically converts single line breaks in Markdown text into hard line breaks in the HTML output. This plugin is not enabled by default as this doesn't follow the semantics of actual Markdown but you may enable it if you'd like parity with [[Obsidian compatibility|Obsidian]].
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin adds LaTeX support to Quartz. See [[features/Latex|Latex]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `renderEngine`: the engine to use to render LaTeX equations. Can be `"katex"` for [KaTeX](https://katex.org/) or `"mathjax"` for [MathJax](https://www.mathjax.org/) [SVG rendering](https://docs.mathjax.org/en/latest/output/svg.html). Defaults to KaTeX.
This plugin provides support for [ox-hugo](https://github.com/kaushalmodi/ox-hugo) compatibility. See [[OxHugo compatibility]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `wikilinks`: If `true` (default), converts Hugo `{{ relref }}` shortcodes to Quartz [[wikilinks]].
- `removePredefinedAnchor`: If `true` (default), strips predefined anchors from headings.
- `removeHugoShortcode`: If `true` (default), removes Hugo shortcode syntax (`{{}}`) from the content.
- `replaceFigureWithMdImg`: If `true` (default), replaces `<figure/>` with `![]()`.
- `replaceOrgLatex`: If `true` (default), converts Org-mode [[features/Latex|Latex]] fragments to Quartz-compatible LaTeX wrapped in `$` (for inline) and `$$` (for block equations).
> [!warning]
> While you can use this together with [[ObsidianFlavoredMarkdown]], it's not recommended because it might mutate the file in unexpected ways. Use with caution.
>
> If you use `toml` frontmatter, make sure to configure the [[Frontmatter]] plugin accordingly. See [[OxHugo compatibility]] for an example.
## API
- Category: Transformer
- Function name: `Plugin.OxHugoFlavoredMarkdown()`.
This plugin filters out content from your vault, so that only finalized content is made available. This prevents [[private pages]] from being published. By default, it filters out all pages with `draft: true` in the frontmatter and leaves all other pages intact.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin emits all static resources needed by Quartz. This is used, for example, for fonts and images that need a stable position, such as banners and icons. The plugin respects the `ignorePatterns` in the global [[configuration]].
> [!important]
> This is different from [[Assets]]. The resources from the [[Static]] plugin are located under `quartz/static`, whereas [[Assets]] renders all static resources under `content` and is used for images, videos, audio, etc. that are directly referenced by your markdown content.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin is used to add syntax highlighting to code blocks in Quartz. See [[syntax highlighting]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `theme`: a separate id of one of the [themes bundled with Shikiji](https://shikiji.netlify.app/themes). One for light mode and one for dark mode. Defaults to `theme: {light: "github-light", dark: "github-dark" }`.
- `keepBackground`: If set to `true`, the background of the Shikiji theme will be used. With `false` (default) the Quartz theme color for background will be used instead.
In addition, you can further override the colours in the `quartz/styles/syntax.scss` file.
This plugin generates a table of contents (TOC) for Markdown documents. See [[table of contents]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
This plugin accepts the following configuration options:
- `maxDepth`: Limits the depth of headings included in the TOC, ranging from `1` (top level headings only) to `6` (all heading levels). Default is `3`.
- `minEntries`: The minimum number of heading entries required for the TOC to be displayed. Default is `1`.
- `showByDefault`: If `true` (default), the TOC should be displayed by default. Can be overridden by frontmatter settings.
- `collapseByDefault`: If `true`, the TOC will start in a collapsed state. Default is `false`.
> [!warning]
> This plugin needs the `Component.TableOfContents` component in `quartz.layout.ts` to determine where to display the TOC. Without it, nothing will be displayed. They should always be added or removed together.
This plugin emits dedicated pages for each tag used in the content. See [[folder and tag listings]] for more information.
> [!note]
> For information on how to add, remove or configure plugins, see the [[configuration#Plugins|Configuration]] page.
The pages are displayed using the `defaultListPageLayout` in `quartz.layouts.ts`. For the content, the `TagContent` component is used. If you want to modify the layout, you must edit it directly (`quartz/components/pages/TagContent.tsx`).
This plugin accepts the following configuration options:
- `sort`: A function of type `(f1: QuartzPluginData, f2: QuartzPluginData) => number{:ts}` used to sort entries. Defaults to sorting by date and tie-breaking on lexographical order.
First, make sure you have Quartz [[index#🪴 Get Started|cloned and setup locally]].
Then, create a new repository on GitHub.com. Do **not** initialize the new repository with `README`, license, or `gitignore` files.
![[github-init-repo-options.png]]
At the top of your repository on GitHub.com's Quick Setup page, clickthe clipboard to copy the remote repository URL.
![[github-quick-setup.png]]
In your terminal of choice, navigate to the root of your Quartz folder. Then, run the following commands, replacing `REMOTE-URL` with the URL you just copied from the previous step.
```bash
# list all the repositories that are tracked
git remote -v
# if the origin doesn't match your own repository, set your repository as the origin
git remote set-url origin REMOTE-URL
# if you don't have upstream as a remote, add it so updates work
Then, you can sync the content to upload it to your repository. This is a helper command that will do the initial push of your content to your repository.
```bash
npx quartz sync --no-pull
```
> [!warning]- `fatal: --[no-]autostash option is only valid with --rebase`
> You may have an outdated version of `git`. Updating `git` should fix this issue.
In future updates, you can simply run `npx quartz sync` every time you want to push updates to your repository.
> [!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
Seethe[documentation](https://quartz.jzhao.xyz) for how to get started.
`,
)
}
// Use cli process if cmd args werent provided
if(!linkResolutionStrategy){
// get a preferred link resolution strategy
linkResolutionStrategy=exitIfCancel(
awaitselect({
message:`Choose how Quartz should resolve links in your content. This should match Obsidian's link format. You can change this later in \`quartz.config.ts\`.`,
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.