├── .gitignore ├── .gitmodules ├── .prettierrc ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── config.toml ├── content ├── _index.md ├── about.md ├── posts │ ├── _index.md │ ├── configuration.md │ ├── markdown.md │ ├── math-symbol.md │ ├── multi-version-full.md │ ├── multi-version-short.md │ ├── shortcode.md │ ├── test.md │ └── without-title.md └── projects │ ├── _index.md │ ├── project-1.jpg │ ├── project_1.md │ ├── project_2.md │ ├── project_3.md │ ├── project_4.md │ └── project_5.md ├── frontend ├── .gitignore ├── breakpoints.json ├── package.json ├── src │ ├── global.d.ts │ ├── index.ts │ ├── render.ts │ └── typst.css ├── tsconfig.json └── vite.config.mjs ├── package.json ├── packages └── typst-apollo │ ├── book.typ │ ├── lib.typ │ ├── pages.typ │ ├── theme-style.toml │ ├── theme.typ │ ├── tokyo-night.tmTheme.xml │ └── typst.toml ├── sass └── main.scss ├── scripts ├── build-posts.js └── compiler.js ├── static ├── favicon.ico └── svg_utils.js ├── templates ├── macros │ └── typst.html ├── page.html └── partials │ └── header.html ├── themes └── apollo │ ├── .editorconfig │ ├── .github │ └── workflows │ │ └── zola.yml │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── config.toml │ ├── content │ ├── _index.md │ ├── about.md │ ├── posts │ │ ├── _index.md │ │ ├── configuration.md │ │ ├── markdown.md │ │ ├── math-symbol.md │ │ └── shortcode.md │ └── projects │ │ ├── _index.md │ │ ├── project-1.jpg │ │ ├── project_1.md │ │ ├── project_2.md │ │ ├── project_3.md │ │ ├── project_4.md │ │ └── project_5.md │ ├── sass │ ├── fonts.scss │ ├── main.scss │ ├── parts │ │ ├── _cards.scss │ │ ├── _code.scss │ │ ├── _header.scss │ │ ├── _image.scss │ │ ├── _misc.scss │ │ ├── _note.scss │ │ ├── _table.scss │ │ ├── _tags.scss │ │ └── _toc.scss │ └── theme │ │ ├── dark.scss │ │ └── light.scss │ ├── screenshot-dark.png │ ├── screenshot.png │ ├── shell.nix │ ├── static │ ├── feather │ │ ├── moon.svg │ │ └── sun.svg │ ├── fonts │ │ ├── .gitkeep │ │ ├── JetbrainsMono │ │ │ ├── JetBrainsMono-Bold.ttf │ │ │ ├── JetBrainsMono-BoldItalic.ttf │ │ │ ├── JetBrainsMono-ExtraBold.ttf │ │ │ ├── JetBrainsMono-ExtraBoldItalic.ttf │ │ │ ├── JetBrainsMono-ExtraLight.ttf │ │ │ ├── JetBrainsMono-ExtraLightItalic.ttf │ │ │ ├── JetBrainsMono-Italic.ttf │ │ │ ├── JetBrainsMono-Light.ttf │ │ │ ├── JetBrainsMono-LightItalic.ttf │ │ │ ├── JetBrainsMono-Medium.ttf │ │ │ ├── JetBrainsMono-MediumItalic.ttf │ │ │ ├── JetBrainsMono-Regular.ttf │ │ │ ├── JetBrainsMono-SemiBold.ttf │ │ │ ├── JetBrainsMono-SemiBoldItalic.ttf │ │ │ ├── JetBrainsMono-Thin.ttf │ │ │ └── JetBrainsMono-ThinItalic.ttf │ │ └── SpaceGrotesk │ │ │ ├── SpaceGrotesk-Bold.ttf │ │ │ ├── SpaceGrotesk-Light.ttf │ │ │ ├── SpaceGrotesk-Medium.ttf │ │ │ ├── SpaceGrotesk-Regular.ttf │ │ │ └── SpaceGrotesk-SemiBold.ttf │ ├── js │ │ ├── codeblock.js │ │ ├── count.js │ │ ├── imamu.js │ │ ├── main.js │ │ ├── note.js │ │ ├── themetoggle.js │ │ └── toc.js │ └── social_icons │ │ ├── LICENSE │ │ ├── apple.svg │ │ ├── bitcoin.svg │ │ ├── deviantart.svg │ │ ├── diaspora.svg │ │ ├── discord.svg │ │ ├── discourse.svg │ │ ├── email.svg │ │ ├── ethereum.svg │ │ ├── etsy.svg │ │ ├── facebook.svg │ │ ├── github.svg │ │ ├── gitlab.svg │ │ ├── google.svg │ │ ├── hacker-news.svg │ │ ├── instagram.svg │ │ ├── linkedin.svg │ │ ├── mastodon.svg │ │ ├── matrix.svg │ │ ├── paypal.svg │ │ ├── pinterest.svg │ │ ├── quora.svg │ │ ├── reddit.svg │ │ ├── rss.svg │ │ ├── skype.svg │ │ ├── slack.svg │ │ ├── snapchat.svg │ │ ├── soundcloud.svg │ │ ├── spotify.svg │ │ ├── stack-exchange.svg │ │ ├── stack-overflow.svg │ │ ├── steam.svg │ │ ├── telegram.svg │ │ ├── twitter.svg │ │ ├── vimeo.svg │ │ ├── whatsapp.svg │ │ ├── x-twitter.svg │ │ └── youtube.svg │ ├── templates │ ├── 404.html │ ├── base.html │ ├── cards.html │ ├── homepage.html │ ├── index.html │ ├── macros │ │ └── macros.html │ ├── page.html │ ├── partials │ │ ├── header.html │ │ └── nav.html │ ├── section.html │ ├── shortcodes │ │ └── note.html │ ├── taxonomy_list.html │ └── taxonomy_single.html │ └── theme.toml ├── typ ├── intro │ ├── build-config.toml │ ├── full.typ │ └── short.typ ├── posts │ └── test │ │ ├── main.typ │ │ └── refs.bib └── single.typ └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | static/typst/* 2 | node_modules 3 | public/ 4 | .idea 5 | target/ 6 | static/apollo-typst 7 | static/typst 8 | static/wasm -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "themes/apollo"] 2 | path = themes/apollo 3 | url = https://github.com/not-matthias/apollo 4 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "singleQuote": true, 4 | "trailingComma": "all", 5 | "useTabs": false, 6 | "tabWidth": 2, 7 | "arrowParens": "avoid", 8 | "semi": true, 9 | "endOfLine": "auto" 10 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[javascript]": { 3 | "editor.defaultFormatter": "esbenp.prettier-vscode", 4 | "editor.formatOnSave": true 5 | }, 6 | "[typescript]": { 7 | "editor.defaultFormatter": "esbenp.prettier-vscode", 8 | "editor.formatOnSave": true 9 | }, 10 | "[html]": { 11 | "editor.defaultFormatter": "esbenp.prettier-vscode", 12 | "editor.formatOnSave": false 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # apollo-typst 2 | 3 | Typst static site template based on [Zola](https://getzola.org), [typst.ts](https://github.com/Myriad-Dreamin/typst.ts), and [apollo](https://github.com/not-matthias/apollo). See a live preview [here](https://dark-flames.com). 4 | 5 | ## Features 6 | 7 | - Full functionality of [Zola](https://getzola.org) and [apollo](https://github.com/not-matthias/apollo). 8 | - Supports both markdown and [typst](https://typst.app/). 9 | 10 | ## Usage 11 | 12 | ### Preparation 13 | 14 | - Install `yarn` and execute `yarn install`. 15 | - Install `zola` following its [document](https://www.getzola.org/documentation/getting-started/installation/). 16 | - Install `typst-ts-cli` following its [document](https://github.com/Myriad-Dreamin/typst.ts/tree/main?tab=readme-ov-file#concept-precompiler). 17 | - Configure your site in `config.toml`. Full configuration options can be found in the [apollo documentation](https://github.com/not-matthias/apollo/blob/main/content/posts/configuration.md). 18 | 19 | ### Write posts with Typst 20 | 21 | - `appollo-typst` support both single files and workspaces: 22 | 23 | - If a subdirectory of typ contains `main.typ`, it will be treated as a workspace, with `main.typ` serving as the entry point. 24 | 25 | - Otherwise, each .typ file within the subdirectory will be compiled independently. 26 | 27 | - Create a `.md` file in the `content` directory and write the metadata of the post in the front matter. Then, add the `extra.typst` field to the front matter, specifying the name (relative path to `typ/`) of the typst file or the typst workspace. The content of the markdown file will be ignored; instead, the content from the typst file will be utilized. For an example, refer to `content/posts/test.md`. 28 | 29 | - If the typst output has its own title, you can set `extra.hide_title = true` to prevent zola from generating a redundant title. 30 | 31 | ### Build 32 | 33 | ```shell 34 | # If you updated the frontend 35 | yarn build:fe 36 | # If you updated the typst 37 | yarn build:typ 38 | # Final zola build 39 | zola build 40 | ``` 41 | 42 | ### Develop 43 | 44 | ```shell 45 | yarn serve 46 | ``` 47 | 48 | ### Deployment 49 | 50 | To deploy your site to GitHub Pages, you can use the provided GitHub Action in branch `action-v1`: 51 | 52 | Example .github/workflows/deployl.yaml 53 | 54 | ```yaml 55 | name: Deploy 56 | 57 | on: workflow_dispatch 58 | 59 | jobs: 60 | deploy: 61 | runs-on: ubuntu-latest 62 | steps: 63 | - name: checkout 64 | uses: actions/checkout@v4 65 | - name: deploy 66 | uses: dark-flames/apollo-typst@action-v1 67 | with: 68 | access-token: ${{ secrets.ACCESS_TOKEN }} 69 | deploy-branch: static 70 | # deploy-repo: ${{ another/repo }} 71 | ``` 72 | If you want to use custom page, remember to put `CNAME` file in the `static/`. -------------------------------------------------------------------------------- /config.toml: -------------------------------------------------------------------------------- 1 | # The URL the site will be built for 2 | base_url = "https://blog.dark-flames.com" 3 | 4 | # Whether to automatically compile all Sass files in the sass directory 5 | compile_sass = true 6 | 7 | # Whether to build a search index to be used later on by a JavaScript library 8 | build_search_index = true 9 | 10 | theme = "apollo" 11 | 12 | taxonomies = [{ name = "tags", feed = true }] 13 | 14 | 15 | [markdown] 16 | # Whether to do syntax highlighting 17 | # Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola 18 | highlight_code = true 19 | 20 | [extra] 21 | menu = [ 22 | { name = "/posts", url = "/posts", weight = 1 }, 23 | { name = "/tags", url = "/tags", weight = 2 }, 24 | { name = "/about", url = "/about", weight = 3 }, 25 | ] 26 | 27 | socials = [ 28 | { name = "twitter", url = "https://twitter.com/Darkf1ames", icon = "twitter" }, 29 | { name = "github", url = "https://github.com/dark-flames", icon = "github" }, 30 | ] 31 | 32 | insert_anchor_links = "heading" 33 | 34 | dynamic_note = true 35 | -------------------------------------------------------------------------------- /content/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title= "Apollo Theme" 3 | template = "homepage.html" 4 | +++ 5 | 6 | Thanks for checking out this theme! 7 | 8 | Checkout all the [options you can configure](./posts/configuration) and the [example pages](./tags/example/).[Test Typst](./posts/test) -------------------------------------------------------------------------------- /content/about.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "About" 3 | path = "about" 4 | +++ 5 | -------------------------------------------------------------------------------- /content/posts/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | paginate_by = 7 3 | title = "Posts" 4 | sort_by = "date" 5 | 6 | insert_anchor_links = "heading" 7 | +++ 8 | -------------------------------------------------------------------------------- /content/posts/configuration.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Configuring Apollo" 3 | date = "2024-07-09" 4 | 5 | [taxonomies] 6 | tags=["documentation"] 7 | 8 | [extra] 9 | repo_view = true 10 | +++ 11 | 12 | ## Theme Mode (`theme`) 13 | 14 | Sets the color theme for your blog. 15 | 16 | - Type: String 17 | - Options: "light", "dark", "auto", "toggle" 18 | - Default: "toggle" 19 | - Usage: `theme = "toggle"` 20 | 21 | The "toggle" option allows users to switch between light and dark modes, while "auto" typically follows the user's system preferences. 22 | 23 | ## Menu 24 | 25 | Defines the navigation menu items for your blog. 26 | 27 | - Type: Array of objects 28 | - Default: [] 29 | - Usage: 30 | ```toml 31 | menu = [ 32 | { name = "/posts", url = "/posts", weight = 1 }, 33 | { name = "/projects", url = "/projects", weight = 2 }, 34 | { name = "/about", url = "/about", weight = 3 }, 35 | { name = "/tags", url = "/tags", weight = 4 }, 36 | ] 37 | ``` 38 | 39 | ## Socials 40 | 41 | Defines the social media links. 42 | 43 | - Type: Array of objects 44 | - Default: [] 45 | - Usage: 46 | ```toml 47 | socials = [ 48 | { name = "twitter", url = "https://twitter.com/not_matthias", icon = "twitter" }, 49 | { name = "github", url = "https://github.com/not-matthias/", icon = "github" }, 50 | ] 51 | ``` 52 | 53 | ## Table of Contents (`toc`) 54 | 55 | Enables or disables the table of contents for posts. 56 | 57 | - Type: Boolean 58 | - Default: true 59 | - Usage: `toc = true` 60 | 61 | When enabled, a table of contents will be generated for posts, making it easier for readers to navigate through longer articles. 62 | 63 | ## CDN Usage (`use_cdn`) 64 | 65 | Determines whether to use a Content Delivery Network (CDN) for assets. 66 | 67 | - Type: Boolean 68 | - Default: false 69 | - Usage: `use_cdn = false` 70 | 71 | When set to true, the theme will attempt to load assets from a CDN, which can improve loading times for visitors from different geographic locations. 72 | 73 | ## Favicon (`favicon`) 74 | 75 | Specifies the path to the favicon image for your blog. 76 | 77 | - Type: String 78 | - Default: "/icon/favicon.png" 79 | - Usage: `favicon = "/icon/favicon.png"` 80 | 81 | This sets the small icon that appears in the browser tab for your website. 82 | 83 | ## Comments (`comment`) 84 | 85 | Enables or disables the comment system for posts. 86 | 87 | - Type: Boolean 88 | - Default: false 89 | - Usage: `comment = false` 90 | 91 | When enabled, this allows readers to leave comments on your blog posts. 92 | 93 | ## Fancy Code Styling (`fancy_code`) 94 | 95 | Enables enhanced styling for code blocks. 96 | 97 | - Type: Boolean 98 | - Default: true 99 | - Usage: `fancy_code = true` 100 | 101 | This option adds the language label and a copy button. 102 | 103 | ## Dynamic Notes (`dynamic_note`) 104 | 105 | Allows for the creation of togglable note sections in your content. 106 | 107 | - Type: Boolean 108 | - Default: true 109 | - Usage: `dynamic_note = true` 110 | 111 | When enabled, you can create expandable/collapsible note sections in your blog posts. 112 | 113 | ## Source code (`repo_view`) 114 | 115 | Do you want to link to the source code of your blog post? You can turn on the `repo_view` inside the `[extra]` section of your blog post. 116 | 117 | ```toml 118 | [extra] 119 | repo_view = true 120 | repo_url = "https://github.com/not-matthias/apollo/tree/main/content" # Alternatively add the repo here 121 | ``` 122 | 123 | The `repo_url` can be set in the `[extra]` section or in your `config.toml`. 124 | 125 | ## Anchor Links 126 | 127 | You can add anchor links by adding the following to your `_index.md`: 128 | ```toml 129 | insert_anchor_links = "heading" 130 | ``` -------------------------------------------------------------------------------- /content/posts/markdown.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Markdown Test" 3 | date = "2022-01-01" 4 | updated = "2022-05-01" 5 | 6 | [taxonomies] 7 | tags=["example"] 8 | +++ 9 | 10 | # H1 11 | ## H2 12 | ### H3 13 | 14 | 15 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Aliquet sagittis id consectetur purus ut. In pellentesque massa placerat duis ultricies. Neque laoreet suspendisse interdum consectetur libero id. Justo nec ultrices dui sapien eget mi proin. Nunc consequat interdum varius sit amet mattis vulputate. Sollicitudin tempor id eu nisl nunc mi ipsum. Non odio euismod lacinia at quis. Sit amet nisl suscipit adipiscing. Amet mattis vulputate enim nulla aliquet porttitor lacus luctus accumsan. Sit amet consectetur adipiscing elit pellentesque habitant. Ac placerat vestibulum lectus mauris. Molestie ac feugiat sed lectus vestibulum mattis ullamcorper velit sed. [Google](https://www.google.com) 16 | 17 | ![Markdown Logo](https://markdown-here.com/img/icon256.png) 18 | 19 | ## Code Block 20 | 21 | ```rust 22 | fn main() { 23 | println!("Hello World"); 24 | } 25 | ``` 26 | 27 | 28 | ```rust,hl_lines=2,linenos 29 | fn main() { 30 | println!("Hello World"); 31 | } 32 | ``` 33 | 34 | ## Ordered List 35 | 36 | 1. First item 37 | 2. Second item 38 | 3. Third item 39 | 40 | ## Unordered List 41 | 42 | - List item 43 | - Another item 44 | - And another item 45 | 46 | ## Nested list 47 | 48 | - Fruit 49 | - Apple 50 | - Orange 51 | - Banana 52 | - Dairy 53 | - Milk 54 | - Cheese 55 | 56 | ## Quote 57 | 58 | > Two things are infinite: the universe and human stupidity; and I'm not sure about the 59 | > universe.
60 | > — Albert Einstein 61 | 62 | 63 | ## Table Inline Markdown 64 | 65 | | Italics | Bold | Code | StrikeThrough | 66 | | --------- | -------- | ------ | ----------------- | 67 | | *italics* | **bold** | `code` | ~~strikethrough~~ | 68 | 69 | ## Foldable Text 70 | 71 |
72 | Title 1 73 |

IT'S A SECRET TO EVERYBODY.

74 |
75 | 76 |
77 | Title 2 78 |

Stay awhile, and listen!

79 |
80 | 81 | ## Code tags 82 | 83 | Lorem ipsum `dolor` sit amet, `consectetur adipiscing` elit. 84 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit.` 85 | -------------------------------------------------------------------------------- /content/posts/math-symbol.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Math Symbol Example" 3 | date = "2023-01-06" 4 | 5 | [taxonomies] 6 | tags=["example"] 7 | +++ 8 | 9 | Note: This requires the `mathjax` and `mathjax_dollar_inline_enable` option set to `true`. 10 | 11 | # Inline Math 12 | 13 | - $(a+b)^2$ = $a^2 + 2ab + b^2$ 14 | - A polynomial P of degree d over $\mathbb{F}_p$ is an expression of the form 15 | $P(s) = a_0 + a_1 . s + a_2 . s^2 + ... + a_d . s^d$ for some 16 | $a_0,..,a_d \in \mathbb{F}_p$ 17 | 18 | # Displayed Math 19 | 20 | $$ 21 | p := (\sum_{k∈I}{c_k.v_k} + \delta_v.t(x))·(\sum_{k∈I}{c_k.w_k} + \delta_w.t(x)) − (\sum_{k∈I}{c_k.y_k} + \delta_y.t(x)) 22 | $$ 23 | -------------------------------------------------------------------------------- /content/posts/multi-version-full.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Ancestors: Multi Version(Full)" 3 | date = "2024-07-09" 4 | 5 | [taxonomies] 6 | tags=["documentation"] 7 | 8 | [extra] 9 | typst = "intro/full" 10 | +++ 11 | -------------------------------------------------------------------------------- /content/posts/multi-version-short.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Ancestors: Multi Version(Short)" 3 | date = "2024-07-09" 4 | 5 | [taxonomies] 6 | tags=["documentation"] 7 | 8 | [extra] 9 | typst = "intro/short" 10 | +++ 11 | -------------------------------------------------------------------------------- /content/posts/shortcode.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Shortcode Example" 3 | date = "2024-06-14" 4 | 5 | [taxonomies] 6 | tags=["example"] 7 | +++ 8 | 9 | 10 | ## Note 11 | 12 | Here is an example of the `note` shortcode: 13 | 14 | This one is static! 15 | {{ note(header="Note!", body="This blog assumes basic terminal maturity") }} 16 | 17 | This one is clickable! 18 | {{ note(clickable=true, hidden = true, header="Quiz!", body="The answer to the quiz!") }} 19 | 20 | 21 | Syntax: 22 | ``` 23 | {{/* note(header="Note!", body="This blog assumes basic terminal maturity") */}} 24 | {{/* note(clickable=true, hidden = true, header="Quiz!", body="The answer to the quiz!") */}} 25 | ``` 26 | 27 | You can also use some HTML in the text: 28 | {{ note(header="Note!", body="

This blog assumes basic terminal maturity

") }} 29 | 30 | 31 | Literal shortcode: 32 | ``` 33 | {{/* note(header="Note!", body="

This blog assumes basic terminal maturity

") */}} 34 | ``` 35 | 36 | Pretty cool, right? 37 | 38 | Finally, you can do something like this (hopefully): 39 | 40 | {% note(clickable=true, header="Quiz!") %} 41 | 42 | # Hello this is markdown inside a note shortcode 43 | 44 | ```rust 45 | fn main() { 46 | println!("Hello World"); 47 | } 48 | ``` 49 | 50 | We can't call another shortcode inside a shortcode, but this is good enough. 51 | 52 | {% end %} 53 | 54 | Here is the raw markdown: 55 | 56 | ```markdown 57 | {{/* note(clickable=true, header="Quiz!") */}} 58 | 59 | # Hello this is markdown inside a note shortcode 60 | 61 | \`\`\`rust 62 | fn main() { 63 | println!("Hello World"); 64 | } 65 | \`\`\` 66 | 67 | We can't call another shortcode inside a shortcode, but this is good enough. 68 | 69 | {{/* end */}} 70 | ``` 71 | 72 | Finally, we have center 73 | {{ note(center=true, header="Centered Text", body="This is centered text") }} 74 | 75 | ```markdown 76 | {{/* note(center=true, header="Centered Text", body="This is centered text") */}} 77 | ``` 78 | It works good enough for me! 79 | -------------------------------------------------------------------------------- /content/posts/test.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Ancestors: Typst" 3 | date = "2024-07-09" 4 | 5 | [taxonomies] 6 | tags=["documentation"] 7 | 8 | [extra] 9 | typst = "posts/test" 10 | +++ 11 | -------------------------------------------------------------------------------- /content/posts/without-title.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Ancestors: Typst (Without Title)" 3 | date = "2024-07-09" 4 | 5 | [taxonomies] 6 | tags=["documentation"] 7 | 8 | [extra] 9 | typst = "posts/test" 10 | hide_title = true 11 | +++ 12 | -------------------------------------------------------------------------------- /content/projects/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Projects" 3 | sort_by = "weight" 4 | template = "cards.html" 5 | +++ 6 | -------------------------------------------------------------------------------- /content/projects/project-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/content/projects/project-1.jpg -------------------------------------------------------------------------------- /content/projects/project_1.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Apollo" 3 | description = "Modern and minimalistic blog theme." 4 | weight = 1 5 | 6 | [extra] 7 | local_image = "/projects/project-1.jpg" 8 | link_to = "https://github.com/not-matthias/apollo" 9 | +++ 10 | 11 | Example project page -------------------------------------------------------------------------------- /content/projects/project_2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Project 2" 3 | description = "Example description" 4 | weight = 1 5 | 6 | [extra] 7 | # You can also crop the image in the url by adjusting w=/h= 8 | remote_image = "https://images.unsplash.com/photo-1523821741446-edb2b68bb7a0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80" 9 | +++ 10 | 11 | Example project page 12 | -------------------------------------------------------------------------------- /content/projects/project_3.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Project 3" 3 | description = "Example description" 4 | weight = 1 5 | 6 | [extra] 7 | remote_image = "https://images.unsplash.com/photo-1462556791646-c201b8241a94?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1465&q=80" 8 | +++ 9 | 10 | Example project page -------------------------------------------------------------------------------- /content/projects/project_4.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Project 4" 3 | description = "Example description with a lot of words but without any meaning. Why use lorem ipsum when you can just write a lot of text that has no underlying meaning?" 4 | weight = 1 5 | 6 | [extra] 7 | remote_image = "https://images.unsplash.com/photo-1620121692029-d088224ddc74?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1632&q=80" 8 | +++ 9 | 10 | Example project page -------------------------------------------------------------------------------- /content/projects/project_5.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Project 4" 3 | description = "Example description" 4 | weight = 1 5 | +++ 6 | 7 | Example project page -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist/ -------------------------------------------------------------------------------- /frontend/breakpoints.json: -------------------------------------------------------------------------------- 1 | [330, 380, 470, 560, 600, 715] 2 | -------------------------------------------------------------------------------- /frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blog-frontend", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "src/index.ts", 6 | "scripts": { 7 | "build:dev": "npm run reset && vite build", 8 | "build:prod": "npm run reset && vite build", 9 | "dev": "npm run reset && vite dev", 10 | "reset": "rimraf ../static/js ../static/css ../static/wasm" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "devDependencies": { 16 | "@types/node": "^20.14.10", 17 | "babel-loader": "^9.1.3", 18 | "css-loader": "^7.1.2", 19 | "file-loader": "^6.2.0", 20 | "mini-css-extract-plugin": "^2.9.0", 21 | "rimraf": "^6.0.1", 22 | "style-loader": "^4.0.0", 23 | "ts-loader": "^9.5.1", 24 | "typescript": "^5.5.3", 25 | "vite": "^5.0.8", 26 | "vite-plugin-singlefile": "^0.13.5", 27 | "vite-plugin-static-copy": "^1.0.6" 28 | }, 29 | "dependencies": { 30 | "@myriaddreamin/typst-ts-renderer": "^0.5.0-rc6", 31 | "@myriaddreamin/typst.ts": "^0.5.0-rc6" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /frontend/src/global.d.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * This file includes code from the shiroa (https://github.com/Myriad-Dreamin/shiroa), 3 | * which is licensed under the Apache License, Version 2.0. 4 | * 5 | * Original code by: 6 | * Myriad-Dreamin (https://github.com/Myriad-Dreamin) 7 | * 8 | * Copyright (c) 2023 shiroa Developers 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | ********************************************************************************/ 22 | 23 | import { TypstSvgRenderer } from '@myriaddreamin/typst.ts/dist/esm/renderer'; 24 | 25 | declare global { 26 | interface Window { 27 | layoutText: any; 28 | typstPathToRoot: string | undefined; 29 | typstGetRelatedElements: any; 30 | handleTypstLocation: any; 31 | getTypstTheme(): string; 32 | captureStack(): any; 33 | typstRerender?: (responsive?: boolean) => void; 34 | typstCheckAndRerender?: (responsive: boolean, stack?: any) => Promise; 35 | typstChangeTheme?: () => Promise; 36 | debounce(fn: T, delay?: number): T; 37 | assignSemaHash: (u: number, x: number, y: number) => void; 38 | typstProcessSvg: any; 39 | typstBookRenderPage( 40 | plugin: TypstSvgRenderer, 41 | relPath: string, 42 | appContainer: HTMLDivElement | undefined, 43 | ): void; 44 | typstBindSvgDom(elem: HTMLDivElement, dom: SVGSVGElement): void; 45 | TypstRenderModule: any; 46 | updateScale: () => void; 47 | calcScale: (appWidth: number) => number; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /frontend/src/index.ts: -------------------------------------------------------------------------------- 1 | import './typst.css'; 2 | 3 | import * as Typst from '@myriaddreamin/typst.ts/dist/esm/main.mjs'; 4 | 5 | import './render'; 6 | import breakpoints from '../breakpoints.json'; 7 | 8 | export default { 9 | ...Typst, 10 | }; 11 | 12 | /** 13 | * Width Device Scale MarginWidth MaxAppWidth DataWidth 14 | * 0 ~ 320 px Smartwatches ~1.0 40 280 280 15 | * 321 ~ 420 px Smaller devices ~1.0 40 380 380 16 | * 421 ~ 599 px Phones ~1.0 40 559 559 17 | * 600 ~ 767 px Tablets and Large Phones 1.0 52 715 715 18 | * 768 ~ 991 px Tablets ~ 64 927 19 | * 992 ~ 1119 px Laptops and Desktops ~ 64 1000 20 | * 1200 ~ px Monitors, Desktops 1.5 64 1000 21 | */ 22 | window.calcScale = function (appWidth) { 23 | const maxDataWidth = breakpoints[breakpoints.length - 1]; 24 | if (appWidth >= maxDataWidth) { 25 | return appWidth / maxDataWidth; 26 | } else { 27 | let dataWidth = breakpoints[0]; 28 | for(const breakpoint of breakpoints) { 29 | if (breakpoint > appWidth) { 30 | break; 31 | } else { 32 | dataWidth = breakpoint; 33 | } 34 | } 35 | console.log(`Scale: app: ${appWidth}, data: ${dataWidth}, scale = ${appWidth / dataWidth}`); 36 | return appWidth / dataWidth; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /frontend/src/typst.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * This file includes code from the shiroa (https://github.com/Myriad-Dreamin/shiroa), 3 | * which is licensed under the Apache License, Version 2.0. 4 | * 5 | * Original code by: 6 | * Myriad-Dreamin (https://github.com/Myriad-Dreamin) 7 | * 8 | * Copyright (c) 2023 shiroa Developers 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | ********************************************************************************/ 22 | 23 | #typst-app { 24 | display: flex; 25 | justify-content: center; 26 | } 27 | 28 | #typst-app.with-title { 29 | margin: 5px; 30 | } 31 | 32 | .typst-dom-page { 33 | width: calc(var(--data-page-width, 100%) * var(--typst-dom-scale)); 34 | height: calc(var(--data-page-height) * var(--typst-dom-scale)); 35 | --data-text-width: calc(1px * var(--typst-dom-scale)); 36 | --data-text-height: calc(1px * var(--typst-dom-scale)); 37 | margin: auto; 38 | } 39 | 40 | .typst-back-canvas { 41 | position: absolute; 42 | z-index: -1; 43 | width: calc(var(--data-page-width, 100%) * var(--typst-dom-scale)); 44 | height: calc(var(--data-page-height) * var(--typst-dom-scale)); 45 | pointer-events: none; 46 | } 47 | 48 | .typst-svg-page { 49 | position: absolute; 50 | z-index: 0; 51 | width: calc(var(--data-page-width, 100%) * var(--typst-dom-scale)); 52 | height: calc(var(--data-page-height) * var(--typst-dom-scale)); 53 | max-height: none; 54 | fill: none; 55 | } 56 | 57 | .typst-content-link { 58 | border-bottom: none; 59 | } 60 | 61 | .typst-content-link:hover { 62 | background-color: inherit; 63 | color: inherit; 64 | } 65 | 66 | .typst-html-semantics { 67 | position: absolute; 68 | z-index: 2; 69 | width: calc(var(--data-page-width, 100%) * var(--typst-dom-scale)); 70 | height: calc(var(--data-page-height) * var(--typst-dom-scale)); 71 | color: transparent; 72 | font-family: monospace; 73 | white-space: pre; 74 | } 75 | 76 | .typst-html-semantics span { 77 | transform-origin: left; 78 | position: absolute; 79 | display: inline-block; 80 | left: 0; 81 | top: 0; 82 | } 83 | 84 | .typst-content-hint { 85 | position: absolute; 86 | display: inline-block; 87 | width: 1px; 88 | height: 1px; 89 | overflow: hidden; 90 | } 91 | 92 | .typst-html-semantics a { 93 | position: absolute; 94 | display: inline-block; 95 | } 96 | 97 | /* set transparent itself */ 98 | .typst-content-group { 99 | pointer-events: visible; 100 | } 101 | 102 | .typst-html-semantics span::-moz-selection { 103 | color: transparent; 104 | background: #7db9dea0; 105 | } 106 | 107 | .typst-html-semantics span::selection { 108 | color: transparent; 109 | background: #7db9dea0; 110 | } 111 | 112 | .typst-html-semantics *::-moz-selection { 113 | color: transparent; 114 | background: transparent; 115 | } 116 | 117 | .typst-html-semantics *::selection { 118 | color: transparent; 119 | background: transparent; 120 | } 121 | 122 | .typst-content-fallback { 123 | color: transparent; 124 | background: transparent; 125 | } 126 | 127 | .pseudo-link, 128 | .typst-text { 129 | pointer-events: none; 130 | } 131 | .outline_glyph path, 132 | path.outline_glyph { 133 | fill: var(--glyph_fill); 134 | stroke: var(--glyph_stroke); 135 | } 136 | 137 | .outline_glyph path, 138 | path.outline_glyph { 139 | transition: 0.2s fill stroke; 140 | } 141 | .hover .typst-text { 142 | --glyph_fill: #66bab7; 143 | --glyph_stroke: #66bab7; 144 | } 145 | 146 | .typst-jump-ripple, 147 | .typst-debug-react-ripple { 148 | width: 0; 149 | height: 0; 150 | background-color: transparent; 151 | position: absolute; 152 | border-radius: 50%; 153 | } 154 | .typst-jump-ripple { 155 | border: 1px solid #66bab7; 156 | } 157 | .typst-debug-react-ripple { 158 | border: 1px solid #cb1b45; 159 | } 160 | @keyframes typst-jump-ripple-effect { 161 | to { 162 | width: 10vw; 163 | height: 10vw; 164 | opacity: 0.01; 165 | margin: -5vw; 166 | } 167 | } 168 | @keyframes typst-debug-react-ripple-effect { 169 | to { 170 | width: 3vw; 171 | height: 3vw; 172 | opacity: 0.01; 173 | margin: -1.5vw; 174 | } 175 | } 176 | 177 | .focus .typst-text { 178 | --glyph_fill: var(--sidebar-active); 179 | } -------------------------------------------------------------------------------- /frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "types": ["./src/global.d.ts", "node"], 4 | "baseUrl": ".", 5 | "outDir": "dist", 6 | "module": "ESNext", 7 | "moduleResolution": "bundler", 8 | "target": "ES2020", 9 | "allowJs": true, 10 | "checkJs": false, 11 | "noImplicitAny": true, 12 | "importHelpers": true, 13 | "isolatedModules": true, 14 | "strictNullChecks": true, 15 | "stripInternal": true, 16 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 17 | "declaration": true, 18 | "declarationMap": true, 19 | "inlineSources": true, 20 | "inlineSourceMap": true, 21 | "composite": true, 22 | }, 23 | "include": [ 24 | "src/**/*.ts", 25 | "breakpoints.json" 26 | ], 27 | 28 | } -------------------------------------------------------------------------------- /frontend/vite.config.mjs: -------------------------------------------------------------------------------- 1 | import { resolve } from 'path'; 2 | import { defineConfig } from 'vite'; 3 | import { viteStaticCopy } from 'vite-plugin-static-copy'; 4 | import { viteSingleFile } from 'vite-plugin-singlefile'; 5 | import { normalizePath } from 'vite'; 6 | 7 | export default defineConfig({ 8 | plugins: [ 9 | viteSingleFile(), 10 | viteStaticCopy({ 11 | targets: [ 12 | { 13 | src: normalizePath( 14 | resolve( 15 | __dirname, 16 | '../node_modules/@myriaddreamin/typst-ts-renderer/pkg/typst_ts_renderer_bg.wasm', 17 | ), 18 | ), 19 | dest: resolve(__dirname, '../static/wasm/'), 20 | }, 21 | ], 22 | }), 23 | ], 24 | resolve: { 25 | preserveSymlinks: true, // this is the fix! 26 | }, 27 | build: { 28 | minify: false, 29 | cssCodeSplit: false, 30 | emptyOutDir: true, // also necessary 31 | outDir: resolve(__dirname, '../static/apollo-typst'), 32 | lib: { 33 | // Could also be a dictionary or array of multiple entry points 34 | entry: resolve(__dirname, 'src/index.ts'), 35 | name: 'TypstApollo', 36 | // the proper extensions will be added 37 | fileName: 'apollo.typst', 38 | }, 39 | }, 40 | }); 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apollo-typst", 3 | "version": "0.1.0", 4 | "private": true, 5 | "contributors": [ 6 | "Myriad Dreamin ", 7 | "dark-flames " 8 | ], 9 | "workspaces": [ 10 | "frontend" 11 | ], 12 | "scripts": { 13 | "reset": "rm -rf static/typst && cd frontend && npm run reset", 14 | "build:fe": "yarn workspace blog-frontend build:prod", 15 | "build:typ": "node scripts/build-posts.js", 16 | "serve": "zola serve" 17 | }, 18 | "dependencies": {}, 19 | "devDependencies": { 20 | "@myriaddreamin/typst-ts-node-compiler": "^0.5.0-rc6", 21 | "toml": "^3.0.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/typst-apollo/book.typ: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * This file includes code from the shiroa (https://github.com/Myriad-Dreamin/shiroa), 3 | * which is licensed under the Apache License, Version 2.0. 4 | * 5 | * Original code by: 6 | * Myriad-Dreamin (https://github.com/Myriad-Dreamin) 7 | * 8 | * Copyright (c) 2023 shiroa Developers 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | ********************************************************************************/ 22 | 23 | #import "@preview/shiroa:0.1.0": * 24 | #import "./pages.typ": project, part-style 25 | 26 | #let _page-project = project 27 | 28 | #let _resolve-inclusion-state = state("_resolve-inclusion", none) 29 | 30 | #let resolve-inclusion(inc) = _resolve-inclusion-state.update(it => inc) 31 | 32 | #let project(title: "", authors: (), spec: "", content) = { 33 | // Set document metadata early 34 | set document( 35 | author: authors, 36 | title: title, 37 | ) 38 | 39 | // Inherit from gh-pages 40 | show: _page-project 41 | 42 | if title != "" { 43 | heading(title) 44 | } 45 | 46 | locate(loc => { 47 | let inc = _resolve-inclusion-state.final(loc) 48 | external-book(spec: inc(spec)) 49 | 50 | let mt = book-meta-state.final(loc) 51 | let styles = (inc: inc, part: part-style, chapter: it => it) 52 | 53 | if mt != none { 54 | mt.summary.map(it => visit-summary(it, styles)).sum() 55 | } 56 | }) 57 | 58 | content 59 | } -------------------------------------------------------------------------------- /packages/typst-apollo/lib.typ: -------------------------------------------------------------------------------- 1 | #import "./pages.typ" 2 | #import "./book.typ" -------------------------------------------------------------------------------- /packages/typst-apollo/pages.typ: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * This file includes code from the shiroa (https://github.com/Myriad-Dreamin/shiroa), 3 | * which is licensed under the Apache License, Version 2.0. 4 | * 5 | * Original code by: 6 | * Myriad-Dreamin (https://github.com/Myriad-Dreamin) 7 | * 8 | * Copyright (c) 2023 shiroa Developers 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | ********************************************************************************/ 22 | 23 | // This is important for shiroa to produce a responsive layout 24 | // and multiple targets. 25 | #import "@preview/shiroa:0.1.0": get-page-width, target, is-web-target, is-pdf-target, plain-text 26 | #import "theme.typ": * 27 | 28 | #let page-width = get-page-width() 29 | #let is-pdf-target = is-pdf-target() 30 | #let is-web-target = is-web-target() 31 | 32 | #let make-unique-label(it, disambiguator: 1) = label({ 33 | let k = plain-text(it).trim() 34 | if disambiguator > 1 { 35 | k + "_d" + str(disambiguator) 36 | } else { 37 | k 38 | } 39 | }) 40 | 41 | #let heading-reference(it, d: 1) = make-unique-label(it.body, disambiguator: d) 42 | 43 | // The project function defines how your document looks. 44 | // It takes your content and some metadata and formats it. 45 | // Go ahead and customize it to your liking! 46 | #let project(title: "Typst Book", authors: (), show-title: false, show-authors: false, body) = { 47 | 48 | // set basic document metadata 49 | set document(author: authors.map(a => a.name), title: title) if not is-pdf-target 50 | 51 | // set web/pdf page properties 52 | set page( 53 | numbering: none, 54 | number-align: center, 55 | width: page-width, 56 | ) 57 | 58 | // remove margins for web target 59 | set page( 60 | margin: ( 61 | // reserved beautiful top margin 62 | top: 20pt, 63 | // reserved for our heading style. 64 | // If you apply a different heading style, you may remove it. 65 | left: 20pt, 66 | // Typst is setting the page's bottom to the baseline of the last line of text. So bad :(. 67 | bottom: 0.5em, 68 | // remove rest margins. 69 | rest: 0pt, 70 | ), 71 | // for a website, we don't need pagination. 72 | height: auto, 73 | ) if is-web-target 74 | 75 | // set text and line style 76 | set text(font: main-font, size: 16pt, fill: main-color, lang: "en") 77 | set line(stroke: main-color) 78 | set table(stroke: main-color) 79 | 80 | let ld = state("label-disambiguator", (:)) 81 | let update-ld(k) = ld.update(it => { 82 | it.insert(k, it.at(k, default: 0) + 1) 83 | it 84 | }) 85 | let get-ld(loc, k) = make-unique-label(k, disambiguator: ld.at(loc).at(k)) 86 | 87 | // render a dash to hint headings instead of bolding it. 88 | show heading: set text(weight: "regular") if is-web-target 89 | show heading: it => { 90 | block({ 91 | if is-web-target { 92 | let title = plain-text(it.body).trim() 93 | update-ld(title) 94 | context ( 95 | { 96 | let loc = here() 97 | let dest = get-ld(loc, title) 98 | let h = measure(it.body).height 99 | place( 100 | left, 101 | dx: -20pt, 102 | [ 103 | #set text(fill: dash-color) 104 | #link(loc)[\#] #dest 105 | ], 106 | ) 107 | } 108 | ) 109 | } 110 | it 111 | }) 112 | } 113 | 114 | // link setting 115 | show link: set text(fill: dash-color) 116 | 117 | // math setting 118 | show math.equation: set text(weight: 400) 119 | 120 | // code block setting 121 | show raw: it => { 122 | set text(font: code-font) 123 | if "block" in it.fields() and it.block { 124 | rect( 125 | width: 100%, 126 | inset: (x: 4pt, y: 5pt), 127 | radius: 4pt, 128 | fill: code-extra-colors.at("bg"), 129 | [ 130 | #set text(fill: code-extra-colors.at("fg")) if code-extra-colors.at("fg") != none 131 | #set par(justify: false) 132 | #place(right, text(luma(110), it.lang)) 133 | #it 134 | ], 135 | ) 136 | } else { 137 | it 138 | } 139 | } 140 | 141 | if show-title { 142 | align(center)[ #block(text(weight: 700, 1.75em, title)) ] 143 | } 144 | 145 | if show-authors and authors.len() > 0 { 146 | // Author information. 147 | pad( 148 | top: 0.5em, 149 | bottom: 0.5em, 150 | x: 2em, 151 | grid( 152 | columns: (1fr,) * calc.min(3, authors.len()), 153 | gutter: 1em, 154 | ..authors.map(author => align(center)[ 155 | *#author.name* \ 156 | #author.email 157 | ]), 158 | ), 159 | ) 160 | } 161 | 162 | // Main body. 163 | set par(justify: true) 164 | 165 | body 166 | } 167 | 168 | #let part-style = heading -------------------------------------------------------------------------------- /packages/typst-apollo/theme-style.toml: -------------------------------------------------------------------------------- 1 | 2 | 3 | [light] 4 | color-scheme = "light" 5 | main-color = "#000" 6 | dash-color = "#ef5350" 7 | code-theme = "" 8 | 9 | [dark] 10 | color-scheme = "dark" 11 | main-color = "#ffffff" 12 | dash-color = "#ef5350" 13 | code-theme = "tokyo-night.tmTheme.xml" -------------------------------------------------------------------------------- /packages/typst-apollo/theme.typ: -------------------------------------------------------------------------------- 1 | #import "@preview/shiroa:0.1.0": target 2 | 3 | 4 | // Theme (Colors) 5 | #let theme-target = if target.contains("-") { target.split("-").at(1) } else { "light" } 6 | #let theme-style = toml("theme-style.toml").at(theme-target) 7 | 8 | #let is-dark-theme = theme-style.at("color-scheme") == "dark" 9 | #let is-light-theme = not is-dark-theme 10 | 11 | #let main-color = rgb(theme-style.at("main-color")) 12 | #let dash-color = rgb(theme-style.at("dash-color")) 13 | 14 | 15 | #let main-font = ( 16 | "Charter", 17 | "Source Han Serif SC", 18 | "Source Han Serif TC", 19 | "Linux Libertine", 20 | ) 21 | 22 | #let code-font = ( 23 | "BlexMono Nerd Font Mono", 24 | "DejaVu Sans Mono", 25 | ) 26 | 27 | #let code-theme-file = theme-style.at("code-theme") 28 | 29 | #let code-extra-colors = if code-theme-file.len() > 0 { 30 | let data = xml(theme-style.at("code-theme")).at(1) 31 | 32 | let find-child(elem, tag) = { 33 | elem.children.find(e => "tag" in e and e.tag == tag) 34 | } 35 | 36 | let find-kv(elem, key, tag) = { 37 | let idx = elem.children.position(e => "tag" in e and e.tag == "key" and e.children.first() == key) 38 | elem.children.slice(idx).find(e => "tag" in e and e.tag == tag) 39 | } 40 | 41 | let plist-dict = find-child(data, "dict") 42 | let plist-array = find-child(plist-dict, "array") 43 | let theme-setting = find-child(plist-array, "dict") 44 | let theme-setting-items = find-kv(theme-setting, "settings", "dict") 45 | let background-setting = find-kv(theme-setting-items, "background", "string") 46 | let foreground-setting = find-kv(theme-setting-items, "foreground", "string") 47 | ( 48 | bg: rgb(background-setting.children.first()), 49 | fg: rgb(foreground-setting.children.first()), 50 | ) 51 | } else { 52 | ( 53 | bg: rgb(239, 241, 243), 54 | fg: none, 55 | ) 56 | } -------------------------------------------------------------------------------- /packages/typst-apollo/typst.toml: -------------------------------------------------------------------------------- 1 | 2 | [package] 3 | name = "typst-apollo" 4 | version = "0.1.0" 5 | entrypoint = "lib.typ" 6 | authors = ["dark-flames"] 7 | license = "MIT" 8 | description = "default page configuration for typst-apollo" -------------------------------------------------------------------------------- /sass/main.scss: -------------------------------------------------------------------------------- 1 | @import "../themes/apollo/sass/parts/_cards.scss"; 2 | @import "../themes/apollo/sass/parts/_code.scss"; 3 | @import "../themes/apollo/sass/parts/_header.scss"; 4 | @import "../themes/apollo/sass/parts/_image.scss"; 5 | @import "../themes/apollo/sass/parts/_toc.scss"; 6 | @import "../themes/apollo/sass/parts/_note.scss"; 7 | @import "../themes/apollo/sass/parts/misc.scss"; 8 | @import "../themes/apollo/sass/parts/table.scss"; 9 | @import "../themes/apollo/sass/parts/tags.scss"; 10 | 11 | :root { 12 | /* Used for: block comment, hr, ... */ 13 | --border-color: var(--border-color); 14 | 15 | /* Fonts */ 16 | --text-font: 'Jetbrains Mono'; 17 | --header-font: 'Space Grotesk', 'Helvetica', sans-serif; 18 | --code-font: 'Jetbrains Mono'; 19 | } 20 | 21 | html { 22 | background-color: var(--bg-0); 23 | color: var(--text-0); 24 | font-family: var(--text-font); 25 | line-height: 1.6em; 26 | } 27 | 28 | .content { 29 | max-width: 1000px; 30 | margin: 0 auto; 31 | padding: 0 12px; 32 | word-wrap: break-word; 33 | } 34 | 35 | @media all and (min-width:600px) { 36 | html { 37 | font-size: 16.5px; 38 | } 39 | .content { 40 | padding: 0 18px; 41 | } 42 | } 43 | 44 | @media all and (min-width:768px) { 45 | html { 46 | font-size: 17px; 47 | } 48 | .content { 49 | padding: 0 24px; 50 | } 51 | } 52 | 53 | @media all and (min-width:960px) { 54 | html { 55 | font-size: 18px; 56 | } 57 | .content { 58 | padding: 0 24px; 59 | } 60 | } -------------------------------------------------------------------------------- /scripts/build-posts.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const { resolve, join, basename, extname } = require('path'); 3 | const { execSync } = require('child_process'); 4 | const { Compiler } = require('./compiler'); 5 | const toml = require('toml'); 6 | 7 | const root = resolve(__dirname, '../'); 8 | 9 | const fontPaths = [ 10 | resolve(root, 'fonts'), 11 | resolve(root, 'assets/fonts'), 12 | resolve(root, 'asset/fonts'), 13 | resolve(root, 'static/fonts') 14 | ] 15 | 16 | const themes = ['light', 'dark']; 17 | 18 | function printWithDepth(depth, ...args) { 19 | if(depth > 0) { 20 | depth -= 1; 21 | console.log(' '.repeat(depth) + '|---', ...args); 22 | } 23 | } 24 | 25 | function isWorkspace(dir) { 26 | const res = fs.readdirSync(dir, { withFileTypes: true }) 27 | .find((d) => 28 | d.isFile() && ( 29 | d.name === 'main.typ' || d.name === 'build-config.toml' 30 | ) 31 | ); 32 | return res; 33 | } 34 | 35 | function parseBuildConfig(path) { 36 | const content = fs.readFileSync(path); 37 | const config = toml.parse(content); 38 | 39 | let res = {}; 40 | 41 | for (const [name, { entry }] of Object.entries(config.entries)) { 42 | res[name] = entry 43 | } 44 | 45 | return res; 46 | } 47 | 48 | function compileEntry(compiler, typstRoot, entry, artifactRoot, outputPath, depth) { 49 | compiler.evictCache(); 50 | const entryPath = join(typstRoot, entry); 51 | const artifactPath = join(artifactRoot, outputPath); 52 | for (const theme of themes) { 53 | printWithDepth(depth + 1, 'Theme:', theme); 54 | fs.mkdirSync(join(artifactPath, theme), { recursive: true }); 55 | 56 | const vec = compiler.vector(entryPath, theme); 57 | 58 | fs.writeFileSync(join(artifactPath, theme, 'main.multi.sir.in'), vec); 59 | } 60 | } 61 | 62 | function compileWorkspace(compiler, typstRoot, path, artifactRoot, depth) { 63 | fs.mkdirSync(join(artifactRoot, path), { recursive: true }); 64 | printWithDepth(depth, 'Compile Workspace: ', path); 65 | const workspacePath = join(typstRoot, path); 66 | 67 | const configPath = fs.readdirSync(workspacePath, { withFileTypes: true }) 68 | .find((d) => 69 | d.isFile() && d.name === 'build-config.toml' 70 | ); 71 | 72 | if (configPath) { 73 | const config = parseBuildConfig(join(workspacePath, 'build-config.toml')); 74 | for (const [name, entry] of Object.entries(config)) { 75 | const entryPath = join(path, entry); 76 | printWithDepth(depth + 1, `Compile: ${entryPath}:${name}`); 77 | compileEntry(compiler, typstRoot, join(path, entry), artifactRoot, join(path, name), depth + 1); 78 | } 79 | } else { 80 | const mainPath = join(path, 'main.typ') 81 | printWithDepth(depth + 1, 'Compile:', mainPath); 82 | compileEntry(compiler, typstRoot, mainPath, artifactRoot, path, depth + 1); 83 | } 84 | } 85 | 86 | function compileFile(compiler, typstRoot, path, name, artifactRoot, depth) { 87 | const base = basename(name, '.typ'); 88 | const filePath = join(path, name); 89 | printWithDepth(depth, 'Compile:', filePath); 90 | compileEntry(compiler, typstRoot, filePath, artifactRoot, join(path, base), depth); 91 | } 92 | 93 | function compileDirectory(compiler, typstRoot, dir, artifactRoot, depth = 0) { 94 | printWithDepth(depth, 'Compile Dir: ', dir); 95 | 96 | for (const p of fs.readdirSync(join(typstRoot, dir), { withFileTypes: true })) { 97 | const subPath = join(dir, p.name); 98 | if(p.isFile()) { 99 | if(extname(p.name) === '.typ') { 100 | compileFile(compiler, typstRoot, dir, p.name, artifactRoot, depth + 1); 101 | } else { 102 | printWithDepth(depth + 1, 'Skip:', subPath); 103 | } 104 | } else if(isWorkspace(join(typstRoot, subPath))) { 105 | compileWorkspace(compiler, typstRoot, subPath, artifactRoot, depth + 1); 106 | } else { 107 | compileDirectory(compiler, typstRoot, subPath, artifactRoot, depth + 1); 108 | } 109 | } 110 | } 111 | 112 | function main() { 113 | const typstDir = resolve(root, 'typ'); 114 | /// Creates artifact directory 115 | const artifactRoot = resolve(root, 'static/typst'); 116 | fs.mkdirSync(artifactRoot, { recursive: true }); 117 | /// Links Apollo package 118 | try { 119 | execSync(`typst-ts-cli package link --manifest ${root}/packages/typst-apollo/typst.toml`); 120 | } catch {} 121 | 122 | console.log('[typst] using fonts:'); 123 | for (const fontPath of fontPaths) { 124 | console.log(`- ${fontPath}`); 125 | } 126 | 127 | const compiler = new Compiler({ baseDir: root, fontPaths: fontPaths }); 128 | 129 | compileDirectory(compiler, typstDir, '.', artifactRoot); 130 | } 131 | 132 | main(); 133 | -------------------------------------------------------------------------------- /scripts/compiler.js: -------------------------------------------------------------------------------- 1 | const { NodeCompiler, DynLayoutCompiler } = require('@myriaddreamin/typst-ts-node-compiler'); 2 | const { resolve } = require('path'); 3 | const breakpoints = require('../frontend/breakpoints.json'); 4 | 5 | breakpoints.reverse(); 6 | 7 | class Compiler { 8 | constructor({ baseDir, fontPaths }) { 9 | this.baseDir = baseDir; 10 | const compileArgs = { 11 | workspace: this.baseDir, 12 | fontArgs: [{ fontPaths }], 13 | // todo: move this to session after we fixed the bug 14 | inputs: { 'x-target': 'web-light' }, 15 | }; 16 | // layout_widths: LayoutWidths::from_iter( 17 | // (0..40).map(|i| { 18 | // typst::layout::Abs::pt(750.0) - typst::layout::Abs::pt(i as f64 * 10.0) 19 | // }), 20 | // ), 21 | this.base = NodeCompiler.create(compileArgs); 22 | const dyn = target => { 23 | const c = DynLayoutCompiler.fromBoxed(NodeCompiler.create(compileArgs).intoBoxed()); 24 | c.setTarget(target); 25 | c.setLayoutWidths(breakpoints); 26 | return c; 27 | }; 28 | this.dyn = { 29 | light: dyn('web-light'), 30 | dark: dyn('web-dark'), 31 | }; 32 | } 33 | 34 | title(path) { 35 | return this.base.compile({ 36 | mainFilePath: path, 37 | }).result.title; 38 | } 39 | 40 | evictCache() { 41 | this.base.evictCache(10); 42 | } 43 | 44 | vector(mainFilePath, theme = 'light') { 45 | try { 46 | return this.dyn[theme].vector({ mainFilePath }); 47 | } catch (e) { 48 | console.log(e); 49 | throw e; 50 | } 51 | } 52 | } 53 | 54 | module.exports = { Compiler }; 55 | -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/static/favicon.ico -------------------------------------------------------------------------------- /templates/macros/typst.html: -------------------------------------------------------------------------------- 1 | {% macro typst(page) %} 2 |
3 |
4 | {% if not page.extra.hide_title %} 5 |
6 | {#

{{ page.title }}

#} 7 | {{ post_macros::page_header(title=page.title) }} 8 | 9 |
10 | {% if page.date %} 11 | Posted on 12 | {% endif %} 13 | 14 | {% if page.updated %} 15 | :: Updated on 16 | {% endif %} 17 | 18 | {% if page.extra.read_time %} 19 | :: Min Read 20 | {% endif %} 21 | 22 | {# Inline display of tags directly after the date #} 23 | {% if page.taxonomies and page.taxonomies.tags %} 24 | :: Tags: 25 | 26 | {%- for tag in page.taxonomies.tags %} 27 | {% if not loop.last %}, {% endif %} 28 | {% endfor %} 29 | 30 | {% endif %} 31 | 32 | {# View the page on GitHub #} 33 | {% if page.extra.repo_view | default(value=false) %} 34 | {# Use the page's repo_url if defined, otherwise use the global edit_repo_url #} 35 | {% if page.extra.repo_url is defined %} 36 | {% set repo_url = page.extra.repo_url %} 37 | {% elif config.extra.repo_url is defined %} 38 | {% set repo_url = config.extra.repo_url %} 39 | {% else %} 40 | {% set repo_url = false %} 41 | {% endif %} 42 | 43 | {% if repo_url %} 44 | {% set final_url = repo_url ~ page.relative_path %} 45 | :: Source Code 46 | {% endif %} 47 | {% endif %} 48 | 49 | {% if page.draft %} 50 | DRAFT 51 | {% endif %} 52 | 53 |
54 |
55 |
56 | {% endif %} 57 | 58 | {% if page.extra.tldr %} 59 |
60 | tl;dr: 61 | {{ page.extra.tldr }} 62 |
63 | {% endif %} 64 | 65 |
66 | {% if page.extra.hide_title %} 67 |
68 | {% else %} 69 |
70 | {% endif %} 71 |
72 | 73 | 74 |
75 |
76 | {% endmacro typst %} -------------------------------------------------------------------------------- /templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% import "macros/typst.html" as typst %} 4 | 5 | {% block main_content %} 6 | {% if page.extra.typst | default(value=false) %} 7 | {{ typst::typst(page=page)}} 8 | {% else %} 9 | {{ post_macros::content(page=page)}} 10 | {% endif %} 11 | 12 | {% endblock main_content %} -------------------------------------------------------------------------------- /templates/partials/header.html: -------------------------------------------------------------------------------- 1 | {% import "macros/macros.html" as post_macros %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | {% if page.extra.meta %} 9 | 10 | {% for data in page.extra.meta %} 11 | 25 | {% endfor %} 26 | {% endif %} 27 | 28 | {# Site title #} 29 | {% set current_path = current_path | default(value="/") %} 30 | {% if current_path == "/" %} 31 | 32 | {{ config.title | default(value="Home") }} 33 | 34 | {% if not page_has_og_title %} 35 | 36 | {% endif %} 37 | 38 | {% else %} 39 | 40 | {% if page.title %} {{ page.title }} 41 | {% elif section.title %} {{ section.title }} 42 | {% elif config.title %} {{ config.title }} 43 | {% else %} Post {% endif %} 44 | 45 | 46 | {% if not page_has_og_title %} 47 | 48 | {% endif %} 49 | {% endif %} 50 | 51 | {% if not page_has_og_description %} 52 | {% if page.description %} 53 | 54 | {% elif config.description %} 55 | 56 | {% endif %} 57 | {% endif %} 58 | 59 | {% if not page_has_description %} 60 | {% if page.description %} 61 | 62 | {% elif config.description %} 63 | 64 | {% endif %} 65 | {% endif %} 66 | 67 | {# Favicon #} 68 | {% if config.extra.favicon %} 69 | 70 | {% endif %} 71 | 72 | {# Font from cdn or disk #} 73 | {% if config.extra.use_cdn | default(value=false) %} 74 | 75 | 76 | {% else %} 77 | 78 | {% endif %} 79 | 80 | {# Analytics #} 81 | {% if config.extra.analytics.enabled %} 82 | {% if config.extra.analytics.umami.website_id %} 83 | {% set website_id = config.extra.analytics.umami.website_id %} 84 | {% set host_url = config.extra.analytics.umami.host_url | default(value="https://analytics.eu.umami.is") %} 85 | 86 | 95 | 96 | {% endif %} 97 | 98 | {% if config.extra.analytics.goatcounter.user %} 99 | {% set user = config.extra.analytics.goatcounter.user %} 100 | {% set host = config.extra.analytics.goatcounter.host | default(value="goatcounter.com") %} 101 | 102 | 103 | 107 | {% endif %} 108 | {% endif %} 109 | 110 | {# Fancy Codeblock #} 111 | {% if config.extra.fancy_code %} 112 | 113 | {% endif %} 114 | 115 | {# Table of contents #} 116 | {% if config.extra.toc | default(value=false) %} 117 | 118 | {% endif %} 119 | 120 | {# Dynamic Note #} 121 | {% if config.extra.dynamic_note | default(value=false) %} 122 | 123 | {% endif %} 124 | 125 | {% if config.extra.mathjax | default(value=false) %} 126 | {% if config.extra.mathjax_dollar_inline_enable | default(value=false) %} 127 | 134 | {% endif %} 135 | 138 | {% endif %} 139 | 140 | {% if page.extra.typst | default(value=false) %} 141 | 142 | 143 | 175 | 207 | {% endif %} 208 | 209 | {# RSS #} 210 | 211 | 212 | 213 | {% set theme = config.extra.theme | default(value="toggle") %} 214 | {% if theme == "dark" %} 215 | 216 | {% elif theme == "light" %} 217 | 218 | {% elif theme == "auto" %} 219 | 220 | 221 | {% elif theme == "toggle" %} 222 | 223 | 224 | {% endif %} 225 | 226 | 227 | 228 | {% if theme == "dark" %} 229 | 230 | {% elif theme == "light" %} 231 | 232 | {% elif theme == "auto" %} 233 | 240 | {% else %} 241 | 242 | {% endif %} 243 | 244 | 245 | 246 | {% if config.extra.stylesheets %} 247 | {% for stylesheet in config.extra.stylesheets %} 248 | 249 | {% endfor %} 250 | {% endif %} 251 | 252 | -------------------------------------------------------------------------------- /themes/apollo/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.css] 2 | indent_style = space 3 | indent_size = 2 -------------------------------------------------------------------------------- /themes/apollo/.github/workflows/zola.yml: -------------------------------------------------------------------------------- 1 | name: Zola 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | workflow_dispatch: 7 | 8 | # Allow one concurrent deployment 9 | concurrency: 10 | group: "pages" 11 | cancel-in-progress: true 12 | 13 | 14 | jobs: 15 | build: 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - uses: actions/checkout@v3 20 | 21 | - name: Build and deploy 22 | uses: shalzz/zola-deploy-action@master 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | -------------------------------------------------------------------------------- /themes/apollo/.gitignore: -------------------------------------------------------------------------------- 1 | public/ -------------------------------------------------------------------------------- /themes/apollo/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 not-matthias 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /themes/apollo/README.md: -------------------------------------------------------------------------------- 1 | # apollo 2 | 3 | Modern and minimalistic blog theme powered by [Zola](https://getzola.org). See a live preview [here](https://not-matthias.github.io/apollo). 4 | 5 | Named after the greek god of knowledge, wisdom and intellect 6 | 7 |
8 | Dark theme 9 | 10 | ![blog-dark](./screenshot-dark.png) 11 |
12 | 13 |
14 | Light theme 15 | 16 | ![blog-light](./screenshot.png) 17 |
18 | 19 | ## Features 20 | 21 | - [X] Pagination 22 | - [X] Themes (light, dark, auto) 23 | - [X] Projects page 24 | - [X] Analytics using [GoatCounter](https://www.goatcounter.com/) / [Umami](https://umami.is/) 25 | - [x] Social Links 26 | - [x] MathJax Rendering 27 | - [x] Taxonomies 28 | - [x] Meta Tags For Individual Pages 29 | - [x] Custom homepage 30 | - [x] Comments 31 | - [ ] Search 32 | - [ ] Categories 33 | 34 | ## Installation 35 | 36 | 1. Download the theme 37 | ``` 38 | git submodule add https://github.com/not-matthias/apollo themes/apollo 39 | ``` 40 | 41 | 2. Add the following to the top of your `config.toml` 42 | 43 | ```toml 44 | theme = "apollo" 45 | taxonomies = [{ name = "tags" }] 46 | 47 | [extra] 48 | theme = "auto" 49 | socials = [ 50 | # Configure socials here 51 | ] 52 | menu = [ 53 | # Configure menu bar here 54 | ] 55 | 56 | # See this for more options: https://github.com/not-matthias/apollo/blob/main/config.toml#L14 57 | ``` 58 | 59 | 3. Copy the example content 60 | 61 | ``` 62 | cp -r themes/apollo/content/* content/ 63 | ``` 64 | 65 | ## Configuration 66 | 67 | You can find all the configuration options [here](./content/posts/configuration.md) 68 | 69 | ## References 70 | 71 | This theme is based on [archie-zola](https://github.com/XXXMrG/archie-zola/). 72 | -------------------------------------------------------------------------------- /themes/apollo/config.toml: -------------------------------------------------------------------------------- 1 | base_url = "https://not-matthias.github.io/apollo/" 2 | title = "not-matthias" 3 | description = "This is an example description" 4 | build_search_index = false 5 | generate_feeds = true 6 | compile_sass = true 7 | minify_html = true 8 | taxonomies = [{ name = "tags" }] 9 | 10 | [markdown] 11 | highlight_code = true 12 | highlight_theme = "ayu-light" 13 | 14 | [extra] 15 | toc = true 16 | use_cdn = false 17 | favicon = "/icon/favicon.png" 18 | theme = "toggle" # light, dark, auto, toggle 19 | comment = false 20 | fancy_code = true 21 | dynamic_note = true # a note that can be toggled 22 | mathjax = true 23 | mathjax_dollar_inline_enable = true 24 | repo_url = "https://github.com/not-matthias/apollo/tree/main/content" 25 | 26 | menu = [ 27 | { name = "/posts", url = "/posts", weight = 1 }, 28 | { name = "/projects", url = "/projects", weight = 2 }, 29 | { name = "/about", url = "/about", weight = 3 }, 30 | { name = "/tags", url = "/tags", weight = 4 }, 31 | ] 32 | 33 | socials = [ 34 | { name = "twitter", url = "https://twitter.com/not_matthias", icon = "twitter" }, 35 | { name = "github", url = "https://github.com/not-matthias/", icon = "github" }, 36 | ] 37 | 38 | custom_css = [] 39 | 40 | [extra.analytics] 41 | enabled = false 42 | 43 | [extra.analytics.goatcounter] 44 | user = "your_user" 45 | host = "example.com" # default= goatcounter.com 46 | 47 | [extra.analytics.umami] 48 | website_id = "43929cd1-1e83...." 49 | host_url = "https://stats.mywebsite.com" # default: https://analytics.eu.umami.is 50 | -------------------------------------------------------------------------------- /themes/apollo/content/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title= "Apollo Theme" 3 | template = "homepage.html" 4 | +++ 5 | 6 | Thanks for checking out this theme! 7 | 8 | Checkout all the [options you can configure](./posts/configuration) and the [example pages](./tags/example/). -------------------------------------------------------------------------------- /themes/apollo/content/about.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "About" 3 | path = "about" 4 | +++ 5 | -------------------------------------------------------------------------------- /themes/apollo/content/posts/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | paginate_by = 7 3 | title = "Posts" 4 | sort_by = "date" 5 | 6 | insert_anchor_links = "heading" 7 | +++ 8 | -------------------------------------------------------------------------------- /themes/apollo/content/posts/configuration.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Configuring Apollo" 3 | date = "2024-07-09" 4 | 5 | [taxonomies] 6 | tags=["documentation"] 7 | 8 | [extra] 9 | repo_view = true 10 | +++ 11 | 12 | ## Theme Mode (`theme`) 13 | 14 | Sets the color theme for your blog. 15 | 16 | - Type: String 17 | - Options: "light", "dark", "auto", "toggle" 18 | - Default: "toggle" 19 | - Usage: `theme = "toggle"` 20 | 21 | The "toggle" option allows users to switch between light and dark modes, while "auto" typically follows the user's system preferences. 22 | 23 | ## Menu 24 | 25 | Defines the navigation menu items for your blog. 26 | 27 | - Type: Array of objects 28 | - Default: [] 29 | - Usage: 30 | ```toml 31 | menu = [ 32 | { name = "/posts", url = "/posts", weight = 1 }, 33 | { name = "/projects", url = "/projects", weight = 2 }, 34 | { name = "/about", url = "/about", weight = 3 }, 35 | { name = "/tags", url = "/tags", weight = 4 }, 36 | ] 37 | ``` 38 | 39 | ## Socials 40 | 41 | Defines the social media links. 42 | 43 | - Type: Array of objects 44 | - Default: [] 45 | - Usage: 46 | ```toml 47 | socials = [ 48 | { name = "twitter", url = "https://twitter.com/not_matthias", icon = "twitter" }, 49 | { name = "github", url = "https://github.com/not-matthias/", icon = "github" }, 50 | ] 51 | ``` 52 | 53 | ## Table of Contents (`toc`) 54 | 55 | Enables or disables the table of contents for posts. 56 | 57 | - Type: Boolean 58 | - Default: true 59 | - Usage: `toc = true` 60 | 61 | When enabled, a table of contents will be generated for posts, making it easier for readers to navigate through longer articles. 62 | 63 | ## CDN Usage (`use_cdn`) 64 | 65 | Determines whether to use a Content Delivery Network (CDN) for assets. 66 | 67 | - Type: Boolean 68 | - Default: false 69 | - Usage: `use_cdn = false` 70 | 71 | When set to true, the theme will attempt to load assets from a CDN, which can improve loading times for visitors from different geographic locations. 72 | 73 | ## Favicon (`favicon`) 74 | 75 | Specifies the path to the favicon image for your blog. 76 | 77 | - Type: String 78 | - Default: "/icon/favicon.png" 79 | - Usage: `favicon = "/icon/favicon.png"` 80 | 81 | This sets the small icon that appears in the browser tab for your website. 82 | 83 | ## Comments (`comment`) 84 | 85 | Enables or disables the comment system for posts. 86 | 87 | - Type: Boolean 88 | - Default: false 89 | - Usage: `comment = false` 90 | 91 | When enabled, this allows readers to leave comments on your blog posts. 92 | 93 | ## Fancy Code Styling (`fancy_code`) 94 | 95 | Enables enhanced styling for code blocks. 96 | 97 | - Type: Boolean 98 | - Default: true 99 | - Usage: `fancy_code = true` 100 | 101 | This option adds the language label and a copy button. 102 | 103 | ## Dynamic Notes (`dynamic_note`) 104 | 105 | Allows for the creation of togglable note sections in your content. 106 | 107 | - Type: Boolean 108 | - Default: true 109 | - Usage: `dynamic_note = true` 110 | 111 | When enabled, you can create expandable/collapsible note sections in your blog posts. 112 | 113 | ## Source code (`repo_view`) 114 | 115 | Do you want to link to the source code of your blog post? You can turn on the `repo_view` inside the `[extra]` section of your blog post. 116 | 117 | ```toml 118 | [extra] 119 | repo_view = true 120 | repo_url = "https://github.com/not-matthias/apollo/tree/main/content" # Alternatively add the repo here 121 | ``` 122 | 123 | The `repo_url` can be set in the `[extra]` section or in your `config.toml`. 124 | 125 | ## Anchor Links 126 | 127 | You can add anchor links by adding the following to your `_index.md`: 128 | ```toml 129 | insert_anchor_links = "heading" 130 | ``` -------------------------------------------------------------------------------- /themes/apollo/content/posts/markdown.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Markdown Test" 3 | date = "2022-01-01" 4 | updated = "2022-05-01" 5 | 6 | [taxonomies] 7 | tags=["example"] 8 | +++ 9 | 10 | # H1 11 | ## H2 12 | ### H3 13 | 14 | 15 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Aliquet sagittis id consectetur purus ut. In pellentesque massa placerat duis ultricies. Neque laoreet suspendisse interdum consectetur libero id. Justo nec ultrices dui sapien eget mi proin. Nunc consequat interdum varius sit amet mattis vulputate. Sollicitudin tempor id eu nisl nunc mi ipsum. Non odio euismod lacinia at quis. Sit amet nisl suscipit adipiscing. Amet mattis vulputate enim nulla aliquet porttitor lacus luctus accumsan. Sit amet consectetur adipiscing elit pellentesque habitant. Ac placerat vestibulum lectus mauris. Molestie ac feugiat sed lectus vestibulum mattis ullamcorper velit sed. [Google](https://www.google.com) 16 | 17 | ![Markdown Logo](https://markdown-here.com/img/icon256.png) 18 | 19 | ## Code Block 20 | 21 | ```rust 22 | fn main() { 23 | println!("Hello World"); 24 | } 25 | ``` 26 | 27 | 28 | ```rust,hl_lines=2,linenos 29 | fn main() { 30 | println!("Hello World"); 31 | } 32 | ``` 33 | 34 | ## Ordered List 35 | 36 | 1. First item 37 | 2. Second item 38 | 3. Third item 39 | 40 | ## Unordered List 41 | 42 | - List item 43 | - Another item 44 | - And another item 45 | 46 | ## Nested list 47 | 48 | - Fruit 49 | - Apple 50 | - Orange 51 | - Banana 52 | - Dairy 53 | - Milk 54 | - Cheese 55 | 56 | ## Quote 57 | 58 | > Two things are infinite: the universe and human stupidity; and I'm not sure about the 59 | > universe.
60 | > — Albert Einstein 61 | 62 | 63 | ## Table Inline Markdown 64 | 65 | | Italics | Bold | Code | StrikeThrough | 66 | | --------- | -------- | ------ | ----------------- | 67 | | *italics* | **bold** | `code` | ~~strikethrough~~ | 68 | 69 | ## Foldable Text 70 | 71 |
72 | Title 1 73 |

IT'S A SECRET TO EVERYBODY.

74 |
75 | 76 |
77 | Title 2 78 |

Stay awhile, and listen!

79 |
80 | 81 | ## Code tags 82 | 83 | Lorem ipsum `dolor` sit amet, `consectetur adipiscing` elit. 84 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit.` 85 | -------------------------------------------------------------------------------- /themes/apollo/content/posts/math-symbol.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Math Symbol Example" 3 | date = "2023-01-06" 4 | 5 | [taxonomies] 6 | tags=["example"] 7 | +++ 8 | 9 | Note: This requires the `mathjax` and `mathjax_dollar_inline_enable` option set to `true`. 10 | 11 | # Inline Math 12 | 13 | - $(a+b)^2$ = $a^2 + 2ab + b^2$ 14 | - A polynomial P of degree d over $\mathbb{F}_p$ is an expression of the form 15 | $P(s) = a_0 + a_1 . s + a_2 . s^2 + ... + a_d . s^d$ for some 16 | $a_0,..,a_d \in \mathbb{F}_p$ 17 | 18 | # Displayed Math 19 | 20 | $$ 21 | p := (\sum_{k∈I}{c_k.v_k} + \delta_v.t(x))·(\sum_{k∈I}{c_k.w_k} + \delta_w.t(x)) − (\sum_{k∈I}{c_k.y_k} + \delta_y.t(x)) 22 | $$ 23 | -------------------------------------------------------------------------------- /themes/apollo/content/posts/shortcode.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Shortcode Example" 3 | date = "2024-06-14" 4 | 5 | [taxonomies] 6 | tags=["example"] 7 | +++ 8 | 9 | 10 | ## Note 11 | 12 | Here is an example of the `note` shortcode: 13 | 14 | This one is static! 15 | {{ note(header="Note!", body="This blog assumes basic terminal maturity") }} 16 | 17 | This one is clickable! 18 | {{ note(clickable=true, hidden = true, header="Quiz!", body="The answer to the quiz!") }} 19 | 20 | 21 | Syntax: 22 | ``` 23 | {{/* note(header="Note!", body="This blog assumes basic terminal maturity") */}} 24 | {{/* note(clickable=true, hidden = true, header="Quiz!", body="The answer to the quiz!") */}} 25 | ``` 26 | 27 | You can also use some HTML in the text: 28 | {{ note(header="Note!", body="

This blog assumes basic terminal maturity

") }} 29 | 30 | 31 | Literal shortcode: 32 | ``` 33 | {{/* note(header="Note!", body="

This blog assumes basic terminal maturity

") */}} 34 | ``` 35 | 36 | Pretty cool, right? 37 | 38 | Finally, you can do something like this (hopefully): 39 | 40 | {% note(clickable=true, header="Quiz!") %} 41 | 42 | # Hello this is markdown inside a note shortcode 43 | 44 | ```rust 45 | fn main() { 46 | println!("Hello World"); 47 | } 48 | ``` 49 | 50 | We can't call another shortcode inside a shortcode, but this is good enough. 51 | 52 | {% end %} 53 | 54 | Here is the raw markdown: 55 | 56 | ```markdown 57 | {{/* note(clickable=true, header="Quiz!") */}} 58 | 59 | # Hello this is markdown inside a note shortcode 60 | 61 | \`\`\`rust 62 | fn main() { 63 | println!("Hello World"); 64 | } 65 | \`\`\` 66 | 67 | We can't call another shortcode inside a shortcode, but this is good enough. 68 | 69 | {{/* end */}} 70 | ``` 71 | 72 | Finally, we have center 73 | {{ note(center=true, header="Centered Text", body="This is centered text") }} 74 | 75 | ```markdown 76 | {{/* note(center=true, header="Centered Text", body="This is centered text") */}} 77 | ``` 78 | It works good enough for me! 79 | -------------------------------------------------------------------------------- /themes/apollo/content/projects/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Projects" 3 | sort_by = "weight" 4 | template = "cards.html" 5 | +++ 6 | -------------------------------------------------------------------------------- /themes/apollo/content/projects/project-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/content/projects/project-1.jpg -------------------------------------------------------------------------------- /themes/apollo/content/projects/project_1.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Apollo" 3 | description = "Modern and minimalistic blog theme." 4 | weight = 1 5 | 6 | [extra] 7 | local_image = "/projects/project-1.jpg" 8 | link_to = "https://github.com/not-matthias/apollo" 9 | +++ 10 | 11 | Example project page -------------------------------------------------------------------------------- /themes/apollo/content/projects/project_2.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Project 2" 3 | description = "Example description" 4 | weight = 1 5 | 6 | [extra] 7 | # You can also crop the image in the url by adjusting w=/h= 8 | remote_image = "https://images.unsplash.com/photo-1523821741446-edb2b68bb7a0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1470&q=80" 9 | +++ 10 | 11 | Example project page 12 | -------------------------------------------------------------------------------- /themes/apollo/content/projects/project_3.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Project 3" 3 | description = "Example description" 4 | weight = 1 5 | 6 | [extra] 7 | remote_image = "https://images.unsplash.com/photo-1462556791646-c201b8241a94?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1465&q=80" 8 | +++ 9 | 10 | Example project page -------------------------------------------------------------------------------- /themes/apollo/content/projects/project_4.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Project 4" 3 | description = "Example description with a lot of words but without any meaning. Why use lorem ipsum when you can just write a lot of text that has no underlying meaning?" 4 | weight = 1 5 | 6 | [extra] 7 | remote_image = "https://images.unsplash.com/photo-1620121692029-d088224ddc74?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1632&q=80" 8 | +++ 9 | 10 | Example project page -------------------------------------------------------------------------------- /themes/apollo/content/projects/project_5.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Project 4" 3 | description = "Example description" 4 | weight = 1 5 | +++ 6 | 7 | Example project page -------------------------------------------------------------------------------- /themes/apollo/sass/fonts.scss: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Jetbrains Mono'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: url('fonts/JetbrainsMono/JetBrainsMono-Regular.ttf'), local('ttf'); 6 | font-display: swap; 7 | } 8 | 9 | @font-face { 10 | font-family: 'Jetbrains Mono'; 11 | font-style: normal; 12 | font-weight: 700; 13 | src: url('fonts/JetbrainsMono/JetBrainsMono-Bold.ttf'), local('ttf'); 14 | font-display: swap 15 | } 16 | 17 | @font-face { 18 | font-family: 'Space Grotesk'; 19 | font-style: normal; 20 | font-weight: 400; 21 | src: url('fonts/SpaceGrotesk/SpaceGrotesk-Regular.ttf'), local('ttf'); 22 | font-display: swap; 23 | } 24 | 25 | @font-face { 26 | font-family: 'Space Grotesk'; 27 | font-style: normal; 28 | font-weight: 700; 29 | src: url('fonts/SpaceGrotesk/SpaceGrotesk-Bold.ttf'), local('ttf'); 30 | font-display: swap; 31 | } -------------------------------------------------------------------------------- /themes/apollo/sass/main.scss: -------------------------------------------------------------------------------- 1 | @import "parts/_cards.scss"; 2 | @import "parts/_code.scss"; 3 | @import "parts/_header.scss"; 4 | @import "parts/_image.scss"; 5 | @import "parts/_toc.scss"; 6 | @import "parts/_note.scss"; 7 | @import "parts/misc.scss"; 8 | @import "parts/table.scss"; 9 | @import "parts/tags.scss"; 10 | 11 | :root { 12 | /* Used for: block comment, hr, ... */ 13 | --border-color: var(--border-color); 14 | 15 | /* Fonts */ 16 | --text-font: 'Jetbrains Mono'; 17 | --header-font: 'Space Grotesk', 'Helvetica', sans-serif; 18 | --code-font: 'Jetbrains Mono'; 19 | } 20 | 21 | html { 22 | background-color: var(--bg-0); 23 | color: var(--text-0); 24 | font-family: var(--text-font); 25 | line-height: 1.6em; 26 | } 27 | 28 | .content { 29 | max-width: 1000px; 30 | margin: 0 auto; 31 | padding: 0 24px; 32 | word-wrap: break-word; 33 | } 34 | 35 | @media all and (min-width:640px) { 36 | html { 37 | font-size: 16.5px; 38 | } 39 | } 40 | 41 | @media all and (min-width:720px) { 42 | html { 43 | font-size: 17px; 44 | } 45 | } 46 | 47 | @media all and (min-width:960px) { 48 | html { 49 | font-size: 18px; 50 | } 51 | } -------------------------------------------------------------------------------- /themes/apollo/sass/parts/_cards.scss: -------------------------------------------------------------------------------- 1 | .cards { 2 | display: grid; 3 | grid-template-rows: auto; 4 | gap: 24px; 5 | padding: 12px 0; 6 | } 7 | 8 | @media all and (min-width: 640px) { 9 | .cards { 10 | grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); 11 | } 12 | } 13 | 14 | @media all and (max-width: 640px) { 15 | .cards { 16 | grid-template-columns: repeat(auto-fill, 1fr); 17 | } 18 | } 19 | 20 | .card { 21 | min-height: 100px; 22 | background: var(--bg-1); 23 | border: 2px solid var(--border-color); 24 | border-radius: 10px; 25 | overflow: hidden; 26 | } 27 | 28 | .card-info { 29 | padding: 0 24px 24px 24px; 30 | } 31 | 32 | .card-title { 33 | margin-top: 0.7em; 34 | } 35 | 36 | .card-image { 37 | border: unset; 38 | width: 100%; 39 | } 40 | 41 | .card-image-placeholder { 42 | height: 12px; 43 | width: 100%; 44 | } 45 | 46 | .card-description { 47 | margin-top: 0.5em; 48 | overflow: hidden; 49 | } 50 | 51 | @media all and (max-width:720px) { 52 | .cards { 53 | gap: 18px; 54 | } 55 | } -------------------------------------------------------------------------------- /themes/apollo/sass/parts/_code.scss: -------------------------------------------------------------------------------- 1 | // Define base colors and fonts for light and dark themes 2 | :root { 3 | --code-font: 'Courier New', monospace; 4 | --bg-primary: var(--bg-1); 5 | --text-color: var(--text-0); // Color of the code text 6 | --label-color: #f0f0f0; // Text color of the label 7 | 8 | --hightlight-color: #f0f0f0; 9 | } 10 | 11 | :root.dark { 12 | --hightlight-color: #204e8a; 13 | } 14 | 15 | 16 | // Define language colors map 17 | $language-colors: ( 18 | "js": (#f7df1e, "JavaScript"), 19 | "yaml": (#f71e6a, "YAML"), 20 | "shell": (#4eaa25, "Shell"), 21 | // Updated to a more specific green shade 22 | "json": (dodgerblue, "JSON"), 23 | "python": (#3572A5, "Python"), 24 | // Using the specific Python blue 25 | "css": (#264de4, "CSS"), 26 | "go": (#00ADD8, "Go"), 27 | // Official Go color 28 | "markdown": (#0000ff, "Markdown"), 29 | "rust": (#ff4647, "Rust"), 30 | // Adjusted to match Rust's branding 31 | "java": (#f89820, "Java"), 32 | // Oracle Java color 33 | "csharp": (#178600, "C#"), 34 | "ruby": (#701516, "Ruby"), 35 | "swift": (#f05138, "Swift"), 36 | "php": (#777bb4, "PHP"), 37 | "typescript": (#3178c6, "TypeScript"), 38 | "scala": (#c22d40, "Scala"), 39 | "kotlin": (#F18E33, "Kotlin"), 40 | "lua": (#000080, "Lua"), 41 | "perl": (#0298c3, "Perl"), 42 | "haskell": (#5e5086, "Haskell"), 43 | "r": (#198ce7, "R"), 44 | "dart": (#00d2b8, "Dart"), 45 | "elixir": (#6e4a7e, "Elixir"), 46 | "clojure": (#5881d8, "Clojure"), 47 | "bash": (#4eaa25, "Bash"), 48 | "default": (#333, "Code"), 49 | ); 50 | 51 | @mixin base-label-style($bg-color, $text-color: var(--label-color)) { 52 | background: $bg-color; 53 | color: $text-color; 54 | border-radius: 0 0 0.25rem 0.25rem; 55 | font-size: 12px; 56 | letter-spacing: 0.025rem; 57 | padding: 0.1rem 0.5rem; 58 | text-align: right; 59 | text-transform: uppercase; 60 | position: absolute; 61 | right: 0; 62 | top: 0; 63 | margin-top: 0.1rem; 64 | } 65 | 66 | // Example usage within a specific class for clarity 67 | .code-label { 68 | @include base-label-style(#333); // Default background color 69 | } 70 | 71 | @each $lang, $color-info in $language-colors { 72 | .label-#{$lang} { 73 | @include base-label-style(nth($color-info, 1)); 74 | } 75 | } 76 | 77 | code { 78 | background-color: var(--bg-primary); 79 | padding: 0.1em 0.2em; 80 | border-radius: 5px; 81 | border: 1px solid var(--border-color); 82 | font-family: var(--code-font); 83 | } 84 | 85 | pre { 86 | background-color: var(--bg-primary) !important; 87 | border-radius: 5px; 88 | border: 1px solid var(--border-color); 89 | line-height: 1.4; 90 | overflow-x: auto; 91 | padding: 1em; 92 | position: relative; 93 | 94 | mark { 95 | background-color: var(--hightlight-color) !important; // Ensure mark uses the theme background 96 | padding: 0; 97 | border-radius: 0px; 98 | } 99 | 100 | code { 101 | background-color: transparent !important; 102 | color: var(--text-color); 103 | font-size: 100%; 104 | padding: 0; 105 | border: none; 106 | font-family: var(--code-font); 107 | 108 | table { 109 | margin: 0; 110 | border-collapse: collapse; 111 | font-family: var(--code-font); 112 | 113 | mark { 114 | display: block; 115 | color: unset; 116 | padding: 0; 117 | background-color: var(--hightlight-color) !important; 118 | filter: brightness(1.2); // Example to slightly increase brightness 119 | } 120 | 121 | } 122 | 123 | td, 124 | th, 125 | tr { 126 | padding: 0; 127 | border-bottom: none; 128 | border: none; // Ensure no borders around rows 129 | } 130 | 131 | tbody td:first-child { 132 | text-align: center; 133 | user-select: none; 134 | min-width: 60px; 135 | border-right: none, 136 | } 137 | 138 | tbody tr:nth-child(even), 139 | thead tr { 140 | background-color: unset; 141 | } 142 | } 143 | } 144 | 145 | .clipboard-button, 146 | .clipboard-button svg { 147 | all: unset; 148 | cursor: pointer; 149 | position: absolute; 150 | bottom: 5px; 151 | /* 5px from the bottom */ 152 | right: 5px; 153 | /* 5px from the right */ 154 | z-index: 10; 155 | background-color: transparent; 156 | border: none; 157 | fill: #ef5350; 158 | /* Sets the color of the SVG, assuming it's an SVG icon */ 159 | } -------------------------------------------------------------------------------- /themes/apollo/sass/parts/_header.scss: -------------------------------------------------------------------------------- 1 | .page-header { 2 | font-size: 2.5em; 3 | line-height: 100%; 4 | font-family: var(--header-font); 5 | margin: 4rem 0px 1rem 0px; 6 | } 7 | 8 | .centered-header { 9 | font-family: var(--header-font); 10 | position: absolute; 11 | top: 40%; 12 | left: 50%; 13 | transform: translate(-50%, -50%); 14 | text-align: center; 15 | font-size: 4em; 16 | } 17 | 18 | header { 19 | display: flex; 20 | flex-direction: row; 21 | flex-wrap: wrap; 22 | justify-content: space-between; 23 | padding: 1em 0; 24 | } 25 | 26 | header .main { 27 | display: flex; 28 | flex-direction: row; 29 | flex-wrap: wrap; 30 | justify-content: space-between; 31 | align-items: flex-start; 32 | gap: 12px; 33 | font-size: 1.5rem; 34 | 35 | /* Otherwise header and menu is too close on small screens*/ 36 | margin-bottom: 5px; 37 | } 38 | 39 | header .social img, 40 | header #dark-mode-toggle img { 41 | width: 16px; 42 | height: 16px; 43 | } 44 | 45 | header .socials { 46 | margin-bottom: 10px; 47 | /* Space between social icons and menu items */ 48 | } 49 | 50 | #dark-mode-toggle { 51 | justify-content: center; 52 | } 53 | 54 | .socials { 55 | /* flex-child */ 56 | flex-grow: 0; 57 | /* flex-container */ 58 | display: flex; 59 | flex-direction: row; 60 | flex-wrap: wrap; 61 | justify-content: flex-start; 62 | align-items: flex-end; 63 | gap: 6px; 64 | } 65 | 66 | .social { 67 | border-bottom: unset; 68 | background-image: unset; 69 | padding: 2px; 70 | } 71 | 72 | .social>img { 73 | border: unset; 74 | width: 24px; 75 | height: 24px; 76 | } 77 | 78 | /* Mobile-specific adjustments */ 79 | @media (max-width: 600px) { 80 | header { 81 | flex-direction: column; 82 | align-items: center; 83 | padding: 1em 0; 84 | } 85 | 86 | header .main a { 87 | font-size: 20px; 88 | } 89 | } 90 | 91 | .meta { 92 | color: #999; 93 | display: flexbox; 94 | /* This changes the meta class to use flexbox, which ensures inline display */ 95 | align-items: center; 96 | /* Aligns items vertically in the middle */ 97 | flex-wrap: wrap; 98 | /* Allows items to wrap as needed */ 99 | } 100 | 101 | #dark-mode-toggle>img { 102 | display: none; 103 | width: 15px; 104 | height: 15px; 105 | border: unset; 106 | } 107 | 108 | h1, 109 | h2, 110 | h3, 111 | h4, 112 | h5, 113 | h6 { 114 | font-size: 1.2rem; 115 | margin-top: 2em; 116 | } 117 | 118 | h1::before { 119 | color: var(--primary-color); 120 | content: "# "; 121 | } 122 | 123 | h2::before { 124 | color: var(--primary-color); 125 | content: "## "; 126 | } 127 | 128 | h3::before { 129 | color: var(--primary-color); 130 | content: "### "; 131 | } 132 | 133 | h4::before { 134 | color: var(--primary-color); 135 | content: "#### "; 136 | } 137 | 138 | h5::before { 139 | color: var(--primary-color); 140 | content: "##### "; 141 | } 142 | 143 | h6::before { 144 | color: var(--primary-color); 145 | content: "###### "; 146 | } 147 | -------------------------------------------------------------------------------- /themes/apollo/sass/parts/_image.scss: -------------------------------------------------------------------------------- 1 | img { 2 | border: 3px solid #ececec; 3 | max-width: 100%; 4 | } 5 | 6 | figure { 7 | box-sizing: border-box; 8 | display: inline-block; 9 | margin: 0; 10 | max-width: 100%; 11 | } 12 | 13 | figure img { 14 | max-height: 500px; 15 | } 16 | 17 | @media screen and (min-width: 600px) { 18 | figure { 19 | padding: 0 40px; 20 | } 21 | } 22 | 23 | figure h4 { 24 | font-size: 1rem; 25 | margin: 0; 26 | margin-bottom: 1em; 27 | } 28 | 29 | figure h4::before { 30 | content: "↳ "; 31 | } 32 | 33 | svg { 34 | max-height: 15px; 35 | } -------------------------------------------------------------------------------- /themes/apollo/sass/parts/_misc.scss: -------------------------------------------------------------------------------- 1 | .primary-color { 2 | color: var(--primary-color); 3 | } 4 | 5 | .draft-label { 6 | color: var(--hover-color); 7 | text-decoration: none; 8 | padding: 2px 4px; 9 | border-radius: 4px; 10 | margin-left: 6px; 11 | background-color: var(--primary-color); 12 | } 13 | 14 | ::-moz-selection { 15 | background: var(--primary-color); 16 | color: var(--hover-color); 17 | text-shadow: none; 18 | } 19 | 20 | ::selection { 21 | background: var(--primary-color); 22 | color: var(--hover-color); 23 | } 24 | 25 | p { 26 | line-height: 1.5; 27 | } 28 | 29 | hr { 30 | border: 0; 31 | border-top: 3px solid var(--border-color); 32 | margin: 1em 0; 33 | } 34 | 35 | blockquote { 36 | border-left: 3px solid var(--primary-color); 37 | color: #737373; 38 | margin: 0; 39 | padding-left: 1em; 40 | } 41 | 42 | a { 43 | border-bottom: 3px solid var(--primary-color); 44 | color: inherit; 45 | text-decoration: none; 46 | 47 | // Make sure the underline is at the top 48 | position: relative; // needed for z-index 49 | z-index: 1; 50 | } 51 | 52 | a.zola-anchor { 53 | border-bottom: none; 54 | } 55 | 56 | a:hover { 57 | background-color: var(--primary-color); 58 | color: var(--hover-color); 59 | } 60 | 61 | time { 62 | color: grey; 63 | } 64 | 65 | /* Remove post list padding */ 66 | .list>ul { 67 | margin: 0; 68 | padding: 1rem 0 0 0; 69 | } 70 | 71 | /* Post list */ 72 | .list-item { 73 | margin-bottom: 30px; 74 | list-style-type: none; 75 | } 76 | 77 | // change the line-through color 78 | del { 79 | text-decoration-color: var(--primary-color); 80 | text-decoration-thickness: 3px; 81 | } 82 | 83 | @media all and (max-width: 640px) { 84 | .post-header { 85 | display: grid; 86 | grid-template-rows: auto 1fr; 87 | 88 | h1 { 89 | margin-top: 0; 90 | // font-size: 130%; 91 | 92 | a { 93 | border-bottom: none; 94 | } 95 | } 96 | } 97 | } 98 | 99 | /* Post list */ 100 | @media all and (min-width: 640px) { 101 | .post-header { 102 | display: grid; 103 | gap: 1rem; 104 | grid-row-gap: 1.5rem; 105 | grid-template-columns: auto 1fr; 106 | 107 | h1 { 108 | margin: 0; 109 | font-size: 130%; 110 | 111 | a { 112 | border-bottom: none; 113 | } 114 | } 115 | } 116 | } 117 | 118 | /* Remove styling from theme toggle button */ 119 | #dark-mode-toggle { 120 | border-bottom: none; 121 | 122 | &:hover { 123 | background-color: transparent; 124 | } 125 | } 126 | 127 | .MathJax_Display, 128 | .MJXc-display, 129 | .MathJax_SVG_Display { 130 | overflow-x: auto; 131 | overflow-y: hidden; 132 | } -------------------------------------------------------------------------------- /themes/apollo/sass/parts/_note.scss: -------------------------------------------------------------------------------- 1 | :root { 2 | --note-header-bg: var(--bg-2); 3 | --note-header-color: var(--text-0); 4 | --note-content-bg: var(--bg-1); 5 | } 6 | 7 | 8 | .note-container { 9 | border-radius: 4px; 10 | overflow: hidden; 11 | margin: 1em 0; 12 | position: relative; 13 | border-left: 3px solid var(--primary-color); 14 | font-family: var(--paragraph-font); 15 | } 16 | 17 | .note-toggle, 18 | .note-header { 19 | color: var(--note-header-color); 20 | background-color: var(--note-header-bg); 21 | padding: 10px 25px; 22 | text-align: left; 23 | border: none; 24 | width: 100%; 25 | position: relative; 26 | outline: none; 27 | font-size: 1.2em; 28 | transition: background-color 0.3s ease; 29 | 30 | p { 31 | margin: 0; 32 | } 33 | 34 | .note-center { 35 | text-align: center; 36 | padding-right: 50px; 37 | } 38 | 39 | .note-icon, 40 | .note-icon { 41 | padding-left: 25px; 42 | } 43 | } 44 | 45 | .note-toggle { 46 | cursor: pointer; 47 | position: relative; 48 | } 49 | 50 | .note-toggle::before { 51 | content: '▼'; 52 | position: absolute; 53 | right: 20px; 54 | /* Position the arrow to the right */ 55 | top: 50%; 56 | /* Center vertically */ 57 | transform: translateY(-50%); 58 | /* Center vertically */ 59 | } 60 | 61 | .note-toggle:hover, 62 | .note-toggle:focus { 63 | color: var(--note-header-color); 64 | background-color: var(--note-header-bg); 65 | outline: none; 66 | } 67 | 68 | .note-content { 69 | padding: 10px 20px; 70 | background-color: var(--note-content-bg); 71 | } 72 | 73 | .note-icon::before { 74 | content: '✎'; 75 | color: var(--primary-color); 76 | position: absolute; 77 | left: 20px; 78 | top: 50%; 79 | transform: translateY(-50%); 80 | } 81 | 82 | summary:hover, 83 | summary:focus { 84 | color: var(--primary-color); 85 | background-color: var(--note-header-bg); 86 | outline: none; 87 | padding: 10px; 88 | } -------------------------------------------------------------------------------- /themes/apollo/sass/parts/_table.scss: -------------------------------------------------------------------------------- 1 | table { 2 | border-spacing: 0; 3 | border-collapse: collapse; 4 | } 5 | 6 | table th { 7 | padding: 6px 13px; 8 | border: 1px solid #dfe2e5; 9 | font-size: large; 10 | } 11 | 12 | table td { 13 | padding: 6px 13px; 14 | border: 1px solid #dfe2e5; 15 | } -------------------------------------------------------------------------------- /themes/apollo/sass/parts/_tags.scss: -------------------------------------------------------------------------------- 1 | .tags { 2 | ul { 3 | margin-left: 0; 4 | padding-left: 0; 5 | } 6 | 7 | li { 8 | list-style-type: none; 9 | } 10 | 11 | a { 12 | border-bottom: 3px solid var(--primary-color); 13 | font-family: var(--text-font); 14 | } 15 | 16 | a:hover { 17 | color: var(--hover_color); 18 | background-color: var(--primary-color); 19 | } 20 | 21 | a::before { 22 | content: "🏷 "; /* Ensure there's a space after the emoji for spacing */ 23 | display: inline; 24 | white-space: nowrap !important; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /themes/apollo/sass/parts/_toc.scss: -------------------------------------------------------------------------------- 1 | .toc-container { 2 | .toc-title { 3 | cursor: pointer; 4 | position: relative; 5 | padding-left: 20px; // Space for the arrow 6 | 7 | &:before { 8 | content: '▼'; // Down arrow 9 | position: absolute; 10 | left: 0; 11 | transition: transform 0.3s ease; // Smooth transformation 12 | } 13 | 14 | &:hover:before, 15 | &.expanded:before { 16 | transform: rotate(180deg); // Arrow points up when expanded or on hover 17 | } 18 | } 19 | 20 | .toc-list { 21 | display: none; // ToC is hidden by default 22 | // Removed transition on display, not effective 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /themes/apollo/sass/theme/dark.scss: -------------------------------------------------------------------------------- 1 | $bg-0: #121212; 2 | 3 | // Dark theme needs a bigger contrast compared to the white theme. 4 | $bg-1: lighten($bg-0, 5%); 5 | $bg-2: lighten($bg-1, 10%); 6 | 7 | $text-0: lighten($bg-0, 87%); 8 | $text-1: lighten($bg-0, 60%); 9 | 10 | :root.dark { 11 | --text-0: #{$text-0}; 12 | --text-1: #{$text-1}; 13 | 14 | --bg-0: #{$bg-0}; 15 | --bg-1: #{$bg-1}; 16 | --bg-2: #{$bg-2}; 17 | 18 | --border-color: var(--bg-2); 19 | 20 | --primary-color: #ef5350; 21 | --hover-color: white; 22 | 23 | .social>img { 24 | filter: invert(1); 25 | } 26 | } -------------------------------------------------------------------------------- /themes/apollo/sass/theme/light.scss: -------------------------------------------------------------------------------- 1 | $bg-0: #fff; 2 | $bg-1: darken($bg-0, 2%); 3 | $bg-2: darken($bg-1, 8%); 4 | 5 | $text-0: darken($bg-0, 87%); 6 | $text-1: darken($bg-0, 60%); 7 | 8 | :root.light { 9 | --text-0: #{$text-0}; 10 | --text-1: #{$text-1}; 11 | 12 | --bg-0: #{$bg-0}; 13 | --bg-1: #{$bg-1}; 14 | --bg-2: #{$bg-2}; 15 | 16 | --border-color: var(--bg-2); 17 | 18 | --primary-color: #ef5350; 19 | --hover-color: white; 20 | 21 | // invert colour on hover for consistency 22 | .social :hover { 23 | filter: invert(1) 24 | } 25 | } -------------------------------------------------------------------------------- /themes/apollo/screenshot-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/screenshot-dark.png -------------------------------------------------------------------------------- /themes/apollo/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/screenshot.png -------------------------------------------------------------------------------- /themes/apollo/shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | pkgs.mkShell { 3 | nativeBuildInputs = [ pkgs.zola ]; 4 | } -------------------------------------------------------------------------------- /themes/apollo/static/feather/moon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/feather/sun.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/fonts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/.gitkeep -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Bold.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-BoldItalic.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBold.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLight.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Italic.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Light.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-LightItalic.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Medium.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-MediumItalic.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Regular.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-SemiBold.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-Thin.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/JetbrainsMono/JetBrainsMono-ThinItalic.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-Bold.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-Light.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-Medium.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-Regular.ttf -------------------------------------------------------------------------------- /themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/fonts/SpaceGrotesk/SpaceGrotesk-SemiBold.ttf -------------------------------------------------------------------------------- /themes/apollo/static/js/codeblock.js: -------------------------------------------------------------------------------- 1 | const successIcon = ` 2 | 3 | `; 4 | const errorIcon = ` 5 | 6 | `; 7 | const copyIcon = ` 8 | 9 | `; 10 | 11 | // Function to change icons after copying 12 | const changeIcon = (button, isSuccess) => { 13 | button.innerHTML = isSuccess ? successIcon : errorIcon; 14 | setTimeout(() => { 15 | button.innerHTML = copyIcon; // Reset to copy icon 16 | }, 2000); 17 | }; 18 | 19 | // Function to get code text from tables, skipping line numbers 20 | const getCodeFromTable = (codeBlock) => { 21 | return [...codeBlock.querySelectorAll('tr')] 22 | .map(row => row.querySelector('td:last-child')?.innerText ?? '') 23 | .join(''); 24 | }; 25 | 26 | // Function to get code text from non-table blocks 27 | const getNonTableCode = (codeBlock) => { 28 | return codeBlock.textContent.trim(); 29 | }; 30 | 31 | document.addEventListener('DOMContentLoaded', function () { 32 | // Select all `pre` elements containing `code` 33 | 34 | const observer = new IntersectionObserver((entries) => { 35 | entries.forEach(entry => { 36 | const pre = entry.target.parentNode; 37 | const clipboardBtn = pre.querySelector('.clipboard-button'); 38 | const label = pre.querySelector('.code-label'); 39 | 40 | if (clipboardBtn) { 41 | // Adjust the position of the clipboard button when the `code` is not fully visible 42 | clipboardBtn.style.right = entry.isIntersecting ? '5px' : `-${entry.boundingClientRect.right - pre.clientWidth + 5}px`; 43 | } 44 | 45 | if (label) { 46 | // Adjust the position of the label similarly 47 | label.style.right = entry.isIntersecting ? '0px' : `-${entry.boundingClientRect.right - pre.clientWidth}px`; 48 | } 49 | }); 50 | }, { 51 | root: null, // observing relative to viewport 52 | rootMargin: '0px', 53 | threshold: 1.0 // Adjust this to control when the callback fires 54 | }); 55 | 56 | document.querySelectorAll('pre code').forEach(codeBlock => { 57 | const pre = codeBlock.parentNode; 58 | pre.style.position = 'relative'; // Ensure parent `pre` can contain absolute elements 59 | 60 | // Create and append the copy button 61 | const copyBtn = document.createElement('button'); 62 | copyBtn.className = 'clipboard-button'; 63 | copyBtn.innerHTML = copyIcon; 64 | copyBtn.setAttribute('aria-label', 'Copy code to clipboard'); 65 | pre.appendChild(copyBtn); 66 | 67 | // Attach event listener to copy button 68 | copyBtn.addEventListener('click', async () => { 69 | // Determine if the code is in a table or not 70 | const isTable = codeBlock.querySelector('table'); 71 | const codeToCopy = isTable ? getCodeFromTable(codeBlock) : getNonTableCode(codeBlock); 72 | try { 73 | await navigator.clipboard.writeText(codeToCopy); 74 | changeIcon(copyBtn, true); // Show success icon 75 | } catch (error) { 76 | console.error('Failed to copy text: ', error); 77 | changeIcon(copyBtn, false); // Show error icon 78 | } 79 | }); 80 | 81 | const langClass = codeBlock.className.match(/language-(\w+)/); 82 | const lang = langClass ? langClass[1] : 'default'; 83 | 84 | // Create and append the label 85 | const label = document.createElement('span'); 86 | label.className = 'code-label label-' + lang; // Use the specific language class 87 | label.textContent = lang.toUpperCase(); // Display the language as label 88 | pre.appendChild(label); 89 | 90 | let ticking = false; 91 | pre.addEventListener('scroll', () => { 92 | if (!ticking) { 93 | window.requestAnimationFrame(() => { 94 | copyBtn.style.right = `-${pre.scrollLeft}px`; 95 | label.style.right = `-${pre.scrollLeft}px`; 96 | ticking = false; 97 | }); 98 | ticking = true; 99 | } 100 | }); 101 | 102 | }); 103 | }); 104 | -------------------------------------------------------------------------------- /themes/apollo/static/js/count.js: -------------------------------------------------------------------------------- 1 | // GoatCounter: https://www.goatcounter.com 2 | // This file (and *only* this file) is released under the ISC license: 3 | // https://opensource.org/licenses/ISC 4 | ;(function() { 5 | 'use strict'; 6 | 7 | if (window.goatcounter && window.goatcounter.vars) // Compatibility with very old version; do not use. 8 | window.goatcounter = window.goatcounter.vars 9 | else 10 | window.goatcounter = window.goatcounter || {} 11 | 12 | // Load settings from data-goatcounter-settings. 13 | var s = document.querySelector('script[data-goatcounter]') 14 | if (s && s.dataset.goatcounterSettings) { 15 | try { var set = JSON.parse(s.dataset.goatcounterSettings) } 16 | catch (err) { console.error('invalid JSON in data-goatcounter-settings: ' + err) } 17 | for (var k in set) 18 | if (['no_onload', 'no_events', 'allow_local', 'allow_frame', 'path', 'title', 'referrer', 'event'].indexOf(k) > -1) 19 | window.goatcounter[k] = set[k] 20 | } 21 | 22 | var enc = encodeURIComponent 23 | 24 | // Get all data we're going to send off to the counter endpoint. 25 | var get_data = function(vars) { 26 | var data = { 27 | p: (vars.path === undefined ? goatcounter.path : vars.path), 28 | r: (vars.referrer === undefined ? goatcounter.referrer : vars.referrer), 29 | t: (vars.title === undefined ? goatcounter.title : vars.title), 30 | e: !!(vars.event || goatcounter.event), 31 | s: [window.screen.width, window.screen.height, (window.devicePixelRatio || 1)], 32 | b: is_bot(), 33 | q: location.search, 34 | } 35 | 36 | var rcb, pcb, tcb // Save callbacks to apply later. 37 | if (typeof(data.r) === 'function') rcb = data.r 38 | if (typeof(data.t) === 'function') tcb = data.t 39 | if (typeof(data.p) === 'function') pcb = data.p 40 | 41 | if (is_empty(data.r)) data.r = document.referrer 42 | if (is_empty(data.t)) data.t = document.title 43 | if (is_empty(data.p)) data.p = get_path() 44 | 45 | if (rcb) data.r = rcb(data.r) 46 | if (tcb) data.t = tcb(data.t) 47 | if (pcb) data.p = pcb(data.p) 48 | return data 49 | } 50 | 51 | // Check if a value is "empty" for the purpose of get_data(). 52 | var is_empty = function(v) { return v === null || v === undefined || typeof(v) === 'function' } 53 | 54 | // See if this looks like a bot; there is some additional filtering on the 55 | // backend, but these properties can't be fetched from there. 56 | var is_bot = function() { 57 | // Headless browsers are probably a bot. 58 | var w = window, d = document 59 | if (w.callPhantom || w._phantom || w.phantom) 60 | return 150 61 | if (w.__nightmare) 62 | return 151 63 | if (d.__selenium_unwrapped || d.__webdriver_evaluate || d.__driver_evaluate) 64 | return 152 65 | if (navigator.webdriver) 66 | return 153 67 | return 0 68 | } 69 | 70 | // Object to urlencoded string, starting with a ?. 71 | var urlencode = function(obj) { 72 | var p = [] 73 | for (var k in obj) 74 | if (obj[k] !== '' && obj[k] !== null && obj[k] !== undefined && obj[k] !== false) 75 | p.push(enc(k) + '=' + enc(obj[k])) 76 | return '?' + p.join('&') 77 | } 78 | 79 | // Show a warning in the console. 80 | var warn = function(msg) { 81 | if (console && 'warn' in console) 82 | console.warn('goatcounter: ' + msg) 83 | } 84 | 85 | // Get the endpoint to send requests to. 86 | var get_endpoint = function() { 87 | var s = document.querySelector('script[data-goatcounter]') 88 | if (s && s.dataset.goatcounter) 89 | return s.dataset.goatcounter 90 | return (goatcounter.endpoint || window.counter) // counter is for compat; don't use. 91 | } 92 | 93 | // Get current path. 94 | var get_path = function() { 95 | var loc = location, 96 | c = document.querySelector('link[rel="canonical"][href]') 97 | if (c) { // May be relative or point to different domain. 98 | var a = document.createElement('a') 99 | a.href = c.href 100 | if (a.hostname.replace(/^www\./, '') === location.hostname.replace(/^www\./, '')) 101 | loc = a 102 | } 103 | return (loc.pathname + loc.search) || '/' 104 | } 105 | 106 | // Run function after DOM is loaded. 107 | var on_load = function(f) { 108 | if (document.body === null) 109 | document.addEventListener('DOMContentLoaded', function() { f() }, false) 110 | else 111 | f() 112 | } 113 | 114 | // Filter some requests that we (probably) don't want to count. 115 | goatcounter.filter = function() { 116 | if ('visibilityState' in document && document.visibilityState === 'prerender') 117 | return 'visibilityState' 118 | if (!goatcounter.allow_frame && location !== parent.location) 119 | return 'frame' 120 | if (!goatcounter.allow_local && location.hostname.match(/(localhost$|^127\.|^10\.|^172\.(1[6-9]|2[0-9]|3[0-1])\.|^192\.168\.|^0\.0\.0\.0$)/)) 121 | return 'localhost' 122 | if (!goatcounter.allow_local && location.protocol === 'file:') 123 | return 'localfile' 124 | if (localStorage && localStorage.getItem('skipgc') === 't') 125 | return 'disabled with #toggle-goatcounter' 126 | return false 127 | } 128 | 129 | // Get URL to send to GoatCounter. 130 | window.goatcounter.url = function(vars) { 131 | var data = get_data(vars || {}) 132 | if (data.p === null) // null from user callback. 133 | return 134 | data.rnd = Math.random().toString(36).substr(2, 5) // Browsers don't always listen to Cache-Control. 135 | 136 | var endpoint = get_endpoint() 137 | if (!endpoint) 138 | return warn('no endpoint found') 139 | 140 | return endpoint + urlencode(data) 141 | } 142 | 143 | // Count a hit. 144 | window.goatcounter.count = function(vars) { 145 | var f = goatcounter.filter() 146 | if (f) 147 | return warn('not counting because of: ' + f) 148 | 149 | var url = goatcounter.url(vars) 150 | if (!url) 151 | return warn('not counting because path callback returned null') 152 | 153 | var img = document.createElement('img') 154 | img.src = url 155 | img.style.position = 'absolute' // Affect layout less. 156 | img.style.bottom = '0px' 157 | img.style.width = '1px' 158 | img.style.height = '1px' 159 | img.loading = 'eager' 160 | img.setAttribute('alt', '') 161 | img.setAttribute('aria-hidden', 'true') 162 | 163 | var rm = function() { if (img && img.parentNode) img.parentNode.removeChild(img) } 164 | img.addEventListener('load', rm, false) 165 | document.body.appendChild(img) 166 | } 167 | 168 | // Get a query parameter. 169 | window.goatcounter.get_query = function(name) { 170 | var s = location.search.substr(1).split('&') 171 | for (var i = 0; i < s.length; i++) 172 | if (s[i].toLowerCase().indexOf(name.toLowerCase() + '=') === 0) 173 | return s[i].substr(name.length + 1) 174 | } 175 | 176 | // Track click events. 177 | window.goatcounter.bind_events = function() { 178 | if (!document.querySelectorAll) // Just in case someone uses an ancient browser. 179 | return 180 | 181 | var send = function(elem) { 182 | return function() { 183 | goatcounter.count({ 184 | event: true, 185 | path: (elem.dataset.goatcounterClick || elem.name || elem.id || ''), 186 | title: (elem.dataset.goatcounterTitle || elem.title || (elem.innerHTML || '').substr(0, 200) || ''), 187 | referrer: (elem.dataset.goatcounterReferrer || elem.dataset.goatcounterReferral || ''), 188 | }) 189 | } 190 | } 191 | 192 | Array.prototype.slice.call(document.querySelectorAll("*[data-goatcounter-click]")).forEach(function(elem) { 193 | if (elem.dataset.goatcounterBound) 194 | return 195 | var f = send(elem) 196 | elem.addEventListener('click', f, false) 197 | elem.addEventListener('auxclick', f, false) // Middle click. 198 | elem.dataset.goatcounterBound = 'true' 199 | }) 200 | } 201 | 202 | // Add a "visitor counter" frame or image. 203 | window.goatcounter.visit_count = function(opt) { 204 | on_load(function() { 205 | opt = opt || {} 206 | opt.type = opt.type || 'html' 207 | opt.append = opt.append || 'body' 208 | opt.path = opt.path || get_path() 209 | opt.attr = opt.attr || {width: '200', height: (opt.no_branding ? '60' : '80')} 210 | 211 | opt.attr['src'] = get_endpoint() + 'er/' + enc(opt.path) + '.' + enc(opt.type) + '?' 212 | if (opt.no_branding) opt.attr['src'] += '&no_branding=1' 213 | if (opt.style) opt.attr['src'] += '&style=' + enc(opt.style) 214 | if (opt.start) opt.attr['src'] += '&start=' + enc(opt.start) 215 | if (opt.end) opt.attr['src'] += '&end=' + enc(opt.end) 216 | 217 | var tag = {png: 'img', svg: 'img', html: 'iframe'}[opt.type] 218 | if (!tag) 219 | return warn('visit_count: unknown type: ' + opt.type) 220 | 221 | if (opt.type === 'html') { 222 | opt.attr['frameborder'] = '0' 223 | opt.attr['scrolling'] = 'no' 224 | } 225 | 226 | var d = document.createElement(tag) 227 | for (var k in opt.attr) 228 | d.setAttribute(k, opt.attr[k]) 229 | 230 | var p = document.querySelector(opt.append) 231 | if (!p) 232 | return warn('visit_count: append not found: ' + opt.append) 233 | p.appendChild(d) 234 | }) 235 | } 236 | 237 | // Make it easy to skip your own views. 238 | if (location.hash === '#toggle-goatcounter') { 239 | if (localStorage.getItem('skipgc') === 't') { 240 | localStorage.removeItem('skipgc', 't') 241 | alert('GoatCounter tracking is now ENABLED in this browser.') 242 | } 243 | else { 244 | localStorage.setItem('skipgc', 't') 245 | alert('GoatCounter tracking is now DISABLED in this browser until ' + location + ' is loaded again.') 246 | } 247 | } 248 | 249 | if (!goatcounter.no_onload) 250 | on_load(function() { 251 | // 1. Page is visible, count request. 252 | // 2. Page is not yet visible; wait until it switches to 'visible' and count. 253 | // See #487 254 | if (!('visibilityState' in document) || document.visibilityState === 'visible') 255 | goatcounter.count() 256 | else { 257 | var f = function(e) { 258 | if (document.visibilityState !== 'visible') 259 | return 260 | document.removeEventListener('visibilitychange', f) 261 | goatcounter.count() 262 | } 263 | document.addEventListener('visibilitychange', f) 264 | } 265 | 266 | if (!goatcounter.no_events) 267 | goatcounter.bind_events() 268 | }) 269 | })(); 270 | 271 | -------------------------------------------------------------------------------- /themes/apollo/static/js/imamu.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";!function(t){var e=t.screen,n=e.width,r=e.height,a=t.navigator.language,i=t.location,o=t.localStorage,u=t.document,c=t.history,f=i.hostname,s=i.pathname,l=i.search,d=u.currentScript;if(d){var m="data-",h=d.getAttribute.bind(d),v=h(m+"website-id"),p=h(m+"host-url"),g="false"!==h(m+"auto-track"),y=h(m+"do-not-track"),b=h(m+"domains")||"",S=b.split(",").map((function(t){return t.trim()})),k=(p?p.replace(/\/$/,""):d.src.split("/").slice(0,-1).join("/"))+"/api/send",w=n+"x"+r,N=/data-umami-event-([\w-_]+)/,T=m+"umami-event",j=300,A=function(t,e,n){var r=t[e];return function(){for(var e=[],a=arguments.length;a--;)e[a]=arguments[a];return n.apply(null,e),r.apply(t,e)}},x=function(){return{website:v,hostname:f,screen:w,language:a,title:M,url:I,referrer:J}},E=function(){return o&&o.getItem("umami.disabled")||y&&function(){var e=t.doNotTrack,n=t.navigator,r=t.external,a="msTrackingProtectionEnabled",i=e||n.doNotTrack||n.msDoNotTrack||r&&a in r&&r[a]();return"1"==i||"yes"===i}()||b&&!S.includes(f)},O=function(t,e,n){n&&(J=I,(I=function(t){try{return new URL(t).pathname}catch(e){return t}}(n.toString()))!==J&&setTimeout(D,j))},L=function(t,e){if(void 0===e&&(e="event"),!E()){var n={"Content-Type":"application/json"};return void 0!==K&&(n["x-umami-cache"]=K),fetch(k,{method:"POST",body:JSON.stringify({type:e,payload:t}),headers:n}).then((function(t){return t.text()})).then((function(t){return K=t})).catch((function(){}))}},D=function(t,e){return L("string"==typeof t?Object.assign({},x(),{name:t,data:"object"==typeof e?e:void 0}):"object"==typeof t?t:"function"==typeof t?t(x()):x())};t.umami||(t.umami={track:D,identify:function(t){return L(Object.assign({},x(),{data:t}),"identify")}});var K,P,_,q,C,I=""+s+l,J=u.referrer,M=u.title;if(g&&!E()){c.pushState=A(c,"pushState",O),c.replaceState=A(c,"replaceState",O),C=function(t){var e=t.getAttribute.bind(t),n=e(T);if(n){var r={};return t.getAttributeNames().forEach((function(t){var n=t.match(N);n&&(r[n[1]]=e(t))})),D(n,r)}return Promise.resolve()},u.addEventListener("click",(function(t){var e=t.target,n="A"===e.tagName?e:function(t,e){for(var n=t,r=0;r title"))&&_.observe(q,{subtree:!0,characterData:!0,childList:!0});var R=function(){"complete"!==u.readyState||P||(D(),P=!0)};u.addEventListener("readystatechange",R,!0),R()}}}(window)}(); -------------------------------------------------------------------------------- /themes/apollo/static/js/main.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dark-flames/apollo-typst/4c1b14fbac340f190f5a2c0d5be608a9c5cbb96d/themes/apollo/static/js/main.js -------------------------------------------------------------------------------- /themes/apollo/static/js/note.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', function() { 2 | document.querySelectorAll('.note-toggle').forEach(function(toggleButton) { 3 | var content = toggleButton.nextElementSibling; 4 | var isHidden = content.style.display === 'none'; 5 | toggleButton.setAttribute('aria-expanded', !isHidden); 6 | 7 | toggleButton.addEventListener('click', function() { 8 | var expanded = this.getAttribute('aria-expanded') === 'true'; 9 | this.setAttribute('aria-expanded', !expanded); 10 | content.style.display = expanded ? 'none' : 'block'; 11 | }); 12 | }); 13 | }); 14 | 15 | -------------------------------------------------------------------------------- /themes/apollo/static/js/themetoggle.js: -------------------------------------------------------------------------------- 1 | function setTheme(mode) { 2 | localStorage.setItem("theme-storage", mode); 3 | } 4 | 5 | // Functions needed for the theme toggle 6 | // 7 | 8 | function toggleTheme() { 9 | if (localStorage.getItem("theme-storage") === "light") { 10 | setTheme("dark"); 11 | updateItemToggleTheme(); 12 | } else if (localStorage.getItem("theme-storage") === "dark") { 13 | setTheme("light"); 14 | updateItemToggleTheme(); 15 | } 16 | } 17 | 18 | function updateItemToggleTheme() { 19 | let mode = getSavedTheme(); 20 | 21 | const darkModeStyle = document.getElementById("darkModeStyle"); 22 | if (darkModeStyle) { 23 | darkModeStyle.disabled = (mode === "light"); 24 | } 25 | 26 | const sunIcon = document.getElementById("sun-icon"); 27 | const moonIcon = document.getElementById("moon-icon"); 28 | if (sunIcon && moonIcon) { 29 | sunIcon.style.display = (mode === "dark") ? "inline-block" : "none"; 30 | moonIcon.style.display = (mode === "light") ? "inline-block" : "none"; 31 | } 32 | 33 | let htmlElement = document.querySelector("html"); 34 | if (mode === "dark") { 35 | htmlElement.classList.remove("light") 36 | htmlElement.classList.add("dark") 37 | } else if (mode === "light") { 38 | htmlElement.classList.remove("dark") 39 | htmlElement.classList.add("light") 40 | } 41 | } 42 | 43 | function getSavedTheme() { 44 | let currentTheme = localStorage.getItem("theme-storage"); 45 | if(!currentTheme) { 46 | if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { 47 | currentTheme = "dark"; 48 | } else { 49 | currentTheme = "light"; 50 | } 51 | } 52 | 53 | return currentTheme; 54 | } 55 | 56 | // Update the toggle theme on page load 57 | updateItemToggleTheme(); 58 | -------------------------------------------------------------------------------- /themes/apollo/static/js/toc.js: -------------------------------------------------------------------------------- 1 | document.addEventListener('DOMContentLoaded', () => { 2 | const tocTitle = document.querySelector('.toc-title'); 3 | const tocList = document.querySelector('.toc-list'); 4 | 5 | if (tocTitle && tocList) { 6 | const toggleToC = () => { 7 | const isExpanded = tocList.style.display === 'block' || window.getComputedStyle(tocList).display === 'block'; 8 | tocList.style.display = isExpanded ? 'none' : 'block'; 9 | tocTitle.classList.toggle('expanded', !isExpanded); 10 | }; 11 | 12 | tocTitle.addEventListener('click', toggleToC); 13 | } 14 | }); 15 | 16 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/LICENSE: -------------------------------------------------------------------------------- 1 | All icons in this directory are downloaded from [FontAwesome](https://fontawesome.com/). They are part of the [free offer](https://fontawesome.com/license/free) and are licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/apple.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/bitcoin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/deviantart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/diaspora.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/discord.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/discourse.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/email.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/ethereum.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/etsy.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/facebook.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/github.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/gitlab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/google.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/hacker-news.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/instagram.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/linkedin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/mastodon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/matrix.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/paypal.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/pinterest.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/quora.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/reddit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/rss.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/skype.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/slack.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/snapchat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/soundcloud.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/spotify.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/stack-exchange.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/stack-overflow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/steam.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/telegram.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/twitter.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/vimeo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/whatsapp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/x-twitter.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/static/social_icons/youtube.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/apollo/templates/404.html: -------------------------------------------------------------------------------- 1 | {% extends "page.html" %} 2 | 3 | {% block main_content %} 4 |
5 | {{ post_macros::page_header(title="404")}} 6 | Page not found :( 7 |
8 | {% endblock main_content %} -------------------------------------------------------------------------------- /themes/apollo/templates/base.html: -------------------------------------------------------------------------------- 1 | {% import "macros/macros.html" as post_macros %} 2 | 3 | 4 | 5 | 6 | 7 | {% include "partials/header.html" %} 8 | 9 | 10 |
11 | {% include "partials/nav.html" %} 12 | 13 | {# Post page is the default #} 14 | {% block main_content %} 15 | Nothing here?! 16 | {% endblock main_content %} 17 | 18 | {% if config.extra.comment | default(value=false) %} 19 |
20 | {% include "_giscus_script.html" %} 21 | {% endif %} 22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /themes/apollo/templates/cards.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block main_content %} 4 | {% if section.extra.section_path -%} 5 | {% set section = get_section(path=section.extra.section_path) %} 6 | {% endif -%} 7 | 8 | {{ post_macros::page_header(title=section.title) }} 9 | 10 |
11 | {%- if paginator %} 12 | {%- set show_pages = paginator.pages -%} 13 | {% else %} 14 | {%- set show_pages = section.pages -%} 15 | {% endif -%} 16 | 17 | {{ post_macros::cards_posts(pages=show_pages) }} 18 |
19 | 20 | {% if paginator %} 21 |
    22 | {% if paginator.previous %} 23 | 24 | 25 | 26 | {% endif %} 27 | 28 | {% if paginator.next %} 29 | 30 | 31 | 32 | {% endif %} 33 |
34 | {% endif %} 35 | {% endblock main_content %} -------------------------------------------------------------------------------- /themes/apollo/templates/homepage.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block main_content %} 4 | {{ post_macros::home_page(section=section) }} 5 | {% endblock main_content %} 6 | -------------------------------------------------------------------------------- /themes/apollo/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "section.html" %} 2 | -------------------------------------------------------------------------------- /themes/apollo/templates/macros/macros.html: -------------------------------------------------------------------------------- 1 | {% macro list_tag_posts(pages, tag_name=false) %} 2 | {% if tag_name %} 3 | 6 | {% else %} 7 | 10 | {% endif %} 11 | 12 |
13 | {{ post_macros::list_posts(pages=pages) }} 14 |
15 | {% endmacro %} 16 | 17 | {% macro list_posts(pages) %} 18 |
    19 | {%- for page in pages %} 20 |
  • 21 |
    22 |
    23 | 24 | 25 |
    26 |

    27 | {{page.title}} 28 | 29 | {% if page.draft %} 30 | DRAFT 31 | {% endif %} 32 |

    33 | 34 |
    35 |
    36 | {% if page.description %} 37 | {{ page.description }} 38 | {% elif page.summary %} 39 | {{ page.summary | safe }}… 40 | {% else %} 41 | {% set hide_read_more = true %} 42 | {% endif %} 43 |
    44 | 45 | {% if not hide_read_more %} 46 | Read more ⟶ 47 | {% endif %} 48 |
    49 |
    50 |
    51 |
    52 |
  • 53 | {% endfor -%} 54 |
55 | {% endmacro list_posts %} 56 | 57 | {% macro list_terms(terms) %} 58 |
    59 | {%- for term in terms %} 60 |
    61 |

    62 | {{term.name}} 63 |

    64 |
    65 | 66 | {% endfor -%} 67 |
68 | {% endmacro list_terms %} 69 | 70 | {% macro tags(page, short=false) %} 71 | {%- if page.taxonomies and page.taxonomies.tags %} 72 | 85 | {% endif -%} 86 | {% endmacro tags %} 87 | 88 | {% macro page_header(title) %} 89 | 92 | {% endmacro content %} 93 | 94 | {% macro home_page(section) %} 95 |
96 |
97 |
98 | {{post_macros::page_header(title=section.title)}} 99 | {{ section.content | safe }} 100 |
101 |
102 |
103 | {% endmacro home_page %} 104 | 105 | {% macro content(page) %} 106 |
107 |
108 |
109 | {#

{{ page.title }}

#} 110 | {{ post_macros::page_header(title=page.title) }} 111 | 112 |
113 | {% if page.date %} 114 | Posted on 115 | {% endif %} 116 | 117 | {% if page.updated %} 118 | :: Updated on 119 | {% endif %} 120 | 121 | {% if page.extra.read_time %} 122 | :: Min Read 123 | {% endif %} 124 | 125 | {# Inline display of tags directly after the date #} 126 | {% if page.taxonomies and page.taxonomies.tags %} 127 | :: Tags: 128 | 129 | {%- for tag in page.taxonomies.tags %} 130 | {% if not loop.last %}, {% endif %} 131 | {% endfor %} 132 | 133 | {% endif %} 134 | 135 | {# View the page on GitHub #} 136 | {% if page.extra.repo_view | default(value=false) %} 137 | {# Use the page's repo_url if defined, otherwise use the global edit_repo_url #} 138 | {% if page.extra.repo_url is defined %} 139 | {% set repo_url = page.extra.repo_url %} 140 | {% elif config.extra.repo_url is defined %} 141 | {% set repo_url = config.extra.repo_url %} 142 | {% else %} 143 | {% set repo_url = false %} 144 | {% endif %} 145 | 146 | {% if repo_url %} 147 | {% set final_url = repo_url ~ page.relative_path %} 148 | :: Source Code 149 | {% endif %} 150 | {% endif %} 151 | 152 | {% if page.draft %} 153 | DRAFT 154 | {% endif %} 155 | 156 |
157 |
158 | 159 | {% if page.extra.tldr %} 160 |
161 | tl;dr: 162 | {{ page.extra.tldr }} 163 |
164 | {% endif %} 165 | 166 | {# Optional table of contents #} 167 | {% if config.extra.toc | default(value=false) %} 168 | {% if page.toc %} 169 |
170 |

Table of Contents

171 |
    172 | {% for h1 in page.toc %} 173 |
  • 174 | {{ h1.title }} 175 | {% if h1.children %} 176 |
      177 | {% for h2 in h1.children %} 178 |
    • 179 | {{ h2.title }} 180 |
    • 181 | 182 | {% if h2.children %} 183 |
        184 | {% for h3 in h2.children %} 185 |
      • 186 | {{ h3.title }} 187 |
      • 188 | {% endfor %} 189 |
      190 | {% endif %} 191 | {% endfor %} 192 |
    193 | {% endif %} 194 |
  • 195 | {% endfor %} 196 |
197 |
198 | {% endif %} 199 | {% endif %} 200 | 201 |
202 | {{ page.content | safe }} 203 |
204 |
205 |
206 | {% endmacro content %} 207 | 208 | {% macro cards_posts(pages) %} 209 |
210 | {%- for page in pages %} 211 |
212 | {% if page.extra.local_image %} 213 | {{ 214 | {% elif page.extra.remote_image %} 215 | {{ 216 | {% else %} 217 |
218 | {% endif %} 219 | 220 |
221 |

222 | {% if page.extra.link_to %} 223 | {{page.title}} 224 | {% else %} 225 | {{page.title}} 226 | {% endif %} 227 |

228 | 229 |
230 | {%- if page.date %} 231 | 232 | {% endif -%} 233 | {% if page.draft %} 234 | DRAFT 235 | {% endif %} 236 |
237 | 238 |
239 | {% if page.description %} 240 | {{ page.description }} 241 | {% endif %} 242 |
243 |
244 |
245 | 246 | {% endfor -%} 247 |
248 | {% endmacro cards_posts %} 249 | -------------------------------------------------------------------------------- /themes/apollo/templates/page.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block main_content %} 4 | {{ post_macros::content(page=page)}} 5 | {% endblock main_content %} -------------------------------------------------------------------------------- /themes/apollo/templates/partials/header.html: -------------------------------------------------------------------------------- 1 | {% import "macros/macros.html" as post_macros %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | {% if page.extra.meta %} 9 | 10 | {% for data in page.extra.meta %} 11 | 25 | {% endfor %} 26 | {% endif %} 27 | 28 | {# Site title #} 29 | {% set current_path = current_path | default(value="/") %} 30 | {% if current_path == "/" %} 31 | 32 | {{ config.title | default(value="Home") }} 33 | 34 | {% if not page_has_og_title %} 35 | 36 | {% endif %} 37 | 38 | {% else %} 39 | 40 | {% if page.title %} {{ page.title }} 41 | {% elif section.title %} {{ section.title }} 42 | {% elif config.title %} {{ config.title }} 43 | {% else %} Post {% endif %} 44 | 45 | 46 | {% if not page_has_og_title %} 47 | 48 | {% endif %} 49 | {% endif %} 50 | 51 | {% if not page_has_og_description %} 52 | {% if page.description %} 53 | 54 | {% elif config.description %} 55 | 56 | {% endif %} 57 | {% endif %} 58 | 59 | {% if not page_has_description %} 60 | {% if page.description %} 61 | 62 | {% elif config.description %} 63 | 64 | {% endif %} 65 | {% endif %} 66 | 67 | {# Favicon #} 68 | {% if config.extra.favicon %} 69 | 70 | {% endif %} 71 | 72 | {# Font from cdn or disk #} 73 | {% if config.extra.use_cdn | default(value=false) %} 74 | 75 | 76 | {% else %} 77 | 78 | {% endif %} 79 | 80 | {# Analytics #} 81 | {% if config.extra.analytics.enabled %} 82 | {% if config.extra.analytics.umami.website_id %} 83 | {% set website_id = config.extra.analytics.umami.website_id %} 84 | {% set host_url = config.extra.analytics.umami.host_url | default(value="https://analytics.eu.umami.is") %} 85 | 86 | 95 | 96 | {% endif %} 97 | 98 | {% if config.extra.analytics.goatcounter.user %} 99 | {% set user = config.extra.analytics.goatcounter.user %} 100 | {% set host = config.extra.analytics.goatcounter.host | default(value="goatcounter.com") %} 101 | 102 | 103 | 107 | {% endif %} 108 | {% endif %} 109 | 110 | {# Fancy Codeblock #} 111 | {% if config.extra.fancy_code %} 112 | 113 | {% endif %} 114 | 115 | {# Table of contents #} 116 | {% if config.extra.toc | default(value=false) %} 117 | 118 | {% endif %} 119 | 120 | {# Dynamic Note #} 121 | {% if config.extra.dynamic_note | default(value=false) %} 122 | 123 | {% endif %} 124 | 125 | {% if config.extra.mathjax | default(value=false) %} 126 | {% if config.extra.mathjax_dollar_inline_enable | default(value=false) %} 127 | 134 | {% endif %} 135 | 138 | {% endif %} 139 | 140 | {# RSS #} 141 | 142 | 143 | 144 | {% set theme = config.extra.theme | default(value="toggle") %} 145 | {% if theme == "dark" %} 146 | 147 | {% elif theme == "light" %} 148 | 149 | {% elif theme == "auto" %} 150 | 151 | 152 | {% elif theme == "toggle" %} 153 | 154 | 155 | {% endif %} 156 | 157 | 158 | 159 | {% if theme == "dark" %} 160 | 161 | {% elif theme == "light" %} 162 | 163 | {% elif theme == "auto" %} 164 | 171 | {% else %} 172 | 173 | {% endif %} 174 | 175 | 176 | 177 | {% if config.extra.stylesheets %} 178 | {% for stylesheet in config.extra.stylesheets %} 179 | 180 | {% endfor %} 181 | {% endif %} 182 | 183 | -------------------------------------------------------------------------------- /themes/apollo/templates/partials/nav.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ config.title }} 4 | 5 |
6 | {% for social in config.extra.socials | default(value=[]) %} 7 | 10 | {% endfor %} 11 |
12 |
13 | 14 | 29 |
30 | -------------------------------------------------------------------------------- /themes/apollo/templates/section.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block main_content %} 4 | {% if section.extra.section_path -%} 5 | {% set section = get_section(path=section.extra.section_path) %} 6 | {% endif -%} 7 | 8 | {% block title %} 9 | {{ post_macros::page_header(title=section.title) }} 10 | {% endblock title %} 11 | 12 | {% block post_list %} 13 |
14 | {%- if paginator %} 15 | {%- set show_pages = paginator.pages -%} 16 | {% else %} 17 | {%- set show_pages = section.pages -%} 18 | {% endif -%} 19 | 20 | {{ post_macros::list_posts(pages=show_pages) }} 21 |
22 | {% endblock post_list %} 23 | 24 | {% if paginator %} 25 |
    26 | {% if paginator.previous %} 27 | 28 | 29 | 30 | {% endif %} 31 | 32 | {% if paginator.next %} 33 | 34 | 35 | 36 | {% endif %} 37 |
38 | {% endif %} 39 | {% endblock main_content %} -------------------------------------------------------------------------------- /themes/apollo/templates/shortcodes/note.html: -------------------------------------------------------------------------------- 1 |
2 | {% if clickable | default(value=false) %} 3 | 14 | 15 | {% if hidden | default(value=false) %} 16 | 39 | -------------------------------------------------------------------------------- /themes/apollo/templates/taxonomy_list.html: -------------------------------------------------------------------------------- 1 | {%extends "base.html"%} 2 | 3 | {% block main_content %} 4 |
5 | {% block title %} 6 | {{ post_macros::page_header(title="Tags") }} 7 | {% endblock title %} 8 | 9 |
10 | 19 |
20 |
21 | {% endblock main_content %} -------------------------------------------------------------------------------- /themes/apollo/templates/taxonomy_single.html: -------------------------------------------------------------------------------- 1 | {% extends "index.html" %} 2 | 3 | {% block main_content %} 4 | 5 | {{ post_macros::list_tag_posts(pages=term.pages, tag_name=term.name) }} 6 | 7 | {% endblock main_content %} 8 | -------------------------------------------------------------------------------- /themes/apollo/theme.toml: -------------------------------------------------------------------------------- 1 | name = "apollo" 2 | description = "Modern and minimalistic blog theme" 3 | min_version = "0.14.0" 4 | license = "MIT" 5 | homepage = "https://github.com/not-matthias/apollo" 6 | demo = "https://not-matthias.github.io/apollo" 7 | 8 | # Any variable there can be overridden in the end user `config.toml` 9 | # You don't need to prefix variables by the theme name but as this will 10 | # be merged with user data, some kind of prefix or nesting is preferable 11 | # Use snake_casing to be consistent with the rest of Zola 12 | [extra] 13 | 14 | [author] 15 | name = "not-matthias" 16 | homepage = "https://github.com/not-matthias" 17 | -------------------------------------------------------------------------------- /typ/intro/build-config.toml: -------------------------------------------------------------------------------- 1 | [entries.short] 2 | entry = "short.typ" 3 | 4 | [entries.full] 5 | entry = "full.typ" -------------------------------------------------------------------------------- /typ/intro/full.typ: -------------------------------------------------------------------------------- 1 | #import "@preview/shiroa:0.1.0": * 2 | #import "@preview/typst-apollo:0.1.0": pages 3 | #import pages: * 4 | #import "@preview/shiroa:0.1.0": get-page-width, target, is-web-target, is-pdf-target, plain-text 5 | 6 | #import "@preview/unequivocal-ams:0.1.0": theorem, proof 7 | 8 | #show: project.with( 9 | title: [], 10 | authors: ( 11 | ( 12 | name: "Darkflames", 13 | email: "darkf1ames@pm.me", 14 | ), 15 | ( 16 | name: "Darkflames", 17 | email: "darkf1ames@pm.me", 18 | ), 19 | ), 20 | ) 21 | 22 | #set par(justify: true) 23 | #set heading(numbering: "1.") 24 | 25 | #align(center, text(17pt)[ 26 | Test - Version: Full 27 | ]) 28 | 29 | = Beginning 30 | Call me Ishmael. Some years ago --- never mind how long precisely --- 31 | having little or no money in my purse, and nothing particular to 32 | interest me on shore, I thought I would sail about a little and see 33 | the watery part of the world. It is a way I have of driving off the 34 | spleen, and regulating the circulation. Whenever I find myself 35 | growing grim about the mouth; whenever it is a damp, drizzly November 36 | in my soul; whenever I find myself involuntarily pausing before coffin 37 | warehouses, and bringing up the rear of every funeral I meet; and 38 | especially whenever my hypos get such an upper hand of me, that it 39 | requires a strong moral principle to prevent me from deliberately 40 | stepping into the street, and methodically knocking people's hats off 41 | --- then, I account it high time to get to sea as soon as I can. This 42 | is my substitute for pistol and ball. With a philosophical flourish 43 | Cato throws himself upon his sword; I quietly take to the ship. There 44 | is nothing surprising in this. If they but knew it, almost all men in 45 | their degree, some time or other, cherish very nearly the same 46 | feelings towards the ocean with me. 47 | 48 | #cross-link("/posts/markdown/")[cross reference to the markdown] 49 | 50 | There now is your insular city of the Manhattoes, belted round by 51 | wharves as Indian isles by coral reefs - commerce surrounds it with 52 | her surf. Right and left, the streets take you waterward. Its extreme 53 | down-town is the battery, where that noble mole is washed by waves, 54 | and cooled by breezes, which a few hours previous were out of sight of 55 | land. Look at the crowds of water-gazers there. 56 | 57 | Call me Ishmael. Some years ago --- never mind how long precisely --- 58 | having little or no money in my purse, and nothing particular to 59 | interest me on shore, I thought I would sail about a little and see 60 | the watery part of the world. It is a way I have of driving off the 61 | spleen, and regulating the circulation. Whenever I find myself 62 | growing grim about the mouth; whenever it is a damp, drizzly November 63 | in my soul; whenever I find myself involuntarily pausing before coffin 64 | warehouses, and bringing up the rear of every funeral I meet; and 65 | especially whenever my hypos get such an upper hand of me, that it 66 | requires a strong moral principle to prevent me from deliberately 67 | stepping into the street, and methodically knocking people's hats off 68 | --- then, I account it high time to get to sea as soon as I can. This 69 | is my substitute for pistol and ball. With a philosophical flourish 70 | Cato throws himself upon his sword; I quietly take to the ship. There 71 | is nothing surprising in this. If they but knew it, almost all men in 72 | their degree, some time or other, cherish very nearly the same 73 | feelings towards the ocean with me. 74 | 75 | There now is your insular city of the Manhattoes, belted round by 76 | wharves as Indian isles by coral reefs - commerce surrounds it with 77 | her surf. Right and left, the streets take you waterward. Its extreme 78 | down-town is the battery, where that noble mole is washed by waves, 79 | and cooled by breezes, which a few hours previous were out of sight of 80 | land. Look at the crowds of water-gazers there. 81 | Anyone caught using formulas such as $sqrt(x+y)=sqrt(x)+sqrt(y)$ 82 | or $1/(x+y) = 1/x + 1/y$ will fail. 83 | 84 | The binomial theorem is 85 | $ (x+y)^n=sum_(k=0)^n binom(n, k) x^k y^(n-k). $ 86 | 87 | A favorite sum of most mathematicians is 88 | $ sum_(n=1)^oo 1 / n^2 = pi^2 / 6. $ 89 | 90 | Likewise a popular integral is 91 | $ integral_(-oo)^oo e^(-x^2) dif x = sqrt(pi) $ 92 | 93 | #theorem[ 94 | The square of any real number is non-negative. 95 | ] 96 | 97 | #proof[ 98 | Any real number $x$ satisfies $x > 0$, $x = 0$, or $x < 0$. If $x = 0$, 99 | then $x^2 = 0 >= 0$. If $x > 0$ then as a positive time a positive is 100 | positive we have $x^2 = x x > 0$. If $x < 0$ then $−x > 0$ and so by 101 | what we have just done $x^2 = (−x)^2 > 0$. So in all cases $x^2 ≥ 0$. 102 | ] 103 | 104 | = Introduction 105 | This is a new section. @beg 106 | You can use tables like @solids. 107 | 108 | 109 | #figure( 110 | table( 111 | columns: (1fr, auto, auto), 112 | inset: 5pt, 113 | align: horizon, 114 | [], [*Area*], [*Parameters*], 115 | [*Cylinder*], 116 | $ pi h (D^2 - d^2) / 4 $, 117 | [$h$: height \ 118 | $D$: outer radius \ 119 | $d$: inner radius], 120 | 121 | [*Tetrahedron*], $ sqrt(2) / 12 a^3 $, [$a$: edge length], 122 | ), 123 | caption: "Solids", 124 | ) 125 | 126 | == Things that need to be done 127 | Prove theorems. 128 | 129 | = Background 130 | #lorem(40) 131 | -------------------------------------------------------------------------------- /typ/intro/short.typ: -------------------------------------------------------------------------------- 1 | #import "@preview/shiroa:0.1.0": * 2 | #import "@preview/typst-apollo:0.1.0": pages 3 | #import pages: * 4 | #import "@preview/shiroa:0.1.0": get-page-width, target, is-web-target, is-pdf-target, plain-text 5 | 6 | #import "@preview/unequivocal-ams:0.1.0": theorem, proof 7 | 8 | #show: project.with( 9 | title: [], 10 | authors: ( 11 | ( 12 | name: "Darkflames", 13 | email: "darkf1ames@pm.me", 14 | ), 15 | ( 16 | name: "Darkflames", 17 | email: "darkf1ames@pm.me", 18 | ), 19 | ), 20 | ) 21 | 22 | #set par(justify: true) 23 | #set heading(numbering: "1.") 24 | 25 | #align(center, text(17pt)[ 26 | Test - Version: Short 27 | ]) 28 | 29 | = Beginning 30 | Call me Ishmael. Some years ago --- never mind how long precisely --- 31 | having little or no money in my purse, and nothing particular to 32 | interest me on shore, I thought I would sail about a little and see 33 | the watery part of the world. It is a way I have of driving off the 34 | spleen, and regulating the circulation. Whenever I find myself 35 | growing grim about the mouth; whenever it is a damp, drizzly November 36 | in my soul; whenever I find myself involuntarily pausing before coffin 37 | warehouses, and bringing up the rear of every funeral I meet; and 38 | especially whenever my hypos get such an upper hand of me, that it 39 | requires a strong moral principle to prevent me from deliberately 40 | stepping into the street, and methodically knocking people's hats off 41 | --- then, I account it high time to get to sea as soon as I can. This 42 | is my substitute for pistol and ball. With a philosophical flourish 43 | Cato throws himself upon his sword; I quietly take to the ship. There 44 | is nothing surprising in this. If they but knew it, almost all men in 45 | their degree, some time or other, cherish very nearly the same 46 | feelings towards the ocean with me. 47 | 48 | #cross-link("/posts/markdown/")[cross reference to the markdown] 49 | 50 | There now is your insular city of the Manhattoes, belted round by 51 | wharves as Indian isles by coral reefs - commerce surrounds it with 52 | her surf. Right and left, the streets take you waterward. Its extreme 53 | down-town is the battery, where that noble mole is washed by waves, 54 | and cooled by breezes, which a few hours previous were out of sight of 55 | land. Look at the crowds of water-gazers there. 56 | 57 | Call me Ishmael. Some years ago --- never mind how long precisely --- 58 | having little or no money in my purse, and nothing particular to 59 | interest me on shore, I thought I would sail about a little and see 60 | the watery part of the world. It is a way I have of driving off the 61 | spleen, and regulating the circulation. Whenever I find myself 62 | growing grim about the mouth; whenever it is a damp, drizzly November 63 | in my soul; whenever I find myself involuntarily pausing before coffin 64 | warehouses, and bringing up the rear of every funeral I meet; and 65 | especially whenever my hypos get such an upper hand of me, that it 66 | requires a strong moral principle to prevent me from deliberately 67 | stepping into the street, and methodically knocking people's hats off 68 | --- then, I account it high time to get to sea as soon as I can. This 69 | is my substitute for pistol and ball. With a philosophical flourish 70 | Cato throws himself upon his sword; I quietly take to the ship. There 71 | is nothing surprising in this. If they but knew it, almost all men in 72 | their degree, some time or other, cherish very nearly the same 73 | feelings towards the ocean with me. 74 | 75 | There now is your insular city of the Manhattoes, belted round by 76 | wharves as Indian isles by coral reefs - commerce surrounds it with 77 | her surf. Right and left, the streets take you waterward. Its extreme 78 | down-town is the battery, where that noble mole is washed by waves, 79 | and cooled by breezes, which a few hours previous were out of sight of 80 | land. Look at the crowds of water-gazers there. 81 | Anyone caught using formulas such as $sqrt(x+y)=sqrt(x)+sqrt(y)$ 82 | or $1/(x+y) = 1/x + 1/y$ will fail. 83 | 84 | The binomial theorem is 85 | $ (x+y)^n=sum_(k=0)^n binom(n, k) x^k y^(n-k). $ 86 | 87 | A favorite sum of most mathematicians is 88 | $ sum_(n=1)^oo 1 / n^2 = pi^2 / 6. $ 89 | 90 | Likewise a popular integral is 91 | $ integral_(-oo)^oo e^(-x^2) dif x = sqrt(pi) $ 92 | 93 | #theorem[ 94 | The square of any real number is non-negative. 95 | ] 96 | 97 | #proof[ 98 | Any real number $x$ satisfies $x > 0$, $x = 0$, or $x < 0$. If $x = 0$, 99 | then $x^2 = 0 >= 0$. If $x > 0$ then as a positive time a positive is 100 | positive we have $x^2 = x x > 0$. If $x < 0$ then $−x > 0$ and so by 101 | what we have just done $x^2 = (−x)^2 > 0$. So in all cases $x^2 ≥ 0$. 102 | ] 103 | 104 | = Introduction 105 | This is a new section. @beg 106 | You can use tables like @solids. 107 | 108 | 109 | #figure( 110 | table( 111 | columns: (1fr, auto, auto), 112 | inset: 5pt, 113 | align: horizon, 114 | [], [*Area*], [*Parameters*], 115 | [*Cylinder*], 116 | $ pi h (D^2 - d^2) / 4 $, 117 | [$h$: height \ 118 | $D$: outer radius \ 119 | $d$: inner radius], 120 | 121 | [*Tetrahedron*], $ sqrt(2) / 12 a^3 $, [$a$: edge length], 122 | ), 123 | caption: "Solids", 124 | ) 125 | 126 | == Things that need to be done 127 | Prove theorems. 128 | 129 | = Background 130 | #lorem(40) 131 | -------------------------------------------------------------------------------- /typ/posts/test/main.typ: -------------------------------------------------------------------------------- 1 | #import "@preview/shiroa:0.1.0": * 2 | #import "@preview/typst-apollo:0.1.0": pages 3 | #import pages: * 4 | #import "@preview/shiroa:0.1.0": get-page-width, target, is-web-target, is-pdf-target, plain-text 5 | 6 | #import "@preview/unequivocal-ams:0.1.0": theorem, proof 7 | 8 | #show: project.with( 9 | title: "Test", 10 | authors: ( 11 | ( 12 | name: "Darkflames", 13 | email: "darkf1ames@pm.me", 14 | ), 15 | ( 16 | name: "Darkflames", 17 | email: "darkf1ames@pm.me", 18 | ), 19 | ), 20 | ) 21 | 22 | #set par(justify: true) 23 | #set heading(numbering: "1.") 24 | 25 | = Beginning 26 | Call me Ishmael. Some years ago --- never mind how long precisely --- 27 | having little or no money in my purse, and nothing particular to 28 | interest me on shore, I thought I would sail about a little and see 29 | the watery part of the world. It is a way I have of driving off the 30 | spleen, and regulating the circulation. Whenever I find myself 31 | growing grim about the mouth; whenever it is a damp, drizzly November 32 | in my soul; whenever I find myself involuntarily pausing before coffin 33 | warehouses, and bringing up the rear of every funeral I meet; and 34 | especially whenever my hypos get such an upper hand of me, that it 35 | requires a strong moral principle to prevent me from deliberately 36 | stepping into the street, and methodically knocking people's hats off 37 | --- then, I account it high time to get to sea as soon as I can. This 38 | is my substitute for pistol and ball. With a philosophical flourish 39 | Cato throws himself upon his sword; I quietly take to the ship. There 40 | is nothing surprising in this. If they but knew it, almost all men in 41 | their degree, some time or other, cherish very nearly the same 42 | feelings towards the ocean with me. @netwok2020 43 | 44 | #cross-link("/posts/markdown/")[cross reference to the markdown] 45 | 46 | There now is your insular city of the Manhattoes, belted round by 47 | wharves as Indian isles by coral reefs - commerce surrounds it with 48 | her surf. Right and left, the streets take you waterward. Its extreme 49 | down-town is the battery, where that noble mole is washed by waves, 50 | and cooled by breezes, which a few hours previous were out of sight of 51 | land. Look at the crowds of water-gazers there. 52 | 53 | Call me Ishmael. Some years ago --- never mind how long precisely --- 54 | having little or no money in my purse, and nothing particular to 55 | interest me on shore, I thought I would sail about a little and see 56 | the watery part of the world. It is a way I have of driving off the 57 | spleen, and regulating the circulation. Whenever I find myself 58 | growing grim about the mouth; whenever it is a damp, drizzly November 59 | in my soul; whenever I find myself involuntarily pausing before coffin 60 | warehouses, and bringing up the rear of every funeral I meet; and 61 | especially whenever my hypos get such an upper hand of me, that it 62 | requires a strong moral principle to prevent me from deliberately 63 | stepping into the street, and methodically knocking people's hats off 64 | --- then, I account it high time to get to sea as soon as I can. This 65 | is my substitute for pistol and ball. With a philosophical flourish 66 | Cato throws himself upon his sword; I quietly take to the ship. There 67 | is nothing surprising in this. If they but knew it, almost all men in 68 | their degree, some time or other, cherish very nearly the same 69 | feelings towards the ocean with me. @netwok2020 70 | 71 | There now is your insular city of the Manhattoes, belted round by 72 | wharves as Indian isles by coral reefs - commerce surrounds it with 73 | her surf. Right and left, the streets take you waterward. Its extreme 74 | down-town is the battery, where that noble mole is washed by waves, 75 | and cooled by breezes, which a few hours previous were out of sight of 76 | land. Look at the crowds of water-gazers there. 77 | Anyone caught using formulas such as $sqrt(x+y)=sqrt(x)+sqrt(y)$ 78 | or $1/(x+y) = 1/x + 1/y$ will fail. 79 | 80 | The binomial theorem is 81 | $ (x+y)^n=sum_(k=0)^n binom(n, k) x^k y^(n-k). $ 82 | 83 | A favorite sum of most mathematicians is 84 | $ sum_(n=1)^oo 1 / n^2 = pi^2 / 6. $ 85 | 86 | Likewise a popular integral is 87 | $ integral_(-oo)^oo e^(-x^2) dif x = sqrt(pi) $ 88 | 89 | #theorem[ 90 | The square of any real number is non-negative. 91 | ] 92 | 93 | #proof[ 94 | Any real number $x$ satisfies $x > 0$, $x = 0$, or $x < 0$. If $x = 0$, 95 | then $x^2 = 0 >= 0$. If $x > 0$ then as a positive time a positive is 96 | positive we have $x^2 = x x > 0$. If $x < 0$ then $−x > 0$ and so by 97 | what we have just done $x^2 = (−x)^2 > 0$. So in all cases $x^2 ≥ 0$. 98 | ] 99 | 100 | = Introduction 101 | This is a new section. @beg 102 | You can use tables like @solids. 103 | 104 | 105 | #figure( 106 | table( 107 | columns: (1fr, auto, auto), 108 | inset: 5pt, 109 | align: horizon, 110 | [], [*Area*], [*Parameters*], 111 | [*Cylinder*], 112 | $ pi h (D^2 - d^2) / 4 $, 113 | [$h$: height \ 114 | $D$: outer radius \ 115 | $d$: inner radius], 116 | 117 | [*Tetrahedron*], $ sqrt(2) / 12 a^3 $, [$a$: edge length], 118 | ), 119 | caption: "Solids", 120 | ) 121 | 122 | == Things that need to be done 123 | Prove theorems. 124 | 125 | = Background 126 | #lorem(40) 127 | 128 | #bibliography("refs.bib") 129 | -------------------------------------------------------------------------------- /typ/posts/test/refs.bib: -------------------------------------------------------------------------------- 1 | @article{netwok2020, 2 | title={At-scale impact of the {Net Wok}: A culinarically holistic investigation of distributed dumplings}, 3 | author={Astley, Rick and Morris, Linda}, 4 | journal={Armenian Journal of Proceedings}, 5 | volume={61}, 6 | pages={192--219}, 7 | year=2020, 8 | publisher={Automatic Publishing Inc.} 9 | } 10 | -------------------------------------------------------------------------------- /typ/single.typ: -------------------------------------------------------------------------------- 1 | #import "@preview/shiroa:0.1.0": * 2 | #import "@preview/typst-apollo:0.1.0": pages 3 | #import pages: * 4 | #import "@preview/shiroa:0.1.0": get-page-width, target, is-web-target, is-pdf-target, plain-text 5 | 6 | #import "@preview/unequivocal-ams:0.1.0": theorem, proof 7 | 8 | #show: project.with( 9 | title: "Test", 10 | authors: ( 11 | ( 12 | name: "Darkflames", 13 | email: "darkf1ames@pm.me", 14 | ), 15 | ( 16 | name: "Darkflames", 17 | email: "darkf1ames@pm.me", 18 | ), 19 | ), 20 | ) 21 | 22 | #set par(justify: true) 23 | #set heading(numbering: "1.") 24 | 25 | = Beginning 26 | Call me Ishmael. Some years ago --- never mind how long precisely --- 27 | having little or no money in my purse, and nothing particular to 28 | interest me on shore, I thought I would sail about a little and see 29 | the watery part of the world. It is a way I have of driving off the 30 | spleen, and regulating the circulation. Whenever I find myself 31 | growing grim about the mouth; whenever it is a damp, drizzly November 32 | in my soul; whenever I find myself involuntarily pausing before coffin 33 | warehouses, and bringing up the rear of every funeral I meet; and 34 | especially whenever my hypos get such an upper hand of me, that it 35 | requires a strong moral principle to prevent me from deliberately 36 | stepping into the street, and methodically knocking people's hats off 37 | --- then, I account it high time to get to sea as soon as I can. This 38 | is my substitute for pistol and ball. With a philosophical flourish 39 | Cato throws himself upon his sword; I quietly take to the ship. There 40 | is nothing surprising in this. If they but knew it, almost all men in 41 | their degree, some time or other, cherish very nearly the same 42 | feelings towards the ocean with me. 43 | 44 | #cross-link("/posts/markdown/")[cross reference to the markdown] 45 | 46 | There now is your insular city of the Manhattoes, belted round by 47 | wharves as Indian isles by coral reefs - commerce surrounds it with 48 | her surf. Right and left, the streets take you waterward. Its extreme 49 | down-town is the battery, where that noble mole is washed by waves, 50 | and cooled by breezes, which a few hours previous were out of sight of 51 | land. Look at the crowds of water-gazers there. 52 | 53 | Call me Ishmael. Some years ago --- never mind how long precisely --- 54 | having little or no money in my purse, and nothing particular to 55 | interest me on shore, I thought I would sail about a little and see 56 | the watery part of the world. It is a way I have of driving off the 57 | spleen, and regulating the circulation. Whenever I find myself 58 | growing grim about the mouth; whenever it is a damp, drizzly November 59 | in my soul; whenever I find myself involuntarily pausing before coffin 60 | warehouses, and bringing up the rear of every funeral I meet; and 61 | especially whenever my hypos get such an upper hand of me, that it 62 | requires a strong moral principle to prevent me from deliberately 63 | stepping into the street, and methodically knocking people's hats off 64 | --- then, I account it high time to get to sea as soon as I can. This 65 | is my substitute for pistol and ball. With a philosophical flourish 66 | Cato throws himself upon his sword; I quietly take to the ship. There 67 | is nothing surprising in this. If they but knew it, almost all men in 68 | their degree, some time or other, cherish very nearly the same 69 | feelings towards the ocean with me. 70 | 71 | There now is your insular city of the Manhattoes, belted round by 72 | wharves as Indian isles by coral reefs - commerce surrounds it with 73 | her surf. Right and left, the streets take you waterward. Its extreme 74 | down-town is the battery, where that noble mole is washed by waves, 75 | and cooled by breezes, which a few hours previous were out of sight of 76 | land. Look at the crowds of water-gazers there. 77 | Anyone caught using formulas such as $sqrt(x+y)=sqrt(x)+sqrt(y)$ 78 | or $1/(x+y) = 1/x + 1/y$ will fail. 79 | 80 | The binomial theorem is 81 | $ (x+y)^n=sum_(k=0)^n binom(n, k) x^k y^(n-k). $ 82 | 83 | A favorite sum of most mathematicians is 84 | $ sum_(n=1)^oo 1 / n^2 = pi^2 / 6. $ 85 | 86 | Likewise a popular integral is 87 | $ integral_(-oo)^oo e^(-x^2) dif x = sqrt(pi) $ 88 | 89 | #theorem[ 90 | The square of any real number is non-negative. 91 | ] 92 | 93 | #proof[ 94 | Any real number $x$ satisfies $x > 0$, $x = 0$, or $x < 0$. If $x = 0$, 95 | then $x^2 = 0 >= 0$. If $x > 0$ then as a positive time a positive is 96 | positive we have $x^2 = x x > 0$. If $x < 0$ then $−x > 0$ and so by 97 | what we have just done $x^2 = (−x)^2 > 0$. So in all cases $x^2 ≥ 0$. 98 | ] 99 | 100 | = Introduction 101 | This is a new section. @beg 102 | You can use tables like @solids. 103 | 104 | 105 | #figure( 106 | table( 107 | columns: (1fr, auto, auto), 108 | inset: 5pt, 109 | align: horizon, 110 | [], [*Area*], [*Parameters*], 111 | [*Cylinder*], 112 | $ pi h (D^2 - d^2) / 4 $, 113 | [$h$: height \ 114 | $D$: outer radius \ 115 | $d$: inner radius], 116 | 117 | [*Tetrahedron*], $ sqrt(2) / 12 a^3 $, [$a$: edge length], 118 | ), 119 | caption: "Solids", 120 | ) 121 | 122 | == Things that need to be done 123 | Prove theorems. 124 | 125 | = Background 126 | #lorem(40) 127 | --------------------------------------------------------------------------------