Skip to content

Commit 6aa19fe

Browse files
committed
init
0 parents  commit 6aa19fe

File tree

144 files changed

+18419
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+18419
-0
lines changed

.github/workflows/deploy.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
#
3+
name: Deploy VitePress site to Pages
4+
5+
on:
6+
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
7+
# using the `master` branch as the default branch.
8+
push:
9+
branches: [main, repo/ci-deploy]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
22+
concurrency:
23+
group: pages
24+
cancel-in-progress: false
25+
26+
jobs:
27+
# Build job
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
35+
- uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
36+
with:
37+
version: 9.5
38+
- name: Setup Node
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 20
42+
cache: pnpm
43+
- name: Setup Pages
44+
uses: actions/configure-pages@v4
45+
- name: Install dependencies
46+
run: pnpm install
47+
- name: Build with VitePress
48+
run: pnpm vitepress build
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: .vitepress/dist
53+
54+
# Deployment job
55+
deploy:
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
needs: build
60+
runs-on: ubuntu-latest
61+
name: Deploy
62+
steps:
63+
- name: Deploy to GitHub Pages
64+
id: deployment
65+
uses: actions/deploy-pages@v4

.gitignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Vite build and cache
2+
.vitepress/dist/
3+
.vitepress/cache/
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
15+
# Directory for instrumented libs generated by jscoverage/JSCover
16+
lib-cov
17+
18+
# Coverage directory used by tools like istanbul
19+
coverage
20+
.nyc_output
21+
coverage.*
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# node-waf configuration
27+
.lock-wscript
28+
29+
# Compiled binary addons (http://nodejs.org/api/addons.html)
30+
build/Release
31+
32+
# Dependency directory
33+
node_modules
34+
35+
# Optional npm cache directory
36+
.npm
37+
38+
# Optional REPL history
39+
.node_repl_history
40+
41+
typings/
42+
lib/*.js
43+
test/*.js
44+
*.map

.vitepress/config.mts

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import { defineConfig } from 'vitepress'
2+
import { BiDirectionalLinks } from '@nolebase/markdown-it-bi-directional-links'
3+
import {
4+
InlineLinkPreviewElementTransform
5+
} from '@nolebase/vitepress-plugin-inline-link-preview/markdown-it'
6+
import Mark from 'markdown-it-mark'
7+
import { withMermaid } from 'vitepress-plugin-mermaid'
8+
9+
// https://vitepress.dev/reference/site-config
10+
export default defineConfig({
11+
title: "Kurage Notes",
12+
description: "A static site to showcase my notes.",
13+
base: '/notes/',
14+
markdown: {
15+
math: true,
16+
config: (md) => {
17+
md.use(BiDirectionalLinks())
18+
md.use(InlineLinkPreviewElementTransform)
19+
md.use(Mark)
20+
},
21+
},
22+
vite: {
23+
optimizeDeps: {
24+
exclude: [
25+
'@nolebase/vitepress-plugin-inline-link-preview/client',
26+
],
27+
},
28+
ssr: {
29+
noExternal: [
30+
// If there are other packages that need to be processed by Vite, you can add them here.
31+
'@nolebase/vitepress-plugin-inline-link-preview',
32+
],
33+
},
34+
},
35+
themeConfig: {
36+
// https://vitepress.dev/reference/default-theme-config
37+
nav: [
38+
{ text: 'Home', link: '/' },
39+
{ text: 'Table of Contents', link: '/toc' },
40+
{ text: 'Examples', link: '/markdown-examples' }
41+
],
42+
43+
// TODO: Consider adding script to compose sidebar items
44+
sidebar: [
45+
{
46+
text: 'CS61C',
47+
link: '/coding/cs61c/info',
48+
collapsed: true,
49+
items: [
50+
{
51+
text: 'C',
52+
items: [
53+
{ text: 'Intro to C', link: '/coding/cs61c/src/c/Intro to C' },
54+
{ text: 'Generics', link: '/coding/cs61c/src/c/Generics' },
55+
{ text: 'Memory Management', link: '/coding/cs61c/src/c/Memory Management' },
56+
{ text: 'GDB Cheetsheet', link: '/coding/cs61c/src/c/GDB Cheetsheet' },
57+
],
58+
},
59+
{
60+
text: 'RISC-V',
61+
items: [
62+
{ text: 'Intro to RISC-V', link: '/coding/cs61c/src/riscv/Intro to RISC-V' },
63+
{ text: 'RISC-V Instructions', link: '/coding/cs61c/src/riscv/RISC-V Instructions' },
64+
{ text: 'RISC-V Instruction Format', link: '/coding/cs61c/src/riscv/RISC-V Instruction Format' },
65+
{ text: 'RISC-V Procedures', link: '/coding/cs61c/src/riscv/RISC-V Procedures' },
66+
{ text: 'CALL', link: '/coding/cs61c/src/riscv/CALL' },
67+
],
68+
},
69+
{
70+
text: 'CPU',
71+
items: [
72+
{ text: 'Design Hierarchy', link: '/coding/cs61c/src/cpu/Design Hierarchy' },
73+
{ text: 'Combinational Logic', link: '/coding/cs61c/src/cpu/Combinational Logic' },
74+
{ text: 'Combinational Logic Blocks', link: '/coding/cs61c/src/cpu/Combinational Logic Blocks' },
75+
{ text: 'State', link: '/coding/cs61c/src/cpu/State' },
76+
{ text: 'Synchronous Digital System', link: '/coding/cs61c/src/cpu/Synchronous Digital System' },
77+
{ text: 'Single-Cycle Datapath', link: '/coding/cs61c/src/cpu/Single-Cycle Datapath' },
78+
{ text: 'Single-Cycle Control', link: '/coding/cs61c/src/cpu/Single-Cycle Control' },
79+
{ text: 'Pipelining', link: '/coding/cs61c/src/cpu/Pipelining' },
80+
{ text: 'Performance', link: '/coding/cs61c/src/cpu/Performance' },
81+
],
82+
},
83+
{
84+
text: 'Performance',
85+
items: [
86+
{ text: 'Caches', link: '/coding/cs61c/src/performance/Caches' },
87+
{ text: 'Data-Level Parallelism (DLP)', link: '/coding/cs61c/src/performance/Data-Level Parallelism (DLP)' },
88+
{ text: 'Measuring Performance', link: '/coding/cs61c/src/performance/Measuring Performance' },
89+
{ text: 'Parallelism', link: '/coding/cs61c/src/performance/Parallelism' },
90+
{ text: 'Virtual Memory and OS', link: '/coding/cs61c/src/performance/Virtual Memory and OS' },
91+
],
92+
}
93+
]
94+
},
95+
{
96+
text: 'Nand to Tetris',
97+
link: '/coding/nand2tetris/info',
98+
items: [
99+
{ text: 'Boolean Logic', link: '/coding/nand2tetris/src/1.1 Boolean Logic' },
100+
{ text: 'Logic Gates', link: '/coding/nand2tetris/src/1.3 Logic Gates' },
101+
]
102+
},
103+
{
104+
text: 'Examples',
105+
items: [
106+
{ text: 'Markdown Examples', link: '/markdown-examples' },
107+
{ text: 'Runtime API Examples', link: '/api-examples' }
108+
]
109+
},
110+
],
111+
112+
socialLinks: [
113+
{ icon: 'github', link: 'https://github.com/mdrkrg' }
114+
]
115+
}
116+
})

.vitepress/theme/index.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// https://vitepress.dev/guide/custom-theme
2+
import { h } from 'vue'
3+
import type { Theme } from 'vitepress'
4+
import DefaultTheme from 'vitepress/theme'
5+
import './style.css'
6+
import {
7+
NolebaseInlineLinkPreviewPlugin
8+
} from '@nolebase/vitepress-plugin-inline-link-preview/client'
9+
10+
import '@nolebase/vitepress-plugin-inline-link-preview/client/style.css'
11+
12+
export default {
13+
extends: DefaultTheme,
14+
Layout: () => {
15+
return h(DefaultTheme.Layout, null, {
16+
// https://vitepress.dev/guide/extending-default-theme#layout-slots
17+
})
18+
},
19+
enhanceApp({ app, router, siteData }) {
20+
app.use(NolebaseInlineLinkPreviewPlugin)
21+
}
22+
} satisfies Theme

.vitepress/theme/style.css

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
/**
2+
* Customize default theme styling by overriding CSS variables:
3+
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
4+
*/
5+
6+
/**
7+
* Colors
8+
*
9+
* Each colors have exact same color scale system with 3 levels of solid
10+
* colors with different brightness, and 1 soft color.
11+
*
12+
* - `XXX-1`: The most solid color used mainly for colored text. It must
13+
* satisfy the contrast ratio against when used on top of `XXX-soft`.
14+
*
15+
* - `XXX-2`: The color used mainly for hover state of the button.
16+
*
17+
* - `XXX-3`: The color for solid background, such as bg color of the button.
18+
* It must satisfy the contrast ratio with pure white (#ffffff) text on
19+
* top of it.
20+
*
21+
* - `XXX-soft`: The color used for subtle background such as custom container
22+
* or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
23+
* on top of it.
24+
*
25+
* The soft color must be semi transparent alpha channel. This is crucial
26+
* because it allows adding multiple "soft" colors on top of each other
27+
* to create a accent, such as when having inline code block inside
28+
* custom containers.
29+
*
30+
* - `default`: The color used purely for subtle indication without any
31+
* special meanings attched to it such as bg color for menu hover state.
32+
*
33+
* - `brand`: Used for primary brand colors, such as link text, button with
34+
* brand theme, etc.
35+
*
36+
* - `tip`: Used to indicate useful information. The default theme uses the
37+
* brand color for this by default.
38+
*
39+
* - `warning`: Used to indicate warning to the users. Used in custom
40+
* container, badges, etc.
41+
*
42+
* - `danger`: Used to show error, or dangerous message to the users. Used
43+
* in custom container, badges, etc.
44+
* -------------------------------------------------------------------------- */
45+
46+
:root {
47+
--vp-c-default-1: var(--vp-c-gray-1);
48+
--vp-c-default-2: var(--vp-c-gray-2);
49+
--vp-c-default-3: var(--vp-c-gray-3);
50+
--vp-c-default-soft: var(--vp-c-gray-soft);
51+
52+
--vp-c-brand-1: var(--vp-c-indigo-1);
53+
--vp-c-brand-2: var(--vp-c-indigo-2);
54+
--vp-c-brand-3: var(--vp-c-indigo-3);
55+
--vp-c-brand-soft: var(--vp-c-indigo-soft);
56+
57+
--vp-c-tip-1: var(--vp-c-brand-1);
58+
--vp-c-tip-2: var(--vp-c-brand-2);
59+
--vp-c-tip-3: var(--vp-c-brand-3);
60+
--vp-c-tip-soft: var(--vp-c-brand-soft);
61+
62+
--vp-c-warning-1: var(--vp-c-yellow-1);
63+
--vp-c-warning-2: var(--vp-c-yellow-2);
64+
--vp-c-warning-3: var(--vp-c-yellow-3);
65+
--vp-c-warning-soft: var(--vp-c-yellow-soft);
66+
67+
--vp-c-danger-1: var(--vp-c-red-1);
68+
--vp-c-danger-2: var(--vp-c-red-2);
69+
--vp-c-danger-3: var(--vp-c-red-3);
70+
--vp-c-danger-soft: var(--vp-c-red-soft);
71+
}
72+
73+
/**
74+
* Component: Button
75+
* -------------------------------------------------------------------------- */
76+
77+
:root {
78+
--vp-button-brand-border: transparent;
79+
--vp-button-brand-text: var(--vp-c-white);
80+
--vp-button-brand-bg: var(--vp-c-brand-3);
81+
--vp-button-brand-hover-border: transparent;
82+
--vp-button-brand-hover-text: var(--vp-c-white);
83+
--vp-button-brand-hover-bg: var(--vp-c-brand-2);
84+
--vp-button-brand-active-border: transparent;
85+
--vp-button-brand-active-text: var(--vp-c-white);
86+
--vp-button-brand-active-bg: var(--vp-c-brand-1);
87+
}
88+
89+
/**
90+
* Component: Home
91+
* -------------------------------------------------------------------------- */
92+
93+
:root {
94+
--vp-home-hero-name-color: transparent;
95+
--vp-home-hero-name-background: -webkit-linear-gradient(
96+
120deg,
97+
#bd34fe 30%,
98+
#41d1ff
99+
);
100+
101+
--vp-home-hero-image-background-image: linear-gradient(
102+
-45deg,
103+
#bd34fe 50%,
104+
#47caff 50%
105+
);
106+
--vp-home-hero-image-filter: blur(44px);
107+
}
108+
109+
@media (min-width: 640px) {
110+
:root {
111+
--vp-home-hero-image-filter: blur(56px);
112+
}
113+
}
114+
115+
@media (min-width: 960px) {
116+
:root {
117+
--vp-home-hero-image-filter: blur(68px);
118+
}
119+
}
120+
121+
/**
122+
* Component: Custom Block
123+
* -------------------------------------------------------------------------- */
124+
125+
:root {
126+
--vp-custom-block-tip-border: transparent;
127+
--vp-custom-block-tip-text: var(--vp-c-text-1);
128+
--vp-custom-block-tip-bg: var(--vp-c-brand-soft);
129+
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
130+
}
131+
132+
/**
133+
* Component: Algolia
134+
* -------------------------------------------------------------------------- */
135+
136+
.DocSearch {
137+
--docsearch-primary-color: var(--vp-c-brand-1) !important;
138+
}
139+

0 commit comments

Comments
 (0)