~repos /website

#astro#js#html#css

git clone https://pyrossh.dev/repos/website.git

木 Personal website of pyrossh. Built with astrojs, shiki, vite.


428c0731 Peter John

1 year ago
fix hosting
Files changed (3) hide show
  1. package.json +1 -1
  2. src/routes/+layout.js +1 -0
  3. svelte.config.js +35 -35
package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "dev": "vite dev",
8
8
  "build": "vite build",
9
9
  "preview": "vite preview",
10
- "publish": "tar -C build -cvz . > site.tar.gz && hut pages publish -d pyrossh.dev site.tar.gz",
10
+ "publish": "rm -rf build && npm run build && tar -C build -cvz . > site.tar.gz && hut pages publish -d pyrossh.dev site.tar.gz && rm site.tar.gz",
11
11
  "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
12
12
  "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
13
13
  "test": "npm run test:integration && npm run test:unit",
src/routes/+layout.js CHANGED
@@ -1 +1,2 @@
1
1
  export const prerender = true;
2
+ export const trailingSlash = 'always';
svelte.config.js CHANGED
@@ -6,45 +6,45 @@ import { getSingletonHighlighter } from 'shiki';
6
6
 
7
7
  /** @type {import('mdsvex').MdsvexOptions} */
8
8
  const mdsvexOptions = {
9
- extensions: ['.md'],
9
+ extensions: ['.md'],
10
- remarkPlugins: [
10
+ remarkPlugins: [
11
- [
11
+ [
12
- github,
12
+ github,
13
- {
13
+ {
14
- repository: 'https://github.com/pyrossh/pyrossh.dev',
14
+ repository: 'https://github.com/pyrossh/pyrossh.dev',
15
- },
15
+ },
16
- ],
16
+ ],
17
- ],
17
+ ],
18
- highlight: {
18
+ highlight: {
19
- highlighter: async (code, lang = 'text') => {
19
+ highlighter: async (code, lang = 'text') => {
20
- const highlighter = await getSingletonHighlighter({
20
+ const highlighter = await getSingletonHighlighter({
21
- themes: ['dracula'],
21
+ themes: ['dracula'],
22
- langs: ['javascript', 'typescript', 'go', 'shell', 'tsx'],
22
+ langs: ['javascript', 'typescript', 'go', 'shell', 'tsx'],
23
- });
23
+ });
24
- await highlighter.loadLanguage('javascript', 'typescript', 'go');
24
+ await highlighter.loadLanguage('javascript', 'typescript', 'go');
25
- const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'dracula' }));
25
+ const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'dracula' }));
26
- return `{@html \`${html}\` }`;
26
+ return `{@html \`${html}\` }`;
27
- },
27
+ },
28
- },
28
+ },
29
29
  };
30
30
 
31
31
  /** @type {import('@sveltejs/kit').Config} */
32
32
  const config = {
33
- extensions: ['.svelte', '.md'],
33
+ extensions: ['.svelte', '.md'],
34
- preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)],
34
+ preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)],
35
- kit: {
35
+ kit: {
36
- adapter: adapter({
36
+ adapter: adapter({
37
- strict: true,
37
+ strict: true,
38
- fallback: '404.html',
38
+ fallback: '404.html',
39
- }),
39
+ }),
40
- },
40
+ },
41
- vitePlugin: {
41
+ vitePlugin: {
42
- inspector: {
42
+ inspector: {
43
- toggleKeyCombo: 'meta-shift',
43
+ toggleKeyCombo: 'meta-shift',
44
- showToggleButton: 'always',
44
+ showToggleButton: 'always',
45
- toggleButtonPos: 'bottom-right',
45
+ toggleButtonPos: 'bottom-right',
46
- },
46
+ },
47
- },
47
+ },
48
48
  };
49
49
 
50
50
  export default config;