initial commit: combine book with quartz
This commit is contained in:
commit
ff112713f9
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
public/
|
||||
exampleSite/public/
|
||||
.DS_Store
|
||||
.hugo_build.lock
|
||||
themes
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "themes/hugo-book"]
|
||||
path = themes/hugo-book
|
||||
url = https://github.com/alex-shpak/hugo-book
|
20
LICENSE
Normal file
20
LICENSE
Normal file
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2022 Ben Cuan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
24
Makefile
Normal file
24
Makefile
Normal file
@ -0,0 +1,24 @@
|
||||
.DEFAULT_GOAL := serve
|
||||
|
||||
help: ## Show all Makefile targets
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
update: ## Update Quartz to the latest version on Github
|
||||
go install github.com/jackyzha0/hugo-obsidian@latest
|
||||
@git remote show upstream || (echo "remote 'upstream' not present, setting 'upstream'" && git remote add upstream https://github.com/jackyzha0/quartz.git)
|
||||
git fetch upstream
|
||||
git log --oneline --decorate --graph ..upstream/hugo
|
||||
git checkout -p upstream/hugo -- layouts .github Makefile assets/js assets/styles/base.scss assets/styles/darkmode.scss config.toml data
|
||||
|
||||
update-force: ## Forcefully pull all changes and don't ask to patch
|
||||
go install github.com/jackyzha0/hugo-obsidian@latest
|
||||
@git remote show upstream || (echo "remote 'upstream' not present, setting 'upstream'" && git remote add upstream https://github.com/jackyzha0/quartz.git)
|
||||
git fetch upstream
|
||||
git checkout upstream/hugo -- layouts .github Makefile assets/js assets/styles/base.scss assets/styles/darkmode.scss config.toml data
|
||||
|
||||
serve: ## Serve Quartz locally
|
||||
hugo-obsidian -input=content -output=assets/indices -index -root=.
|
||||
hugo server --enableGitInfo --minify --bind=$(or $(HUGO_BIND),0.0.0.0) --baseURL=$(or $(HUGO_BASEURL),http://localhost) --port=$(or $(HUGO_PORT),1313) --appendPort=$(or $(HUGO_APPENDPORT),true)
|
||||
|
||||
docker: ## Serve locally using Docker
|
||||
docker run -it --volume=$(shell pwd):/quartz -p 1313:1313 ghcr.io/jackyzha0/quartz:hugo
|
218
README.md
Normal file
218
README.md
Normal file
@ -0,0 +1,218 @@
|
||||
# Amethyst Hugo Theme
|
||||
|
||||
[![Hugo](https://img.shields.io/badge/hugo-0.79-blue.svg)](https://gohugo.io)
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
|
||||
|
||||
Amethyst combines the navigational features of [hugo-book](https://github.com/alex-shpak/hugo-book) with the Obsidian integrations of [quartz](https://github.com/jackyzha0/quartz) to provide a hassle-free place to store and host personal notes or documentation.
|
||||
|
||||
Insert screenshot here
|
||||
|
||||
## Features
|
||||
- Most of the features of the original themes (Quartz and Book)
|
||||
- Mobile-friendly
|
||||
- Multi-language support
|
||||
- Customizable
|
||||
- Dark Mode
|
||||
- LaTeX support
|
||||
- Obsidian-style back/forward links and page previews
|
||||
- Interactive graph view
|
||||
- Tab cards for practice problems
|
||||
|
||||
## Requirements
|
||||
|
||||
- **Go 1.16 or higher**: [installation instructions](https://golang.org/doc/install)
|
||||
- **Hugo 0.93 or higher:** [installation instructions](https://gohugo.io/getting-started/installing/)
|
||||
- If installing on Ubuntu/Debian-based systems, this is a higher version than is available in apt at the time of writing. Install the extended version from the [releases page](https://github.com/gohugoio/hugo/releases) instead.
|
||||
- **Hugo-obsidian:** Run `go install github.com/jackyzha0/hugo-obsidian@latest`.
|
||||
- If you're getting a `command not found` error, [ensure that your PATH is configured properly so that binaries in the GOPATH can be executed](https://stackoverflow.com/questions/21001387/how-do-i-set-the-gopath-environment-variable-on-ubuntu-what-file-must-i-edit).
|
||||
|
||||
## Installation
|
||||
|
||||
### Install as git submodule
|
||||
Navigate to your hugo project root and run:
|
||||
|
||||
```
|
||||
git submodule add https://github.com/64bitpandas/amethyst themes/amethyst
|
||||
```
|
||||
|
||||
Then run hugo (or set `theme = "amethyst"`/`theme: amethyst` in configuration file)
|
||||
|
||||
```
|
||||
hugo server --minify --theme amethyst
|
||||
```
|
||||
|
||||
### Install as hugo module
|
||||
|
||||
You can also add this theme as a Hugo module instead of a git submodule.
|
||||
|
||||
Start with initializing hugo modules, if not done yet:
|
||||
```
|
||||
hugo mod init github.com/repo/path
|
||||
```
|
||||
|
||||
Navigate to your hugo project root and add [module] section to your `config.toml`:
|
||||
|
||||
```toml
|
||||
[module]
|
||||
[[module.imports]]
|
||||
path = 'github.com/alex-shpak/hugo-book'
|
||||
```
|
||||
|
||||
Then, to load/update the theme module and run hugo:
|
||||
|
||||
```sh
|
||||
hugo mod get -u
|
||||
hugo server --minify
|
||||
```
|
||||
|
||||
### Creating site from scratch
|
||||
|
||||
Below is an example on how to create a new site from scratch:
|
||||
|
||||
```sh
|
||||
hugo new site mydocs; cd mydocs
|
||||
git init
|
||||
git submodule add https://github.com/alex-shpak/hugo-book themes/hugo-book
|
||||
cp -R themes/hugo-book/exampleSite/content .
|
||||
```
|
||||
|
||||
```sh
|
||||
hugo server --minify --theme hugo-book
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Site Configuration
|
||||
|
||||
Most configuration can be done by creating a `config.yaml` file in the root directory and editing the parameters. You can start by copying the example [here](https://github.com/64bitpandas/amethyst/blob/main/config.yaml).
|
||||
|
||||
Graph-specific configuration can be added to `data/graphConfig.yaml`. (Example [here](https://github.com/64bitpandas/amethyst/blob/main/data/graphConfig.yaml))
|
||||
|
||||
|
||||
### Multi-Language Support
|
||||
|
||||
Theme supports Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/), just follow configuration guide there. You can also tweak search indexing configuration per language in `i18n` folder.
|
||||
|
||||
### Page Configuration
|
||||
|
||||
You can specify additional params in the front matter of individual pages:
|
||||
|
||||
```toml
|
||||
# Set type to 'docs' if you want to render page outside of configured section or if you render section other than 'docs'
|
||||
type = 'docs'
|
||||
|
||||
# Set page weight to re-arrange items in file-tree menu (if BookMenuBundle not set)
|
||||
weight = 10
|
||||
|
||||
# (Optional) Set to 'true' to mark page as flat section in file-tree menu (if BookMenuBundle not set)
|
||||
bookFlatSection = false
|
||||
|
||||
# (Optional) Set to hide nested sections or pages at that level. Works only with file-tree menu mode
|
||||
bookCollapseSection = true
|
||||
|
||||
# (Optional) Set true to hide page or section from side menu (if BookMenuBundle not set)
|
||||
bookHidden = false
|
||||
|
||||
# (Optional) Set 'false' to hide ToC from page
|
||||
bookToC = true
|
||||
|
||||
# (Optional) If you have enabled BookComments for the site, you can disable it for specific pages.
|
||||
bookComments = true
|
||||
|
||||
# (Optional) Set to 'false' to exclude page from search index.
|
||||
bookSearchExclude = true
|
||||
|
||||
# (Optional) Set explicit href attribute for this page in a menu (if BookMenuBundle not set)
|
||||
bookHref = ''
|
||||
```
|
||||
|
||||
### Partials
|
||||
|
||||
There are layout partials available for you to easily override components of the theme in `layouts/partials/`.
|
||||
|
||||
In addition to this, there are several empty partials you can override to easily add/inject code.
|
||||
|
||||
| Empty Partial | Placement |
|
||||
| -------------------------------------------------- | ------------------------------------------- |
|
||||
| `layouts/partials/docs/inject/head.html` | Before closing `<head>` tag |
|
||||
| `layouts/partials/docs/inject/body.html` | Before closing `<body>` tag |
|
||||
| `layouts/partials/docs/inject/footer.html` | After page footer content |
|
||||
| `layouts/partials/docs/inject/menu-before.html` | At the beginning of `<nav>` menu block |
|
||||
| `layouts/partials/docs/inject/menu-after.html` | At the end of `<nav>` menu block |
|
||||
| `layouts/partials/docs/inject/content-before.html` | Before page content |
|
||||
| `layouts/partials/docs/inject/content-after.html` | After page content |
|
||||
| `layouts/partials/docs/inject/toc-before.html` | At the beginning of table of contents block |
|
||||
| `layouts/partials/docs/inject/toc-after.html` | At the end of table of contents block |
|
||||
|
||||
### Extra Customisation
|
||||
|
||||
| File | Description |
|
||||
| ------------------------ | ------------------------------------------------------------------------------------- |
|
||||
| `static/favicon.png` | Override default favicon |
|
||||
| `assets/_custom.scss` | Customise or override scss styles |
|
||||
| `assets/_variables.scss` | Override default SCSS variables |
|
||||
| `assets/_fonts.scss` | Replace default font with custom fonts (e.g. local files or remote like google fonts) |
|
||||
| `assets/mermaid.json` | Replace Mermaid initialization config |
|
||||
|
||||
### Plugins
|
||||
|
||||
There are a few features implemented as plugable `scss` styles. Usually these are features that don't make it to the core but can still be useful.
|
||||
|
||||
| Plugin | Description |
|
||||
| --------------------------------- | ----------------------------------------------------------- |
|
||||
| `assets/plugins/_numbered.scss` | Makes headings in markdown numbered, e.g. `1.1`, `1.2` |
|
||||
| `assets/plugins/_scrollbars.scss` | Overrides scrollbar styles to look similar across platforms |
|
||||
|
||||
To enable plugins, add `@import "plugins/{name}";` to `assets/_custom.scss` in your website root.
|
||||
|
||||
### Hugo Internal Templates
|
||||
|
||||
There are a few hugo templates inserted in `<head>`
|
||||
|
||||
- [Google Analytics](https://gohugo.io/templates/internal/#google-analytics)
|
||||
- [Open Graph](https://gohugo.io/templates/internal/#open-graph)
|
||||
|
||||
To disable Open Graph inclusion you can create your own empty file `\layouts\_internal\opengraph.html`.
|
||||
In fact almost empty not quite empty because an empty file looks like absent for HUGO. For example:
|
||||
```
|
||||
<!-- -->
|
||||
```
|
||||
|
||||
## Shortcodes
|
||||
|
||||
- [Buttons](https://hugo-book-demo.netlify.app/docs/shortcodes/buttons/)
|
||||
- [Columns](https://hugo-book-demo.netlify.app/docs/shortcodes/columns/)
|
||||
- [Details](https://hugo-book-demo.netlify.app/docs/shortcodes/details/)
|
||||
- [Hints](https://hugo-book-demo.netlify.app/docs/shortcodes/hints/)
|
||||
- [KaTeX](https://hugo-book-demo.netlify.app/docs/shortcodes/katex/)
|
||||
- [Mermaid](https://hugo-book-demo.netlify.app/docs/shortcodes/mermaid/)
|
||||
- [Tabs](https://hugo-book-demo.netlify.app/docs/shortcodes/tabs/)
|
||||
|
||||
By default, Goldmark trims unsafe outputs which might prevent some shortcodes from rendering. It is recommended to set `markup.goldmark.renderer.unsafe=true` if you encounter problems.
|
||||
|
||||
```toml
|
||||
[markup.goldmark.renderer]
|
||||
unsafe = true
|
||||
```
|
||||
|
||||
If you are using `config.yaml` or `config.json`, consult the [configuration markup](https://gohugo.io/getting-started/configuration-markup/)
|
||||
|
||||
## Versioning
|
||||
|
||||
This theme follows a simple incremental versioning. e.g. `v1`, `v2` and so on. There might be breaking changes between versions.
|
||||
|
||||
If you want lower maintenance, use one of the released versions. If you want to live on the bleeding edge of changes, you can use the `master` branch and update your website when needed.
|
||||
|
||||
## Contributing
|
||||
|
||||
### [Extra credits to contributors](https://github.com/alex-shpak/hugo-book/graphs/contributors)
|
||||
|
||||
Contributions are welcome and I will review and consider pull requests.
|
||||
Primary goals are:
|
||||
|
||||
- Keep it simple.
|
||||
- Keep minimal (or zero) default configuration.
|
||||
- Avoid interference with user-defined layouts.
|
||||
- Avoid using JS if it can be solved by CSS.
|
||||
|
||||
Feel free to open issues if you find missing configuration or customisation options.
|
10
archetypes/docs.md
Normal file
10
archetypes/docs.md
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "{{ .Name | humanize | title }}"
|
||||
weight: 1
|
||||
# bookFlatSection: false
|
||||
# bookToc: true
|
||||
# bookHidden: false
|
||||
# bookCollapseSection: false
|
||||
# bookComments: false
|
||||
# bookSearchExclude: false
|
||||
---
|
6
archetypes/posts.md
Normal file
6
archetypes/posts.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
title: "{{ .Name | humanize | title }}"
|
||||
date: {{ .Date }}
|
||||
# bookComments: false
|
||||
# bookSearchExclude: false
|
||||
---
|
80
assets/_amethyst.scss
Normal file
80
assets/_amethyst.scss
Normal file
@ -0,0 +1,80 @@
|
||||
$header-height: 80px;
|
||||
|
||||
header {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
padding: 0px 80px;
|
||||
z-index: 9999;
|
||||
background-color: #88ddff;
|
||||
margin: 0 !important;
|
||||
height: $header-height;
|
||||
}
|
||||
|
||||
.book-menu,
|
||||
.book-menu-content,
|
||||
.book-toc-content,
|
||||
.book-page {
|
||||
margin-top: $header-height;
|
||||
}
|
||||
|
||||
.book-header {
|
||||
display: flex;
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: $mobile-breakpoint) {
|
||||
.book-header {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#page-title {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.menu-search {
|
||||
display: block;
|
||||
|
||||
#search-icon {
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
header #search-icon {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: $mobile-breakpoint) {
|
||||
.book-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.menu-search {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
header #search-icon {
|
||||
display: block;
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.book-toc-content::-webkit-scrollbar,
|
||||
.book-menu-content::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb {
|
||||
background: grey;
|
||||
border-radius: 8px;
|
||||
// box-shadow: inset 2px 2px 2px hsla(0,0%,100%,.25),inset -2px -2px 2px rgba(0,0,0,.25);
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track {
|
||||
// background: linear-gradient(90deg,#434343,#434343 1px,#111 0,#111);
|
||||
background-color: #DDD;
|
||||
}
|
3
assets/_custom.scss
Normal file
3
assets/_custom.scss
Normal file
@ -0,0 +1,3 @@
|
||||
/* You can add custom styles here. */
|
||||
|
||||
// @import "plugins/numbered";
|
66
assets/_defaults.scss
Normal file
66
assets/_defaults.scss
Normal file
@ -0,0 +1,66 @@
|
||||
// Used in layout
|
||||
$padding-1: 1px !default;
|
||||
$padding-4: 0.25rem !default;
|
||||
$padding-8: 0.5rem !default;
|
||||
$padding-16: 1rem !default;
|
||||
|
||||
$font-size-base: 16px !default;
|
||||
$font-size-12: 0.75rem !default;
|
||||
$font-size-14: 0.875rem !default;
|
||||
$font-size-16: 1rem !default;
|
||||
|
||||
$border-radius: $padding-4 !default;
|
||||
|
||||
$body-font-weight: normal !default;
|
||||
|
||||
$body-min-width: 20rem !default;
|
||||
$container-max-width: 80rem !default;
|
||||
|
||||
$header-height: 3.5rem !default;
|
||||
$menu-width: 16rem !default;
|
||||
$toc-width: 16rem !default;
|
||||
|
||||
$mobile-breakpoint: $menu-width + $body-min-width * 1.2 + $toc-width !default;
|
||||
|
||||
$hint-colors: (
|
||||
info: #6bf,
|
||||
warning: #fd6,
|
||||
danger: #f66,
|
||||
) !default;
|
||||
|
||||
// Themes
|
||||
@mixin theme-light {
|
||||
--gray-100: #f8f9fa;
|
||||
--gray-200: #e9ecef;
|
||||
--gray-500: #adb5bd;
|
||||
|
||||
--color-link: #0055bb;
|
||||
--color-visited-link: #8440f1;
|
||||
|
||||
--body-background: white;
|
||||
--body-font-color: black;
|
||||
|
||||
--icon-filter: none;
|
||||
|
||||
--hint-color-info: #6bf;
|
||||
--hint-color-warning: #fd6;
|
||||
--hint-color-danger: #f66;
|
||||
}
|
||||
|
||||
@mixin theme-dark {
|
||||
--gray-100: rgba(255, 255, 255, 0.1);
|
||||
--gray-200: rgba(255, 255, 255, 0.2);
|
||||
--gray-500: rgba(255, 255, 255, 0.5);
|
||||
|
||||
--color-link: #84b2ff;
|
||||
--color-visited-link: #b88dff;
|
||||
|
||||
--body-background: #343a40;
|
||||
--body-font-color: #e9ecef;
|
||||
|
||||
--icon-filter: brightness(0) invert(1);
|
||||
|
||||
--hint-color-info: #6bf;
|
||||
--hint-color-warning: #fd6;
|
||||
--hint-color-danger: #f66;
|
||||
}
|
39
assets/_fonts.scss
Normal file
39
assets/_fonts.scss
Normal file
@ -0,0 +1,39 @@
|
||||
/* roboto-regular - latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: local(''),
|
||||
url('fonts/roboto-v27-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||
url('fonts/roboto-v27-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||
}
|
||||
/* roboto-700 - latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: local(''),
|
||||
url('fonts/roboto-v27-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||
url('fonts/roboto-v27-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||
}
|
||||
|
||||
/* roboto-mono-regular - latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto Mono';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: local(''),
|
||||
url('fonts/roboto-mono-v13-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||
url('fonts/roboto-mono-v13-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: 'Roboto Mono', monospace;
|
||||
}
|
364
assets/_main.scss
Normal file
364
assets/_main.scss
Normal file
@ -0,0 +1,364 @@
|
||||
html {
|
||||
font-size: $font-size-base;
|
||||
scroll-behavior: smooth;
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
body {
|
||||
min-width: $body-min-width;
|
||||
color: var(--body-font-color);
|
||||
background: var(--body-background);
|
||||
|
||||
letter-spacing: 0.33px;
|
||||
font-weight: $body-font-weight;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
box-sizing: border-box;
|
||||
* {
|
||||
box-sizing: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5 {
|
||||
font-weight: $body-font-weight;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: var(--color-link);
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
:focus {
|
||||
@include outline;
|
||||
}
|
||||
|
||||
aside nav ul {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
|
||||
li {
|
||||
margin: 1em 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-inline-start: $padding-16;
|
||||
}
|
||||
}
|
||||
|
||||
ul.pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
list-style-type: none;
|
||||
padding-inline-start: 0px;
|
||||
|
||||
.page-item a {
|
||||
padding: $padding-16;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: $container-max-width;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.book-icon {
|
||||
filter: var(--icon-filter);
|
||||
}
|
||||
|
||||
.book-brand {
|
||||
margin-top: 0;
|
||||
margin-bottom: $padding-16;
|
||||
|
||||
img {
|
||||
height: 1.5em;
|
||||
width: 1.5em;
|
||||
margin-inline-end: $padding-8;
|
||||
}
|
||||
}
|
||||
|
||||
.book-menu {
|
||||
flex: 0 0 $menu-width;
|
||||
font-size: $font-size-14;
|
||||
|
||||
.book-menu-content {
|
||||
width: $menu-width;
|
||||
padding: $padding-16;
|
||||
background: var(--body-background);
|
||||
|
||||
@include fixed;
|
||||
}
|
||||
|
||||
a,
|
||||
label {
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
a.active {
|
||||
color: var(--color-link);
|
||||
}
|
||||
|
||||
input.toggle + label + ul {
|
||||
display: none;
|
||||
}
|
||||
|
||||
input.toggle:checked + label + ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input.toggle + label::after {
|
||||
content: "▸";
|
||||
}
|
||||
|
||||
input.toggle:checked + label::after {
|
||||
content: "▾";
|
||||
}
|
||||
}
|
||||
|
||||
// for RTL support
|
||||
body[dir="rtl"] .book-menu {
|
||||
input.toggle + label::after {
|
||||
content: "◂";
|
||||
}
|
||||
|
||||
input.toggle:checked + label::after {
|
||||
content: "▾";
|
||||
}
|
||||
}
|
||||
|
||||
.book-section-flat {
|
||||
margin: $padding-16 * 2 0;
|
||||
|
||||
> a,
|
||||
> span,
|
||||
> label {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
> ul {
|
||||
padding-inline-start: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.book-page {
|
||||
min-width: $body-min-width;
|
||||
flex-grow: 1;
|
||||
padding: $padding-16;
|
||||
}
|
||||
|
||||
.book-post {
|
||||
margin-bottom: $padding-16 * 3;
|
||||
}
|
||||
|
||||
// .book-header {
|
||||
// display: none;
|
||||
// margin-bottom: $padding-16;
|
||||
|
||||
// label {
|
||||
// line-height: 0;
|
||||
// }
|
||||
|
||||
// img.book-icon {
|
||||
// height: 1.5em;
|
||||
// width: 1.5em;
|
||||
// }
|
||||
// }
|
||||
|
||||
.book-search {
|
||||
position: relative;
|
||||
margin: $padding-16 0;
|
||||
border-bottom: 1px solid transparent;
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
padding: $padding-8;
|
||||
|
||||
border: 0;
|
||||
border-radius: $border-radius;
|
||||
|
||||
background: var(--gray-100);
|
||||
color: var(--body-font-color);
|
||||
|
||||
&:required + .book-search-spinner {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.book-search-spinner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
margin: $padding-8;
|
||||
margin-inline-start: calc(100% - #{$padding-16 + $padding-8});
|
||||
|
||||
width: $padding-16;
|
||||
height: $padding-16;
|
||||
|
||||
border: $padding-1 solid transparent;
|
||||
border-top-color: var(--body-font-color);
|
||||
border-radius: 50%;
|
||||
|
||||
@include spin(1s);
|
||||
}
|
||||
|
||||
small {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.book-toc {
|
||||
flex: 0 0 $toc-width;
|
||||
font-size: $font-size-12;
|
||||
|
||||
.book-toc-content {
|
||||
width: $toc-width;
|
||||
padding: $padding-16;
|
||||
|
||||
@include fixed;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
}
|
||||
|
||||
nav > ul > li:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.book-footer {
|
||||
padding-top: $padding-16;
|
||||
font-size: $font-size-14;
|
||||
|
||||
img {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
margin-inline-end: $padding-8;
|
||||
}
|
||||
}
|
||||
|
||||
.book-comments {
|
||||
margin-top: $padding-16;
|
||||
}
|
||||
|
||||
.book-languages {
|
||||
margin-block-end: $padding-16 * 2;
|
||||
|
||||
.book-icon {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
margin-inline-end: .5em;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-inline-start: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
// Responsive styles
|
||||
.book-menu-content,
|
||||
.book-toc-content,
|
||||
.book-page,
|
||||
.book-header aside,
|
||||
.markdown {
|
||||
transition: 0.2s ease-in-out;
|
||||
transition-property: transform, margin, opacity, visibility;
|
||||
will-change: transform, margin, opacity;
|
||||
}
|
||||
|
||||
@media screen and (max-width: $mobile-breakpoint) {
|
||||
#menu-control,
|
||||
#toc-control {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.book-menu {
|
||||
visibility: hidden;
|
||||
margin-inline-start: -$menu-width;
|
||||
font-size: $font-size-base;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.book-toc {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.book-header {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#menu-control:focus ~ main label[for="menu-control"] {
|
||||
@include outline;
|
||||
}
|
||||
|
||||
#menu-control:checked ~ main {
|
||||
.book-menu {
|
||||
visibility: initial;
|
||||
}
|
||||
|
||||
.book-menu .book-menu-content {
|
||||
transform: translateX($menu-width);
|
||||
box-shadow: 0 0 $padding-8 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.book-page {
|
||||
opacity: 0.25;
|
||||
}
|
||||
|
||||
.book-menu-overlay {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
#toc-control:focus ~ main label[for="toc-control"] {
|
||||
@include outline;
|
||||
}
|
||||
|
||||
#toc-control:checked ~ main {
|
||||
.book-header aside {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
// for RTL support
|
||||
body[dir="rtl"] #menu-control:checked ~ main {
|
||||
.book-menu .book-menu-content {
|
||||
transform: translateX(-$menu-width);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Extra space for big screens
|
||||
@media screen and (min-width: $container-max-width) {
|
||||
.book-page,
|
||||
.book-menu .book-menu-content,
|
||||
.book-toc .book-toc-content {
|
||||
padding: $padding-16 * 2 $padding-16;
|
||||
}
|
||||
}
|
196
assets/_markdown.scss
Normal file
196
assets/_markdown.scss
Normal file
@ -0,0 +1,196 @@
|
||||
@import "variables";
|
||||
|
||||
.markdown {
|
||||
line-height: 1.6;
|
||||
|
||||
// remove padding at the beginning of page
|
||||
> :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: $padding-16;
|
||||
|
||||
a.anchor {
|
||||
opacity: 0;
|
||||
font-size: 0.75em;
|
||||
vertical-align: middle;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&:hover a.anchor,
|
||||
a.anchor:focus {
|
||||
opacity: initial;
|
||||
}
|
||||
}
|
||||
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
h6 {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
b,
|
||||
optgroup,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
&:visited {
|
||||
color: var(--color-visited-link);
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
code {
|
||||
padding: 0 $padding-4;
|
||||
background: var(--gray-200);
|
||||
border-radius: $border-radius;
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: $padding-16;
|
||||
background: var(--gray-100);
|
||||
border-radius: $border-radius;
|
||||
overflow-x: auto;
|
||||
|
||||
code {
|
||||
padding: 0;
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
word-wrap:break-word;
|
||||
}
|
||||
|
||||
// blockquote {
|
||||
// margin: $padding-16 0;
|
||||
// padding: $padding-8 $padding-16 $padding-8 ($padding-16 - $padding-4); //to keep total left space 16dp
|
||||
|
||||
// border-inline-start: $padding-4 solid var(--gray-200);
|
||||
// border-radius: $border-radius;
|
||||
|
||||
// :first-child {
|
||||
// margin-top: 0;
|
||||
// }
|
||||
// :last-child {
|
||||
// margin-bottom: 0;
|
||||
// }
|
||||
// }
|
||||
|
||||
table {
|
||||
overflow: auto;
|
||||
display: block;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
margin-top: $padding-16;
|
||||
margin-bottom: $padding-16;
|
||||
|
||||
tr th,
|
||||
tr td {
|
||||
padding: $padding-8 $padding-16;
|
||||
border: $padding-1 solid var(--gray-200);
|
||||
}
|
||||
|
||||
tr:nth-child(2n) {
|
||||
background: var(--gray-100);
|
||||
}
|
||||
}
|
||||
|
||||
hr {
|
||||
height: $padding-1;
|
||||
border: none;
|
||||
background: var(--gray-200);
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
padding-inline-start: $padding-16 * 2;
|
||||
}
|
||||
|
||||
dl {
|
||||
dt {
|
||||
font-weight: bolder;
|
||||
margin-top: $padding-16;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-inline-start: 0;
|
||||
margin-bottom: $padding-16;
|
||||
}
|
||||
}
|
||||
|
||||
// Special case for highlighted code with line numbers
|
||||
.highlight table tr {
|
||||
td:nth-child(1) pre {
|
||||
margin: 0;
|
||||
padding-inline-end: 0;
|
||||
}
|
||||
td:nth-child(2) pre {
|
||||
margin: 0;
|
||||
padding-inline-start: 0;
|
||||
}
|
||||
}
|
||||
|
||||
details {
|
||||
padding: $padding-16;
|
||||
border: $padding-1 solid var(--gray-200);
|
||||
border-radius: $border-radius;
|
||||
|
||||
summary {
|
||||
line-height: 1;
|
||||
padding: $padding-16;
|
||||
margin: -$padding-16;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&[open] summary {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: $padding-16 0;
|
||||
figcaption p {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.markdown-inner {
|
||||
// Util class to remove extra margin in nested markdown content
|
||||
> :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
> :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
17
assets/_print.scss
Normal file
17
assets/_print.scss
Normal file
@ -0,0 +1,17 @@
|
||||
@media print {
|
||||
.book-menu,
|
||||
.book-footer,
|
||||
.book-toc {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.book-header,
|
||||
.book-header aside {
|
||||
display: block;
|
||||
}
|
||||
|
||||
main {
|
||||
// Fix for https://bugzilla.mozilla.org/show_bug.cgi?id=939897
|
||||
display: block !important;
|
||||
}
|
||||
}
|
104
assets/_shortcodes.scss
Normal file
104
assets/_shortcodes.scss
Normal file
@ -0,0 +1,104 @@
|
||||
.markdown {
|
||||
// {{< expand "Label" "icon" >}}
|
||||
.book-expand {
|
||||
margin-top: $padding-16;
|
||||
margin-bottom: $padding-16;
|
||||
|
||||
border: $padding-1 solid var(--gray-200);
|
||||
border-radius: $border-radius;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
.book-expand-head {
|
||||
background: var(--gray-100);
|
||||
padding: $padding-8 $padding-16;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.book-expand-content {
|
||||
display: none;
|
||||
padding: $padding-16;
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked + .book-expand-content {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
// {{< tabs >}}
|
||||
.book-tabs {
|
||||
margin-top: $padding-16;
|
||||
margin-bottom: $padding-16;
|
||||
|
||||
border: $padding-1 solid var(--gray-200);
|
||||
border-radius: $border-radius;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
padding: $padding-8 $padding-16;
|
||||
border-bottom: $padding-1 transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.book-tabs-content {
|
||||
order: 999; //Move content blocks to the end
|
||||
width: 100%;
|
||||
border-top: $padding-1 solid var(--gray-100);
|
||||
padding: $padding-16;
|
||||
display: none;
|
||||
}
|
||||
|
||||
input[type="radio"]:checked + label {
|
||||
border-bottom: $padding-1 solid var(--color-link);
|
||||
}
|
||||
input[type="radio"]:checked + label + .book-tabs-content {
|
||||
display: block;
|
||||
}
|
||||
input[type="radio"]:focus + label {
|
||||
@include outline;
|
||||
}
|
||||
}
|
||||
|
||||
// {{< columns >}}
|
||||
.book-columns {
|
||||
margin-left: -$padding-16;
|
||||
margin-right: -$padding-16;
|
||||
|
||||
> div {
|
||||
margin: $padding-16 0;
|
||||
min-width: $body-min-width / 2;
|
||||
padding: 0 $padding-16;
|
||||
}
|
||||
}
|
||||
|
||||
// {{< button >}}
|
||||
a.book-btn {
|
||||
display: inline-block;
|
||||
font-size: $font-size-14;
|
||||
color: var(--color-link);
|
||||
line-height: $padding-16 * 2;
|
||||
padding: 0 $padding-16;
|
||||
border: $padding-1 solid var(--color-link);
|
||||
border-radius: $border-radius;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
// {{< hint >}}
|
||||
.book-hint {
|
||||
@each $name, $color in $hint-colors {
|
||||
&.#{$name} {
|
||||
border-color: $color;
|
||||
background-color: rgba($color, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
92
assets/_utils.scss
Normal file
92
assets/_utils.scss
Normal file
@ -0,0 +1,92 @@
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.flex-auto {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.flex-even {
|
||||
flex: 1 1;
|
||||
}
|
||||
|
||||
.flex-wrap {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.justify-start {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.justify-end {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.justify-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.justify-between {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.align-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mx-auto {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
input.toggle {
|
||||
height: 0;
|
||||
width: 0;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.clearfix::after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
@mixin spin($duration) {
|
||||
animation: spin $duration ease infinite;
|
||||
@keyframes spin {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@mixin fixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
@mixin outline {
|
||||
outline-style: auto;
|
||||
outline-color: currentColor;
|
||||
outline-color: -webkit-focus-ring-color;
|
||||
}
|
3
assets/_variables.scss
Normal file
3
assets/_variables.scss
Normal file
@ -0,0 +1,3 @@
|
||||
/* You can override SASS variables here. */
|
||||
|
||||
// @import "plugins/dark";
|
16
assets/book.scss
Normal file
16
assets/book.scss
Normal file
@ -0,0 +1,16 @@
|
||||
@import "defaults";
|
||||
@import "variables";
|
||||
@import "themes/{{ default "light" .Site.Params.BookTheme }}";
|
||||
|
||||
@import "normalize";
|
||||
@import "utils";
|
||||
@import "main";
|
||||
@import "fonts";
|
||||
@import "print";
|
||||
|
||||
@import "markdown";
|
||||
@import "shortcodes";
|
||||
|
||||
// Custom defined styles
|
||||
@import "amethyst";
|
||||
@import "custom";
|
24
assets/clipboard.js
Normal file
24
assets/clipboard.js
Normal file
@ -0,0 +1,24 @@
|
||||
(function () {
|
||||
function select(element) {
|
||||
const selection = window.getSelection();
|
||||
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(element);
|
||||
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
}
|
||||
|
||||
document.querySelectorAll("pre code").forEach(code => {
|
||||
code.addEventListener("click", function (event) {
|
||||
if (window.getSelection().toString()) {
|
||||
return;
|
||||
}
|
||||
select(code.parentElement);
|
||||
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(code.parentElement.textContent);
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
0
assets/indices/.gitkeep
Normal file
0
assets/indices/.gitkeep
Normal file
266
assets/indices/contentIndex.json
Normal file
266
assets/indices/contentIndex.json
Normal file
File diff suppressed because one or more lines are too long
744
assets/indices/linkIndex.json
Normal file
744
assets/indices/linkIndex.json
Normal file
@ -0,0 +1,744 @@
|
||||
{
|
||||
"index": {
|
||||
"links": {
|
||||
"/": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/search",
|
||||
"text": "notes/search"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"text": "CJK + Latex Support"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/callouts",
|
||||
"text": "Admonition-style callouts"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/showcase",
|
||||
"text": "amazing gardens that community members"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/philosophy",
|
||||
"text": "why I made Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/setup",
|
||||
"text": "Setup your own digital garden using Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/updating",
|
||||
"text": "update"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/tags/setup",
|
||||
"text": "setup-related notes"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "Troubleshooting and FAQ"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/foo",
|
||||
"text": "notes/foo"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/foo/footest",
|
||||
"text": "notes/foo/footest"
|
||||
}
|
||||
],
|
||||
"/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95": [
|
||||
{
|
||||
"source": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"target": "/notes/config",
|
||||
"text": "config"
|
||||
}
|
||||
],
|
||||
"/notes/config": [
|
||||
{
|
||||
"source": "/notes/config",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/config",
|
||||
"target": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"text": "CJK + Latex Support (测试)"
|
||||
}
|
||||
],
|
||||
"/notes/docker": [
|
||||
{
|
||||
"source": "/notes/docker",
|
||||
"target": "/notes/preview-changes",
|
||||
"text": "install Quartz's dependencies manually"
|
||||
}
|
||||
],
|
||||
"/notes/editing": [
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/obsidian",
|
||||
"text": "How to setup your Obsidian Vault to work with Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/preview-changes",
|
||||
"text": "Preview Quartz Changes"
|
||||
},
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/hosting",
|
||||
"text": "Hosting Quartz online!"
|
||||
},
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
}
|
||||
],
|
||||
"/notes/hosting": [
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/custom-Domain",
|
||||
"text": "Learn how to set it up with Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/ignore-notes",
|
||||
"text": "Excluding pages from being published"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/docker",
|
||||
"text": "Docker"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/config",
|
||||
"text": "Customizing Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
}
|
||||
],
|
||||
"/notes/obsidian": [
|
||||
{
|
||||
"source": "/notes/obsidian",
|
||||
"target": "/notes/setup",
|
||||
"text": "setup"
|
||||
},
|
||||
{
|
||||
"source": "/notes/obsidian",
|
||||
"target": "/notes/preview-changes",
|
||||
"text": "Preview Quartz Changes"
|
||||
}
|
||||
],
|
||||
"/notes/preview-changes": [
|
||||
{
|
||||
"source": "/notes/preview-changes",
|
||||
"target": "/notes/hosting",
|
||||
"text": "Hosting Quartz online!"
|
||||
}
|
||||
],
|
||||
"/notes/setup": [
|
||||
{
|
||||
"source": "/notes/setup",
|
||||
"target": "/notes/editing",
|
||||
"text": "Editing Notes in Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/setup",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
}
|
||||
],
|
||||
"/notes/troubleshooting": [
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"text": "CJK + Latex Support (测试)"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/hosting",
|
||||
"text": "hosting"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/ignore-notes",
|
||||
"text": "excluding pages from being published"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/hosting",
|
||||
"text": "hosting"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/obsidian",
|
||||
"text": "Obsidian"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/editing",
|
||||
"text": "the 'how to edit' guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/hosting",
|
||||
"text": "the hosting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/config",
|
||||
"text": "customization guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/editing",
|
||||
"text": "local editing"
|
||||
}
|
||||
],
|
||||
"/posts/goisforlovers": [
|
||||
{
|
||||
"source": "/posts/goisforlovers",
|
||||
"target": "/layout/variables",
|
||||
"text": "variables"
|
||||
},
|
||||
{
|
||||
"source": "/posts/goisforlovers",
|
||||
"target": "/layout/functions",
|
||||
"text": "Hugo template\nfunctions"
|
||||
},
|
||||
{
|
||||
"source": "/posts/goisforlovers",
|
||||
"target": "/content/front-matter",
|
||||
"text": "front matter"
|
||||
}
|
||||
],
|
||||
"/posts/migrate-from-jekyll": [
|
||||
{
|
||||
"source": "/posts/migrate-from-jekyll",
|
||||
"target": "/overview/configuration/",
|
||||
"text": "Hugo configuration documentation"
|
||||
},
|
||||
{
|
||||
"source": "/posts/migrate-from-jekyll",
|
||||
"target": "/layout/templates/",
|
||||
"text": "Hugo's template"
|
||||
},
|
||||
{
|
||||
"source": "/posts/migrate-from-jekyll",
|
||||
"target": "/doc/shortcodes/",
|
||||
"text": "shortcodes"
|
||||
}
|
||||
]
|
||||
},
|
||||
"backlinks": {
|
||||
"/content/front-matter": [
|
||||
{
|
||||
"source": "/posts/goisforlovers",
|
||||
"target": "/content/front-matter",
|
||||
"text": "front matter"
|
||||
}
|
||||
],
|
||||
"/doc/shortcodes/": [
|
||||
{
|
||||
"source": "/posts/migrate-from-jekyll",
|
||||
"target": "/doc/shortcodes/",
|
||||
"text": "shortcodes"
|
||||
}
|
||||
],
|
||||
"/layout/functions": [
|
||||
{
|
||||
"source": "/posts/goisforlovers",
|
||||
"target": "/layout/functions",
|
||||
"text": "Hugo template\nfunctions"
|
||||
}
|
||||
],
|
||||
"/layout/templates/": [
|
||||
{
|
||||
"source": "/posts/migrate-from-jekyll",
|
||||
"target": "/layout/templates/",
|
||||
"text": "Hugo's template"
|
||||
}
|
||||
],
|
||||
"/layout/variables": [
|
||||
{
|
||||
"source": "/posts/goisforlovers",
|
||||
"target": "/layout/variables",
|
||||
"text": "variables"
|
||||
}
|
||||
],
|
||||
"/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"text": "CJK + Latex Support"
|
||||
},
|
||||
{
|
||||
"source": "/notes/config",
|
||||
"target": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"text": "CJK + Latex Support (测试)"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"text": "CJK + Latex Support (测试)"
|
||||
}
|
||||
],
|
||||
"/notes/callouts": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/callouts",
|
||||
"text": "Admonition-style callouts"
|
||||
}
|
||||
],
|
||||
"/notes/config": [
|
||||
{
|
||||
"source": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"target": "/notes/config",
|
||||
"text": "config"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/config",
|
||||
"text": "Customizing Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/config",
|
||||
"text": "customization guide"
|
||||
}
|
||||
],
|
||||
"/notes/custom-Domain": [
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/custom-Domain",
|
||||
"text": "Learn how to set it up with Quartz"
|
||||
}
|
||||
],
|
||||
"/notes/docker": [
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/docker",
|
||||
"text": "Docker"
|
||||
}
|
||||
],
|
||||
"/notes/editing": [
|
||||
{
|
||||
"source": "/notes/setup",
|
||||
"target": "/notes/editing",
|
||||
"text": "Editing Notes in Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/editing",
|
||||
"text": "the 'how to edit' guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/editing",
|
||||
"text": "local editing"
|
||||
}
|
||||
],
|
||||
"/notes/foo": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/foo",
|
||||
"text": "notes/foo"
|
||||
}
|
||||
],
|
||||
"/notes/foo/footest": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/foo/footest",
|
||||
"text": "notes/foo/footest"
|
||||
}
|
||||
],
|
||||
"/notes/hosting": [
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/hosting",
|
||||
"text": "Hosting Quartz online!"
|
||||
},
|
||||
{
|
||||
"source": "/notes/preview-changes",
|
||||
"target": "/notes/hosting",
|
||||
"text": "Hosting Quartz online!"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/hosting",
|
||||
"text": "hosting"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/hosting",
|
||||
"text": "hosting"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/hosting",
|
||||
"text": "the hosting guide"
|
||||
}
|
||||
],
|
||||
"/notes/ignore-notes": [
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/ignore-notes",
|
||||
"text": "Excluding pages from being published"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/ignore-notes",
|
||||
"text": "excluding pages from being published"
|
||||
}
|
||||
],
|
||||
"/notes/obsidian": [
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/obsidian",
|
||||
"text": "How to setup your Obsidian Vault to work with Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/obsidian",
|
||||
"text": "Obsidian"
|
||||
}
|
||||
],
|
||||
"/notes/philosophy": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/philosophy",
|
||||
"text": "why I made Quartz"
|
||||
}
|
||||
],
|
||||
"/notes/preview-changes": [
|
||||
{
|
||||
"source": "/notes/docker",
|
||||
"target": "/notes/preview-changes",
|
||||
"text": "install Quartz's dependencies manually"
|
||||
},
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/preview-changes",
|
||||
"text": "Preview Quartz Changes"
|
||||
},
|
||||
{
|
||||
"source": "/notes/obsidian",
|
||||
"target": "/notes/preview-changes",
|
||||
"text": "Preview Quartz Changes"
|
||||
}
|
||||
],
|
||||
"/notes/search": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/search",
|
||||
"text": "notes/search"
|
||||
}
|
||||
],
|
||||
"/notes/setup": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/setup",
|
||||
"text": "Setup your own digital garden using Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/obsidian",
|
||||
"target": "/notes/setup",
|
||||
"text": "setup"
|
||||
}
|
||||
],
|
||||
"/notes/showcase": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/showcase",
|
||||
"text": "amazing gardens that community members"
|
||||
}
|
||||
],
|
||||
"/notes/troubleshooting": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "Troubleshooting and FAQ"
|
||||
},
|
||||
{
|
||||
"source": "/notes/config",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/setup",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
}
|
||||
],
|
||||
"/notes/updating": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/updating",
|
||||
"text": "update"
|
||||
}
|
||||
],
|
||||
"/overview/configuration/": [
|
||||
{
|
||||
"source": "/posts/migrate-from-jekyll",
|
||||
"target": "/overview/configuration/",
|
||||
"text": "Hugo configuration documentation"
|
||||
}
|
||||
],
|
||||
"/tags/setup": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/tags/setup",
|
||||
"text": "setup-related notes"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"links": [
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/search",
|
||||
"text": "notes/search"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"text": "CJK + Latex Support"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/callouts",
|
||||
"text": "Admonition-style callouts"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/showcase",
|
||||
"text": "amazing gardens that community members"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/philosophy",
|
||||
"text": "why I made Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/setup",
|
||||
"text": "Setup your own digital garden using Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/updating",
|
||||
"text": "update"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/tags/setup",
|
||||
"text": "setup-related notes"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "Troubleshooting and FAQ"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/foo",
|
||||
"text": "notes/foo"
|
||||
},
|
||||
{
|
||||
"source": "/",
|
||||
"target": "/notes/foo/footest",
|
||||
"text": "notes/foo/footest"
|
||||
},
|
||||
{
|
||||
"source": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"target": "/notes/config",
|
||||
"text": "config"
|
||||
},
|
||||
{
|
||||
"source": "/notes/config",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/config",
|
||||
"target": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"text": "CJK + Latex Support (测试)"
|
||||
},
|
||||
{
|
||||
"source": "/notes/docker",
|
||||
"target": "/notes/preview-changes",
|
||||
"text": "install Quartz's dependencies manually"
|
||||
},
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/obsidian",
|
||||
"text": "How to setup your Obsidian Vault to work with Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/preview-changes",
|
||||
"text": "Preview Quartz Changes"
|
||||
},
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/hosting",
|
||||
"text": "Hosting Quartz online!"
|
||||
},
|
||||
{
|
||||
"source": "/notes/editing",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/custom-Domain",
|
||||
"text": "Learn how to set it up with Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/ignore-notes",
|
||||
"text": "Excluding pages from being published"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/docker",
|
||||
"text": "Docker"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/config",
|
||||
"text": "Customizing Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/hosting",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/obsidian",
|
||||
"target": "/notes/setup",
|
||||
"text": "setup"
|
||||
},
|
||||
{
|
||||
"source": "/notes/obsidian",
|
||||
"target": "/notes/preview-changes",
|
||||
"text": "Preview Quartz Changes"
|
||||
},
|
||||
{
|
||||
"source": "/notes/preview-changes",
|
||||
"target": "/notes/hosting",
|
||||
"text": "Hosting Quartz online!"
|
||||
},
|
||||
{
|
||||
"source": "/notes/setup",
|
||||
"target": "/notes/editing",
|
||||
"text": "Editing Notes in Quartz"
|
||||
},
|
||||
{
|
||||
"source": "/notes/setup",
|
||||
"target": "/notes/troubleshooting",
|
||||
"text": "FAQ and Troubleshooting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/CJK-+-Latex-Support-%E6%B5%8B%E8%AF%95",
|
||||
"text": "CJK + Latex Support (测试)"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/hosting",
|
||||
"text": "hosting"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/ignore-notes",
|
||||
"text": "excluding pages from being published"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/hosting",
|
||||
"text": "hosting"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/obsidian",
|
||||
"text": "Obsidian"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/editing",
|
||||
"text": "the 'how to edit' guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/hosting",
|
||||
"text": "the hosting guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/config",
|
||||
"text": "customization guide"
|
||||
},
|
||||
{
|
||||
"source": "/notes/troubleshooting",
|
||||
"target": "/notes/editing",
|
||||
"text": "local editing"
|
||||
},
|
||||
{
|
||||
"source": "/posts/goisforlovers",
|
||||
"target": "/layout/variables",
|
||||
"text": "variables"
|
||||
},
|
||||
{
|
||||
"source": "/posts/goisforlovers",
|
||||
"target": "/layout/functions",
|
||||
"text": "Hugo template\nfunctions"
|
||||
},
|
||||
{
|
||||
"source": "/posts/goisforlovers",
|
||||
"target": "/content/front-matter",
|
||||
"text": "front matter"
|
||||
},
|
||||
{
|
||||
"source": "/posts/migrate-from-jekyll",
|
||||
"target": "/overview/configuration/",
|
||||
"text": "Hugo configuration documentation"
|
||||
},
|
||||
{
|
||||
"source": "/posts/migrate-from-jekyll",
|
||||
"target": "/layout/templates/",
|
||||
"text": "Hugo's template"
|
||||
},
|
||||
{
|
||||
"source": "/posts/migrate-from-jekyll",
|
||||
"target": "/doc/shortcodes/",
|
||||
"text": "shortcodes"
|
||||
}
|
||||
]
|
||||
}
|
15
assets/manifest.json
Normal file
15
assets/manifest.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "{{ .Site.Params.Title }}",
|
||||
"short_name": "{{ .Site.Params.Title }}",
|
||||
"start_url": "{{ "/" | relURL }}",
|
||||
"scope": "{{ "/" | relURL }}",
|
||||
"display": "standalone",
|
||||
"background_color": "#000000",
|
||||
"theme_color": "#000000",
|
||||
"icons": [
|
||||
{
|
||||
"src": "{{ "/favicon.png" | relURL }}",
|
||||
"sizes": "1024x1024"
|
||||
}
|
||||
]
|
||||
}
|
7
assets/menu-reset.js
Normal file
7
assets/menu-reset.js
Normal file
@ -0,0 +1,7 @@
|
||||
(function() {
|
||||
var menu = document.querySelector("aside .book-menu-content");
|
||||
addEventListener("beforeunload", function(event) {
|
||||
localStorage.setItem("menu.scrollTop", menu.scrollTop);
|
||||
});
|
||||
menu.scrollTop = localStorage.getItem("menu.scrollTop");
|
||||
})();
|
6
assets/mermaid.json
Normal file
6
assets/mermaid.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"flowchart": {
|
||||
"useMaxWidth":true
|
||||
},
|
||||
"theme": "default"
|
||||
}
|
349
assets/normalize.css
vendored
Normal file
349
assets/normalize.css
vendored
Normal file
@ -0,0 +1,349 @@
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
||||
|
||||
/* Document
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Correct the line height in all browsers.
|
||||
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
||||
*/
|
||||
|
||||
html {
|
||||
line-height: 1.15; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/* Sections
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the margin in all browsers.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the `main` element consistently in IE.
|
||||
*/
|
||||
|
||||
main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the font size and margin on `h1` elements within `section` and
|
||||
* `article` contexts in Chrome, Firefox, and Safari.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: 0.67em 0;
|
||||
}
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in Firefox.
|
||||
* 2. Show the overflow in Edge and IE.
|
||||
*/
|
||||
|
||||
hr {
|
||||
box-sizing: content-box; /* 1 */
|
||||
height: 0; /* 1 */
|
||||
overflow: visible; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the gray background on active links in IE 10.
|
||||
*/
|
||||
|
||||
a {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove the bottom border in Chrome 57-
|
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: none; /* 1 */
|
||||
text-decoration: underline; /* 2 */
|
||||
text-decoration: underline dotted; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
font-size: 1em; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||
* all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the border on images inside links in IE 10.
|
||||
*/
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Change the font styles in all browsers.
|
||||
* 2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit; /* 1 */
|
||||
font-size: 100%; /* 1 */
|
||||
line-height: 1.15; /* 1 */
|
||||
margin: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the overflow in IE.
|
||||
* 1. Show the overflow in Edge.
|
||||
*/
|
||||
|
||||
button,
|
||||
input { /* 1 */
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||
* 1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select { /* 1 */
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
[type="button"]::-moz-focus-inner,
|
||||
[type="reset"]::-moz-focus-inner,
|
||||
[type="submit"]::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
|
||||
button:-moz-focusring,
|
||||
[type="button"]:-moz-focusring,
|
||||
[type="reset"]:-moz-focusring,
|
||||
[type="submit"]:-moz-focusring {
|
||||
outline: 1px dotted ButtonText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the padding in Firefox.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
padding: 0.35em 0.75em 0.625em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the text wrapping in Edge and IE.
|
||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||
* 3. Remove the padding so developers are not caught out when they zero out
|
||||
* `fieldset` elements in all browsers.
|
||||
*/
|
||||
|
||||
legend {
|
||||
box-sizing: border-box; /* 1 */
|
||||
color: inherit; /* 2 */
|
||||
display: table; /* 1 */
|
||||
max-width: 100%; /* 1 */
|
||||
padding: 0; /* 3 */
|
||||
white-space: normal; /* 1 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the default vertical scrollbar in IE 10+.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in IE 10.
|
||||
* 2. Remove the padding in IE 10.
|
||||
*/
|
||||
|
||||
[type="checkbox"],
|
||||
[type="radio"] {
|
||||
box-sizing: border-box; /* 1 */
|
||||
padding: 0; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||
*/
|
||||
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the odd appearance in Chrome and Safari.
|
||||
* 2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
outline-offset: -2px; /* 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||
* 2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
font: inherit; /* 2 */
|
||||
}
|
||||
|
||||
/* Interactive
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Add the correct display in Edge, IE 10+, and Firefox.
|
||||
*/
|
||||
|
||||
details {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the correct display in all browsers.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/* Misc
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10+.
|
||||
*/
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
}
|
36
assets/plugins/_numbered.scss
Normal file
36
assets/plugins/_numbered.scss
Normal file
@ -0,0 +1,36 @@
|
||||
$startLevel: 1;
|
||||
$endLevel: 6;
|
||||
|
||||
.book-page .markdown {
|
||||
@for $currentLevel from $startLevel through $endLevel {
|
||||
> h#{$currentLevel} {
|
||||
counter-increment: h#{$currentLevel};
|
||||
counter-reset: h#{$currentLevel + 1};
|
||||
|
||||
$content: "";
|
||||
@for $n from $startLevel through $currentLevel {
|
||||
$content: $content + 'counter(h#{$n})"."';
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: unquote($content) " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.book-toc nav ul {
|
||||
li {
|
||||
counter-increment: item;
|
||||
|
||||
&:first-child {
|
||||
counter-reset: item;
|
||||
}
|
||||
|
||||
&:before {
|
||||
content: counters(item, ".") ". ";
|
||||
float: left;
|
||||
margin-inline-end: $padding-4;
|
||||
}
|
||||
}
|
||||
}
|
26
assets/plugins/_scrollbars.scss
Normal file
26
assets/plugins/_scrollbars.scss
Normal file
@ -0,0 +1,26 @@
|
||||
@import "defaults";
|
||||
@import "variables";
|
||||
|
||||
// Webkit
|
||||
::-webkit-scrollbar {
|
||||
width: $padding-8;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: transparent;
|
||||
border-radius: $padding-8;
|
||||
}
|
||||
|
||||
:hover::-webkit-scrollbar-thumb {
|
||||
background: var(--gray-500);
|
||||
}
|
||||
|
||||
// MS
|
||||
body {
|
||||
-ms-overflow-style: -ms-autohiding-scrollbar;
|
||||
}
|
||||
|
||||
// Future
|
||||
.book-menu nav {
|
||||
scrollbar-color: transparent var(--gray-500);
|
||||
}
|
6
assets/quartz/js/callouts.js
Normal file
6
assets/quartz/js/callouts.js
Normal file
@ -0,0 +1,6 @@
|
||||
const addCollapsibleCallouts = () => {
|
||||
const collapsibleCallouts = document.querySelectorAll("blockquote.callout-collapsible");
|
||||
collapsibleCallouts.forEach(el => el.addEventListener('click', event => {
|
||||
event.currentTarget.classList.toggle("callout-collapsed");
|
||||
}));
|
||||
}
|
45
assets/quartz/js/clipboard.js
Normal file
45
assets/quartz/js/clipboard.js
Normal file
@ -0,0 +1,45 @@
|
||||
const svgCopy =
|
||||
'<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg>';
|
||||
const svgCheck =
|
||||
'<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true"><path fill-rule="evenodd" fill="rgb(63, 185, 80)" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>';
|
||||
|
||||
|
||||
const addCopyButtons = () => {
|
||||
let els = document.getElementsByClassName("highlight");
|
||||
// for each highlight
|
||||
for (let i = 0; i < els.length; i++) {
|
||||
try {
|
||||
if (els[i].getElementsByClassName("clipboard-button").length) continue;
|
||||
|
||||
// find pre > code inside els[i]
|
||||
let codeBlocks = els[i].getElementsByTagName("code");
|
||||
|
||||
// line numbers are inside first code block
|
||||
let lastCodeBlock = codeBlocks[codeBlocks.length - 1];
|
||||
const button = document.createElement("button");
|
||||
button.className = "clipboard-button";
|
||||
button.type = "button";
|
||||
button.innerHTML = svgCopy;
|
||||
button.ariaLabel = "opy the shown code";
|
||||
// remove every second newline from lastCodeBlock.innerText
|
||||
button.addEventListener("click", () => {
|
||||
navigator.clipboard.writeText(lastCodeBlock.innerText.replace(/\n\n/g, "\n")).then(
|
||||
() => {
|
||||
button.blur();
|
||||
button.innerHTML = svgCheck;
|
||||
setTimeout(() => {
|
||||
button.innerHTML = svgCopy
|
||||
button.style.borderColor = ""
|
||||
}, 2000);
|
||||
},
|
||||
(error) => (button.innerHTML = "Error")
|
||||
);
|
||||
});
|
||||
// find chroma inside els[i]
|
||||
let chroma = els[i].getElementsByClassName("chroma")[0];
|
||||
els[i].insertBefore(button, chroma);
|
||||
} catch(error) {
|
||||
console.debug(error);
|
||||
}
|
||||
}
|
||||
}
|
17
assets/quartz/js/code-title.js
Normal file
17
assets/quartz/js/code-title.js
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
function addTitleToCodeBlocks() {
|
||||
const els = document.getElementsByClassName("highlight");
|
||||
for (let i = 0; i < els.length; i++) {
|
||||
try {
|
||||
if (els[i].title.length) {
|
||||
let div = document.createElement("div");
|
||||
if (els[i].getElementsByClassName("code-title").length) continue;
|
||||
div.textContent = els[i].title;
|
||||
div.classList.add("code-title")
|
||||
els[i].insertBefore(div, els[i].firstChild);
|
||||
}
|
||||
} catch (error) {
|
||||
console.debug(error);
|
||||
}
|
||||
}
|
||||
}
|
37
assets/quartz/js/darkmode.js
Normal file
37
assets/quartz/js/darkmode.js
Normal file
@ -0,0 +1,37 @@
|
||||
const userPref = window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'
|
||||
const currentTheme = localStorage.getItem('theme') ?? userPref
|
||||
const syntaxTheme = document.querySelector("#theme-link");
|
||||
|
||||
|
||||
{{ $darkSyntax := resources.Get "quartz/styles/_dark_syntax.scss" | resources.ToCSS (dict "outputStyle" "compressed") | resources.Fingerprint "md5" | resources.Minify }}
|
||||
{{ $lightSyntax := resources.Get "quartz/styles/_light_syntax.scss" | resources.ToCSS (dict "outputStyle" "compressed") | resources.Fingerprint "md5" | resources.Minify }}
|
||||
|
||||
if (currentTheme) {
|
||||
document.documentElement.setAttribute('saved-theme', currentTheme);
|
||||
syntaxTheme.href = currentTheme === 'dark' ? '{{ $darkSyntax.Permalink }}' : '{{ $lightSyntax.Permalink }}';
|
||||
}
|
||||
|
||||
const switchTheme = (e) => {
|
||||
if (e.target.checked) {
|
||||
document.documentElement.setAttribute('saved-theme', 'dark');
|
||||
localStorage.setItem('theme', 'dark');
|
||||
syntaxTheme.href = '{{ $darkSyntax.Permalink }}';
|
||||
}
|
||||
else {
|
||||
document.documentElement.setAttribute('saved-theme', 'light')
|
||||
localStorage.setItem('theme', 'light')
|
||||
syntaxTheme.href = '{{ $lightSyntax.Permalink }}';
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
// Darkmode toggle
|
||||
const toggleSwitch = document.querySelector('#darkmode-toggle')
|
||||
|
||||
// listen for toggle
|
||||
toggleSwitch.addEventListener('change', switchTheme, false)
|
||||
|
||||
if (currentTheme === 'dark') {
|
||||
toggleSwitch.checked = true
|
||||
}
|
||||
})
|
61
assets/quartz/js/full-text-search.js
Normal file
61
assets/quartz/js/full-text-search.js
Normal file
@ -0,0 +1,61 @@
|
||||
; (async function() {
|
||||
const encoder = (str) => str.toLowerCase().split(/([^a-z]|[^\x00-\x7F])/)
|
||||
const contentIndex = new FlexSearch.Document({
|
||||
cache: true,
|
||||
charset: "latin:extra",
|
||||
optimize: true,
|
||||
index: [
|
||||
{
|
||||
field: "content",
|
||||
tokenize: "reverse",
|
||||
encode: encoder,
|
||||
},
|
||||
{
|
||||
field: "title",
|
||||
tokenize: "forward",
|
||||
encode: encoder,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const { content } = await fetchData
|
||||
for (const [key, value] of Object.entries(content)) {
|
||||
contentIndex.add({
|
||||
id: key,
|
||||
title: value.title,
|
||||
content: removeMarkdown(value.content),
|
||||
})
|
||||
}
|
||||
|
||||
const formatForDisplay = (id) => ({
|
||||
id,
|
||||
url: id,
|
||||
title: content[id].title,
|
||||
content: content[id].content,
|
||||
})
|
||||
|
||||
registerHandlers((e) => {
|
||||
const term = e.target.value
|
||||
const searchResults = contentIndex.search(term, [
|
||||
{
|
||||
field: "content",
|
||||
limit: 10,
|
||||
},
|
||||
{
|
||||
field: "title",
|
||||
limit: 5,
|
||||
},
|
||||
])
|
||||
const getByField = (field) => {
|
||||
const results = searchResults.filter((x) => x.field === field)
|
||||
if (results.length === 0) {
|
||||
return []
|
||||
} else {
|
||||
return [...results[0].result]
|
||||
}
|
||||
}
|
||||
const allIds = new Set([...getByField("title"), ...getByField("content")])
|
||||
const finalResults = [...allIds].map(formatForDisplay)
|
||||
displayResults(term, finalResults, true)
|
||||
})
|
||||
})()
|
269
assets/quartz/js/graph.js
Normal file
269
assets/quartz/js/graph.js
Normal file
@ -0,0 +1,269 @@
|
||||
async function drawGraph(baseUrl, isHome, pathColors, graphConfig) {
|
||||
let {
|
||||
depth,
|
||||
enableDrag,
|
||||
enableLegend,
|
||||
enableZoom,
|
||||
opacityScale,
|
||||
scale,
|
||||
repelForce,
|
||||
fontSize} = graphConfig;
|
||||
|
||||
const container = document.getElementById("graph-container")
|
||||
const { index, links, content } = await fetchData
|
||||
|
||||
// Use .pathname to remove hashes / searchParams / text fragments
|
||||
const cleanUrl = window.location.origin + window.location.pathname
|
||||
|
||||
const curPage = cleanUrl.replace(/\/$/g, "").replace(baseUrl, "")
|
||||
|
||||
const parseIdsFromLinks = (links) => [
|
||||
...new Set(links.flatMap((link) => [link.source, link.target])),
|
||||
]
|
||||
|
||||
// Links is mutated by d3. We want to use links later on, so we make a copy and pass that one to d3
|
||||
// Note: shallow cloning does not work because it copies over references from the original array
|
||||
const copyLinks = JSON.parse(JSON.stringify(links))
|
||||
|
||||
const neighbours = new Set()
|
||||
const wl = [curPage || "/", "__SENTINEL"]
|
||||
if (depth >= 0) {
|
||||
while (depth >= 0 && wl.length > 0) {
|
||||
// compute neighbours
|
||||
const cur = wl.shift()
|
||||
if (cur === "__SENTINEL") {
|
||||
depth--
|
||||
wl.push("__SENTINEL")
|
||||
} else {
|
||||
neighbours.add(cur)
|
||||
const outgoing = index.links[cur] || []
|
||||
const incoming = index.backlinks[cur] || []
|
||||
wl.push(...outgoing.map((l) => l.target), ...incoming.map((l) => l.source))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
parseIdsFromLinks(copyLinks).forEach((id) => neighbours.add(id))
|
||||
}
|
||||
|
||||
const data = {
|
||||
nodes: [...neighbours].map((id) => ({ id })),
|
||||
links: copyLinks.filter((l) => neighbours.has(l.source) && neighbours.has(l.target)),
|
||||
}
|
||||
|
||||
const color = (d) => {
|
||||
if (d.id === curPage || (d.id === "/" && curPage === "")) {
|
||||
return "var(--g-node-active)"
|
||||
}
|
||||
|
||||
for (const pathColor of pathColors) {
|
||||
const path = Object.keys(pathColor)[0]
|
||||
const colour = pathColor[path]
|
||||
if (d.id.startsWith(path)) {
|
||||
return colour
|
||||
}
|
||||
}
|
||||
|
||||
return "var(--g-node)"
|
||||
}
|
||||
|
||||
const drag = (simulation) => {
|
||||
function dragstarted(event, d) {
|
||||
if (!event.active) simulation.alphaTarget(1).restart()
|
||||
d.fx = d.x
|
||||
d.fy = d.y
|
||||
}
|
||||
|
||||
function dragged(event, d) {
|
||||
d.fx = event.x
|
||||
d.fy = event.y
|
||||
}
|
||||
|
||||
function dragended(event, d) {
|
||||
if (!event.active) simulation.alphaTarget(0)
|
||||
d.fx = null
|
||||
d.fy = null
|
||||
}
|
||||
|
||||
const noop = () => {}
|
||||
return d3
|
||||
.drag()
|
||||
.on("start", enableDrag ? dragstarted : noop)
|
||||
.on("drag", enableDrag ? dragged : noop)
|
||||
.on("end", enableDrag ? dragended : noop)
|
||||
}
|
||||
|
||||
const height = Math.max(container.offsetHeight, isHome ? 500 : 250)
|
||||
const width = container.offsetWidth
|
||||
|
||||
const simulation = d3
|
||||
.forceSimulation(data.nodes)
|
||||
.force("charge", d3.forceManyBody().strength(-100 * repelForce))
|
||||
.force(
|
||||
"link",
|
||||
d3
|
||||
.forceLink(data.links)
|
||||
.id((d) => d.id)
|
||||
.distance(40),
|
||||
)
|
||||
.force("center", d3.forceCenter())
|
||||
|
||||
const svg = d3
|
||||
.select("#graph-container")
|
||||
.append("svg")
|
||||
.attr("width", width)
|
||||
.attr("height", height)
|
||||
.attr('viewBox', [-width / 2 / scale, -height / 2 / scale, width / scale, height / scale])
|
||||
|
||||
if (enableLegend) {
|
||||
const legend = [{ Current: "var(--g-node-active)" }, { Note: "var(--g-node)" }, ...pathColors]
|
||||
legend.forEach((legendEntry, i) => {
|
||||
const key = Object.keys(legendEntry)[0]
|
||||
const colour = legendEntry[key]
|
||||
svg
|
||||
.append("circle")
|
||||
.attr("cx", -width / 2 + 20)
|
||||
.attr("cy", height / 2 - 30 * (i + 1))
|
||||
.attr("r", 6)
|
||||
.style("fill", colour)
|
||||
svg
|
||||
.append("text")
|
||||
.attr("x", -width / 2 + 40)
|
||||
.attr("y", height / 2 - 30 * (i + 1))
|
||||
.text(key)
|
||||
.style("font-size", "15px")
|
||||
.attr("alignment-baseline", "middle")
|
||||
})
|
||||
}
|
||||
|
||||
// draw links between nodes
|
||||
const link = svg
|
||||
.append("g")
|
||||
.selectAll("line")
|
||||
.data(data.links)
|
||||
.join("line")
|
||||
.attr("class", "link")
|
||||
.attr("stroke", "var(--g-link)")
|
||||
.attr("stroke-width", 2)
|
||||
.attr("data-source", (d) => d.source.id)
|
||||
.attr("data-target", (d) => d.target.id)
|
||||
|
||||
// svg groups
|
||||
const graphNode = svg.append("g").selectAll("g").data(data.nodes).enter().append("g")
|
||||
|
||||
// calculate radius
|
||||
const nodeRadius = (d) => {
|
||||
const numOut = index.links[d.id]?.length || 0
|
||||
const numIn = index.backlinks[d.id]?.length || 0
|
||||
return 2 + Math.sqrt(numOut + numIn)
|
||||
}
|
||||
|
||||
// draw individual nodes
|
||||
const node = graphNode
|
||||
.append("circle")
|
||||
.attr("class", "node")
|
||||
.attr("id", (d) => d.id)
|
||||
.attr("r", nodeRadius)
|
||||
.attr("fill", color)
|
||||
.style("cursor", "pointer")
|
||||
.on("click", (_, d) => {
|
||||
// SPA navigation
|
||||
window.Million.navigate(new URL(`${baseUrl}${decodeURI(d.id).replace(/\s+/g, "-")}/`), ".singlePage")
|
||||
})
|
||||
.on("mouseover", function (_, d) {
|
||||
d3.selectAll(".node").transition().duration(100).attr("fill", "var(--g-node-inactive)")
|
||||
|
||||
const neighbours = parseIdsFromLinks([
|
||||
...(index.links[d.id] || []),
|
||||
...(index.backlinks[d.id] || []),
|
||||
])
|
||||
const neighbourNodes = d3.selectAll(".node").filter((d) => neighbours.includes(d.id))
|
||||
const currentId = d.id
|
||||
window.Million.prefetch(new URL(`${baseUrl}${decodeURI(d.id).replace(/\s+/g, "-")}/`))
|
||||
const linkNodes = d3
|
||||
.selectAll(".link")
|
||||
.filter((d) => d.source.id === currentId || d.target.id === currentId)
|
||||
|
||||
// highlight neighbour nodes
|
||||
neighbourNodes.transition().duration(200).attr("fill", color)
|
||||
|
||||
// highlight links
|
||||
linkNodes.transition().duration(200).attr("stroke", "var(--g-link-active)")
|
||||
|
||||
const bigFont = fontSize*1.5
|
||||
|
||||
// show text for self
|
||||
d3.select(this.parentNode)
|
||||
.raise()
|
||||
.select("text")
|
||||
.transition()
|
||||
.duration(200)
|
||||
.attr('opacityOld', d3.select(this.parentNode).select('text').style("opacity"))
|
||||
.style('opacity', 1)
|
||||
.style('font-size', bigFont+'em')
|
||||
.attr('dy', d => nodeRadius(d) + 20 + 'px') // radius is in px
|
||||
})
|
||||
.on("mouseleave", function (_, d) {
|
||||
d3.selectAll(".node").transition().duration(200).attr("fill", color)
|
||||
|
||||
const currentId = d.id
|
||||
const linkNodes = d3
|
||||
.selectAll(".link")
|
||||
.filter((d) => d.source.id === currentId || d.target.id === currentId)
|
||||
|
||||
linkNodes.transition().duration(200).attr("stroke", "var(--g-link)")
|
||||
|
||||
d3.select(this.parentNode)
|
||||
.select("text")
|
||||
.transition()
|
||||
.duration(200)
|
||||
.style('opacity', d3.select(this.parentNode).select('text').attr("opacityOld"))
|
||||
.style('font-size', fontSize+'em')
|
||||
.attr('dy', d => nodeRadius(d) + 8 + 'px') // radius is in px
|
||||
})
|
||||
.call(drag(simulation))
|
||||
|
||||
// draw labels
|
||||
const labels = graphNode
|
||||
.append("text")
|
||||
.attr("dx", 0)
|
||||
.attr("dy", (d) => nodeRadius(d) + 8 + "px")
|
||||
.attr("text-anchor", "middle")
|
||||
.text((d) => content[d.id]?.title || d.id.replace("-", " "))
|
||||
.style('opacity', (opacityScale - 1) / 3.75)
|
||||
.style("pointer-events", "none")
|
||||
.style('font-size', fontSize+'em')
|
||||
.raise()
|
||||
.call(drag(simulation))
|
||||
|
||||
// set panning
|
||||
|
||||
if (enableZoom) {
|
||||
svg.call(
|
||||
d3
|
||||
.zoom()
|
||||
.extent([
|
||||
[0, 0],
|
||||
[width, height],
|
||||
])
|
||||
.scaleExtent([0.25, 4])
|
||||
.on("zoom", ({ transform }) => {
|
||||
link.attr("transform", transform)
|
||||
node.attr("transform", transform)
|
||||
const scale = transform.k * opacityScale;
|
||||
const scaledOpacity = Math.max((scale - 1) / 3.75, 0)
|
||||
labels.attr("transform", transform).style("opacity", scaledOpacity)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
// progress the simulation
|
||||
simulation.on("tick", () => {
|
||||
link
|
||||
.attr("x1", (d) => d.source.x)
|
||||
.attr("y1", (d) => d.source.y)
|
||||
.attr("x2", (d) => d.target.x)
|
||||
.attr("y2", (d) => d.target.y)
|
||||
node.attr("cx", (d) => d.x).attr("cy", (d) => d.y)
|
||||
labels.attr("x", (d) => d.x).attr("y", (d) => d.y)
|
||||
})
|
||||
}
|
7
assets/quartz/js/menu-reset.js
Normal file
7
assets/quartz/js/menu-reset.js
Normal file
@ -0,0 +1,7 @@
|
||||
(function() {
|
||||
var menu = document.querySelector("aside .book-menu-content");
|
||||
addEventListener("beforeunload", function(event) {
|
||||
localStorage.setItem("menu.scrollTop", menu.scrollTop);
|
||||
});
|
||||
menu.scrollTop = localStorage.getItem("menu.scrollTop");
|
||||
})();
|
74
assets/quartz/js/popover.js
Normal file
74
assets/quartz/js/popover.js
Normal file
@ -0,0 +1,74 @@
|
||||
function htmlToElement(html) {
|
||||
const template = document.createElement("template")
|
||||
html = html.trim()
|
||||
template.innerHTML = html
|
||||
return template.content.firstChild
|
||||
}
|
||||
|
||||
function initPopover(baseURL, useContextualBacklinks) {
|
||||
const basePath = baseURL.replace(window.location.origin, "")
|
||||
fetchData.then(({ content }) => {
|
||||
const links = [...document.getElementsByClassName("internal-link")]
|
||||
links
|
||||
.filter(li => li.dataset.src || (li.dataset.idx && useContextualBacklinks))
|
||||
.forEach(li => {
|
||||
let el
|
||||
if (li.dataset.ctx) {
|
||||
const linkDest = content[li.dataset.src]
|
||||
const popoverElement = `<div class="popover">
|
||||
<h3>${linkDest.title}</h3>
|
||||
<p>${highlight(removeMarkdown(linkDest.content), li.dataset.ctx)}...</p>
|
||||
<p class="meta">${new Date(linkDest.lastmodified).toLocaleDateString()}</p>
|
||||
</div>`
|
||||
el = htmlToElement(popoverElement)
|
||||
} else {
|
||||
const linkDest = content[li.dataset.src.replace(/\/$/g, "").replace(basePath, "")]
|
||||
if (linkDest) {
|
||||
let splitLink = li.href.split("#")
|
||||
let cleanedContent = removeMarkdown(linkDest.content)
|
||||
if (splitLink.length > 1) {
|
||||
let headingName = decodeURIComponent(splitLink[1]).replace(/\-/g, " ")
|
||||
let headingIndex = cleanedContent.toLowerCase().indexOf("<b>" + headingName + "</b>")
|
||||
cleanedContent = cleanedContent.substring(headingIndex, cleanedContent.length)
|
||||
}
|
||||
const popoverElement = `<div class="popover">
|
||||
<h3>${linkDest.title}</h3>
|
||||
<p>${cleanedContent.split(" ", 20).join(" ")}...</p>
|
||||
<p class="meta">${new Date(linkDest.lastmodified).toLocaleDateString()}</p>
|
||||
</div>`
|
||||
el = htmlToElement(popoverElement)
|
||||
}
|
||||
}
|
||||
|
||||
if (el) {
|
||||
li.appendChild(el)
|
||||
if (LATEX_ENABLED) {
|
||||
renderMathInElement(el, {
|
||||
delimiters: [
|
||||
{ left: '$$', right: '$$', display: false },
|
||||
{ left: '$', right: '$', display: false },
|
||||
],
|
||||
throwOnError: false
|
||||
})
|
||||
}
|
||||
|
||||
li.addEventListener("mouseover", () => {
|
||||
// fix tooltip positioning
|
||||
window.FloatingUIDOM.computePosition(li, el, {
|
||||
middleware: [window.FloatingUIDOM.offset(10), window.FloatingUIDOM.inline(), window.FloatingUIDOM.shift()],
|
||||
}).then(({ x, y }) => {
|
||||
Object.assign(el.style, {
|
||||
left: `${x}px`,
|
||||
top: `${y}px`,
|
||||
})
|
||||
})
|
||||
|
||||
el.classList.add("visible")
|
||||
})
|
||||
li.addEventListener("mouseout", () => {
|
||||
el.classList.remove("visible")
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
26
assets/quartz/js/router.js
Normal file
26
assets/quartz/js/router.js
Normal file
@ -0,0 +1,26 @@
|
||||
import {
|
||||
apply,
|
||||
navigate,
|
||||
prefetch,
|
||||
router,
|
||||
} from "https://unpkg.com/million@1.11.5/dist/router.mjs"
|
||||
|
||||
export const attachSPARouting = (init, rerender) => {
|
||||
// Attach SPA functions to the global Million namespace
|
||||
window.Million = {
|
||||
apply,
|
||||
navigate,
|
||||
prefetch,
|
||||
router,
|
||||
}
|
||||
|
||||
const render = () => requestAnimationFrame(rerender)
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
apply((doc) => init(doc))
|
||||
init()
|
||||
router(".singlePage")
|
||||
render()
|
||||
})
|
||||
window.addEventListener("million:navigate", render)
|
||||
}
|
54
assets/quartz/js/semantic-search.js
Normal file
54
assets/quartz/js/semantic-search.js
Normal file
@ -0,0 +1,54 @@
|
||||
// Note: Currently, we use the REST API for Operand because of some unpkg/webpack issues.
|
||||
// In the future, we'd like to use the SDK (https://github.com/operandinc/typescript-sdk).
|
||||
// If someone knows how to do this w/o breaking the Operand typescript-sdk for npm users,
|
||||
// please let Morgan (@morgallant) and/or (@_jzhao) know! <3
|
||||
|
||||
const apiKey = "{{$.Site.params.search.operandApiKey}}"
|
||||
const indexId = "{{$.Site.params.search.operandIndexId}}"
|
||||
|
||||
function parseSearchResults(searchResults) {
|
||||
return searchResults.matches.map((m) => ({
|
||||
content: m.content,
|
||||
title: searchResults.objects[m.objectId].properties.properties._title.text,
|
||||
url: searchResults.objects[m.objectId].properties.properties._url.text,
|
||||
}))
|
||||
}
|
||||
|
||||
async function searchContents(query) {
|
||||
const result = await fetch("https://api.operand.ai/operand.v1.ObjectService/SearchWithin", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `${apiKey}`,
|
||||
"Operand-Index-ID": `${indexId}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
query: query,
|
||||
limit: 10,
|
||||
}),
|
||||
})
|
||||
if (result.ok) {
|
||||
return parseSearchResults(await result.json())
|
||||
} else {
|
||||
console.error(result)
|
||||
}
|
||||
}
|
||||
|
||||
function debounce(func, timeout = 200) {
|
||||
let timer
|
||||
return (...args) => {
|
||||
clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
func.apply(this, args)
|
||||
}, timeout)
|
||||
}
|
||||
}
|
||||
|
||||
registerHandlers(
|
||||
debounce((e) => {
|
||||
let term = e.target.value
|
||||
if (term !== "") {
|
||||
searchContents(term).then((results) => displayResults(term, results))
|
||||
}
|
||||
}),
|
||||
)
|
7
assets/quartz/js/sw-register.js
Normal file
7
assets/quartz/js/sw-register.js
Normal file
@ -0,0 +1,7 @@
|
||||
{{- $swJS := resources.Get "sw.js" | resources.ExecuteAsTemplate "sw.js" . -}}
|
||||
if (navigator.serviceWorker) {
|
||||
navigator.serviceWorker.register(
|
||||
"{{ $swJS.RelPermalink }}",
|
||||
{ scope: "{{ "/" | relURL }}" }
|
||||
);
|
||||
}
|
55
assets/quartz/js/sw.js
Normal file
55
assets/quartz/js/sw.js
Normal file
@ -0,0 +1,55 @@
|
||||
const cacheName = self.location.pathname
|
||||
const pages = [
|
||||
{{ if eq .Site.Params.BookServiceWorker "precache" }}
|
||||
{{ range .Site.AllPages -}}
|
||||
"{{ .RelPermalink }}",
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
];
|
||||
|
||||
self.addEventListener("install", function (event) {
|
||||
self.skipWaiting();
|
||||
|
||||
caches.open(cacheName).then((cache) => {
|
||||
return cache.addAll(pages);
|
||||
});
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (event) => {
|
||||
const request = event.request;
|
||||
if (request.method !== "GET") {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Response} response
|
||||
* @returns {Promise<Response>}
|
||||
*/
|
||||
function saveToCache(response) {
|
||||
if (cacheable(response)) {
|
||||
return caches
|
||||
.open(cacheName)
|
||||
.then((cache) => cache.put(request, response.clone()))
|
||||
.then(() => response);
|
||||
} else {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Error} error
|
||||
*/
|
||||
function serveFromCache(error) {
|
||||
return caches.open(cacheName).then((cache) => cache.match(request.url));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Response} response
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
function cacheable(response) {
|
||||
return response.type === "basic" && response.ok && !response.headers.has("Content-Disposition")
|
||||
}
|
||||
|
||||
event.respondWith(fetch(request).then(saveToCache).catch(serveFromCache));
|
||||
});
|
224
assets/quartz/js/util.js
Normal file
224
assets/quartz/js/util.js
Normal file
@ -0,0 +1,224 @@
|
||||
// code from https://github.com/danestves/markdown-to-text
|
||||
const removeMarkdown = (
|
||||
markdown,
|
||||
options = {
|
||||
listUnicodeChar: false,
|
||||
stripListLeaders: true,
|
||||
gfm: true,
|
||||
useImgAltText: false,
|
||||
preserveLinks: false,
|
||||
},
|
||||
) => {
|
||||
let output = markdown || ""
|
||||
output = output.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm, "")
|
||||
|
||||
try {
|
||||
if (options.stripListLeaders) {
|
||||
if (options.listUnicodeChar)
|
||||
output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, options.listUnicodeChar + " $1")
|
||||
else output = output.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm, "$1")
|
||||
}
|
||||
if (options.gfm) {
|
||||
output = output
|
||||
.replace(/\n={2,}/g, "\n")
|
||||
.replace(/~{3}.*\n/g, "")
|
||||
.replace(/~~/g, "")
|
||||
.replace(/`{3}.*\n/g, "")
|
||||
}
|
||||
if (options.preserveLinks) {
|
||||
output = output.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g, "$1 ($2)")
|
||||
}
|
||||
output = output
|
||||
.replace(/<[^>]*>/g, "")
|
||||
.replace(/^[=\-]{2,}\s*$/g, "")
|
||||
.replace(/\[\^.+?\](\: .*?$)?/g, "")
|
||||
.replace(/(#{1,6})\s+(.+)\1?/g, "<b>$2</b>")
|
||||
.replace(/\s{0,2}\[.*?\]: .*?$/g, "")
|
||||
.replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g, options.useImgAltText ? "$1" : "")
|
||||
.replace(/\[(.*?)\][\[\(].*?[\]\)]/g, "<a>$1</a>")
|
||||
.replace(/!?\[\[\S[^\[\]\|]*(?:\|([^\[\]]*))?\S\]\]/g, "<a>$1</a>")
|
||||
.replace(/^\s{0,3}>\s?/g, "")
|
||||
.replace(/(^|\n)\s{0,3}>\s?/g, "\n\n")
|
||||
.replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, "")
|
||||
.replace(/([\*_]{1,3})(\S.*?\S?)\1/g, "$2")
|
||||
.replace(/([\*_]{1,3})(\S.*?\S?)\1/g, "$2")
|
||||
.replace(/(`{3,})(.*?)\1/gm, "$2")
|
||||
.replace(/`(.+?)`/g, "$1")
|
||||
.replace(/\n{2,}/g, "\n\n")
|
||||
.replace(/\[![a-zA-Z]+\][-\+]? /g, "")
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return markdown
|
||||
}
|
||||
return output
|
||||
}
|
||||
|
||||
const highlight = (content, term) => {
|
||||
const highlightWindow = 20
|
||||
// try to find direct match first
|
||||
const directMatchIdx = content.indexOf(term)
|
||||
if (directMatchIdx !== -1) {
|
||||
const h = highlightWindow
|
||||
const before = content.substring(0, directMatchIdx).split(" ").slice(-h)
|
||||
const after = content
|
||||
.substring(directMatchIdx + term.length, content.length - 2)
|
||||
.split(" ")
|
||||
.slice(0, h)
|
||||
return (
|
||||
(before.length === h ? `...${before.join(" ")}` : before.join(" ")) +
|
||||
`<span class="search-highlight">${term}</span>` +
|
||||
after.join(" ")
|
||||
)
|
||||
}
|
||||
|
||||
const tokenizedTerm = term.split(/\s+/).filter((t) => t !== "")
|
||||
const splitText = content.split(/\s+/).filter((t) => t !== "")
|
||||
const includesCheck = (token) =>
|
||||
tokenizedTerm.some((term) => token.toLowerCase().startsWith(term.toLowerCase()))
|
||||
|
||||
const occurrencesIndices = splitText.map(includesCheck)
|
||||
|
||||
// calculate best index
|
||||
let bestSum = 0
|
||||
let bestIndex = 0
|
||||
for (let i = 0; i < Math.max(occurrencesIndices.length - highlightWindow, 0); i++) {
|
||||
const window = occurrencesIndices.slice(i, i + highlightWindow)
|
||||
const windowSum = window.reduce((total, cur) => total + cur, 0)
|
||||
if (windowSum >= bestSum) {
|
||||
bestSum = windowSum
|
||||
bestIndex = i
|
||||
}
|
||||
}
|
||||
|
||||
const startIndex = Math.max(bestIndex - highlightWindow, 0)
|
||||
const endIndex = Math.min(startIndex + 2 * highlightWindow, splitText.length)
|
||||
const mappedText = splitText
|
||||
.slice(startIndex, endIndex)
|
||||
.map((token) => {
|
||||
if (includesCheck(token)) {
|
||||
return `<span class="search-highlight">${token}</span>`
|
||||
}
|
||||
return token
|
||||
})
|
||||
.join(" ")
|
||||
.replaceAll('</span> <span class="search-highlight">', " ")
|
||||
return `${startIndex === 0 ? "" : "..."}${mappedText}${endIndex === splitText.length ? "" : "..."
|
||||
}`
|
||||
}
|
||||
|
||||
// Common utilities for search
|
||||
const resultToHTML = ({ url, title, content }) => {
|
||||
return `<button class="result-card" id="${url}">
|
||||
<h3>${title}</h3>
|
||||
<p>${content}</p>
|
||||
</button>`
|
||||
}
|
||||
|
||||
const redir = (id, term) => {
|
||||
const shouldTrim = PRODUCTION && SEARCH_ENABLED
|
||||
const baseURLPrefix = shouldTrim ? "" : BASE_URL.replace(/\/$/g, "")
|
||||
const urlString = `${baseURLPrefix}${id}#:~:text=${encodeURIComponent(term)}/`
|
||||
window.Million.navigate(
|
||||
new URL(urlString),
|
||||
".singlePage",
|
||||
)
|
||||
closeSearch()
|
||||
}
|
||||
|
||||
function openSearch() {
|
||||
const source = document.getElementById("search-bar")
|
||||
const results = document.getElementById("results-container")
|
||||
const searchContainer = document.getElementById("search-container")
|
||||
if (searchContainer.style.display === "none" || searchContainer.style.display === "") {
|
||||
source.value = ""
|
||||
results.innerHTML = ""
|
||||
searchContainer.style.display = "block"
|
||||
source.focus()
|
||||
} else {
|
||||
searchContainer.style.display = "none"
|
||||
}
|
||||
}
|
||||
|
||||
function closeSearch() {
|
||||
const searchContainer = document.getElementById("search-container")
|
||||
searchContainer.style.display = "none"
|
||||
}
|
||||
|
||||
const registerHandlers = (onInputFn) => {
|
||||
const source = document.getElementById("search-bar")
|
||||
const searchContainer = document.getElementById("search-container")
|
||||
let term
|
||||
source.addEventListener("keyup", (e) => {
|
||||
if (e.key === "Enter") {
|
||||
const anchor = document.getElementsByClassName("result-card")[0]
|
||||
redir(anchor.id, term)
|
||||
}
|
||||
})
|
||||
source.addEventListener("input", onInputFn)
|
||||
document.addEventListener("keydown", (event) => {
|
||||
if (event.key === "k" && (event.ctrlKey || event.metaKey)) {
|
||||
event.preventDefault()
|
||||
openSearch()
|
||||
}
|
||||
if (event.key === "Escape") {
|
||||
event.preventDefault()
|
||||
closeSearch()
|
||||
}
|
||||
})
|
||||
|
||||
const searchButtons = document.getElementsByClassName("quartz-search")
|
||||
for (let searchButton of searchButtons) {
|
||||
|
||||
searchButton.addEventListener("click", (_) => {
|
||||
openSearch()
|
||||
})
|
||||
searchButton.addEventListener("keydown", (_) => {
|
||||
openSearch()
|
||||
})
|
||||
searchContainer.addEventListener("click", (_) => {
|
||||
closeSearch()
|
||||
})
|
||||
document.getElementById("search-space").addEventListener("click", (evt) => {
|
||||
evt.stopPropagation()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const displayResults = (term, finalResults, extractHighlight = false) => {
|
||||
const results = document.getElementById("results-container")
|
||||
if (finalResults.length === 0) {
|
||||
results.innerHTML = `<button class="result-card">
|
||||
<h3>No results.</h3>
|
||||
<p>Try another search term?</p>
|
||||
</button>`
|
||||
} else {
|
||||
results.innerHTML = finalResults
|
||||
.map((result) => {
|
||||
if (extractHighlight) {
|
||||
return resultToHTML({
|
||||
url: result.url,
|
||||
title: highlight(result.title, term),
|
||||
content: highlight(removeMarkdown(result.content), term)
|
||||
})
|
||||
} else {
|
||||
return resultToHTML(result)
|
||||
}
|
||||
}
|
||||
)
|
||||
.join("\n")
|
||||
if (LATEX_ENABLED) {
|
||||
renderMathInElement(results, {
|
||||
delimiters: [
|
||||
{ left: '$$', right: '$$', display: false },
|
||||
{ left: '$', right: '$', display: false },
|
||||
],
|
||||
throwOnError: false
|
||||
})
|
||||
}
|
||||
|
||||
const anchors = [...document.getElementsByClassName("result-card")]
|
||||
anchors.forEach((anchor) => {
|
||||
anchor.onclick = () => redir(anchor.id, term)
|
||||
})
|
||||
}
|
||||
}
|
170
assets/quartz/styles/_callouts.scss
Normal file
170
assets/quartz/styles/_callouts.scss
Normal file
@ -0,0 +1,170 @@
|
||||
:root {
|
||||
--callout-summary: #00b0ff;
|
||||
--callout-summary-accent: #7fd7ff;
|
||||
--callout-bug: #f50057;
|
||||
--callout-bug-accent: #ff7aa9;
|
||||
--callout-danger: #ff1744;
|
||||
--callout-danger-accent: #ff8aa1;
|
||||
--callout-example: #7c4dff;
|
||||
--callout-example-accent: #bda5ff;
|
||||
--callout-fail: #ff5252;
|
||||
--callout-fail-accent: #ffa8a8;
|
||||
--callout-info: #00b8d4;
|
||||
--callout-info-accent: #69ebff;
|
||||
--callout-note: #448aff;
|
||||
--callout-note-accent: #a1c4ff;
|
||||
--callout-question: #64dd17;
|
||||
--callout-question-accent: #b0f286;
|
||||
--callout-quote: #9e9e9e;
|
||||
--callout-quote-accent: #cecece;
|
||||
--callout-done: #00c853;
|
||||
--callout-done-accent: #63ffa4;
|
||||
--callout-important: #00bfa5;
|
||||
--callout-important-accent: #5fffe9;
|
||||
--callout-warning: #ff9100;
|
||||
--callout-warning-accent: #ffc87f;
|
||||
}
|
||||
|
||||
[saved-theme=dark] {
|
||||
--callout-summary: #00b0ff !important;
|
||||
--callout-summary-accent: #00587f !important;
|
||||
--callout-bug: #f50057 !important;
|
||||
--callout-bug-accent: #7a002b !important;
|
||||
--callout-danger: #ff1744 !important;
|
||||
--callout-danger-accent: #8b001a !important;
|
||||
--callout-example: #7c4dff !important;
|
||||
--callout-example-accent: #2b00a6 !important;
|
||||
--callout-fail: #ff5252 !important;
|
||||
--callout-fail-accent: #a80000 !important;
|
||||
--callout-info: #00b8d4 !important;
|
||||
--callout-info-accent: #005c6a !important;
|
||||
--callout-note: #448aff !important;
|
||||
--callout-note-accent: #003ca1 !important;
|
||||
--callout-question: #64dd17 !important;
|
||||
--callout-question-accent: #006429 !important;
|
||||
--callout-quote: #9e9e9e !important;
|
||||
--callout-quote-accent: #4f4f4f !important;
|
||||
--callout-done: #00c853 !important;
|
||||
--callout-done-accent: #006429 !important;
|
||||
--callout-important: #00bfa5 !important;
|
||||
--callout-important-accent: #005f52 !important;
|
||||
--callout-warning: #ff9100 !important;
|
||||
--callout-warning-accent: #7f4800 !important;
|
||||
}
|
||||
|
||||
blockquote.callout-collapsible {
|
||||
cursor: pointer;
|
||||
|
||||
&.callout-collapsible::after {
|
||||
content: '-';
|
||||
right: 6px;
|
||||
font-weight: bolder;
|
||||
font-family: Courier New, Courier, monospace;
|
||||
}
|
||||
}
|
||||
|
||||
blockquote.callout-collapsed {
|
||||
& > p { border-bottom-right-radius: 5px !important; }
|
||||
padding-bottom: 0 !important;
|
||||
&::after {
|
||||
content: '+' !important;
|
||||
}
|
||||
& > *:not(:first-child) {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
blockquote[class*="-callout"] {
|
||||
margin-right: 0;
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
padding-left: 0 !important;
|
||||
padding-bottom: 0.25em;
|
||||
color: var(--dark);
|
||||
background-color: var(--lightgray);
|
||||
border-left: 6px solid var(--primary) !important;
|
||||
& > p {
|
||||
border-top-right-radius: 5px;
|
||||
padding: 0.5em 1em;
|
||||
margin: 0;
|
||||
color: var(--gray);
|
||||
&:first-child {
|
||||
font-weight: 600;
|
||||
color: var(--dark);
|
||||
padding: 0.4em 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
blockquote[class*="-callout"] > p:first-child::after, blockquote.callout-collapsible::after {
|
||||
display: inline-block;
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
position: absolute;
|
||||
top: 0.4em;
|
||||
margin: 0.2em 0.4em;
|
||||
}
|
||||
|
||||
blockquote[class*="-callout"] > p:first-child {
|
||||
font-weight: bold;
|
||||
padding: 0.4em 35px;
|
||||
|
||||
&::after {
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
$summary: summary, abstract, tldr;
|
||||
$bug: bug;
|
||||
$danger: danger, error;
|
||||
$example: example;
|
||||
$fail: fail, failure, missing;
|
||||
$info: info, todo;
|
||||
$note: note;
|
||||
$question: question, help, faq;
|
||||
$quote: quote, cite;
|
||||
$done: done, success, check;
|
||||
$important: important, tip, hint;
|
||||
$warning: warning, caution, attention;
|
||||
$types: $summary, $bug, $danger, $example, $fail, $info, $note, $question, $quote, $done, $important, $warning;
|
||||
$svgs: ();
|
||||
$svgs: map-merge($svgs, ($summary: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='book' class='svg-inline--callout-fa fa-book fa-w-14' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($bug: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='bug' class='svg-inline--callout-fa fa-bug fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($danger: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='bolt' class='svg-inline--callout-fa fa-bolt fa-w-10' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath fill='currentColor' d='M296 160H180.6l42.6-129.8C227.2 15 215.7 0 200 0H56C44 0 33.8 8.9 32.2 20.8l-32 240C-1.7 275.2 9.5 288 24 288h118.7L96.6 482.5c-3.6 15.2 8 29.5 23.3 29.5 8.4 0 16.4-4.4 20.8-12l176-304c9.3-15.9-2.2-36-20.7-36z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($example: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='list-ol' class='svg-inline--callout-fa fa-list-ol fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22.83a157.41 157.41 0 0 0-11 12.31l-5.61 7c-4 5.07-5.25 10.13-2.8 14.88l1.05 1.93c3 5.76 6.29 7.88 12.25 7.88h4.73c10.33 0 15.94 2.44 15.94 9.09 0 4.72-4.2 8.22-14.36 8.22a41.54 41.54 0 0 1-15.47-3.12c-6.49-3.88-11.74-3.5-15.6 3.12l-5.59 9.31c-3.72 6.13-3.19 11.72 2.63 15.94 7.71 4.69 20.38 9.44 37 9.44 34.16 0 48.5-22.75 48.5-44.12-.03-14.38-9.12-29.76-28.73-34.88zM496 224H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM16 160h64a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H64V40a8 8 0 0 0-8-8H32a8 8 0 0 0-7.14 4.42l-8 16A8 8 0 0 0 24 64h8v64H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8zm-3.91 160H80a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H41.32c3.29-10.29 48.34-18.68 48.34-56.44 0-29.06-25-39.56-44.47-39.56-21.36 0-33.8 10-40.46 18.75-4.37 5.59-3 10.84 2.8 15.37l8.58 6.88c5.61 4.56 11 2.47 16.12-2.44a13.44 13.44 0 0 1 9.46-3.84c3.33 0 9.28 1.56 9.28 8.75C51 248.19 0 257.31 0 304.59v4C0 316 5.08 320 12.09 320z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($fail: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='times-circle' class='svg-inline--callout-fa fa-times-circle fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($info: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='info-circle' class='svg-inline--callout-fa fa-info-circle fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($note: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='pencil-alt' class='svg-inline--callout-fa fa-pencil-alt fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($question: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='question-circle' class='svg-inline--callout-fa fa-question-circle fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($quote: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='quote-right' class='svg-inline--callout-fa fa-quote-right fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($done: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='check-circle' class='svg-inline--callout-fa fa-check-circle fa-w-16' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($important: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='fire' class='svg-inline--callout-fa fa-fire fa-w-12' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='currentColor' d='M216 23.86c0-23.8-30.65-32.77-44.15-13.04C48 191.85 224 200 224 288c0 35.63-29.11 64.46-64.85 63.99-35.17-.45-63.15-29.77-63.15-64.94v-85.51c0-21.7-26.47-32.23-41.43-16.5C27.8 213.16 0 261.33 0 320c0 105.87 86.13 192 192 192s192-86.13 192-192c0-170.29-168-193-168-296.14z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
$svgs: map-merge($svgs, ($warning: url("data:image/svg+xml,%3Csvg aria-hidden='true' focusable='false' data-icon='exclamation-triangle' class='svg-inline--callout-fa fa-exclamation-triangle fa-w-18' role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath fill='currentColor' d='M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z'%3E%3C/path%3E%3C/svg%3E")));
|
||||
|
||||
@function getstr($l) {
|
||||
$v: nth($l, 1);
|
||||
@return $v;
|
||||
}
|
||||
|
||||
@each $type in $types {
|
||||
@each $s in $type {
|
||||
blockquote.#{$s}-callout {
|
||||
border-left: 6px solid var(--callout-#{getstr($type)}) !important;
|
||||
& > p:first-child {
|
||||
background-color: var(--callout-#{getstr($type)}-accent) !important;
|
||||
&::after {
|
||||
content: '';
|
||||
-webkit-mask: map-get($svgs, $type);
|
||||
mask: map-get($svgs, $type);
|
||||
background-color: var(--callout-#{getstr($type)}) !important;
|
||||
-webkit-mask-size: contain;
|
||||
mask-size: contain;
|
||||
-webkit-mask-repeat: no-repeat;
|
||||
mask-repeat: no-repeat;
|
||||
-webkit-mask-position: center;
|
||||
mask-position: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
85
assets/quartz/styles/_dark_syntax.scss
Normal file
85
assets/quartz/styles/_dark_syntax.scss
Normal file
@ -0,0 +1,85 @@
|
||||
/* Background */ .bg { color: #f8f8f2; background-color: #282a36; }
|
||||
/* PreWrapper */ .chroma { color: #f8f8f2; background-color: #282a36; }
|
||||
/* Other */ .chroma .x { }
|
||||
/* Error */ .chroma .err { }
|
||||
/* CodeLine */ .chroma .cl { }
|
||||
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
|
||||
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
|
||||
/* LineHighlight */ .chroma .hl { background-color: #ffffcc }
|
||||
/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||
/* LineNumbers */ .chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||
/* Line */ .chroma .line { display: flex; }
|
||||
/* Keyword */ .chroma .k { color: #ff79c6 }
|
||||
/* KeywordConstant */ .chroma .kc { color: #ff79c6 }
|
||||
/* KeywordDeclaration */ .chroma .kd { color: #8be9fd; font-style: italic }
|
||||
/* KeywordNamespace */ .chroma .kn { color: #ff79c6 }
|
||||
/* KeywordPseudo */ .chroma .kp { color: #ff79c6 }
|
||||
/* KeywordReserved */ .chroma .kr { color: #ff79c6 }
|
||||
/* KeywordType */ .chroma .kt { color: #8be9fd }
|
||||
/* Name */ .chroma .n { }
|
||||
/* NameAttribute */ .chroma .na { color: #50fa7b }
|
||||
/* NameBuiltin */ .chroma .nb { color: #8be9fd; font-style: italic }
|
||||
/* NameBuiltinPseudo */ .chroma .bp { }
|
||||
/* NameClass */ .chroma .nc { color: #50fa7b }
|
||||
/* NameConstant */ .chroma .no { }
|
||||
/* NameDecorator */ .chroma .nd { }
|
||||
/* NameEntity */ .chroma .ni { }
|
||||
/* NameException */ .chroma .ne { }
|
||||
/* NameFunction */ .chroma .nf { color: #50fa7b }
|
||||
/* NameFunctionMagic */ .chroma .fm { }
|
||||
/* NameLabel */ .chroma .nl { color: #8be9fd; font-style: italic }
|
||||
/* NameNamespace */ .chroma .nn { }
|
||||
/* NameOther */ .chroma .nx { }
|
||||
/* NameProperty */ .chroma .py { }
|
||||
/* NameTag */ .chroma .nt { color: #ff79c6 }
|
||||
/* NameVariable */ .chroma .nv { color: #8be9fd; font-style: italic }
|
||||
/* NameVariableClass */ .chroma .vc { color: #8be9fd; font-style: italic }
|
||||
/* NameVariableGlobal */ .chroma .vg { color: #8be9fd; font-style: italic }
|
||||
/* NameVariableInstance */ .chroma .vi { color: #8be9fd; font-style: italic }
|
||||
/* NameVariableMagic */ .chroma .vm { }
|
||||
/* Literal */ .chroma .l { }
|
||||
/* LiteralDate */ .chroma .ld { }
|
||||
/* LiteralString */ .chroma .s { color: #f1fa8c }
|
||||
/* LiteralStringAffix */ .chroma .sa { color: #f1fa8c }
|
||||
/* LiteralStringBacktick */ .chroma .sb { color: #f1fa8c }
|
||||
/* LiteralStringChar */ .chroma .sc { color: #f1fa8c }
|
||||
/* LiteralStringDelimiter */ .chroma .dl { color: #f1fa8c }
|
||||
/* LiteralStringDoc */ .chroma .sd { color: #f1fa8c }
|
||||
/* LiteralStringDouble */ .chroma .s2 { color: #f1fa8c }
|
||||
/* LiteralStringEscape */ .chroma .se { color: #f1fa8c }
|
||||
/* LiteralStringHeredoc */ .chroma .sh { color: #f1fa8c }
|
||||
/* LiteralStringInterpol */ .chroma .si { color: #f1fa8c }
|
||||
/* LiteralStringOther */ .chroma .sx { color: #f1fa8c }
|
||||
/* LiteralStringRegex */ .chroma .sr { color: #f1fa8c }
|
||||
/* LiteralStringSingle */ .chroma .s1 { color: #f1fa8c }
|
||||
/* LiteralStringSymbol */ .chroma .ss { color: #f1fa8c }
|
||||
/* LiteralNumber */ .chroma .m { color: #bd93f9 }
|
||||
/* LiteralNumberBin */ .chroma .mb { color: #bd93f9 }
|
||||
/* LiteralNumberFloat */ .chroma .mf { color: #bd93f9 }
|
||||
/* LiteralNumberHex */ .chroma .mh { color: #bd93f9 }
|
||||
/* LiteralNumberInteger */ .chroma .mi { color: #bd93f9 }
|
||||
/* LiteralNumberIntegerLong */ .chroma .il { color: #bd93f9 }
|
||||
/* LiteralNumberOct */ .chroma .mo { color: #bd93f9 }
|
||||
/* Operator */ .chroma .o { color: #ff79c6 }
|
||||
/* OperatorWord */ .chroma .ow { color: #ff79c6 }
|
||||
/* Punctuation */ .chroma .p { }
|
||||
/* Comment */ .chroma .c { color: #6272a4 }
|
||||
/* CommentHashbang */ .chroma .ch { color: #6272a4 }
|
||||
/* CommentMultiline */ .chroma .cm { color: #6272a4 }
|
||||
/* CommentSingle */ .chroma .c1 { color: #6272a4 }
|
||||
/* CommentSpecial */ .chroma .cs { color: #6272a4 }
|
||||
/* CommentPreproc */ .chroma .cp { color: #ff79c6 }
|
||||
/* CommentPreprocFile */ .chroma .cpf { color: #ff79c6 }
|
||||
/* Generic */ .chroma .g { }
|
||||
/* GenericDeleted */ .chroma .gd { color: #ff5555 }
|
||||
/* GenericEmph */ .chroma .ge { text-decoration: underline }
|
||||
/* GenericError */ .chroma .gr { }
|
||||
/* GenericHeading */ .chroma .gh { font-weight: bold }
|
||||
/* GenericInserted */ .chroma .gi { color: #50fa7b; font-weight: bold }
|
||||
/* GenericOutput */ .chroma .go { color: #44475a }
|
||||
/* GenericPrompt */ .chroma .gp { }
|
||||
/* GenericStrong */ .chroma .gs { }
|
||||
/* GenericSubheading */ .chroma .gu { font-weight: bold }
|
||||
/* GenericTraceback */ .chroma .gt { }
|
||||
/* GenericUnderline */ .chroma .gl { text-decoration: underline }
|
||||
/* TextWhitespace */ .chroma .w { }
|
85
assets/quartz/styles/_light_syntax.scss
Normal file
85
assets/quartz/styles/_light_syntax.scss
Normal file
@ -0,0 +1,85 @@
|
||||
/* Background */ .bg { color: #272822; background-color: #fafafa; }
|
||||
/* PreWrapper */ .chroma { color: #272822; background-color: #fafafa; }
|
||||
/* Other */ .chroma .x { }
|
||||
/* Error */ .chroma .err { }
|
||||
/* CodeLine */ .chroma .cl { }
|
||||
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
|
||||
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
|
||||
/* LineHighlight */ .chroma .hl { background-color: #ffffcc }
|
||||
/* LineNumbersTable */ .chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||
/* LineNumbers */ .chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
|
||||
/* Line */ .chroma .line { display: flex; }
|
||||
/* Keyword */ .chroma .k { color: #00a8c8 }
|
||||
/* KeywordConstant */ .chroma .kc { color: #00a8c8 }
|
||||
/* KeywordDeclaration */ .chroma .kd { color: #00a8c8 }
|
||||
/* KeywordNamespace */ .chroma .kn { color: #f92672 }
|
||||
/* KeywordPseudo */ .chroma .kp { color: #00a8c8 }
|
||||
/* KeywordReserved */ .chroma .kr { color: #00a8c8 }
|
||||
/* KeywordType */ .chroma .kt { color: #00a8c8 }
|
||||
/* Name */ .chroma .n { color: #111111 }
|
||||
/* NameAttribute */ .chroma .na { color: #75af00 }
|
||||
/* NameBuiltin */ .chroma .nb { color: #111111 }
|
||||
/* NameBuiltinPseudo */ .chroma .bp { color: #111111 }
|
||||
/* NameClass */ .chroma .nc { color: #75af00 }
|
||||
/* NameConstant */ .chroma .no { color: #00a8c8 }
|
||||
/* NameDecorator */ .chroma .nd { color: #75af00 }
|
||||
/* NameEntity */ .chroma .ni { color: #111111 }
|
||||
/* NameException */ .chroma .ne { color: #75af00 }
|
||||
/* NameFunction */ .chroma .nf { color: #75af00 }
|
||||
/* NameFunctionMagic */ .chroma .fm { color: #111111 }
|
||||
/* NameLabel */ .chroma .nl { color: #111111 }
|
||||
/* NameNamespace */ .chroma .nn { color: #111111 }
|
||||
/* NameOther */ .chroma .nx { color: #75af00 }
|
||||
/* NameProperty */ .chroma .py { color: #111111 }
|
||||
/* NameTag */ .chroma .nt { color: #f92672 }
|
||||
/* NameVariable */ .chroma .nv { color: #111111 }
|
||||
/* NameVariableClass */ .chroma .vc { color: #111111 }
|
||||
/* NameVariableGlobal */ .chroma .vg { color: #111111 }
|
||||
/* NameVariableInstance */ .chroma .vi { color: #111111 }
|
||||
/* NameVariableMagic */ .chroma .vm { color: #111111 }
|
||||
/* Literal */ .chroma .l { color: #ae81ff }
|
||||
/* LiteralDate */ .chroma .ld { color: #d88200 }
|
||||
/* LiteralString */ .chroma .s { color: #d88200 }
|
||||
/* LiteralStringAffix */ .chroma .sa { color: #d88200 }
|
||||
/* LiteralStringBacktick */ .chroma .sb { color: #d88200 }
|
||||
/* LiteralStringChar */ .chroma .sc { color: #d88200 }
|
||||
/* LiteralStringDelimiter */ .chroma .dl { color: #d88200 }
|
||||
/* LiteralStringDoc */ .chroma .sd { color: #d88200 }
|
||||
/* LiteralStringDouble */ .chroma .s2 { color: #d88200 }
|
||||
/* LiteralStringEscape */ .chroma .se { color: #8045ff }
|
||||
/* LiteralStringHeredoc */ .chroma .sh { color: #d88200 }
|
||||
/* LiteralStringInterpol */ .chroma .si { color: #d88200 }
|
||||
/* LiteralStringOther */ .chroma .sx { color: #d88200 }
|
||||
/* LiteralStringRegex */ .chroma .sr { color: #d88200 }
|
||||
/* LiteralStringSingle */ .chroma .s1 { color: #d88200 }
|
||||
/* LiteralStringSymbol */ .chroma .ss { color: #d88200 }
|
||||
/* LiteralNumber */ .chroma .m { color: #ae81ff }
|
||||
/* LiteralNumberBin */ .chroma .mb { color: #ae81ff }
|
||||
/* LiteralNumberFloat */ .chroma .mf { color: #ae81ff }
|
||||
/* LiteralNumberHex */ .chroma .mh { color: #ae81ff }
|
||||
/* LiteralNumberInteger */ .chroma .mi { color: #ae81ff }
|
||||
/* LiteralNumberIntegerLong */ .chroma .il { color: #ae81ff }
|
||||
/* LiteralNumberOct */ .chroma .mo { color: #ae81ff }
|
||||
/* Operator */ .chroma .o { color: #f92672 }
|
||||
/* OperatorWord */ .chroma .ow { color: #f92672 }
|
||||
/* Punctuation */ .chroma .p { color: #111111 }
|
||||
/* Comment */ .chroma .c { color: #75715e }
|
||||
/* CommentHashbang */ .chroma .ch { color: #75715e }
|
||||
/* CommentMultiline */ .chroma .cm { color: #75715e }
|
||||
/* CommentSingle */ .chroma .c1 { color: #75715e }
|
||||
/* CommentSpecial */ .chroma .cs { color: #75715e }
|
||||
/* CommentPreproc */ .chroma .cp { color: #75715e }
|
||||
/* CommentPreprocFile */ .chroma .cpf { color: #75715e }
|
||||
/* Generic */ .chroma .g { }
|
||||
/* GenericDeleted */ .chroma .gd { }
|
||||
/* GenericEmph */ .chroma .ge { font-style: italic }
|
||||
/* GenericError */ .chroma .gr { }
|
||||
/* GenericHeading */ .chroma .gh { }
|
||||
/* GenericInserted */ .chroma .gi { }
|
||||
/* GenericOutput */ .chroma .go { }
|
||||
/* GenericPrompt */ .chroma .gp { }
|
||||
/* GenericStrong */ .chroma .gs { font-weight: bold }
|
||||
/* GenericSubheading */ .chroma .gu { }
|
||||
/* GenericTraceback */ .chroma .gt { }
|
||||
/* GenericUnderline */ .chroma .gl { }
|
||||
/* TextWhitespace */ .chroma .w { }
|
623
assets/quartz/styles/base.scss
Normal file
623
assets/quartz/styles/base.scss
Normal file
@ -0,0 +1,623 @@
|
||||
// Replace this with your own font imports!
|
||||
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&family=Inter:wght@400;600;700&family=Source+Sans+Pro:wght@400;600&display=swap');
|
||||
:root {
|
||||
--font-body: "Source Sans Pro";
|
||||
--font-header: "Inter";
|
||||
--font-mono: "Fira Code"
|
||||
}
|
||||
|
||||
// typography
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
&:lang(ar) {
|
||||
& p, & h1, & h2, & h3, article, header {
|
||||
direction: rtl;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
& footer > p {
|
||||
text-align: center !important;
|
||||
}
|
||||
}
|
||||
|
||||
.singlePage {
|
||||
padding: 4em 30vw;
|
||||
@media all and (max-width: 1200px) {
|
||||
padding: 25px 5vw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: var(--light);
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6, thead {
|
||||
font-family: var(--font-header);
|
||||
color: var(--dark);
|
||||
font-weight: revert;
|
||||
margin: 2rem 0 0;
|
||||
padding: 2rem auto 1rem;
|
||||
|
||||
&:hover > .hanchor {
|
||||
color: var(--secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.hanchor {
|
||||
font-family: var(--font-header);
|
||||
opacity: 0.8;
|
||||
transition: color 0.3s ease;
|
||||
color: var(--dark);
|
||||
}
|
||||
|
||||
p, ul, text, a, tr, td, li, ol, ul {
|
||||
font-family: var(--font-body);
|
||||
color: var(--gray);
|
||||
fill: var(--gray);
|
||||
font-weight: revert;
|
||||
margin: revert;
|
||||
padding: revert;
|
||||
}
|
||||
|
||||
tbody, li, p {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
.mainTOC {
|
||||
border-radius: 5px;
|
||||
padding: 0.75em 0;
|
||||
|
||||
& details {
|
||||
& summary {
|
||||
cursor: zoom-in;
|
||||
font-family: var(--font-header);
|
||||
color: var(--dark);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
&[open] summary {
|
||||
cursor: zoom-out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#TableOfContents > ol {
|
||||
counter-reset: section;
|
||||
margin-left: 0;
|
||||
padding-left: 1.5em;
|
||||
& > li {
|
||||
counter-increment: section;
|
||||
& > ol {
|
||||
counter-reset: subsection;
|
||||
& > li {
|
||||
counter-increment: subsection;
|
||||
&::marker {
|
||||
content: counter(section) "." counter(subsection) " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > li::marker {
|
||||
content: counter(section) " ";
|
||||
}
|
||||
|
||||
& > li::marker, & > li > ol > li::marker {
|
||||
font-family: var(--font-body);
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
border: 1px solid var(--outlinegray);
|
||||
width: 100%;
|
||||
padding: 1.5em;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
td, th {
|
||||
padding: 0.2em 1em;
|
||||
border: 1px solid var(--outlinegray);
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
border-radius: 3px;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
p > img + em {
|
||||
display: block;
|
||||
transform: translateY(-1em);
|
||||
}
|
||||
|
||||
sup {
|
||||
line-height: 0
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
border-left: 3px solid var(--secondary);
|
||||
padding-left: 1em;
|
||||
transition: border-color 0.2s ease;
|
||||
}
|
||||
|
||||
.footnotes p {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
display: flex;
|
||||
margin-top: 2em;
|
||||
gap: 1.5em;
|
||||
justify-content: center;
|
||||
|
||||
.disabled {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
& > li {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
|
||||
& a {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
& a[href$="#"], &.active a {
|
||||
opacity: 0.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
article {
|
||||
& > h1 {
|
||||
margin-top: 2em;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
& > .meta {
|
||||
margin: 0 0 1em 0;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
& a {
|
||||
font-weight: 600;
|
||||
|
||||
&.internal-link {
|
||||
text-decoration: none;
|
||||
background-color: transparentize(#8f9fa9, 0.85);
|
||||
padding: 0 0.1em;
|
||||
margin: auto -0.1em;
|
||||
border-radius: 3px;
|
||||
|
||||
&.broken {
|
||||
opacity: 0.5;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& p {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
}
|
||||
|
||||
.tags {
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
|
||||
& .meta {
|
||||
margin: 1.5em 0;
|
||||
& > h1 {
|
||||
margin: 0;
|
||||
}
|
||||
& > p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
& > li {
|
||||
display: inline-block;
|
||||
margin: 0.4em 0.2em;
|
||||
}
|
||||
|
||||
& > li > a {
|
||||
border-radius: 8px;
|
||||
border: var(--outlinegray) 1px solid;
|
||||
padding: 0.2em 0.5em;
|
||||
&::before {
|
||||
content: "#";
|
||||
margin-right: 0.3em;
|
||||
color: var(--outlinegray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.backlinks a {
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
sup > a {
|
||||
text-decoration: none;
|
||||
padding: 0 0.1em 0 0.2em;
|
||||
}
|
||||
|
||||
#page-title {
|
||||
margin: 0;
|
||||
& > a {
|
||||
font-family: var(--font-header);
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
font-size: 1em;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease;
|
||||
color: var(--secondary);
|
||||
&:hover {
|
||||
color: var(--tertiary) !important;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: var(--font-mono);
|
||||
padding: 0.75em;
|
||||
border-radius: 3px;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.85em;
|
||||
padding: 0.15em 0.3em;
|
||||
border-radius: 5px;
|
||||
background: var(--lightgray);
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
0% {opacity:0;}
|
||||
100% {opacity:1;}
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-top: 4em;
|
||||
text-align: center;
|
||||
& ul {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
hr {
|
||||
width: 100%;
|
||||
margin: 2em auto;
|
||||
height: 1px;
|
||||
border: none;
|
||||
background-color: var(--outlinegray);
|
||||
}
|
||||
|
||||
.page-end {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 2em;
|
||||
|
||||
@media all and (max-width: 780px) {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
& > * {
|
||||
flex: 1 0 0;
|
||||
}
|
||||
|
||||
& > .backlinks-container {
|
||||
& > ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
& > li {
|
||||
margin: 0.5em 0;
|
||||
padding: 0.25em 1em;
|
||||
border: var(--outlinegray) 1px solid;
|
||||
border-radius: 5px
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& #graph-container {
|
||||
border: var(--outlinegray) 1px solid;
|
||||
border-radius: 5px;
|
||||
box-sizing: border-box;
|
||||
min-height: 250px;
|
||||
margin: 0.5em 0;
|
||||
|
||||
& > svg {
|
||||
margin-bottom: -5px;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.centered {
|
||||
margin-top: 30vh;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
header, .menu-search {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
margin: 2em 1em 2em;
|
||||
|
||||
& > h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
& > nav {
|
||||
@media all and (max-width: 600px) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
#search-icon {
|
||||
background-color: var(--lightgray);
|
||||
border-radius: 4px;
|
||||
height: 2em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
& > p {
|
||||
display: inline;
|
||||
padding: 0 1.5em 0 2em;
|
||||
}
|
||||
}
|
||||
|
||||
& svg {
|
||||
cursor: pointer;
|
||||
width: 18px;
|
||||
min-width: 18px;
|
||||
margin: 0 0.5em;
|
||||
|
||||
&:hover .search-path {
|
||||
stroke: var(--tertiary);
|
||||
}
|
||||
|
||||
.search-path {
|
||||
stroke: var(--gray);
|
||||
stroke-width: 2px;
|
||||
transition: stroke 0.5s ease;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#search-container {
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
height: 100%;
|
||||
overflow: scroll;
|
||||
display: none;
|
||||
backdrop-filter: blur(4px);
|
||||
-webkit-backdrop-filter: blur(4px);
|
||||
|
||||
& > div {
|
||||
width: 50%;
|
||||
margin-top: 15vh;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
@media all and (max-width: 1200px) {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
& > * {
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
background: var(--light);
|
||||
box-shadow: 0 14px 50px rgba(27, 33, 48, 0.12), 0 10px 30px rgba(27, 33, 48, 0.16);
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
& > input {
|
||||
box-sizing: border-box;
|
||||
padding: 0.5em 1em;
|
||||
font-family: var(--font-body);
|
||||
color: var(--dark);
|
||||
font-size: 1.1em;
|
||||
border: 1px solid var(--outlinegray);
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
& > #results-container {
|
||||
& .result-card {
|
||||
padding: 1em;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s ease;
|
||||
border: 1px solid var(--outlinegray);
|
||||
border-bottom: none;
|
||||
width: 100%;
|
||||
|
||||
// normalize button props
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
text-transform: none;
|
||||
text-align: left;
|
||||
background: var(--light);
|
||||
outline: none;
|
||||
|
||||
&:hover, &:focus {
|
||||
background: rgba(180, 180, 180, 0.15);
|
||||
}
|
||||
|
||||
&:first-of-type {
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
border-bottom: 1px solid var(--outlinegray);
|
||||
}
|
||||
|
||||
& > h3, & > p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-highlight {
|
||||
background-color: #afbfc966;
|
||||
padding: 0.05em 0.2em;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.section-ul {
|
||||
list-style: none;
|
||||
margin-top: 2em;
|
||||
padding-left: 0;
|
||||
|
||||
}
|
||||
|
||||
.section-li {
|
||||
margin-bottom: 1em;
|
||||
|
||||
& > .section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@media all and (max-width: 600px) {
|
||||
& .tags {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
& h3 > a {
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
& p {
|
||||
margin: 0;
|
||||
padding-right: 1em;
|
||||
flex-basis: 6em;
|
||||
}
|
||||
}
|
||||
|
||||
& h3 {
|
||||
opacity: 1;
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
& .meta {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes dropin {
|
||||
0% {
|
||||
display: none;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
1% {
|
||||
display: inline-block;
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.popover {
|
||||
z-index: 999;
|
||||
position: absolute;
|
||||
width: 20rem;
|
||||
display: none;
|
||||
background-color: var(--light);
|
||||
padding: 1rem;
|
||||
margin: 1rem;
|
||||
border: 1px solid var(--outlinegray);
|
||||
border-radius: 5px;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||
user-select: none;
|
||||
overflow-wrap: anywhere;
|
||||
box-shadow: 6px 6px 36px 0 rgba(0,0,0,0.25);
|
||||
|
||||
@media all and (max-width: 600px) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
&.visible {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
display: inline-block;
|
||||
animation: dropin 0.2s ease;
|
||||
}
|
||||
|
||||
& > h3 {
|
||||
font-size: 1rem;
|
||||
margin: 0.25rem 0;
|
||||
}
|
||||
|
||||
& .meta {
|
||||
margin-top: 0.25rem;
|
||||
opacity: 0.5;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
& > p {
|
||||
margin: 0;
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
& > p, & > a {
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
|
||||
#contact_buttons ul {
|
||||
list-style-type: none;
|
||||
|
||||
li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
li a {
|
||||
padding: 0 1em;
|
||||
}
|
||||
}
|
||||
|
||||
mark {
|
||||
background-color: var(--highlighted);
|
||||
color: var(--gray);
|
||||
}
|
47
assets/quartz/styles/clipboard.scss
Normal file
47
assets/quartz/styles/clipboard.scss
Normal file
@ -0,0 +1,47 @@
|
||||
.clipboard-button {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
float: right;
|
||||
right: 0;
|
||||
padding: 0.69em;
|
||||
margin: 0.5em;
|
||||
color: var(--outlinegray);
|
||||
border-color: var(--dark);
|
||||
background-color: var(--lightgray);
|
||||
filter: contrast(1.1);
|
||||
border: 2px solid;
|
||||
border-radius: 6px;
|
||||
font-size: 0.8em;
|
||||
z-index: 1;
|
||||
opacity: 0;
|
||||
transition: 0.12s;
|
||||
|
||||
& > svg {
|
||||
fill: var(--light);
|
||||
filter: contrast(0.3);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
border-color: var(--primary);
|
||||
|
||||
& > svg {
|
||||
fill: var(--primary);
|
||||
}
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.highlight {
|
||||
position: relative;
|
||||
|
||||
&:hover > .clipboard-button {
|
||||
opacity: 1;
|
||||
transition: 0.2s;
|
||||
}
|
||||
}
|
||||
|
||||
|
20
assets/quartz/styles/code-title.scss
Normal file
20
assets/quartz/styles/code-title.scss
Normal file
@ -0,0 +1,20 @@
|
||||
.code-title {
|
||||
color: var(--primary) ;
|
||||
font-family: var(--font-mono);
|
||||
width: max-content;
|
||||
overflow-x: auto;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
font-weight: normal;
|
||||
line-height: 1em;
|
||||
position: relative;
|
||||
padding: 0.5em 0.6em 0.6em; // + 1.2 em
|
||||
max-width: calc(100% - 1.2em); // (-1.2 em) fits article width exactly
|
||||
margin-bottom: -0.2em;
|
||||
z-index: -1;
|
||||
border-top-left-radius: 0.3em;
|
||||
border-top-right-radius: 0.3em;
|
||||
font-size: 0.9em;
|
||||
background-color: var(--lightgray);
|
||||
filter: hue-rotate(-30deg) contrast(1.0) opacity(0.8);
|
||||
}
|
31
assets/quartz/styles/custom.scss
Normal file
31
assets/quartz/styles/custom.scss
Normal file
@ -0,0 +1,31 @@
|
||||
// Add your own CSS here!
|
||||
|
||||
:root {
|
||||
--light: #faf8f8;
|
||||
--dark: #141021;
|
||||
--secondary: #284b63;
|
||||
--tertiary: #84a59d;
|
||||
--visited: #afbfc9;
|
||||
--primary: #f28482;
|
||||
--gray: #4e4e4e;
|
||||
--lightgray: #f0f0f0;
|
||||
--outlinegray: #dadada;
|
||||
--million-progress-bar-color: var(--secondary);
|
||||
--highlighted: #f5dfaf88;
|
||||
}
|
||||
|
||||
[saved-theme="dark"] {
|
||||
--light: #1e1e21 !important;
|
||||
--dark: #fbfffe !important;
|
||||
--secondary: #6b879a !important;
|
||||
--visited: #4a575e !important;
|
||||
--tertiary: #84a59d !important;
|
||||
--primary: #f58382 !important;
|
||||
--gray: #d4d4d4 !important;
|
||||
--lightgray: #292633 !important;
|
||||
--outlinegray: #343434 !important;
|
||||
--highlighted: #574010;
|
||||
}
|
||||
|
||||
|
||||
|
44
assets/quartz/styles/darkmode.scss
Normal file
44
assets/quartz/styles/darkmode.scss
Normal file
@ -0,0 +1,44 @@
|
||||
.darkmode {
|
||||
float: right;
|
||||
// padding: 1em;
|
||||
min-width: 30px;
|
||||
position: relative;
|
||||
|
||||
@media all and (max-width: 450px) {
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
& > .toggle {
|
||||
display: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
& svg {
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
top: calc(50% - 10px);
|
||||
margin: 0 7px;
|
||||
fill: var(--gray);
|
||||
transition: opacity 0.1s ease;
|
||||
}
|
||||
}
|
||||
|
||||
.toggle:checked ~ label {
|
||||
& > #dayIcon {
|
||||
opacity: 0;
|
||||
}
|
||||
& > #nightIcon {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.toggle:not(:checked) ~ label {
|
||||
& > #dayIcon {
|
||||
opacity: 1;
|
||||
}
|
||||
& > #nightIcon {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
66
assets/quartz/styles/syntax.scss
Normal file
66
assets/quartz/styles/syntax.scss
Normal file
@ -0,0 +1,66 @@
|
||||
// Overrides
|
||||
/* Background */
|
||||
.chroma {
|
||||
overflow: hidden !important;
|
||||
background-color: var(--lightgray) !important;
|
||||
}
|
||||
|
||||
/* LineTable */
|
||||
.chroma .lntable {
|
||||
width: auto !important;
|
||||
overflow: auto !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
/* LineHighlight */
|
||||
.chroma .hl {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* LineNumbersTable */
|
||||
.chroma .lnt {
|
||||
margin-right: 0.0em !important;
|
||||
padding: 0 0.0em 0 0.0em !important;
|
||||
}
|
||||
|
||||
/* LineNumbers */
|
||||
.chroma .ln {
|
||||
margin-right: 0.0em !important;
|
||||
padding: 0 0.0em 0 0.0em !important;
|
||||
}
|
||||
|
||||
/* GenericDeleted */
|
||||
.chroma .gd {
|
||||
color: #8b080b !important;
|
||||
}
|
||||
|
||||
/* GenericInserted */
|
||||
.chroma .gi {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.lntd:first-of-type > .chroma {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
.chroma code {
|
||||
font-family: var(--font-mono) !important;
|
||||
font-size: 0.85em !important;
|
||||
line-height: 2em !important;
|
||||
background: none !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.chroma {
|
||||
border-radius: 3px !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
pre.chroma {
|
||||
-moz-tab-size:4;-o-tab-size:4;tab-size:4;
|
||||
}
|
||||
|
||||
.katex {
|
||||
font-size: 1.1em !important;
|
||||
}
|
15
assets/search-data.json
Normal file
15
assets/search-data.json
Normal file
@ -0,0 +1,15 @@
|
||||
[
|
||||
{{- $pages := where .Site.Pages "Kind" "in" (slice "page" "section") -}}
|
||||
{{- $pages = where $pages "Params.booksearchexclude" "!=" true -}}
|
||||
{{- $pages = where $pages "Content" "not in" (slice nil "") -}}
|
||||
|
||||
{{ range $index, $page := $pages }}
|
||||
{{ if gt $index 0}},{{end}} {
|
||||
"id": {{ $index }},
|
||||
"href": "{{ $page.RelPermalink }}",
|
||||
"title": {{ (partial "docs/title" $page) | jsonify }},
|
||||
"section": {{ (partial "docs/title" $page.Parent) | jsonify }},
|
||||
"content": {{ $page.Plain | jsonify }}
|
||||
}
|
||||
{{- end -}}
|
||||
]
|
104
assets/search.js
Normal file
104
assets/search.js
Normal file
@ -0,0 +1,104 @@
|
||||
'use strict';
|
||||
|
||||
{{ $searchDataFile := printf "%s.search-data.json" .Language.Lang }}
|
||||
{{ $searchData := resources.Get "search-data.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify | resources.Fingerprint }}
|
||||
{{ $searchConfig := i18n "bookSearchConfig" | default "{}" }}
|
||||
|
||||
(function () {
|
||||
const searchDataURL = '{{ $searchData.RelPermalink }}';
|
||||
const indexConfig = Object.assign({{ $searchConfig }}, {
|
||||
doc: {
|
||||
id: 'id',
|
||||
field: ['title', 'content'],
|
||||
store: ['title', 'href', 'section']
|
||||
}
|
||||
});
|
||||
|
||||
const input = document.querySelector('#book-search-input');
|
||||
const results = document.querySelector('#book-search-results');
|
||||
|
||||
if (!input) {
|
||||
return
|
||||
}
|
||||
|
||||
input.addEventListener('focus', init);
|
||||
input.addEventListener('keyup', search);
|
||||
|
||||
document.addEventListener('keypress', focusSearchFieldOnKeyPress);
|
||||
|
||||
/**
|
||||
* @param {Event} event
|
||||
*/
|
||||
function focusSearchFieldOnKeyPress(event) {
|
||||
if (event.target.value !== undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (input === document.activeElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
const characterPressed = String.fromCharCode(event.charCode);
|
||||
if (!isHotkey(characterPressed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
input.focus();
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} character
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
function isHotkey(character) {
|
||||
const dataHotkeys = input.getAttribute('data-hotkeys') || '';
|
||||
return dataHotkeys.indexOf(character) >= 0;
|
||||
}
|
||||
|
||||
function init() {
|
||||
input.removeEventListener('focus', init); // init once
|
||||
input.required = true;
|
||||
|
||||
fetch(searchDataURL)
|
||||
.then(pages => pages.json())
|
||||
.then(pages => {
|
||||
window.bookSearchIndex = FlexSearch.create('balance', indexConfig);
|
||||
window.bookSearchIndex.add(pages);
|
||||
})
|
||||
.then(() => input.required = false)
|
||||
.then(search);
|
||||
}
|
||||
|
||||
function search() {
|
||||
while (results.firstChild) {
|
||||
results.removeChild(results.firstChild);
|
||||
}
|
||||
|
||||
if (!input.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
const searchHits = window.bookSearchIndex.search(input.value, 10);
|
||||
searchHits.forEach(function (page) {
|
||||
const li = element('<li><a href></a><small></small></li>');
|
||||
const a = li.querySelector('a'), small = li.querySelector('small');
|
||||
|
||||
a.href = page.href;
|
||||
a.textContent = page.title;
|
||||
small.textContent = page.section;
|
||||
|
||||
results.appendChild(li);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {String} content
|
||||
* @returns {Node}
|
||||
*/
|
||||
function element(content) {
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = content;
|
||||
return div.firstChild;
|
||||
}
|
||||
})();
|
7
assets/sw-register.js
Normal file
7
assets/sw-register.js
Normal file
@ -0,0 +1,7 @@
|
||||
{{- $swJS := resources.Get "sw.js" | resources.ExecuteAsTemplate "sw.js" . -}}
|
||||
if (navigator.serviceWorker) {
|
||||
navigator.serviceWorker.register(
|
||||
"{{ $swJS.RelPermalink }}",
|
||||
{ scope: "{{ "/" | relURL }}" }
|
||||
);
|
||||
}
|
55
assets/sw.js
Normal file
55
assets/sw.js
Normal file
@ -0,0 +1,55 @@
|
||||
const cacheName = self.location.pathname
|
||||
const pages = [
|
||||
{{ if eq .Site.Params.BookServiceWorker "precache" }}
|
||||
{{ range .Site.AllPages -}}
|
||||
"{{ .RelPermalink }}",
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
];
|
||||
|
||||
self.addEventListener("install", function (event) {
|
||||
self.skipWaiting();
|
||||
|
||||
caches.open(cacheName).then((cache) => {
|
||||
return cache.addAll(pages);
|
||||
});
|
||||
});
|
||||
|
||||
self.addEventListener("fetch", (event) => {
|
||||
const request = event.request;
|
||||
if (request.method !== "GET") {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Response} response
|
||||
* @returns {Promise<Response>}
|
||||
*/
|
||||
function saveToCache(response) {
|
||||
if (cacheable(response)) {
|
||||
return caches
|
||||
.open(cacheName)
|
||||
.then((cache) => cache.put(request, response.clone()))
|
||||
.then(() => response);
|
||||
} else {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Error} error
|
||||
*/
|
||||
function serveFromCache(error) {
|
||||
return caches.open(cacheName).then((cache) => cache.match(request.url));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Response} response
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
function cacheable(response) {
|
||||
return response.type === "basic" && response.ok && !response.headers.has("Content-Disposition")
|
||||
}
|
||||
|
||||
event.respondWith(fetch(request).then(saveToCache).catch(serveFromCache));
|
||||
});
|
143
config.yaml
Normal file
143
config.yaml
Normal file
@ -0,0 +1,143 @@
|
||||
# hugo server --minify --themesDir ... --baseURL=http://0.0.0.0:1313/theme/hugo-book/
|
||||
|
||||
name: Ben Cuan
|
||||
baseURL: https://notes.bencuan.me
|
||||
|
||||
# Book configuration
|
||||
disablePathToLower: true
|
||||
enableGitInfo: true
|
||||
|
||||
# # Needed for mermaid/katex shortcodes
|
||||
# markup:
|
||||
# goldmark:
|
||||
# renderer:
|
||||
# unsafe: true
|
||||
# tableOfContents:
|
||||
# startLevel: 1
|
||||
|
||||
# Multi-lingual mode config
|
||||
# There are different options to translate files
|
||||
# See https://gohugo.io/content-management/multilingual/#translation-by-filename
|
||||
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
|
||||
|
||||
menu:
|
||||
# before: []
|
||||
after:
|
||||
- name: "Github"
|
||||
url: "https://github.com/alex-shpak/hugo-book"
|
||||
weight: 10
|
||||
# - name: "Hugo Themes"
|
||||
# url: "https://themes.gohugo.io/hugo-book/"
|
||||
# weight: 20
|
||||
|
||||
params:
|
||||
|
||||
title: 📓 Ben's Notes
|
||||
|
||||
# OPTIONAL: custom favicon location
|
||||
# favicon: 'location/to/favicon. png'
|
||||
|
||||
# Show previews for links to other internal pages.
|
||||
enableLinkPreview: true
|
||||
|
||||
# Enable rendering of LaTeX blocks
|
||||
# (surrounded by either single or double dollar signs)
|
||||
enableLatex: true
|
||||
enableCodeBlockTitle: true
|
||||
enableCodeBlockCopy: true
|
||||
enableCallouts: true
|
||||
enableSPA: false
|
||||
|
||||
# Show footer, including backlinks and graph view
|
||||
enableFooter: true
|
||||
enableContextualBacklinks: true
|
||||
enableRecentNotes: false
|
||||
enableGitHubEdit: true
|
||||
enableMermaid: true
|
||||
|
||||
# Link to your Github repo
|
||||
GitHubLink: https://github.com/64bitpandas/amethyst
|
||||
|
||||
# Search (WIP)
|
||||
search:
|
||||
enableSemanticSearch: false
|
||||
operandApiKey: "REPLACE-WITH-YOUR-OPERAND-API-KEY"
|
||||
operandIndexId: "REPLACE-WITH-YOUR-OPERAND-INDEX-ID"
|
||||
|
||||
# Site description and title
|
||||
description:
|
||||
Notes, hosted by bencuan
|
||||
|
||||
|
||||
# Footer links
|
||||
links:
|
||||
- link_name: Website
|
||||
link: https://twitter.com/_jzhao
|
||||
- link_name: GitHub
|
||||
link: https://github.com/jackyzha0
|
||||
|
||||
# (Optional, default true) Controls table of contents visibility on right side of pages.
|
||||
# Start and end levels can be controlled with markup.tableOfContents setting.
|
||||
# You can also specify this parameter per page in front matter.
|
||||
BookToC: true
|
||||
|
||||
# (Optional, default none) Set the path to a logo for the book. If the logo is
|
||||
# /static/logo.png then the path would be logo.png
|
||||
# BookLogo: /logo.png
|
||||
|
||||
# (Optional, default none) Set leaf bundle to render as side menu
|
||||
# When not specified file structure and weights will be used
|
||||
# BookMenuBundle: /menu
|
||||
|
||||
# (Optional, default docs) Specify root page to render child pages as menu.
|
||||
# Page is resoled by .GetPage function: https://gohugo.io/functions/getpage/
|
||||
# For backward compatibility you can set '*' to render all sections to menu. Acts same as '/'
|
||||
BookSection: "/"
|
||||
|
||||
# Set source repository location.
|
||||
# Used for 'Last Modified' and 'Edit this page' links.
|
||||
BookRepo: https://github.com/64bitpandas/amethyst
|
||||
|
||||
# (Optional, default 'commit') Specifies commit portion of the link to the page's last modified
|
||||
# commit hash for 'doc' page type.
|
||||
# Requires 'BookRepo' param.
|
||||
# Value used to construct a URL consisting of BookRepo/BookCommitPath/<commit-hash>
|
||||
# Github uses 'commit', Bitbucket uses 'commits'
|
||||
# BookCommitPath: commit
|
||||
|
||||
# Enable "Edit this page" links for 'doc' page type.
|
||||
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
|
||||
# Edit path must point to root directory of repo.
|
||||
BookEditPath: edit/main/exampleSite
|
||||
|
||||
# Configure the date format used on the pages
|
||||
# - In git information
|
||||
# - In blog posts
|
||||
BookDateFormat: "January 2, 2006"
|
||||
|
||||
# (Optional, default true) Enables search function with flexsearch,
|
||||
# Index is built on fly, therefore it might slowdown your website.
|
||||
# Configuration for indexing can be adjusted in i18n folder per language.
|
||||
BookSearch: true
|
||||
|
||||
# (Optional, default true) Enables comments template on pages
|
||||
# By default partals/docs/comments.html includes Disqus template
|
||||
# See https://gohugo.io/content-management/comments/#configure-disqus
|
||||
# Can be overwritten by same param in page frontmatter
|
||||
BookComments: true
|
||||
|
||||
# /!\ This is an experimental feature, might be removed or changed at any time
|
||||
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
|
||||
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
|
||||
# Theme will print warning if page referenced in markdown does not exists.
|
||||
BookPortableLinks: true
|
||||
|
||||
# /!\ This is an experimental feature, might be removed or changed at any time
|
||||
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
|
||||
BookServiceWorker: true
|
||||
|
||||
# /!\ This is an experimental feature, might be removed or changed at any time
|
||||
# (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
|
||||
BookTranslatedOnly: false
|
||||
|
||||
|
28
content/_index.md
Normal file
28
content/_index.md
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
title: 🪴 Quartz 3.
|
||||
enableToc: false
|
||||
---
|
||||
|
||||
Host your second brain and [digital garden](https://jzhao.xyz/posts/networked-thought) for free. Quartz features
|
||||
|
||||
1. Extremely fast natural-language [[notes/search]]
|
||||
2. Customizable and hackable design based on [Hugo](https://gohugo.io/)
|
||||
3. Automatically generated backlinks, link previews, and local graph
|
||||
4. Built-in [[notes/CJK + Latex Support (测试) | CJK + Latex Support]] and [[notes/callouts | Admonition-style callouts]]
|
||||
5. Support for both Markdown Links and Wikilinks
|
||||
|
||||
Check out some of the [amazing gardens that community members](notes/showcase.md) have published with Quartz or read about [why I made Quartz](notes/philosophy.md) to begin with.
|
||||
|
||||
## Get Started
|
||||
> 📚 Step 1: [Setup your own digital garden using Quartz](notes/setup.md)
|
||||
|
||||
Returning user? Figure out how to [[notes/updating|update]] your existing Quartz garden.
|
||||
|
||||
If you prefer browsing the contents of this site through a list instead of a graph, you see a list of all [setup-related notes](/tags/setup).
|
||||
|
||||
### Troubleshooting
|
||||
- 🚧 [Troubleshooting and FAQ](notes/troubleshooting.md)
|
||||
- 🐛 [Submit an Issue](https://github.com/jackyzha0/quartz/issues)
|
||||
- 👀 [Discord Community](https://discord.gg/cRFFHYye7t)
|
||||
|
||||
[[notes/foo]] [[notes/foo/footest]]
|
71
content/docs/example/_index.md
Normal file
71
content/docs/example/_index.md
Normal file
@ -0,0 +1,71 @@
|
||||
---
|
||||
weight: 1
|
||||
bookFlatSection: true
|
||||
title: "Example Site"
|
||||
---
|
||||
|
||||
# Introduction
|
||||
|
||||
## Ferre hinnitibus erat accipitrem dixi Troiae tollens
|
||||
|
||||
Lorem markdownum, a quoque nutu est *quodcumque mandasset* veluti. Passim
|
||||
inportuna totidemque nympha fert; repetens pendent, poenarum guttura sed vacet
|
||||
non, mortali undas. Omnis pharetramque gramen portentificisque membris servatum
|
||||
novabis fallit de nubibus atque silvas mihi. **Dixit repetitaque Quid**; verrit
|
||||
longa; sententia [mandat](http://pastor-ad.io/questussilvas) quascumque nescio
|
||||
solebat [litore](http://lacrimas-ab.net/); noctes. *Hostem haerentem* circuit
|
||||
[plenaque tamen](http://www.sine.io/in).
|
||||
|
||||
- Pedum ne indigenae finire invergens carpebat
|
||||
- Velit posses summoque
|
||||
- De fumos illa foret
|
||||
|
||||
## Est simul fameque tauri qua ad
|
||||
|
||||
Locum nullus nisi vomentes. Ab Persea sermone vela, miratur aratro; eandem
|
||||
Argolicas gener.
|
||||
|
||||
## Me sol
|
||||
|
||||
Nec dis certa fuit socer, Nonacria **dies** manet tacitaque sibi? Sucis est
|
||||
iactata Castrumque iudex, et iactato quoque terraeque es tandem et maternos
|
||||
vittis. Lumina litus bene poenamque animos callem ne tuas in leones illam dea
|
||||
cadunt genus, et pleno nunc in quod. Anumque crescentesque sanguinis
|
||||
[progenies](http://www.late.net/alimentavirides) nuribus rustica tinguet. Pater
|
||||
omnes liquido creditis noctem.
|
||||
|
||||
if (mirrored(icmp_dvd_pim, 3, smbMirroredHard) != lion(clickImportQueue,
|
||||
viralItunesBalancing, bankruptcy_file_pptp)) {
|
||||
file += ip_cybercrime_suffix;
|
||||
}
|
||||
if (runtimeSmartRom == netMarketingWord) {
|
||||
virusBalancingWin *= scriptPromptBespoke + raster(post_drive,
|
||||
windowsSli);
|
||||
cd = address_hertz_trojan;
|
||||
soap_ccd.pcbServerGigahertz(asp_hardware_isa, offlinePeopleware, nui);
|
||||
} else {
|
||||
megabyte.api = modem_flowchart - web + syntaxHalftoneAddress;
|
||||
}
|
||||
if (3 < mebibyteNetworkAnimated) {
|
||||
pharming_regular_error *= jsp_ribbon + algorithm * recycleMediaKindle(
|
||||
dvrSyntax, cdma);
|
||||
adf_sla *= hoverCropDrive;
|
||||
templateNtfs = -1 - vertical;
|
||||
} else {
|
||||
expressionCompressionVariable.bootMulti = white_eup_javascript(
|
||||
table_suffix);
|
||||
guidPpiPram.tracerouteLinux += rtfTerabyteQuicktime(1,
|
||||
managementRosetta(webcamActivex), 740874);
|
||||
}
|
||||
var virusTweetSsl = nullGigo;
|
||||
|
||||
## Trepident sitimque
|
||||
|
||||
Sentiet et ferali errorem fessam, coercet superbus, Ascaniumque in pennis
|
||||
mediis; dolor? Vidit imi **Aeacon** perfida propositos adde, tua Somni Fluctibus
|
||||
errante lustrat non.
|
||||
|
||||
Tamen inde, vos videt e flammis Scythica parantem rupisque pectora umbras. Haec
|
||||
ficta canistris repercusso simul ego aris Dixit! Esse Fama trepidare hunc
|
||||
crescendo vigor ululasse vertice *exspatiantur* celer tepidique petita aversata
|
||||
oculis iussa est me ferro.
|
12
content/docs/example/collapsed/3rd-level/4th-level.md
Normal file
12
content/docs/example/collapsed/3rd-level/4th-level.md
Normal file
@ -0,0 +1,12 @@
|
||||
# 4th Level of Menu
|
||||
|
||||
## Caesorum illa tu sentit micat vestes papyriferi
|
||||
|
||||
Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non
|
||||
regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo;
|
||||
gestanda nitidi, vero? Dum ne pectoraque testantur.
|
||||
|
||||
Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut
|
||||
manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus
|
||||
pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae
|
||||
iusto! Sedes ante dum superest **extrema**.
|
26
content/docs/example/collapsed/3rd-level/_index.md
Normal file
26
content/docs/example/collapsed/3rd-level/_index.md
Normal file
@ -0,0 +1,26 @@
|
||||
# 3rd Level of Menu
|
||||
|
||||
Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae
|
||||
miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me
|
||||
ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta.
|
||||
Intravit quam erat figentem hunc, motus de fontes parvo tempestate.
|
||||
|
||||
iscsi_virus = pitch(json_in_on(eupViral),
|
||||
northbridge_services_troubleshooting, personal(
|
||||
firmware_rw.trash_rw_crm.device(interactive_gopher_personal,
|
||||
software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel,
|
||||
mips_whitelist_duplex, cpa)));
|
||||
if (5) {
|
||||
managementNetwork += dma - boolean;
|
||||
kilohertz_token = 2;
|
||||
honeypot_affiliate_ergonomics = fiber;
|
||||
}
|
||||
mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet(
|
||||
analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet),
|
||||
gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork,
|
||||
trim_duplex_file), cellTapeDirect, token_tooltip_mashup(
|
||||
ripcordingMashup)));
|
||||
module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) +
|
||||
coreLog.joystick(componentUdpLink), windows_expansion_touchscreen);
|
||||
bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling(
|
||||
ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp);
|
4
content/docs/example/collapsed/_index.md
Normal file
4
content/docs/example/collapsed/_index.md
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
bookCollapseSection: true
|
||||
weight: 20
|
||||
---
|
52
content/docs/example/hidden.md
Normal file
52
content/docs/example/hidden.md
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
bookHidden: true
|
||||
---
|
||||
|
||||
# This page is hidden in menu
|
||||
|
||||
# Quondam non pater est dignior ille Eurotas
|
||||
|
||||
## Latent te facies
|
||||
|
||||
Lorem markdownum arma ignoscas vocavit quoque ille texit mandata mentis ultimus,
|
||||
frementes, qui in vel. Hippotades Peleus [pennas
|
||||
conscia](http://gratia.net/tot-qua.php) cuiquam Caeneus quas.
|
||||
|
||||
- Pater demittere evincitque reddunt
|
||||
- Maxime adhuc pressit huc Danaas quid freta
|
||||
- Soror ego
|
||||
- Luctus linguam saxa ultroque prior Tatiumque inquit
|
||||
- Saepe liquitur subita superata dederat Anius sudor
|
||||
|
||||
## Cum honorum Latona
|
||||
|
||||
O fallor [in sustinui
|
||||
iussorum](http://www.spectataharundine.org/aquas-relinquit.html) equidem.
|
||||
Nymphae operi oris alii fronde parens dumque, in auro ait mox ingenti proxima
|
||||
iamdudum maius?
|
||||
|
||||
reality(burnDocking(apache_nanometer),
|
||||
pad.property_data_programming.sectorBrowserPpga(dataMask, 37,
|
||||
recycleRup));
|
||||
intellectualVaporwareUser += -5 * 4;
|
||||
traceroute_key_upnp /= lag_optical(android.smb(thyristorTftp));
|
||||
surge_host_golden = mca_compact_device(dual_dpi_opengl, 33,
|
||||
commerce_add_ppc);
|
||||
if (lun_ipv) {
|
||||
verticalExtranet(1, thumbnail_ttl, 3);
|
||||
bar_graphics_jpeg(chipset - sector_xmp_beta);
|
||||
}
|
||||
|
||||
## Fronde cetera dextrae sequens pennis voce muneris
|
||||
|
||||
Acta cretus diem restet utque; move integer, oscula non inspirat, noctisque
|
||||
scelus! Nantemque in suas vobis quamvis, et labori!
|
||||
|
||||
var runtimeDiskCompiler = home - array_ad_software;
|
||||
if (internic > disk) {
|
||||
emoticonLockCron += 37 + bps - 4;
|
||||
wan_ansi_honeypot.cardGigaflops = artificialStorageCgi;
|
||||
simplex -= downloadAccess;
|
||||
}
|
||||
var volumeHardeningAndroid = pixel + tftp + onProcessorUnmount;
|
||||
sector(memory(firewire + interlaced, wired));
|
85
content/docs/example/table-of-contents/_index.md
Normal file
85
content/docs/example/table-of-contents/_index.md
Normal file
@ -0,0 +1,85 @@
|
||||
---
|
||||
weight: 10
|
||||
---
|
||||
|
||||
# Ubi loqui
|
||||
|
||||
## Mentem genus facietque salire tempus bracchia
|
||||
|
||||
Lorem markdownum partu paterno Achillem. Habent amne generosi aderant ad pellem
|
||||
nec erat sustinet merces columque haec et, dixit minus nutrit accipiam subibis
|
||||
subdidit. Temeraria servatum agros qui sed fulva facta. Primum ultima, dedit,
|
||||
suo quisque linguae medentes fixo: tum petis.
|
||||
|
||||
## Rapit vocant si hunc siste adspice
|
||||
|
||||
Ora precari Patraeque Neptunia, dixit Danae [Cithaeron
|
||||
armaque](http://mersis-an.org/litoristum) maxima in **nati Coniugis** templis
|
||||
fluidove. Effugit usus nec ingreditur agmen *ac manus* conlato. Nullis vagis
|
||||
nequiquam vultibus aliquos altera *suum venis* teneas fretum. Armos [remotis
|
||||
hoc](http://tutum.io/me) sine ferrea iuncta quam!
|
||||
|
||||
## Locus fuit caecis
|
||||
|
||||
Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae
|
||||
miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me
|
||||
ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta.
|
||||
Intravit quam erat figentem hunc, motus de fontes parvo tempestate.
|
||||
|
||||
iscsi_virus = pitch(json_in_on(eupViral),
|
||||
northbridge_services_troubleshooting, personal(
|
||||
firmware_rw.trash_rw_crm.device(interactive_gopher_personal,
|
||||
software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel,
|
||||
mips_whitelist_duplex, cpa)));
|
||||
if (5) {
|
||||
managementNetwork += dma - boolean;
|
||||
kilohertz_token = 2;
|
||||
honeypot_affiliate_ergonomics = fiber;
|
||||
}
|
||||
mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet(
|
||||
analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet),
|
||||
gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork,
|
||||
trim_duplex_file), cellTapeDirect, token_tooltip_mashup(
|
||||
ripcordingMashup)));
|
||||
module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) +
|
||||
coreLog.joystick(componentUdpLink), windows_expansion_touchscreen);
|
||||
bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling(
|
||||
ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp);
|
||||
|
||||
## Placabilis coactis nega ingemuit ignoscat nimia non
|
||||
|
||||
Frontis turba. Oculi gravis est Delphice; *inque praedaque* sanguine manu non.
|
||||
|
||||
if (ad_api) {
|
||||
zif += usb.tiffAvatarRate(subnet, digital_rt) + exploitDrive;
|
||||
gigaflops(2 - bluetooth, edi_asp_memory.gopher(queryCursor, laptop),
|
||||
panel_point_firmware);
|
||||
spyware_bash.statePopApplet = express_netbios_digital(
|
||||
insertion_troubleshooting.brouter(recordFolderUs), 65);
|
||||
}
|
||||
recursionCoreRay = -5;
|
||||
if (hub == non) {
|
||||
portBoxVirus = soundWeb(recursive_card(rwTechnologyLeopard),
|
||||
font_radcab, guidCmsScalable + reciprocalMatrixPim);
|
||||
left.bug = screenshot;
|
||||
} else {
|
||||
tooltipOpacity = raw_process_permalink(webcamFontUser, -1);
|
||||
executable_router += tape;
|
||||
}
|
||||
if (tft) {
|
||||
bandwidthWeb *= social_page;
|
||||
} else {
|
||||
regular += 611883;
|
||||
thumbnail /= system_lag_keyboard;
|
||||
}
|
||||
|
||||
## Caesorum illa tu sentit micat vestes papyriferi
|
||||
|
||||
Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non
|
||||
regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo;
|
||||
gestanda nitidi, vero? Dum ne pectoraque testantur.
|
||||
|
||||
Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut
|
||||
manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus
|
||||
pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae
|
||||
iusto! Sedes ante dum superest **extrema**.
|
64
content/docs/example/table-of-contents/with-toc.md
Normal file
64
content/docs/example/table-of-contents/with-toc.md
Normal file
@ -0,0 +1,64 @@
|
||||
---
|
||||
title: With ToC
|
||||
weight: 1
|
||||
---
|
||||
# Caput vino delphine in tamen vias
|
||||
|
||||
## Cognita laeva illo fracta
|
||||
|
||||
Lorem markdownum pavent auras, surgit nunc cingentibus libet **Laomedonque que**
|
||||
est. Pastor [An](http://est.org/ire.aspx) arbor filia foedat, ne [fugit
|
||||
aliter](http://www.indiciumturbam.org/moramquid.php), per. Helicona illas et
|
||||
callida neptem est *Oresitrophos* caput, dentibus est venit. Tenet reddite
|
||||
[famuli](http://www.antro-et.net/) praesentem fortibus, quaeque vis foret si
|
||||
frondes *gelidos* gravidae circumtulit [inpulit armenta
|
||||
nativum](http://incurvasustulit.io/illi-virtute.html).
|
||||
|
||||
1. Te at cruciabere vides rubentis manebo
|
||||
2. Maturuit in praetemptat ruborem ignara postquam habitasse
|
||||
3. Subitarum supplevit quoque fontesque venabula spretis modo
|
||||
4. Montis tot est mali quasque gravis
|
||||
5. Quinquennem domus arsit ipse
|
||||
6. Pellem turis pugnabant locavit
|
||||
|
||||
## Natus quaerere
|
||||
|
||||
Pectora et sine mulcere, coniuge dum tincta incurvae. Quis iam; est dextra
|
||||
Peneosque, metuis a verba, primo. Illa sed colloque suis: magno: gramen, aera
|
||||
excutiunt concipit.
|
||||
|
||||
> Phrygiae petendo suisque extimuit, super, pars quod audet! Turba negarem.
|
||||
> Fuerat attonitus; et dextra retinet sidera ulnas undas instimulat vacuae
|
||||
> generis? *Agnus* dabat et ignotis dextera, sic tibi pacis **feriente at mora**
|
||||
> euhoeque *comites hostem* vestras Phineus. Vultuque sanguine dominoque [metuit
|
||||
> risi](http://iuvat.org/eundem.php) fama vergit summaque meus clarissimus
|
||||
> artesque tinguebat successor nominis cervice caelicolae.
|
||||
|
||||
## Limitibus misere sit
|
||||
|
||||
Aurea non fata repertis praerupit feruntur simul, meae hosti lentaque *citius
|
||||
levibus*, cum sede dixit, Phaethon texta. *Albentibus summos* multifidasque
|
||||
iungitur loquendi an pectore, mihi ursaque omnia adfata, aeno parvumque in animi
|
||||
perlucentes. Epytus agis ait vixque clamat ornum adversam spondet, quid sceptra
|
||||
ipsum **est**. Reseret nec; saeva suo passu debentia linguam terga et aures et
|
||||
cervix [de](http://www.amnem.io/pervenit.aspx) ubera. Coercet gelidumque manus,
|
||||
doluit volvitur induta?
|
||||
|
||||
## Enim sua
|
||||
|
||||
Iuvenilior filia inlustre templa quidem herbis permittat trahens huic. In
|
||||
cruribus proceres sole crescitque *fata*, quos quos; merui maris se non tamen
|
||||
in, mea.
|
||||
|
||||
## Germana aves pignus tecta
|
||||
|
||||
Mortalia rudibusque caelum cognosceret tantum aquis redito felicior texit, nec,
|
||||
aris parvo acre. Me parum contulerant multi tenentem, gratissime suis; vultum tu
|
||||
occupat deficeret corpora, sonum. E Actaea inplevit Phinea concepit nomenque
|
||||
potest sanguine captam nulla et, in duxisses campis non; mercede. Dicere cur
|
||||
Leucothoen obitum?
|
||||
|
||||
Postibus mittam est *nubibus principium pluma*, exsecratur facta et. Iunge
|
||||
Mnemonidas pallamque pars; vere restitit alis flumina quae **quoque**, est
|
||||
ignara infestus Pyrrha. Di ducis terris maculatum At sede praemia manes
|
||||
nullaque!
|
59
content/docs/example/table-of-contents/without-toc.md
Normal file
59
content/docs/example/table-of-contents/without-toc.md
Normal file
@ -0,0 +1,59 @@
|
||||
---
|
||||
title: Without ToC
|
||||
weight: 2
|
||||
bookToc: false
|
||||
---
|
||||
|
||||
# At me ipso nepotibus nunc celebratior genus
|
||||
|
||||
## Tanto oblite
|
||||
|
||||
Lorem markdownum pectora novis patenti igne sua opus aurae feras materiaque
|
||||
illic demersit imago et aristas questaque posset. Vomit quoque suo inhaesuro
|
||||
clara. Esse cumque, per referri triste. Ut exponit solisque communis in tendens
|
||||
vincetis agisque iamque huic bene ante vetat omina Thebae rates. Aeacus servat
|
||||
admonitu concidit, ad resimas vultus et rugas vultu **dignamque** Siphnon.
|
||||
|
||||
Quam iugulum regia simulacra, plus meruit humo pecorumque haesit, ab discedunt
|
||||
dixit: ritu pharetramque. Exul Laurenti orantem modo, per densum missisque labor
|
||||
manibus non colla unum, obiectat. Tu pervia collo, fessus quae Cretenque Myconon
|
||||
crate! Tegumenque quae invisi sudore per vocari quaque plus ventis fluidos. Nodo
|
||||
perque, fugisse pectora sorores.
|
||||
|
||||
## Summe promissa supple vadit lenius
|
||||
|
||||
Quibus largis latebris aethera versato est, ait sentiat faciemque. Aequata alis
|
||||
nec Caeneus exululat inclite corpus est, ire **tibi** ostendens et tibi. Rigent
|
||||
et vires dique possent lumina; **eadem** dixit poma funeribus paret et felix
|
||||
reddebant ventis utile lignum.
|
||||
|
||||
1. Remansit notam Stygia feroxque
|
||||
2. Et dabit materna
|
||||
3. Vipereas Phrygiaeque umbram sollicito cruore conlucere suus
|
||||
4. Quarum Elis corniger
|
||||
5. Nec ieiunia dixit
|
||||
|
||||
Vertitur mos ortu ramosam contudit dumque; placabat ac lumen. Coniunx Amoris
|
||||
spatium poenamque cavernis Thebae Pleiadasque ponunt, rapiare cum quae parum
|
||||
nimium rima.
|
||||
|
||||
## Quidem resupinus inducto solebat una facinus quae
|
||||
|
||||
Credulitas iniqua praepetibus paruit prospexit, voce poena, sub rupit sinuatur,
|
||||
quin suum ventorumque arcadiae priori. Soporiferam erat formamque, fecit,
|
||||
invergens, nymphae mutat fessas ait finge.
|
||||
|
||||
1. Baculum mandataque ne addere capiti violentior
|
||||
2. Altera duas quam hoc ille tenues inquit
|
||||
3. Sicula sidereus latrantis domoque ratae polluit comites
|
||||
4. Possit oro clausura namque se nunc iuvenisque
|
||||
5. Faciem posuit
|
||||
6. Quodque cum ponunt novercae nata vestrae aratra
|
||||
|
||||
Ite extrema Phrygiis, patre dentibus, tonso perculit, enim blanda, manibus fide
|
||||
quos caput armis, posse! Nocendo fas Alcyonae lacertis structa ferarum manus
|
||||
fulmen dubius, saxa caelum effuge extremis fixum tumor adfecit **bella**,
|
||||
potentes? Dum nec insidiosa tempora tegit
|
||||
[spirarunt](http://mihiferre.net/iuvenes-peto.html). Per lupi pars foliis,
|
||||
porreximus humum negant sunt subposuere Sidone steterant auro. Memoraverit sine:
|
||||
ferrum idem Orion caelum heres gerebat fixis?
|
3
content/docs/shortcodes/_index.md
Normal file
3
content/docs/shortcodes/_index.md
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
bookFlatSection: true
|
||||
---
|
13
content/docs/shortcodes/buttons.md
Normal file
13
content/docs/shortcodes/buttons.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Buttons
|
||||
|
||||
Buttons are styled links that can lead to local page or external link.
|
||||
|
||||
## Example
|
||||
|
||||
```tpl
|
||||
{{</* button relref="/" [class="..."] */>}}Get Home{{</* /button */>}}
|
||||
{{</* button href="https://github.com/alex-shpak/hugo-book" */>}}Contribute{{</* /button */>}}
|
||||
```
|
||||
|
||||
{{< button relref="/" >}}Get Home{{< /button >}}
|
||||
{{< button href="https://github.com/alex-shpak/hugo-book" >}}Contribute{{< /button >}}
|
45
content/docs/shortcodes/columns.md
Normal file
45
content/docs/shortcodes/columns.md
Normal file
@ -0,0 +1,45 @@
|
||||
# Columns
|
||||
|
||||
Columns help organize shorter pieces of content horizontally for readability.
|
||||
|
||||
|
||||
```html
|
||||
{{</* columns */>}} <!-- begin columns block -->
|
||||
# Left Content
|
||||
Lorem markdownum insigne...
|
||||
|
||||
<---> <!-- magic separator, between columns -->
|
||||
|
||||
# Mid Content
|
||||
Lorem markdownum insigne...
|
||||
|
||||
<---> <!-- magic separator, between columns -->
|
||||
|
||||
# Right Content
|
||||
Lorem markdownum insigne...
|
||||
{{</* /columns */>}}
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
{{< columns >}}
|
||||
## Left Content
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||
Miseratus fonte Ditis conubia.
|
||||
|
||||
<--->
|
||||
|
||||
## Mid Content
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter!
|
||||
|
||||
<--->
|
||||
|
||||
## Right Content
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||
Miseratus fonte Ditis conubia.
|
||||
{{< /columns >}}
|
22
content/docs/shortcodes/details.md
Normal file
22
content/docs/shortcodes/details.md
Normal file
@ -0,0 +1,22 @@
|
||||
# Details
|
||||
|
||||
Details shortcode is a helper for `details` html5 element. It is going to replace `expand` shortcode.
|
||||
|
||||
## Example
|
||||
```tpl
|
||||
{{</* details "Title" [open] */>}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{</* /details */>}}
|
||||
```
|
||||
```tpl
|
||||
{{</* details title="Title" open=true */>}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{</* /details */>}}
|
||||
```
|
||||
|
||||
{{< details "Title" open >}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{< /details >}}
|
35
content/docs/shortcodes/expand.md
Normal file
35
content/docs/shortcodes/expand.md
Normal file
@ -0,0 +1,35 @@
|
||||
# Expand
|
||||
|
||||
Expand shortcode can help to decrease clutter on screen by hiding part of text. Expand content by clicking on it.
|
||||
|
||||
## Example
|
||||
### Default
|
||||
|
||||
```tpl
|
||||
{{</* expand */>}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{</* /expand */>}}
|
||||
```
|
||||
|
||||
{{< expand >}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{< /expand >}}
|
||||
|
||||
### With Custom Label
|
||||
|
||||
```tpl
|
||||
{{</* expand "Custom Label" "..." */>}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne...
|
||||
{{</* /expand */>}}
|
||||
```
|
||||
|
||||
{{< expand "Custom Label" "..." >}}
|
||||
## Markdown content
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||
Miseratus fonte Ditis conubia.
|
||||
{{< /expand >}}
|
32
content/docs/shortcodes/hints.md
Normal file
32
content/docs/shortcodes/hints.md
Normal file
@ -0,0 +1,32 @@
|
||||
# Hints
|
||||
|
||||
Hint shortcode can be used as hint/alerts/notification block.
|
||||
There are 3 colors to choose: `info`, `warning` and `danger`.
|
||||
|
||||
```tpl
|
||||
{{</* hint [info|warning|danger] */>}}
|
||||
**Markdown content**
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
{{</* /hint */>}}
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
{{< hint info >}}
|
||||
**Markdown content**
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
{{< /hint >}}
|
||||
|
||||
{{< hint warning >}}
|
||||
**Markdown content**
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
{{< /hint >}}
|
||||
|
||||
{{< hint danger >}}
|
||||
**Markdown content**
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
{{< /hint >}}
|
28
content/docs/shortcodes/katex.md
Normal file
28
content/docs/shortcodes/katex.md
Normal file
@ -0,0 +1,28 @@
|
||||
# KaTeX
|
||||
|
||||
KaTeX shortcode let you render math typesetting in markdown document. See [KaTeX](https://katex.org/)
|
||||
|
||||
## Example
|
||||
{{< columns >}}
|
||||
|
||||
```latex
|
||||
{{</*/* katex [display] [class="text-center"] */*/>}}
|
||||
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||
{{</*/* /katex */*/>}}
|
||||
```
|
||||
|
||||
<--->
|
||||
|
||||
{{< katex display >}}
|
||||
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||
{{< /katex >}}
|
||||
|
||||
{{< /columns >}}
|
||||
|
||||
## Display Mode Example
|
||||
|
||||
Here is some inline example: {{< katex >}}\pi(x){{< /katex >}}, rendered in the same line. And below is `display` example, having `display: block`
|
||||
{{< katex display >}}
|
||||
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||
{{< /katex >}}
|
||||
Text continues here.
|
41
content/docs/shortcodes/mermaid.md
Normal file
41
content/docs/shortcodes/mermaid.md
Normal file
@ -0,0 +1,41 @@
|
||||
# Mermaid Chart
|
||||
|
||||
[MermaidJS](https://mermaid-js.github.io/) is library for generating svg charts and diagrams from text.
|
||||
|
||||
{{< hint info >}}
|
||||
**Override Mermaid Initialization Config**
|
||||
|
||||
To override the [initialization config](https://mermaid-js.github.io/mermaid/#/Setup) for Mermaid,
|
||||
create a `mermaid.json` file in your `assets` folder!
|
||||
{{< /hint >}}
|
||||
|
||||
## Example
|
||||
|
||||
{{< columns >}}
|
||||
```tpl
|
||||
{{</*/* mermaid [class="text-center"]*/*/>}}
|
||||
stateDiagram-v2
|
||||
State1: The state with a note
|
||||
note right of State1
|
||||
Important information! You can write
|
||||
notes.
|
||||
end note
|
||||
State1 --> State2
|
||||
note left of State2 : This is the note to the left.
|
||||
{{</*/* /mermaid */*/>}}
|
||||
```
|
||||
|
||||
<--->
|
||||
|
||||
{{< mermaid >}}
|
||||
stateDiagram-v2
|
||||
State1: The state with a note
|
||||
note right of State1
|
||||
Important information! You can write
|
||||
notes.
|
||||
end note
|
||||
State1 --> State2
|
||||
note left of State2 : This is the note to the left.
|
||||
{{< /mermaid >}}
|
||||
|
||||
{{< /columns >}}
|
15
content/docs/shortcodes/section/_index.md
Normal file
15
content/docs/shortcodes/section/_index.md
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
bookCollapseSection: true
|
||||
---
|
||||
|
||||
# Section
|
||||
|
||||
Section renders pages in section as definition list, using title and description.
|
||||
|
||||
## Example
|
||||
|
||||
```tpl
|
||||
{{</* section */>}}
|
||||
```
|
||||
|
||||
{{<section>}}
|
6
content/docs/shortcodes/section/first-page.md
Normal file
6
content/docs/shortcodes/section/first-page.md
Normal file
@ -0,0 +1,6 @@
|
||||
# First page
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
|
||||
<!--more-->
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
6
content/docs/shortcodes/section/second-page.md
Normal file
6
content/docs/shortcodes/section/second-page.md
Normal file
@ -0,0 +1,6 @@
|
||||
# Second Page
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
|
||||
<!--more-->
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
|
50
content/docs/shortcodes/tabs.md
Normal file
50
content/docs/shortcodes/tabs.md
Normal file
@ -0,0 +1,50 @@
|
||||
# Tabs
|
||||
|
||||
Tabs let you organize content by context, for example installation instructions for each supported platform.
|
||||
|
||||
```tpl
|
||||
{{</* tabs "uniqueid" */>}}
|
||||
{{</* tab "MacOS" */>}} # MacOS Content {{</* /tab */>}}
|
||||
{{</* tab "Linux" */>}} # Linux Content {{</* /tab */>}}
|
||||
{{</* tab "Windows" */>}} # Windows Content {{</* /tab */>}}
|
||||
{{</* /tabs */>}}
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
{{< tabs "uniqueid" >}}
|
||||
{{< tab "MacOS" >}}
|
||||
# MacOS
|
||||
|
||||
This is tab **MacOS** content.
|
||||
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||
Miseratus fonte Ditis conubia.
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab "Linux" >}}
|
||||
|
||||
# Linux
|
||||
|
||||
This is tab **Linux** content.
|
||||
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||
Miseratus fonte Ditis conubia.
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab "Windows" >}}
|
||||
|
||||
# Windows
|
||||
|
||||
This is tab **Windows** content.
|
||||
|
||||
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||
Miseratus fonte Ditis conubia.
|
||||
{{< /tab >}}
|
||||
{{< /tabs >}}
|
22
content/menu/index.md
Normal file
22
content/menu/index.md
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
headless: true
|
||||
---
|
||||
|
||||
- [**Example Site**]({{< relref "/docs/example" >}})
|
||||
- [Table of Contents]({{< relref "/docs/example/table-of-contents" >}})
|
||||
- [With ToC]({{< relref "/docs/example/table-of-contents/with-toc" >}})
|
||||
- [Without ToC]({{< relref "/docs/example/table-of-contents/without-toc" >}})
|
||||
- [Collapsed]({{< relref "/docs/example/collapsed" >}})
|
||||
- [3rd]({{< relref "/docs/example/collapsed/3rd-level" >}})
|
||||
- [4th]({{< relref "/docs/example/collapsed/3rd-level/4th-level" >}})
|
||||
<br />
|
||||
|
||||
- **Shortcodes**
|
||||
- [Buttons]({{< relref "/docs/shortcodes/buttons" >}})
|
||||
- [Columns]({{< relref "/docs/shortcodes/columns" >}})
|
||||
- [Expand]({{< relref "/docs/shortcodes/expand" >}})
|
||||
- [Hints]({{< relref "/docs/shortcodes/hints" >}})
|
||||
- [KaTex]({{< relref "/docs/shortcodes/katex" >}})
|
||||
- [Mermaid]({{< relref "/docs/shortcodes/mermaid" >}})
|
||||
- [Tabs]({{< relref "/docs/shortcodes/tabs" >}})
|
||||
<br />
|
40
content/notes/CJK + Latex Support (测试).md
Normal file
40
content/notes/CJK + Latex Support (测试).md
Normal file
@ -0,0 +1,40 @@
|
||||
---
|
||||
title: "CJK + Latex Support (测试)"
|
||||
---
|
||||
|
||||
## Chinese, Japanese, Korean Support
|
||||
几乎在我们意识到之前,我们已经离开了地面。
|
||||
|
||||
우리가 그것을 알기도 전에 우리는 땅을 떠났습니다.
|
||||
|
||||
私たちがそれを知るほぼ前に、私たちは地面を離れていました。
|
||||
|
||||
## Latex
|
||||
|
||||
Block math works with two dollar signs `$$...$$`
|
||||
|
||||
$$f(x) = \int_{-\infty}^\infty
|
||||
f\hat(\xi),e^{2 \pi i \xi x}
|
||||
\,d\xi$$
|
||||
|
||||
Inline math also works with single dollar signs `$...$`. For example, Euler's identity but inline: $e^{i\pi} = -1$
|
||||
|
||||
Aligned equations work quite well:
|
||||
|
||||
$$
|
||||
\begin{aligned}
|
||||
a &= b + c \\ &= e + f \\
|
||||
\end{aligned}
|
||||
$$
|
||||
|
||||
And matrices
|
||||
|
||||
$$
|
||||
\begin{bmatrix}
|
||||
1 & 2 & 3 \\
|
||||
a & b & c
|
||||
\end{bmatrix}
|
||||
$$
|
||||
|
||||
## RTL
|
||||
More information on configuring RTL languages like Arabic in the [config](notes/config.md) page.
|
6
content/notes/_index.md
Normal file
6
content/notes/_index.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
title: "Test Notes"
|
||||
bookCollapseSection: true
|
||||
---
|
||||
|
||||
# Hello World
|
63
content/notes/callouts.md
Normal file
63
content/notes/callouts.md
Normal file
@ -0,0 +1,63 @@
|
||||
---
|
||||
title: "Callouts"
|
||||
---
|
||||
|
||||
## Callout support
|
||||
|
||||
Quartz supports the same Admonition-callout syntax as Obsidian.
|
||||
|
||||
This includes
|
||||
- 12 Distinct callout types (each with several aliases)
|
||||
- Collapsable callouts
|
||||
|
||||
See [documentation on supported types and syntax here](https://help.obsidian.md/How+to/Use+callouts#Types).
|
||||
|
||||
## Showcase
|
||||
|
||||
> [!EXAMPLE] Examples
|
||||
>
|
||||
> Aliases: example
|
||||
|
||||
> [!note] Notes
|
||||
>
|
||||
> Aliases: note
|
||||
|
||||
> [!abstract] Summaries
|
||||
>
|
||||
> Aliases: abstract, summary, tldr
|
||||
|
||||
> [!info] Info
|
||||
>
|
||||
> Aliases: info, todo
|
||||
|
||||
> [!tip] Hint
|
||||
>
|
||||
> Aliases: tip, hint, important
|
||||
|
||||
> [!success] Success
|
||||
>
|
||||
> Aliases: success, check, done
|
||||
|
||||
> [!question] Question
|
||||
>
|
||||
> Aliases: question, help, faq
|
||||
|
||||
> [!warning] Warning
|
||||
>
|
||||
> Aliases: warning, caution, attention
|
||||
|
||||
> [!failure] Failure
|
||||
>
|
||||
> Aliases: failure, fail, missing
|
||||
|
||||
> [!danger] Error
|
||||
>
|
||||
> Aliases: danger, error
|
||||
|
||||
> [!bug] Bug
|
||||
>
|
||||
> Aliases: bug
|
||||
|
||||
> [!quote] Quote
|
||||
>
|
||||
> Aliases: quote, cite
|
228
content/notes/config.md
Normal file
228
content/notes/config.md
Normal file
@ -0,0 +1,228 @@
|
||||
---
|
||||
title: "Configuration"
|
||||
tags:
|
||||
- setup
|
||||
weight: 0
|
||||
---
|
||||
|
||||
## Configuration
|
||||
Quartz is designed to be extremely configurable. You can find the bulk of the configuration scattered throughout the repository depending on how in-depth you'd like to get.
|
||||
|
||||
The majority of configuration can be found under `data/config.yaml`. An annotated example configuration is shown below.
|
||||
|
||||
```yaml {title="data/config.yaml"}
|
||||
# The name to display in the footer
|
||||
name: Jacky Zhao
|
||||
|
||||
# whether to globally show the table of contents on each page
|
||||
# this can be turned off on a per-page basis by adding this to the
|
||||
# front-matter of that note
|
||||
enableToc: true
|
||||
|
||||
# whether to by-default open or close the table of contents on each page
|
||||
openToc: false
|
||||
|
||||
# whether to display on-hover link preview cards
|
||||
enableLinkPreview: true
|
||||
|
||||
# whether to render titles for code blocks
|
||||
enableCodeBlockTitle: true
|
||||
|
||||
# whether to render copy buttons for code blocks
|
||||
enableCodeBlockCopy: true
|
||||
|
||||
# whether to render callouts
|
||||
enableCallouts: true
|
||||
|
||||
# whether to try to process Latex
|
||||
enableLatex: true
|
||||
|
||||
# whether to enable single-page-app style rendering
|
||||
# this prevents flashes of unstyled content and improves
|
||||
# smoothness of Quartz. More info in issue #109 on GitHub
|
||||
enableSPA: true
|
||||
|
||||
# whether to render a footer
|
||||
enableFooter: true
|
||||
|
||||
# whether backlinks of pages should show the context in which
|
||||
# they were mentioned
|
||||
enableContextualBacklinks: true
|
||||
|
||||
# whether to show a section of recent notes on the home page
|
||||
enableRecentNotes: false
|
||||
|
||||
# whether to display an 'edit' button next to the last edited field
|
||||
# that links to github
|
||||
enableGitHubEdit: true
|
||||
GitHubLink: https://github.com/jackyzha0/quartz/tree/hugo/content
|
||||
|
||||
# whether to render mermaid diagrams
|
||||
enableMermaid: true
|
||||
|
||||
# whether to use Operand to power semantic search
|
||||
# IMPORTANT: replace this API key with your own if you plan on using
|
||||
# Operand search!
|
||||
search:
|
||||
enableSemanticSearch: false
|
||||
operandApiKey: "REPLACE-WITH-YOUR-OPERAND-API-KEY"
|
||||
operandIndexId: "REPLACE-WITH-YOUR-OPERAND-INDEX-ID"
|
||||
|
||||
# page description used for SEO
|
||||
description:
|
||||
Host your second brain and digital garden for free. Quartz features extremely fast full-text search,
|
||||
Wikilink support, backlinks, local graph, tags, and link previews.
|
||||
|
||||
# title of the home page (also for SEO)
|
||||
page_title:
|
||||
"🪴 Quartz 3.3"
|
||||
|
||||
# links to show in the footer
|
||||
links:
|
||||
- link_name: Twitter
|
||||
link: https://twitter.com/_jzhao
|
||||
- link_name: Github
|
||||
link: https://github.com/jackyzha0
|
||||
```
|
||||
|
||||
### Code Block Titles
|
||||
To add code block titles with Quartz:
|
||||
|
||||
1. Ensure that code block titles are enabled in Quartz's configuration:
|
||||
|
||||
```yaml {title="data/config.yaml", linenos=false}
|
||||
enableCodeBlockTitle: true
|
||||
```
|
||||
|
||||
2. Add the `title` attribute to the desired [code block
|
||||
fence](https://gohugo.io/content-management/syntax-highlighting/#highlighting-in-code-fences):
|
||||
|
||||
```markdown {linenos=false}
|
||||
```yaml {title="data/config.yaml"}
|
||||
enableCodeBlockTitle: true # example from step 1
|
||||
```
|
||||
```
|
||||
|
||||
**Note** that if `{title=<my-title>}` is included, and code block titles are not
|
||||
enabled, no errors will occur, and the title attribute will be ignored.
|
||||
|
||||
### HTML Favicons
|
||||
If you would like to customize the favicons of your Quartz-based website, you
|
||||
can add them to the `data/config.yaml` file. The **default** without any set
|
||||
`favicon` key is:
|
||||
|
||||
```html {title="layouts/partials/head.html", linenostart=15}
|
||||
<link rel="shortcut icon" href="icon.png" type="image/png">
|
||||
```
|
||||
|
||||
The default can be overridden by defining a value to the `favicon` key in your
|
||||
`data/config.yaml` file. For example, here is a `List[Dictionary]` example format, which is
|
||||
equivalent to the default:
|
||||
|
||||
```yaml {title="data/config.yaml", linenos=false}
|
||||
favicon:
|
||||
- { rel: "shortcut icon", href: "icon.png", type: "image/png" }
|
||||
# - { ... } # Repeat for each additional favicon you want to add
|
||||
```
|
||||
|
||||
In this format, the keys are identical to their HTML representations.
|
||||
|
||||
If you plan to add multiple favicons generated by a website (see list below), it
|
||||
may be easier to define it as HTML. Here is an example which appends the
|
||||
**Apple touch icon** to Quartz's default favicon:
|
||||
|
||||
```yaml {title="data/config.yaml", linenos=false}
|
||||
favicon: |
|
||||
<link rel="shortcut icon" href="icon.png" type="image/png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
```
|
||||
|
||||
This second favicon will now be used as a web page icon when someone adds your
|
||||
webpage to the home screen of their Apple device. If you are interested in more
|
||||
information about the current and past standards of favicons, you can read
|
||||
[this article](https://www.emergeinteractive.com/insights/detail/the-essentials-of-favicons/).
|
||||
|
||||
**Note** that all generated favicon paths, defined by the `href`
|
||||
attribute, are relative to the `static/` directory.
|
||||
|
||||
### Graph View
|
||||
To customize the Interactive Graph view, you can poke around `data/graphConfig.yaml`.
|
||||
|
||||
```yaml {title="data/graphConfig.yaml"}
|
||||
# if true, a Global Graph will be shown on home page with full width, no backlink.
|
||||
# A different set of Local Graphs will be shown on sub pages.
|
||||
# if false, Local Graph will be default on every page as usual
|
||||
enableGlobalGraph: false
|
||||
|
||||
### Local Graph ###
|
||||
localGraph:
|
||||
# whether automatically generate a legend
|
||||
enableLegend: false
|
||||
|
||||
# whether to allow dragging nodes in the graph
|
||||
enableDrag: true
|
||||
|
||||
# whether to allow zooming and panning the graph
|
||||
enableZoom: true
|
||||
|
||||
# how many neighbours of the current node to show (-1 is all nodes)
|
||||
depth: 1
|
||||
|
||||
# initial zoom factor of the graph
|
||||
scale: 1.2
|
||||
|
||||
# how strongly nodes should repel each other
|
||||
repelForce: 2
|
||||
|
||||
# how strongly should nodes be attracted to the center of gravity
|
||||
centerForce: 1
|
||||
|
||||
# what the default link length should be
|
||||
linkDistance: 1
|
||||
|
||||
# how big the node labels should be
|
||||
fontSize: 0.6
|
||||
|
||||
# scale at which to start fading the labes on nodes
|
||||
opacityScale: 3
|
||||
|
||||
### Global Graph ###
|
||||
globalGraph:
|
||||
# same settings as above
|
||||
|
||||
### For all graphs ###
|
||||
# colour specific nodes path off of their path
|
||||
paths:
|
||||
- /moc: "#4388cc"
|
||||
```
|
||||
|
||||
|
||||
## Styling
|
||||
Want to go even more in-depth? You can add custom CSS styling and change existing colours through editing `assets/styles/custom.scss`. If you'd like to target specific parts of the site, you can add ids and classes to the HTML partials in `/layouts/partials`.
|
||||
|
||||
### Partials
|
||||
Partials are what dictate what gets rendered to the page. Want to change how pages are styled and structured? You can edit the appropriate layout in `/layouts`.
|
||||
|
||||
For example, the structure of the home page can be edited through `/layouts/index.html`. To customize the footer, you can edit `/layouts/partials/footer.html`
|
||||
|
||||
More info about partials on [Hugo's website.](https://gohugo.io/templates/partials/)
|
||||
|
||||
Still having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md).
|
||||
|
||||
## Language Support
|
||||
[CJK + Latex Support (测试)](notes/CJK%20+%20Latex%20Support%20(测试).md) comes out of the box with Quartz.
|
||||
|
||||
Want to support languages that read from right-to-left (like Arabic)? Hugo (and by proxy, Quartz) supports this natively.
|
||||
|
||||
Follow the steps [Hugo provides here](https://gohugo.io/content-management/multilingual/#configure-languages) and modify your `config.toml`
|
||||
|
||||
For example:
|
||||
|
||||
```toml
|
||||
defaultContentLanguage = 'ar'
|
||||
[languages]
|
||||
[languages.ar]
|
||||
languagedirection = 'rtl'
|
||||
title = 'مدونتي'
|
||||
weight = 1
|
||||
```
|
17
content/notes/custom Domain.md
Normal file
17
content/notes/custom Domain.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "Custom Domain"
|
||||
---
|
||||
|
||||
### Registrar
|
||||
This step is only applicable if you are using a **custom domain**! If you are using a `<YOUR-USERNAME>.github.io` domain, you can skip this step.
|
||||
|
||||
For this last bit to take effect, you also need to create a CNAME record with the DNS provider you register your domain with (i.e. NameCheap, Google Domains).
|
||||
|
||||
GitHub has some [documentation on this](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site), but the tldr; is to
|
||||
|
||||
1. Go to your forked repository (`github.com/<YOUR-GITHUB-USERNAME>/quartz`) settings page and go to the Pages tab. Under "Custom domain", type your custom domain, then click **Save**.
|
||||
2. Go to your DNS Provider and create a CNAME record that points from your domain to `<YOUR-GITHUB-USERNAME.github.io.` (yes, with the trailing period).
|
||||
|
||||
![Example Configuration for Quartz](/notes/images/google-domains.png)*Example Configuration for Quartz*
|
||||
3. Wait 30 minutes to an hour for the network changes to kick in.
|
||||
4. Done!
|
56
content/notes/docker.md
Normal file
56
content/notes/docker.md
Normal file
@ -0,0 +1,56 @@
|
||||
---
|
||||
title: "Hosting with Docker"
|
||||
tags:
|
||||
- setup
|
||||
---
|
||||
|
||||
If you want to host Quartz on a machine without using a webpage hosting service, it may be easier to [install Docker Compose](https://docs.docker.com/compose/install/) and follow the instructions below than to [install Quartz's dependencies manually](notes/preview%20changes.md).
|
||||
## Hosting Quartz Locally
|
||||
You can serve Quartz locally at `http://localhost:1313` with the following script, replacing `/path/to/quartz` with the
|
||||
actual path to your Quartz folder.
|
||||
|
||||
docker-compose.yml
|
||||
```
|
||||
services:
|
||||
quartz-hugo:
|
||||
image: ghcr.io/jackyzha0/quartz:hugo
|
||||
container_name: quartz-hugo
|
||||
volumes:
|
||||
- /path/to/quartz:/quartz
|
||||
ports:
|
||||
- 1313:1313
|
||||
|
||||
# optional
|
||||
environment:
|
||||
- HUGO_BIND=0.0.0.0
|
||||
- HUGO_BASEURL=http://localhost
|
||||
- HUGO_PORT=1313
|
||||
- HUGO_APPENDPORT=true
|
||||
```
|
||||
|
||||
Then run with: `docker-compose up -d` in the same directory as your `docker-compose.yml` file.
|
||||
|
||||
While the container is running, you can update the `quartz` fork with: `docker exec -it quartz-hugo make update`.
|
||||
|
||||
## Exposing Your Container to the Internet
|
||||
|
||||
### To Your Public IP Address with Port Forwarding (insecure)
|
||||
|
||||
Assuming you are already familiar with [port forwarding](https://en.wikipedia.org/wiki/Port_forwarding) and [setting it up with your router model](https://portforward.com):
|
||||
|
||||
1. You should set the environment variable `HUGO_BASEURL=http://your-public-ip` and then start your container.
|
||||
2. Set up port forwarding on your router from port `p` to `your-local-ip:1313`.
|
||||
3. You should now be able to access Quartz from outside your local network at `http://your-public-ip:p`.
|
||||
|
||||
However, your HTTP connection will be unencrypted and **this method is not secure**.
|
||||
|
||||
### To a Domain using Cloudflare Proxy
|
||||
|
||||
1. Port forward 443 (HTTPS) from your machine.
|
||||
2. Buy a custom domain (say, `your-domain.com`) from [Cloudflare](https://www.cloudflare.com/products/registrar/). Point a DNS A record from `your-domain.com` to your public IP address and enable the proxy.
|
||||
3. Set the environment variables `HUGO_BASEURL=https://your-domain.com`, `HUGO_PORT=443`, and `HUGO_APPENDPORT=false`. Change `1313:1313` to `443:443` for the `ports` in `docker-compose.yml`.
|
||||
4. Spin up your Quartz container and enjoy it at `https://your-domain.com`!
|
||||
|
||||
### To a Domain using a Reverse Proxy
|
||||
|
||||
If you want to serve more than just Quartz to the internet on this machine (or don't want to use the Cloudflare registrar and proxy), you should follow the steps in the section above (as appropriate) and also set up a reverse proxy, like [Traefik](https://doc.traefik.io/traefik). Be sure to configure your TLS certificates too!
|
66
content/notes/editing.md
Normal file
66
content/notes/editing.md
Normal file
@ -0,0 +1,66 @@
|
||||
---
|
||||
title: "Editing Content in Quartz"
|
||||
tags:
|
||||
- setup
|
||||
weight: -4
|
||||
---
|
||||
|
||||
## Editing
|
||||
Quartz runs on top of [Hugo](https://gohugo.io/) so all notes are written in [Markdown](https://www.markdownguide.org/getting-started/).
|
||||
|
||||
### Folder Structure
|
||||
Here's a rough overview of what's what.
|
||||
|
||||
**All content in your garden can found in the `/content` folder.** To make edits, you can open any of the files and make changes directly and save it. You can organize content into any folder you'd like.
|
||||
|
||||
**To edit the main home page, open `/content/_index.md`.**
|
||||
|
||||
To create a link between notes in your garden, just create a normal link using Markdown pointing to the document in question. Please note that **all links should be relative to the root `/content` path**.
|
||||
|
||||
```markdown
|
||||
For example, I want to link this current document to `notes/config.md`.
|
||||
[A link to the config page](notes/config.md)
|
||||
```
|
||||
|
||||
Similarly, you can put local images anywhere in the `/content` folder.
|
||||
|
||||
```markdown
|
||||
Example image (source is in content/notes/images/example.png)
|
||||
![Example Image](/content/notes/images/example.png)
|
||||
```
|
||||
|
||||
You can also use wikilinks if that is what you are more comfortable with!
|
||||
|
||||
### Front Matter
|
||||
Hugo is picky when it comes to metadata for files. Make sure that your title is double-quoted and that you have a title defined at the top of your file like so. You can also add tags here as well.
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "Example Title"
|
||||
tags:
|
||||
- example-tag
|
||||
---
|
||||
|
||||
Rest of your content here...
|
||||
```
|
||||
|
||||
### Obsidian
|
||||
I recommend using [Obsidian](http://obsidian.md/) as a way to edit and grow your digital garden. It comes with a really nice editor and graphical interface to preview all of your local files.
|
||||
|
||||
This step is **highly recommended**.
|
||||
|
||||
> 🔗 Step 3: [How to setup your Obsidian Vault to work with Quartz](notes/obsidian.md)
|
||||
|
||||
## Previewing Changes
|
||||
This step is purely optional and mostly for those who want to see the published version of their digital garden locally before opening it up to the internet. This is *highly recommended* but not required.
|
||||
|
||||
> 👀 Step 4: [Preview Quartz Changes](notes/preview%20changes.md)
|
||||
|
||||
For those who like to live life more on the edge, viewing the garden through Obsidian gets you pretty close to the real thing.
|
||||
|
||||
## Publishing Changes
|
||||
Now that you know the basics of managing your digital garden using Quartz, you can publish it to the internet!
|
||||
|
||||
> 🌍 Step 5: [Hosting Quartz online!](notes/hosting.md)
|
||||
|
||||
Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md).
|
96
content/notes/hosting.md
Normal file
96
content/notes/hosting.md
Normal file
@ -0,0 +1,96 @@
|
||||
---
|
||||
title: "Deploying Quartz to the Web"
|
||||
tags:
|
||||
- setup
|
||||
weight: -1
|
||||
aliases:
|
||||
- hosting
|
||||
---
|
||||
|
||||
## Hosting on GitHub Pages
|
||||
Quartz is designed to be effortless to deploy. If you forked and cloned Quartz directly from the repository, everything should already be good to go! Follow the steps below.
|
||||
|
||||
### Enable GitHub Actions
|
||||
By default, GitHub disables workflows from running automatically on Forked Repostories. Head to the 'Actions' tab of your forked repository and Enable Workflows to setup deploying your Quartz site!
|
||||
|
||||
![Enable GitHub Actions](notes/images/github-actions.png)*Enable GitHub Actions*
|
||||
|
||||
### Enable GitHub Pages
|
||||
|
||||
Head to the 'Settings' tab of your forked repository and go to the 'Pages' tab.
|
||||
|
||||
1. (IMPORTANT) Set the source to deploy from `master` (and not `hugo`) using `/ (root)`
|
||||
2. Set a custom domain here if you have one!
|
||||
|
||||
![Enable GitHub Pages](/notes/images/github-pages.png)*Enable GitHub Pages*
|
||||
|
||||
### Pushing Changes
|
||||
To see your changes on the internet, we need to push it them to GitHub. Quartz is a `git` repository so updating it is the same workflow as you would follow as if it were just a regular software project.
|
||||
|
||||
```shell
|
||||
# Navigate to Quartz folder
|
||||
cd <path-to-quartz>
|
||||
|
||||
# Commit all changes
|
||||
git add .
|
||||
git commit -m "message describing changes"
|
||||
|
||||
# Push to GitHub to update site
|
||||
git push origin hugo
|
||||
```
|
||||
|
||||
Note: we specifically push to the `hugo` branch here. Our GitHub action automatically runs everytime a push to is detected to that branch and then updates the `master` branch for redeployment.
|
||||
|
||||
### Setting up the Site
|
||||
Now let's get this site up and running. Never hosted a site before? No problem. Have a fancy custom domain you already own or want to subdomain your Quartz? That's easy too.
|
||||
|
||||
Here, we take advantage of GitHub's free page hosting to deploy our site. Change `baseURL` in `/config.toml`.
|
||||
|
||||
Make sure that your `baseURL` has a trailing `/`!
|
||||
|
||||
[Reference `config.toml` here](https://github.com/jackyzha0/quartz/blob/hugo/config.toml)
|
||||
|
||||
```toml
|
||||
baseURL = "https://<YOUR-DOMAIN>/"
|
||||
```
|
||||
|
||||
If you are using this under a subdomain (e.g. `<YOUR-GITHUB-USERNAME>.github.io/quartz`), include the trailing `/`. **You need to do this especially if you are using GitHub!**
|
||||
|
||||
```toml
|
||||
baseURL = "https://<YOUR-GITHUB-USERNAME>.github.io/quartz/"
|
||||
```
|
||||
|
||||
Change `cname` in `/.github/workflows/deploy.yaml`. Again, if you don't have a custom domain to use, you can use `<YOUR-USERNAME>.github.io`.
|
||||
|
||||
Please note that the `cname` field should *not* have any path `e.g. end with /quartz` or have a trailing `/`.
|
||||
|
||||
[Reference `deploy.yaml` here](https://github.com/jackyzha0/quartz/blob/hugo/.github/workflows/deploy.yaml)
|
||||
|
||||
```yaml {title=".github/workflows/deploy.yaml"}
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }} # this can stay as is, GitHub fills this in for us!
|
||||
publish_dir: ./public
|
||||
publish_branch: master
|
||||
cname: <YOUR-DOMAIN>
|
||||
```
|
||||
|
||||
Have a custom domain? [Learn how to set it up with Quartz ](notes/custom%20Domain.md).
|
||||
|
||||
### Ignoring Files
|
||||
Only want to publish a subset of all of your notes? Don't worry, Quartz makes this a simple two-step process.
|
||||
|
||||
❌ [Excluding pages from being published](notes/ignore%20notes.md)
|
||||
|
||||
## Docker Support
|
||||
If you don't want to use a hosting service, you can host using [Docker](notes/docker.md) instead!
|
||||
I would *not use this method* unless you know what you are doing.
|
||||
|
||||
---
|
||||
|
||||
Now that your Quartz is live, let's figure out how to make Quartz really *yours*!
|
||||
|
||||
> Step 6: 🎨 [Customizing Quartz](notes/config.md)
|
||||
|
||||
Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md).
|
31
content/notes/ignore notes.md
Normal file
31
content/notes/ignore notes.md
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
title: "Ignoring Notes"
|
||||
---
|
||||
|
||||
### Quartz Ignore
|
||||
Edit `ignoreFiles` in `config.toml` to include paths you'd like to exclude from being rendered.
|
||||
|
||||
```toml
|
||||
...
|
||||
ignoreFiles = [
|
||||
"/content/templates/*",
|
||||
"/content/private/*",
|
||||
"<your path here>"
|
||||
]
|
||||
```
|
||||
|
||||
`ignoreFiles` supports the use of Regular Expressions (RegEx) so you can ignore patterns as well (e.g. ignoring all `.png`s by doing `\\.png$`).
|
||||
To ignore a specific file, you can also add the tag `draft: true` to the frontmatter of a note.
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: Some Private Note
|
||||
draft: true
|
||||
---
|
||||
...
|
||||
```
|
||||
|
||||
More details in [Hugo's documentation](https://gohugo.io/getting-started/configuration/#ignore-content-and-data-files-when-rendering).
|
||||
|
||||
### Global Ignore
|
||||
However, just adding to the `ignoreFiles` will only prevent the page from being access through Quartz. If you want to prevent the file from being pushed to GitHub (for example if you have a public repository), you need to also add the path to the `.gitignore` file at the root of the repository.
|
BIN
content/notes/images/github-actions.png
Normal file
BIN
content/notes/images/github-actions.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 116 KiB |
BIN
content/notes/images/github-pages.png
Normal file
BIN
content/notes/images/github-pages.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 226 KiB |
BIN
content/notes/images/google-domains.png
Normal file
BIN
content/notes/images/google-domains.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 72 KiB |
BIN
content/notes/images/obsidian-settings.png
Normal file
BIN
content/notes/images/obsidian-settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
32
content/notes/obsidian.md
Normal file
32
content/notes/obsidian.md
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "Obsidian Vault Integration"
|
||||
tags:
|
||||
- setup
|
||||
weight: -3
|
||||
---
|
||||
|
||||
## Setup
|
||||
Obsidian is the preferred way to use Quartz. You can either create a new Obsidian Vault or link one that your already have.
|
||||
|
||||
### New Vault
|
||||
If you don't have an existing Vault, [download Obsidian](https://obsidian.md/) and create a new Vault in the `/content` folder that you created and cloned during the [setup](notes/setup.md) step.
|
||||
|
||||
### Linking an existing Vault
|
||||
The easiest way to use an existing Vault is to copy all of your files (directory and hierarchies intact) into the `/content` folder.
|
||||
|
||||
## Settings
|
||||
Great, now that you have your Obsidian linked to your Quartz, let's fix some settings so that they play well.
|
||||
|
||||
1. Under Options > Files and Links, set the New link format to always use Absolute Path in Vault.
|
||||
2. Go to Settings > Files & Links > Turn "on" automatically update internal links.
|
||||
|
||||
![Obsidian Settings](/notes/images/obsidian-settings.png)*Obsidian Settings*
|
||||
|
||||
## Templates
|
||||
Inserting front matter everytime you want to create a new Note gets annoying really quickly. Luckily, Obsidian supports templates which makes inserting new content really easily.
|
||||
|
||||
**If you decide to overwrite the `/content` folder completely, don't remove the `/content/templates` folder!**
|
||||
|
||||
Head over to Options > Core Plugins and enable the Templates plugin. Then go to Options > Hotkeys and set a hotkey for 'Insert Template' (I recommend `[cmd]+T`). That way, when you create a new note, you can just press the hotkey for a new template and be ready to go!
|
||||
|
||||
> 👀 Step 4: [Preview Quartz Changes](notes/preview%20changes.md)
|
17
content/notes/philosophy.md
Normal file
17
content/notes/philosophy.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "Quartz Philosophy"
|
||||
---
|
||||
|
||||
> “[One] who works with the door open gets all kinds of interruptions, but [they] also occasionally gets clues as to what the world is and what might be important.” — Richard Hamming
|
||||
|
||||
## Why Quartz?
|
||||
Hosting a public digital garden isn't easy. There are an overwhelming number of tutorials, resources, and guides for tools like [Notion](https://www.notion.so/), [Roam](https://roamresearch.com/), and [Obsidian](https://obsidian.md/), yet none of them have super easy to use *free* tools to publish that garden to the world.
|
||||
|
||||
I've personally found that
|
||||
1. It's nice to access notes from anywhere
|
||||
2. Having a public digital garden invites open conversations
|
||||
3. It makes keeping personal notes and knowledge *playful and fun*
|
||||
|
||||
I was really inspired by [Bianca](https://garden.bianca.digital/) and [Joel](https://joelhooks.com/digital-garden)'s digital gardens and wanted to try making my own.
|
||||
|
||||
**The goal of Quartz is to make hosting your own public digital garden free and simple.** You don't even need your own website. Quartz does all of that for you and gives your own little corner of the internet.
|
43
content/notes/preview changes.md
Normal file
43
content/notes/preview changes.md
Normal file
@ -0,0 +1,43 @@
|
||||
---
|
||||
title: "Preview Changes"
|
||||
tags:
|
||||
- setup
|
||||
weight: -2
|
||||
---
|
||||
|
||||
If you'd like to preview what your Quartz site looks like before deploying it to the internet, the following
|
||||
instructions guide you through installing the proper dependencies to run it locally.
|
||||
|
||||
|
||||
## Install `hugo-obsidian`
|
||||
This step will generate the list of backlinks for Hugo to parse. Ensure you have [Go](https://golang.org/doc/install) (>= 1.16) installed.
|
||||
|
||||
```bash
|
||||
# Install and link `hugo-obsidian` locally
|
||||
go install github.com/jackyzha0/hugo-obsidian@latest
|
||||
```
|
||||
|
||||
If you are running into an error saying that `command not found: hugo-obsidian`, make sure you set your `GOPATH` correctly! This will allow your terminal to correctly recognize hugo-obsidian as an executable.
|
||||
|
||||
Afterwards, start the Hugo server as shown above and your local backlinks and interactive graph should be populated!
|
||||
|
||||
## Installing Hugo
|
||||
Hugo is the static site generator that powers Quartz. [Install Hugo with "extended" Sass/SCSS version](https://gohugo.io/getting-started/installing/) first. Then,
|
||||
|
||||
```bash
|
||||
# Navigate to your local Quartz folder
|
||||
cd <location-of-your-local-quartz>
|
||||
|
||||
# Start local server
|
||||
make serve
|
||||
|
||||
# View your site in a browser at http://localhost:1313/
|
||||
```
|
||||
|
||||
> [!INFO] Docker Support
|
||||
>
|
||||
> If you have Docker installed already, open your terminal, navigate to your folder with Quartz and run `make docker`
|
||||
|
||||
Now that you are happy with how your Quartz instance looks, let's get it hosted!
|
||||
|
||||
> 🌍 Step 5: [Hosting Quartz online!](notes/hosting.md)
|
37
content/notes/search.md
Normal file
37
content/notes/search.md
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
title: "Search"
|
||||
---
|
||||
|
||||
Quartz supports two modes of searching through content.
|
||||
|
||||
## Full-text
|
||||
Full-text search is the default in Quartz. It produces results that *exactly* match the search query. This is easier to setup but usually produces lower quality matches.
|
||||
|
||||
```yaml {title="data/config.yaml"}
|
||||
# the default option
|
||||
enableSemanticSearch: false
|
||||
```
|
||||
|
||||
## Natural Language
|
||||
Natural language search is powered by [Operand](https://beta.operand.ai/). It understands language like a person does and finds results that best match user intent. In this sense, it is closer to how Google Search works.
|
||||
|
||||
Natural language search tends to produce higher quality results than full-text search.
|
||||
|
||||
Here's how to set it up.
|
||||
|
||||
1. Login or Register for a new Operand account. Click the verification link sent to your email, and you'll be redirected to the dashboard. (Note) You do not need to enter a credit card to create an account, or get started with the Operand API. The first $10 of usage each month is free. To learn more, see pricing. If you go over your free quota, we'll (politely) reach out and ask you to configure billing.
|
||||
2. Create your first index. On the dashboard, under "Indexes", enter the name and description of your index, and click "Create Index". Note down the ID of the index (obtained by clicking on the index name in the list of indexes), as you'll need it in the next step. IDs are unique to each index, and look something like `uqv1duxxbdxu`.
|
||||
3. Click into the index you've created. Under "Index Something", select "SITEMAP" from the dropdown and click "Add Source".
|
||||
4. For the "Sitemap.xml URL", put your deployed site's base URL followed by `sitemap.xml`. For example, for `quartz.jzhao.xyz`, put `https://quartz.jzhao.xyz/sitemap.xml`. Leave the URL Regex empty.
|
||||
5. Get your API key. On the dashboard, under "API Keys", you can manage your API keys. If you don't already have an API key, click "Create API Key". You'll need this for the next step.
|
||||
6. Open `data/config.yaml`. Set `enableSemanticSearch` to `true`, `operandApiKey` to your copied key, and `operandIndexId` to the ID of the index we created from earlier..
|
||||
|
||||
```yaml {title="data/config.yaml"}
|
||||
# the default option
|
||||
search:
|
||||
enableSemanticSearch: true
|
||||
operandApiKey: "jp9k5hudse2a828z98kxd6z3payi8u90rnjf"
|
||||
operandIndexId: "s0kf3bd6tldw"
|
||||
```
|
||||
7. Push your changes to the site and wait for it to deploy.
|
||||
8. Check the Operand dashboard and wait for your site to index. Enjoy natural language search powered by Operand!
|
32
content/notes/setup.md
Normal file
32
content/notes/setup.md
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "Setup"
|
||||
tags:
|
||||
- setup
|
||||
weight: -5
|
||||
---
|
||||
|
||||
## Making your own Quartz
|
||||
Setting up Quartz requires a basic understanding of `git`. If you are unfamiliar, [this resource](https://resources.nwplus.io/2-beginner/how-to-git-github.html) is a great place to start!
|
||||
|
||||
### Forking
|
||||
> A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
|
||||
|
||||
Navigate to the GitHub repository for the Quartz project:
|
||||
|
||||
📁 [Quartz Repository](https://github.com/jackyzha0/quartz)
|
||||
|
||||
Then, Fork the repository into your own GitHub account. If you don't have an account, you can make on for free [here](https://github.com/join). More details about forking a repo can be found on [GitHub's documentation](https://docs.github.com/en/get-started/quickstart/fork-a-repo).
|
||||
|
||||
### Cloning
|
||||
After you've made a fork of the repository, you need to download the files locally onto your machine. Ensure you have `git`, then type the following command replacing `YOUR-USERNAME` with your GitHub username.
|
||||
|
||||
```shell
|
||||
git clone https://github.com/YOUR-USERNAME/quartz
|
||||
```
|
||||
|
||||
## Editing
|
||||
Great! Now you have everything you need to start editing and growing your digital garden. If you're ready to start writing content already, check out the recommended flow for editing notes in Quartz.
|
||||
|
||||
> ✏️ Step 2: [Editing Notes in Quartz](notes/editing.md)
|
||||
|
||||
Having problems? Checkout our [FAQ and Troubleshooting guide](notes/troubleshooting.md).
|
23
content/notes/showcase.md
Normal file
23
content/notes/showcase.md
Normal file
@ -0,0 +1,23 @@
|
||||
---
|
||||
title: "Showcase"
|
||||
---
|
||||
|
||||
Want to see what Quartz can do? Here are some cool community gardens :)
|
||||
|
||||
- [Quartz Documentation (this site!)](https://quartz.jzhao.xyz/)
|
||||
- [Jacky Zhao's Garden](https://jzhao.xyz/)
|
||||
- [Scaling Synthesis - A hypertext research notebook](https://scalingsynthesis.com/)
|
||||
- [AWAGMI Intern Notes](https://notes.awagmi.xyz/)
|
||||
- [Shihyu's PKM](https://shihyuho.github.io/pkm/)
|
||||
- [Chloe's Garden](https://garden.chloeabrasada.online/)
|
||||
- [SlRvb's Site](https://slrvb.github.io/Site/)
|
||||
- [Course notes for Information Technology Advanced Theory](https://a2itnotes.github.io/quartz/)
|
||||
- [Brandon Boswell's Garden](https://brandonkboswell.com)
|
||||
- [Siyang's Courtyard](https://siyangsun.github.io/courtyard/)
|
||||
- [Data Dictionary 🧠](https://glossary.airbyte.com/)
|
||||
- [sspaeti.com's Second Brain](https://brain.sspaeti.com/)
|
||||
- [oldwinterの数字花园](https://garden.oldwinter.top/)
|
||||
- [SethMB Work](https://sethmb.xyz/)
|
||||
- [Abhijeet's Math Wiki](https://abhmul.github.io/quartz/Math-Wiki/)
|
||||
|
||||
If you want to see your own on here, submit a [Pull Request adding yourself to this file](https://github.com/jackyzha0/quartz/blob/hugo/content/notes/showcase.md)!
|
81
content/notes/troubleshooting.md
Normal file
81
content/notes/troubleshooting.md
Normal file
@ -0,0 +1,81 @@
|
||||
---
|
||||
title: "Troubleshooting and FAQ"
|
||||
---
|
||||
|
||||
Still having trouble? Here are a list of common questions and problems people encounter when installing Quartz.
|
||||
|
||||
While you're here, join our [Discord](https://discord.gg/cRFFHYye7t) :)
|
||||
|
||||
### Does Quartz have Latex support?
|
||||
Yes! See [CJK + Latex Support (测试)](notes/CJK%20+%20Latex%20Support%20(测试).md) for a brief demo.
|
||||
|
||||
### Can I use \<Obsidian Plugin\> in Quartz?
|
||||
Unless it produces direct Markdown output in the file, no. There currently is no way to bundle plugin code with Quartz.
|
||||
|
||||
The easiest way would be to add your own HTML partial that supports the functionality you are looking for.
|
||||
|
||||
### My GitHub pages is just showing the README and not Quartz
|
||||
Make sure you set the source to deploy from `master` (and not `hugo`) using `/ (root)`! See more in the [hosting](/notes/hosting) guide
|
||||
|
||||
### Some of my pages have 'January 1, 0001' as the last modified date
|
||||
This is a problem caused by `git` treating files as case-insensitive by default and some of your posts probably have capitalized file names. You can turn this off in your Quartz by running this command.
|
||||
|
||||
```shell
|
||||
# in the root of your Quartz (same folder as config.toml)
|
||||
git config core.ignorecase true
|
||||
|
||||
# or globally (not recommended)
|
||||
git config --global core.ignorecase true
|
||||
```
|
||||
|
||||
### Can I publish only a subset of my pages?
|
||||
Yes! Quartz makes selective publishing really easy. Heres a guide on [excluding pages from being published](notes/ignore%20notes.md).
|
||||
|
||||
### Can I host this myself and not on GitHub Pages?
|
||||
Yes! All built files can be found under `/public` in the `master` branch. More details under [hosting](notes/hosting.md).
|
||||
|
||||
### `command not found: hugo-obsidian`
|
||||
Make sure you set your `GOPATH` correctly! This will allow your terminal to correctly recognize `hugo-obsidian` as an executable.
|
||||
|
||||
```shell
|
||||
# Add the following 2 lines to your ~/.bash_profile
|
||||
export GOPATH=/Users/$USER/go
|
||||
export PATH=$GOPATH/bin:$PATH
|
||||
|
||||
# In your current terminal, to reload the session
|
||||
source ~/.bash_profile
|
||||
```
|
||||
|
||||
### How come my notes aren't being rendered?
|
||||
You probably forgot to include front matter in your Markdown files. You can either setup [Obsidian](notes/obsidian.md) to do this for you or you need to manually define it. More details in [the 'how to edit' guide](notes/editing.md).
|
||||
|
||||
### My custom domain isn't working!
|
||||
Walk through the steps in [the hosting guide](notes/hosting.md) again. Make sure you wait 30 min to 1 hour for changes to take effect.
|
||||
|
||||
### How do I setup Google Analytics?
|
||||
You can edit it in `config.toml` and either use a V3 (UA-) or V4 (G-) tag.
|
||||
|
||||
### How do I change the content on the home page?
|
||||
To edit the main home page, open `/content/_index.md`.
|
||||
|
||||
### How do I change the colours?
|
||||
You can change the theme by editing `assets/custom.scss`. More details on customization and themeing can be found in the [customization guide](notes/config.md).
|
||||
|
||||
### How do I add images?
|
||||
You can put images anywhere in the `/content` folder.
|
||||
|
||||
```markdown
|
||||
Example image (source is in content/notes/images/example.png)
|
||||
![Example Image](/content/notes/images/example.png)
|
||||
```
|
||||
|
||||
### My Interactive Graph and Backlinks aren't up to date
|
||||
By default, the `linkIndex.json` (which Quartz needs to generate the Interactive Graph and Backlinks) are not regenerated locally. To set that up, see the guide on [local editing](notes/editing.md)
|
||||
|
||||
### Can I use React/Vue/some other framework?
|
||||
Not out of the box. You could probably make it work by editing `/layouts/_default/single.html` but that's not what Quartz is designed to work with. 99% of things you are trying to do with those frameworks you can accomplish perfectly fine using just vanilla HTML/CSS/JS.
|
||||
|
||||
## Still Stuck?
|
||||
Quartz isn't perfect! If you're still having troubles, file an issue in the GitHub repo with as much information as you can reasonably provide. Alternatively, you can message me on [Twitter](https://twitter.com/_jzhao) and I'll try to get back to you as soon as I can.
|
||||
|
||||
🐛 [Submit an Issue](https://github.com/jackyzha0/quartz/issues)
|
34
content/notes/updating.md
Normal file
34
content/notes/updating.md
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
title: "Updating"
|
||||
aliases:
|
||||
- update
|
||||
---
|
||||
|
||||
Haven't updated Quartz in a while and want all the cool new optimizations? On Unix/Mac systems you can run the following command for a one-line update! This command will show you a log summary of all commits since you last updated, press `q` to acknowledge this. Then, it will show you each change in turn and press `y` to accept the patch or `n` to reject it. Usually you should press `y` for most of these unless it conflicts with existing changes you've made!
|
||||
|
||||
```shell
|
||||
make update
|
||||
```
|
||||
|
||||
Or, if you don't want the interactive parts and just want to force update your local garden (this assumed that you are okay with some of your personalizations been overriden!)
|
||||
|
||||
```shell
|
||||
make update-force
|
||||
```
|
||||
|
||||
Or, manually checkout the changes yourself.
|
||||
|
||||
> [!warning] Warning!
|
||||
>
|
||||
> If you customized the files in `data/`, or anything inside `layouts/`, your customization may be overwritten!
|
||||
> Make sure you have a copy of these changes if you don't want to lose them.
|
||||
|
||||
|
||||
```shell
|
||||
# add Quartz as a remote host
|
||||
git remote add upstream git@github.com:jackyzha0/quartz.git
|
||||
|
||||
# index and fetch changes
|
||||
git fetch upstream
|
||||
git checkout -p upstream/hugo -- layouts .github Makefile assets/js assets/styles/base.scss assets/styles/darkmode.scss config.toml data
|
||||
```
|
7
content/posts/_index.md
Normal file
7
content/posts/_index.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
menu:
|
||||
after:
|
||||
name: blog
|
||||
weight: 5
|
||||
title: Blog
|
||||
---
|
1150
content/posts/creating-a-new-theme.md
Normal file
1150
content/posts/creating-a-new-theme.md
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user