Compare commits
No commits in common. "main" and "post/header" have entirely different histories.
main
...
post/heade
|
@ -11,7 +11,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: conventional-pre-commit
|
- id: conventional-pre-commit
|
||||||
stages: [commit-msg]
|
stages: [commit-msg]
|
||||||
args: [feat, fix, chore, test, build, merge, refactor, doc]
|
args: [feat, fix, chore, test, build, merge, refactor]
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: eslint
|
- id: eslint
|
||||||
|
|
12
README.md
12
README.md
|
@ -19,18 +19,6 @@ To insert custom content, create a directory with a similar structure to
|
||||||
directory. The website will be built statically in `build/`. Note that changing
|
directory. The website will be built statically in `build/`. Note that changing
|
||||||
`favicon.svg` will require modifying the `static/` folder.
|
`favicon.svg` will require modifying the `static/` folder.
|
||||||
|
|
||||||
Set `metadata.json` based on the example to have a custom avatar and background
|
|
||||||
image.
|
|
||||||
- `name`: Displayed name on the home page
|
|
||||||
- `blogName`: Displayed name of the blog
|
|
||||||
- `url`: The site url
|
|
||||||
- `frontDescription`: The text above the main navbar
|
|
||||||
- `frontCover`: Path to the cover image
|
|
||||||
- `picture`: Avatar
|
|
||||||
- `links`: A map of brands to links
|
|
||||||
- `extra`: Extra pages showing on the navbar
|
|
||||||
- `markdown`: `{ "highlighterLangs": [ ... ], "katex": [ ... ] }`
|
|
||||||
|
|
||||||
## Developing
|
## Developing
|
||||||
|
|
||||||
Install [pre-commit](https://pre-commit.com/).
|
Install [pre-commit](https://pre-commit.com/).
|
||||||
|
|
|
@ -115,13 +115,11 @@ a, button {
|
||||||
text-shadow: 0 0 5px;
|
text-shadow: 0 0 5px;
|
||||||
}
|
}
|
||||||
.nav-link, .nav-link * {
|
.nav-link, .nav-link * {
|
||||||
|
color: var(--navlink);
|
||||||
@apply text-lg;
|
@apply text-lg;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-family: serif;
|
font-family: serif;
|
||||||
}
|
}
|
||||||
.nav-link:not(.disabled-link):not(.current-link) {
|
|
||||||
color: var(--navlink);
|
|
||||||
}
|
|
||||||
a.disabled-link {
|
a.disabled-link {
|
||||||
color: rgb(128,128,128);
|
color: rgb(128,128,128);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
|
@ -12,12 +12,5 @@
|
||||||
},
|
},
|
||||||
"extra": [
|
"extra": [
|
||||||
{ "route": "/archives", "name": "Archives" }
|
{ "route": "/archives", "name": "Archives" }
|
||||||
],
|
]
|
||||||
"markdown": {
|
|
||||||
"highlighterLangs": [
|
|
||||||
"python",
|
|
||||||
"lean",
|
|
||||||
"tex"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,3 @@ $$
|
||||||
$$
|
$$
|
||||||
\vec z^{(l+1)} = \mat M\vec z^{(l)} + \vec b
|
\vec z^{(l+1)} = \mat M\vec z^{(l)} + \vec b
|
||||||
$$
|
$$
|
||||||
|
|
||||||
```tex
|
|
||||||
\\newcommand{\\cirno}{9}
|
|
||||||
```
|
|
||||||
|
|
|
@ -19,22 +19,15 @@
|
||||||
|
|
||||||
import metadata from '$content/metadata.json';
|
import metadata from '$content/metadata.json';
|
||||||
const iconMap: Map<string, string> = {
|
const iconMap: Map<string, string> = {
|
||||||
"orcid": "fa-brands fa-orcid",
|
"bitbucket": "fa-brands fa-bitbucket",
|
||||||
"google-scholar": "fa-brands fa-google-scholar",
|
|
||||||
|
|
||||||
"discord": "fa-brands fa-discord",
|
"discord": "fa-brands fa-discord",
|
||||||
"email": "fa-solid fa-envelope",
|
"email": "fa-solid fa-envelope",
|
||||||
|
|
||||||
"bitbucket": "fa-brands fa-bitbucket",
|
|
||||||
"github": "fa-brands fa-github",
|
"github": "fa-brands fa-github",
|
||||||
"gitlab": "fa-brands fa-gitlab",
|
"gitlab": "fa-brands fa-gitlab",
|
||||||
"open-source": "fa-brands fa-osi",
|
"google-scholar": "fa-brands fa-google-scholar",
|
||||||
|
|
||||||
"bluesky": "fa-brands fa-bluesky",
|
|
||||||
"youtube": "fa-brands fa-youtube",
|
|
||||||
"instagram": "fa-brands fa-instagram",
|
"instagram": "fa-brands fa-instagram",
|
||||||
"bandcamp": "fa-brands fa-bandcamp",
|
"open-source": "fa-brands fa-osi",
|
||||||
"pixiv": "fa-brands fa-pixiv",
|
"orcid": "fa-brands fa-orcid",
|
||||||
};
|
};
|
||||||
const iconLinks: [string, string][] = Object.entries(metadata.links).map(
|
const iconLinks: [string, string][] = Object.entries(metadata.links).map(
|
||||||
([key, link]) => [iconMap[key], link]);
|
([key, link]) => [iconMap[key], link]);
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
{#each routes as item}
|
{#each routes as item}
|
||||||
<a
|
<a
|
||||||
class="nav-link"
|
class="nav-link"
|
||||||
class:disabled-link={item.disabled}
|
|
||||||
class:current-link={isCurrentLink($page.url.pathname, item.route)}
|
class:current-link={isCurrentLink($page.url.pathname, item.route)}
|
||||||
|
class:disabled-link={item.disabled}
|
||||||
href={item.route}>{item.name}</a>
|
href={item.route}>{item.name}</a>
|
||||||
{/each}
|
{/each}
|
||||||
<a class="nav-link icon" href="/rss.xml"><Rss /></a>
|
<a class="nav-link icon" href="/rss.xml"><Rss /></a>
|
||||||
|
|
|
@ -12,4 +12,4 @@
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<hr class="separator" />
|
<hr class="separator" />
|
||||||
<PostList {posts} pageN={1} {maxPageN}/>
|
<PostList {posts} pageN=1 {maxPageN}/>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||||
import adapter from '@sveltejs/adapter-static';
|
import adapter from '@sveltejs/adapter-static';
|
||||||
import fs from 'fs';
|
|
||||||
|
|
||||||
import { mdsvex, escapeSvelte } from 'mdsvex';
|
import { mdsvex, escapeSvelte } from 'mdsvex';
|
||||||
import remarkAlert from './src/lib/markdown.js'
|
import remarkAlert from './src/lib/markdown.js'
|
||||||
|
@ -13,9 +12,7 @@ import remarkMath from 'remark-math'
|
||||||
|
|
||||||
const contentDir = process.env?.CHRYSOBLOG_CONTENT ?? "src/content";
|
const contentDir = process.env?.CHRYSOBLOG_CONTENT ?? "src/content";
|
||||||
|
|
||||||
const metadata = await fs.promises.readFile(contentDir + "/metadata.json")
|
const langs = [
|
||||||
.then((file) => JSON.parse(file.toString()));
|
|
||||||
const langs = metadata?.markdown.highlighterLangs ?? [
|
|
||||||
"javascript",
|
"javascript",
|
||||||
"lean",
|
"lean",
|
||||||
"lisp",
|
"lisp",
|
||||||
|
@ -29,7 +26,11 @@ const langs = metadata?.markdown.highlighterLangs ?? [
|
||||||
"c++",
|
"c++",
|
||||||
"sh",
|
"sh",
|
||||||
];
|
];
|
||||||
const katexOptions = metadata?.markdown.katex ?? {
|
const highlightingThemes = {
|
||||||
|
light: 'vitesse-light',
|
||||||
|
dark: 'vitesse-dark',
|
||||||
|
};
|
||||||
|
const katexOptions = {
|
||||||
macros: {
|
macros: {
|
||||||
"\\Nat": "\\mathbb N",
|
"\\Nat": "\\mathbb N",
|
||||||
"\\Complex": "\\mathbb C",
|
"\\Complex": "\\mathbb C",
|
||||||
|
@ -38,10 +39,6 @@ const katexOptions = metadata?.markdown.katex ?? {
|
||||||
"\\rv": "\\mathrm",
|
"\\rv": "\\mathrm",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const highlightingThemes = {
|
|
||||||
light: 'vitesse-light',
|
|
||||||
dark: 'vitesse-dark',
|
|
||||||
};
|
|
||||||
|
|
||||||
const themes = Object.keys(highlightingThemes).map(function(k){ return highlightingThemes[k] });
|
const themes = Object.keys(highlightingThemes).map(function(k){ return highlightingThemes[k] });
|
||||||
const highlighter = await getHighlighter({
|
const highlighter = await getHighlighter({
|
||||||
|
|
Loading…
Reference in New Issue