Skip to content

Commit daa78c5

Browse files
committed
feat: Added eslint, test ci lint #1
1 parent 52fb735 commit daa78c5

File tree

12 files changed

+3343
-346
lines changed

12 files changed

+3343
-346
lines changed

.github/workflows/test.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Sample workflow for building and deploying a VitePress site to GitHub Pages
2+
#
3+
name: Test CI Lint and Build
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: [feat/*, fix/*, test/*]
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+
# Lint files
28+
lint:
29+
name: Lint
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
36+
- uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
37+
with:
38+
version: 9.5
39+
- name: Setup Node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: 20
43+
cache: pnpm
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v4
46+
- name: Install dependencies
47+
run: pnpm install
48+
- name: Lint
49+
run: pnpm lint
50+
51+
# Build job
52+
build:
53+
needs: lint
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Build with VitePress
57+
run: pnpm build
58+
- name: Upload artifact
59+
uses: actions/upload-pages-artifact@v3
60+
with:
61+
path: .vitepress/dist

.vitepress/config.mts

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { defineConfig } from 'vitepress'
21
import { BiDirectionalLinks } from '@nolebase/markdown-it-bi-directional-links'
32
import {
4-
InlineLinkPreviewElementTransform
3+
InlineLinkPreviewElementTransform,
54
} from '@nolebase/vitepress-plugin-inline-link-preview/markdown-it'
65
import Mark from 'markdown-it-mark'
76
import Callout from 'markdown-it-obsidian-callouts'
7+
import { defineConfig } from 'vitepress'
88
import { withMermaid } from 'vitepress-plugin-mermaid'
99
import { sidebar } from '../constants/nav'
1010

1111
// https://vitepress.dev/reference/site-config
1212
export default withMermaid(
1313
defineConfig({
14-
title: "Kurage Notes",
15-
description: "A static site to showcase my notes.",
14+
title: 'Kurage Notes',
15+
description: 'A static site to showcase my notes.',
1616
base: '/notes/',
1717
markdown: {
1818
math: true,
@@ -45,15 +45,15 @@ export default withMermaid(
4545
nav: [
4646
{ text: 'Home', link: '/' },
4747
{ text: 'Table of Contents', link: '/pages/toc' },
48-
{ text: 'Examples', link: '/pages/markdown-examples' }
48+
{ text: 'Examples', link: '/pages/markdown-examples' },
4949
],
5050

5151
// TODO: Consider adding script to compose sidebar items
52-
sidebar: sidebar,
52+
sidebar,
5353

5454
socialLinks: [
55-
{ icon: 'github', link: 'https://github.com/mdrkrg' }
56-
]
57-
}
58-
})
55+
{ icon: 'github', link: 'https://github.com/mdrkrg' },
56+
],
57+
},
58+
}),
5959
)

.vitepress/theme/callout.css

+26-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/**
2-
* Color about
1+
/**
2+
* Color about
33
*/
44
:root {
55
--bold-modifier: 200;
@@ -29,7 +29,7 @@
2929
--callout-question: 236, 117, 0;
3030
--callout-warning: 236, 117, 0;
3131
--callout-quote: 158, 158, 158;
32-
--callout-collapse-icon: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0ibTkgMThsNi02bC02LTYiLz48L3N2Zz4=");
32+
--callout-collapse-icon: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxZW0iIGhlaWdodD0iMWVtIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGZpbGw9Im5vbmUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0ibTkgMThsNi02bC02LTYiLz48L3N2Zz4=');
3333
}
3434

3535
.theme-light {
@@ -40,18 +40,18 @@
4040
--callout-blend-mode: var(lighten);
4141
}
4242

43-
html[data-theme="light"] #app {
43+
html[data-theme='light'] #app {
4444
--callout-blend-mode: var(darken);
4545
}
4646

47-
html[data-theme="dark"] #app {
47+
html[data-theme='dark'] #app {
4848
--callout-blend-mode: var(lighten);
4949
}
5050

51-
/**
52-
* Obsidian callout about
53-
*
54-
* The following style is exactly the same as in obsidian
51+
/**
52+
* Obsidian callout about
53+
*
54+
* The following style is exactly the same as in obsidian
5555
*/
5656
.callout {
5757
overflow: hidden;
@@ -125,42 +125,51 @@ details[open].callout > .callout-title > .callout-fold {
125125
background-color: var(--callout-content-background);
126126
}
127127

128-
.callout[data-callout="todo"] {
128+
.callout[data-callout='todo'] {
129129
--callout-color: var(--callout-todo);
130130
--callout-icon: lucide-check-circle-2;
131131
}
132132

133-
.callout[data-callout="success"], .callout[data-callout="check"], .callout[data-callout="done"] {
133+
.callout[data-callout='success'],
134+
.callout[data-callout='check'],
135+
.callout[data-callout='done'] {
134136
--callout-color: var(--callout-success);
135137
--callout-icon: lucide-check;
136138
}
137139

138-
.callout[data-callout="warning"], .callout[data-callout="caution"], .callout[data-callout="attention"] {
140+
.callout[data-callout='warning'],
141+
.callout[data-callout='caution'],
142+
.callout[data-callout='attention'] {
139143
--callout-color: var(--callout-warning);
140144
--callout-icon: lucide-alert-triangle;
141145
}
142146

143-
.callout[data-callout="danger"], .callout[data-callout="error"] {
147+
.callout[data-callout='danger'],
148+
.callout[data-callout='error'] {
144149
--callout-color: var(--callout-error);
145150
--callout-icon: lucide-zap;
146151
}
147152

148-
.callout[data-callout="tip"], .callout[data-callout="hint"] {
153+
.callout[data-callout='tip'],
154+
.callout[data-callout='hint'] {
149155
--callout-color: var(--callout-tip);
150156
--callout-icon: lucide-flame;
151157
}
152158

153-
.callout[data-callout="example"] {
159+
.callout[data-callout='example'] {
154160
--callout-color: var(--callout-example);
155161
--callout-icon: lucide-list;
156162
}
157163

158-
.callout[data-callout="abstract"], .callout[data-callout="summary"], .callout[data-callout="tldr"] {
164+
.callout[data-callout='abstract'],
165+
.callout[data-callout='summary'],
166+
.callout[data-callout='tldr'] {
159167
--callout-color: var(--callout-summary);
160168
--callout-icon: lucide-clipboard-list;
161169
}
162170

163-
.callout[data-callout="quote"], .callout[data-callout="cite"] {
171+
.callout[data-callout='quote'],
172+
.callout[data-callout='cite'] {
164173
--callout-color: var(--callout-quote);
165174
--callout-icon: quote-glyph;
166175
}

.vitepress/theme/callout.min.css

-1
This file was deleted.

0 commit comments

Comments
 (0)