~repos /website

#astro#js#html#css

git clone https://pyrossh.dev/repos/website.git
Discussions: https://groups.google.com/g/rust-embed-devs

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


745bbadf pyrossh

1 year ago
add onlybible pages
.eslintrc.cjs CHANGED
@@ -5,11 +5,11 @@ module.exports = {
5
5
  parserOptions: {
6
6
  sourceType: 'module',
7
7
  ecmaVersion: 2020,
8
- extraFileExtensions: ['.svelte']
8
+ extraFileExtensions: ['.svelte'],
9
9
  },
10
10
  env: {
11
11
  browser: true,
12
12
  es2017: true,
13
- node: true
13
+ node: true,
14
- }
14
+ },
15
15
  };
.flox/env.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "name": "pyros.sh",
2
+ "name": "pyros.sh",
3
- "version": 1
3
+ "version": 1
4
- }
4
+ }
.prettierrc CHANGED
@@ -1,8 +1,17 @@
1
1
  {
2
- "useTabs": true,
2
+ "useTabs": true,
3
- "singleQuote": true,
3
+ "singleQuote": true,
4
- "trailingComma": "none",
4
+ "trailingComma": "all",
5
- "printWidth": 100,
5
+ "printWidth": 100,
6
+ "plugins": [
7
+ "prettier-plugin-svelte"
8
+ ],
9
+ "overrides": [
10
+ {
6
- "plugins": ["prettier-plugin-svelte"],
11
+ "files": "*.svelte",
12
+ "options": {
7
- "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
13
+ "parser": "svelte"
8
- }
14
+ }
15
+ }
16
+ ]
17
+ }
.vscode/extensions.json CHANGED
@@ -1,6 +1,3 @@
1
1
  {
2
- "recommendations": [
3
- "svelte.svelte-vscode",
2
+ "recommendations": ["svelte.svelte-vscode", "antfu.unocss"]
4
- "antfu.unocss"
5
- ]
6
3
  }
.vscode/settings.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "[html]": {
2
+ "[html]": {
3
- "editor.defaultFormatter": "vscode.html-language-features"
3
+ "editor.defaultFormatter": "vscode.html-language-features"
4
- },
5
- }
4
+ }
5
+ }
package.json CHANGED
@@ -1,45 +1,45 @@
1
1
  {
2
- "name": "website",
2
+ "name": "website",
3
- "version": "0.0.1",
3
+ "version": "0.0.1",
4
- "private": true,
4
+ "private": true,
5
- "type": "module",
5
+ "type": "module",
6
- "scripts": {
6
+ "scripts": {
7
- "dev": "vite dev",
7
+ "dev": "vite dev",
8
- "build": "vite build",
8
+ "build": "vite build",
9
- "preview": "vite preview",
9
+ "preview": "vite preview",
10
- "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
10
+ "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
11
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
11
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
12
- "test": "npm run test:integration && npm run test:unit",
12
+ "test": "npm run test:integration && npm run test:unit",
13
- "lint": "prettier --check . && eslint .",
13
+ "lint": "prettier --check . && eslint .",
14
- "format": "prettier --write .",
14
+ "format": "prettier --write .",
15
- "test:integration": "playwright test",
15
+ "test:integration": "playwright test",
16
- "test:unit": "vitest"
16
+ "test:unit": "vitest"
17
- },
17
+ },
18
- "devDependencies": {
18
+ "devDependencies": {
19
- "@iconify/svelte": "^4.0.2",
19
+ "@iconify/svelte": "^4.0.2",
20
- "@playwright/test": "^1.28.1",
20
+ "@playwright/test": "^1.28.1",
21
- "@poppanator/sveltekit-svg": "^4.2.1",
21
+ "@poppanator/sveltekit-svg": "^4.2.1",
22
- "@sveltejs/adapter-static": "^3.0.1",
22
+ "@sveltejs/adapter-static": "^3.0.1",
23
- "@sveltejs/enhanced-img": "^0.2.0",
23
+ "@sveltejs/enhanced-img": "^0.2.0",
24
- "@sveltejs/kit": "2.5.1",
24
+ "@sveltejs/kit": "2.5.1",
25
- "@tailwindcss/typography": "^0.5.13",
25
+ "@tailwindcss/typography": "^0.5.13",
26
- "@types/eslint": "8.56.0",
26
+ "@types/eslint": "8.56.0",
27
- "autoprefixer": "^10.4.19",
27
+ "autoprefixer": "^10.4.19",
28
- "eslint": "^8.56.0",
28
+ "eslint": "^8.56.0",
29
- "eslint-config-prettier": "^9.1.0",
29
+ "eslint-config-prettier": "^9.1.0",
30
- "eslint-plugin-svelte": "^2.36.0-next.4",
30
+ "eslint-plugin-svelte": "^2.36.0-next.4",
31
- "mdsvex": "^0.11.0",
31
+ "mdsvex": "^0.11.0",
32
- "postcss": "^8.4.38",
32
+ "postcss": "^8.4.38",
33
- "prettier": "^3.1.1",
33
+ "prettier": "^3.1.1",
34
- "prettier-plugin-svelte": "^3.1.2",
34
+ "prettier-plugin-svelte": "^3.1.2",
35
- "remark-github": "^12.0.0",
35
+ "remark-github": "^12.0.0",
36
- "shiki": "^1.1.7",
36
+ "shiki": "^1.1.7",
37
- "super-sitemap": "^0.14.14",
37
+ "super-sitemap": "^0.14.14",
38
- "svelte": "4.2.11",
38
+ "svelte": "4.2.11",
39
- "svelte-check": "^3.6.0",
39
+ "svelte-check": "^3.6.0",
40
- "tailwindcss": "^3.4.3",
40
+ "tailwindcss": "^3.4.3",
41
- "typescript": "^5.0.0",
41
+ "typescript": "^5.0.0",
42
- "vite": "^5.0.3",
42
+ "vite": "^5.0.3",
43
- "vitest": "^1.2.0"
43
+ "vitest": "^1.2.0"
44
- }
44
+ }
45
45
  }
playwright.config.js CHANGED
@@ -2,10 +2,10 @@
2
2
  const config = {
3
3
  webServer: {
4
4
  command: 'npm run build && npm run preview',
5
- port: 4173
5
+ port: 4173,
6
6
  },
7
7
  testDir: 'tests',
8
- testMatch: /(.+\.)?(test|spec)\.[jt]s/
8
+ testMatch: /(.+\.)?(test|spec)\.[jt]s/,
9
9
  };
10
10
 
11
11
  export default config;
postcss.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
- plugins: {
2
+ plugins: {
3
- tailwindcss: {},
3
+ tailwindcss: {},
4
- autoprefixer: {},
4
+ autoprefixer: {},
5
- },
5
+ },
6
- }
6
+ };
src/app.css CHANGED
@@ -1,3 +1,3 @@
1
1
  @tailwind base;
2
2
  @tailwind components;
3
- @tailwind utilities;
3
+ @tailwind utilities;
src/app.d.ts CHANGED
@@ -3,13 +3,13 @@
3
3
  import '@poppanator/sveltekit-svg/dist/svg';
4
4
 
5
5
  declare global {
6
- namespace App {
6
+ namespace App {
7
- // interface Error {}
7
+ // interface Error {}
8
- // interface Locals {}
8
+ // interface Locals {}
9
- // interface PageData {}
9
+ // interface PageData {}
10
- // interface PageState {}
10
+ // interface PageState {}
11
- // interface Platform {}
11
+ // interface Platform {}
12
- }
12
+ }
13
13
  }
14
14
 
15
- export { };
15
+ export {};
src/app.html CHANGED
@@ -1,23 +1,23 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
+ <head>
4
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-L1TPX7RGP2"></script>
5
+ <script>
6
+ window.dataLayer = window.dataLayer || [];
7
+ function gtag() {
8
+ dataLayer.push(arguments);
9
+ }
10
+ gtag('js', new Date());
3
11
 
4
- <head>
5
- <script async src="https://www.googletagmanager.com/gtag/js?id=G-L1TPX7RGP2"></script>
12
+ gtag('config', 'G-L1TPX7RGP2');
6
- <script>
13
+ </script>
7
- window.dataLayer = window.dataLayer || [];
8
- function gtag() { dataLayer.push(arguments); }
14
+ <meta charset="utf-8" />
15
+ <link rel="icon" type="image/png" href="%sveltekit.assets%/favicon.png" />
16
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
17
+ %sveltekit.head%
9
- gtag('js', new Date());
18
+ </head>
10
19
 
11
- gtag('config', 'G-L1TPX7RGP2');
12
- </script>
13
- <meta charset="utf-8" />
14
- <link rel="icon" type="image/png" href="%sveltekit.assets%/favicon.png" />
15
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
16
- %sveltekit.head%
17
- </head>
18
-
19
- <body class="min-h-screen flex flex-col" data-sveltekit-preload-data="hover">
20
+ <body class="min-h-screen flex flex-col" data-sveltekit-preload-data="hover">
20
- <div class="contents">%sveltekit.body%</div>
21
+ <div class="contents">%sveltekit.body%</div>
21
- </body>
22
+ </body>
22
-
23
- </html>
23
+ </html>
src/lib/assets/images/dark.png ADDED
Binary file
src/lib/assets/images/light.png ADDED
Binary file
src/lib/components/Footer.svelte CHANGED
@@ -1,5 +1,4 @@
1
1
  <script>
2
- import Icon from '@iconify/svelte';
3
2
  import SocialLinks from './SocialLinks.svelte';
4
3
  </script>
5
4
 
@@ -9,10 +8,15 @@
9
8
  <SocialLinks />
10
9
  </div>
11
10
  <div class="flex items-center justify-center mx-2">
12
- <span class="text-base text-gray-200 hover:no-underline mr-2"> powered by </span>
11
+ <span class="text-base text-gray-200 hover:no-underline mr-2"
12
+ >Copyright © {new Date().getFullYear()}
13
+ <a
14
+ class="decoration-2 underline underline-offset-2 font-medium hover:text-gray-400 hover:decoration-gray-400"
13
- <a href="https://kit.svelte.dev" target="_blank" rel="noopener noreferrer">
15
+ href="https://github.com/pyrossh"
16
+ >
14
- <Icon icon="logos:svelte-icon" height="36px" />
17
+ pyrossh
15
- </a>
18
+ </a>
19
+ </span>
16
20
  </div>
17
21
  </div>
18
22
  </footer>
src/lib/components/Intro.svelte ADDED
@@ -0,0 +1,8 @@
1
+ <h1 class="text-xl text-center sm:text-left lg:leading-tight mt-3">
2
+ The only bible app you will ever need
3
+ </h1>
4
+ <div class="text-center sm:text-left flex flex-col text-lg sm:mt-5">
5
+ <span>No ads,</span>
6
+ <span>No in-app purchases,</span>
7
+ <span>No distractions.</span>
8
+ </div>
src/lib/components/Slide.svelte CHANGED
@@ -1,7 +1,9 @@
1
1
  <script>
2
2
  import Icon from '@iconify/svelte';
3
3
  // let { title, link, children } = $props();
4
- export let title, link;
4
+ export let title,
5
+ link,
6
+ isExternal = true;
5
7
  </script>
6
8
 
7
9
  <article class="overflow-hidden rounded bg-[#f0ede2]">
@@ -10,8 +12,8 @@
10
12
  <a
11
13
  href={link}
12
14
  class="flex items-center text-lg font-semibold mb-2 text-black underline child-svg:mr-2"
13
- target="_blank"
15
+ target={isExternal ? '_blank' : ''}
14
- rel="noopener noreferrer"
16
+ rel={isExternal ? 'noopener noreferrer' : ''}
15
17
  >
16
18
  <slot name="icon">
17
19
  <Icon icon="mdi-github" class="mr-2" width="36" />
src/lib/dateUtils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const formatDate = (d) =>
2
- new Intl.DateTimeFormat('en-IN').format(new Date(d)).replaceAll('/', '-');
2
+ new Intl.DateTimeFormat('en-IN').format(new Date(d)).replaceAll('/', '-');
3
3
 
4
4
  export const formatDateLong = (d) =>
5
- new Intl.DateTimeFormat('en-IN', { dateStyle: 'long' }).format(new Date(d));
5
+ new Intl.DateTimeFormat('en-IN', { dateStyle: 'long' }).format(new Date(d));
src/posts/gopibot-to-the-rescue.md CHANGED
@@ -42,7 +42,7 @@ const bot_token = process.env.SLACK_BOT_TOKEN;
42
42
 
43
43
  const rtm = new RtmClient(bot_token);
44
44
  const COMMANDS = {
45
- web: 'ssh -i qa.pem user@url docker pull image-name && docker rm -f container-id && docker run -d image-name'
45
+ web: 'ssh -i qa.pem user@url docker pull image-name && docker rm -f container-id && docker run -d image-name',
46
46
  };
47
47
  let deploymentInProgress = false;
48
48
  let counter = 0;
@@ -56,7 +56,7 @@ rtm.on(RTM_EVENTS.MESSAGE, (event) => {
56
56
  ) {
57
57
  return rtm.sendMessage(
58
58
  'Please dont change the message and expect me to correct your past mistakes',
59
- event.channel
59
+ event.channel,
60
60
  );
61
61
  }
62
62
  if (event.subtype) {
@@ -69,7 +69,7 @@ rtm.on(RTM_EVENTS.MESSAGE, (event) => {
69
69
  counter = 0;
70
70
  return rtm.sendMessage(
71
71
  "Stop bugging me noob or I'll tell to raise you bugs",
72
- event.channel
72
+ event.channel,
73
73
  );
74
74
  }
75
75
  return rtm.sendMessage('I am already processing a deploy request please wait', event.channel);
@@ -108,14 +108,14 @@ rtm.on(RTM_EVENTS.MESSAGE, (event) => {
108
108
  counter = 0;
109
109
  return rtm.sendMessage(
110
110
  "Stop bugging me noob or I'll tell <@U30TXGLS1|gopi> to raise you bugs",
111
- event.channel
111
+ event.channel,
112
112
  );
113
113
  }
114
114
  return rtm.sendMessage(
115
115
  `command '${event.text} ' not found.You need to specify one of these commands [${COMMANDS.map(
116
- (v, k) => k
116
+ (v, k) => k,
117
117
  ).join(',')} ]`,
118
- event.channel
118
+ event.channel,
119
119
  );
120
120
  }
121
121
  }
src/routes/+page.svelte CHANGED
@@ -81,30 +81,13 @@
81
81
  <p>👾 A statically typed, functional programming language inspired by rust, koka.</p>
82
82
  <p>WIP to support compilation to WASM.</p>
83
83
  </Slide>
84
- <Slide title="onlybible.app" link="https://onlybible.app">
84
+ <Slide title="onlybible.app" link="/only-bible-app" isExternal={false}>
85
85
  <div slot="icon">
86
86
  <enhanced:img class="mr-2 w-9 rounded-xl" src={onlyBiblePng} alt="Only Bible App" />
87
87
  </div>
88
88
  <p>
89
89
  The only bible app you will ever need. No ads, No in-app purchases, No distractions.
90
90
  </p>
91
- <div class="flex mt-4">
92
- <a
93
- class="mr-2"
94
- href="https://play.google.com/store/apps/details?id=sh.pyros.only_bible_app"
95
- rel="noopener noreferrer"
96
- target="blank"
97
- >
98
- <PlayStoreIcon class="w-32" aria-label="Get it on Google Play" />
99
- </a>
100
- <a
101
- href="https://apps.apple.com/us/app/only-bible-app/id6467606465?itsct=apps_box_badge&amp;itscg=30200"
102
- rel="noopener noreferrer"
103
- target="blank"
104
- >
105
- <AppStoreIcon class="w-32" aria-label="Download on the App Store" />
106
- </a>
107
- </div>
108
91
  </Slide>
109
92
  <section>
110
93
  <div class="flex items-center">
src/routes/only-bible-app/+page.svelte ADDED
@@ -0,0 +1,55 @@
1
+ <script>
2
+ import PlayStoreIcon from '$lib/assets/icons/playstore.svg?component';
3
+ import AppStoreIcon from '$lib/assets/icons/appstore.svg?component';
4
+ import lightPng from '$lib/assets/images/light.png?enhanced';
5
+ import logoPng from '$lib/assets/logos/onlybible.png';
6
+ import Intro from '$lib/components/Intro.svelte';
7
+ </script>
8
+
9
+ <svelte:head>
10
+ <title>Only Bible App</title>
11
+ <meta name="description" content="The only bible app you will ever need" />
12
+ </svelte:head>
13
+
14
+ <div class="flex flex-col mx-4">
15
+ <div class="flex flex-1 flex-col sm:flex-row items-center sm:items-start">
16
+ <div class="flex flex-col items-center sm:items-start sm:mt-10">
17
+ <img class="mr-2 w-40 m-0 rounded-xl" src={logoPng} alt="Only Bible App" />
18
+ <div
19
+ class="flex flex-1 items-center text-5xl font-semibold no-underline focus:outline-none focus:ring-1 focus:ring-gray-600"
20
+ aria-label="Brand"
21
+ >
22
+ <div class="flex flex-1 mt-8">Only Bible App</div>
23
+ </div>
24
+ <div class="mb-4">
25
+ <Intro />
26
+ </div>
27
+ <div class="flex flex-col items-center sm:items-start">
28
+ <h3 class="m-0 my-4 font-semibold">Download it now.</h3>
29
+ <div class="flex flex-col sm:flex-row">
30
+ <a
31
+ class="mt-4 sm:mt-0 sm:mr-2"
32
+ href="https://play.google.com/store/apps/details?id=sh.pyros.only_bible_app"
33
+ rel="noopener noreferrer"
34
+ target="blank"
35
+ >
36
+ <PlayStoreIcon class="w-48 sm:w-44" />
37
+ </a>
38
+ <a
39
+ class="mt-8 sm:mt-0"
40
+ href="https://apps.apple.com/us/app/only-bible-app/id6467606465?itsct=apps_box_badge&amp;itscg=30200"
41
+ rel="noopener noreferrer"
42
+ target="blank"
43
+ >
44
+ <AppStoreIcon class="w-48 sm:w-44" />
45
+ </a>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ <div
50
+ class="not-prose flex items-center sm:flex-row [&>picture]:flex [&>picture]:justify-center sm:[&>picture]:justify-end mt-10 sm:mt-0"
51
+ >
52
+ <enhanced:img class="w-9/12" src={lightPng} alt="app screenshot" />
53
+ </div>
54
+ </div>
55
+ </div>
src/routes/only-bible-app/privacy-policy/+page.svelte ADDED
@@ -0,0 +1,20 @@
1
+ <svelte:head>
2
+ <title>Privacy Policy | Only Bible App</title>
3
+ </svelte:head>
4
+
5
+ <main class="prose mx-4">
6
+ <h1 class="text-center">Privacy Policy</h1>
7
+ <p>
8
+ Only Bible App does not collect any information about you or your usage of the app. It does not
9
+ send any information about you to anyone. It does not contain ads. It will never install
10
+ additional products on your device or change your device's configuration. No ads, No in-app
11
+ purchases, No distractions.
12
+ </p>
13
+ <h4>Changes to this Privacy Policy</h4>
14
+ I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically
15
+ for any changes. I will notify you of any changes by posting the new Privacy Policy on this page.
16
+ <p>This policy is effective as of <strong>2023-09-08</strong></p>
17
+ <h4>Contact Us</h4>
18
+ If you have any questions or suggestions for us you can contact us at
19
+ <strong>pyros2097@gmail.com</strong>
20
+ </main>
src/routes/only-bible-app/terms-and-conditions/+page.svelte ADDED
@@ -0,0 +1,38 @@
1
+ <svelte:head>
2
+ <title>Terms and Conditions | Only Bible App</title>
3
+ </svelte:head>
4
+
5
+ <main class="mx-4 pb-10">
6
+ <h1 class="text-center text-3xl">Terms and Conditions</h1>
7
+ <p>
8
+ By downloading or using the app, these terms will automatically apply to you – you should make
9
+ sure therefore that you read them carefully before using the app. You’re not allowed to copy or
10
+ modify the app, any part of the app, or our trademarks in any way. You’re not allowed to attempt
11
+ to extract the source code of the app, and you also shouldn’t try to translate the app into
12
+ other languages or make derivative versions. The app itself, and all the trademarks, copyright,
13
+ database rights, and other intellectual property rights related to it, still belong to us.
14
+ </p>
15
+ <p>
16
+ We are committed to ensuring that the app is as useful and efficient as possible. For that
17
+ reason, we reserve the right to make changes to the app or to charge for its services, at any
18
+ time and for any reason. We will never charge you for the app or its services without making it
19
+ very clear to you exactly what you’re paying for.
20
+ </p>
21
+ <p>
22
+ The Only Bible App app stores and processes personal data that you have provided to us, to
23
+ provide my Service. It’s your responsibility to keep your phone and access to the app secure. We
24
+ therefore recommend that you do not jailbreak or root your phone, which is the process of
25
+ removing software restrictions and limitations imposed by the official operating system of your
26
+ device. It could make your phone vulnerable to malware/viruses/malicious programs, compromise
27
+ your phone’s security features and it could mean that the Only Bible App app won’t work properly
28
+ or at all.
29
+ </p>
30
+ <h4>Changes to this Terms and conditions</h4>
31
+ I may update our Terms and conditions from time to time. Thus, you are advised to review this page
32
+ periodically for any changes. I will notify you of any changes by posting the new Terms and conditions
33
+ on this page.
34
+ <p>This policy is effective as of <strong>2023-09-08</strong></p>
35
+ <h4>Contact Us</h4>
36
+ If you have any questions or suggestions for us you can contact us at
37
+ <strong>pyros2097@gmail.com</strong>
38
+ </main>
src/routes/posts/+page.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export const load = async ({ params }) => {
2
- const paths = import.meta.glob('/src/posts/*.md', { eager: true });
2
+ const paths = import.meta.glob('/src/posts/*.md', { eager: true });
3
- const posts = Object.keys(paths)
3
+ const posts = Object.keys(paths)
4
- .map((key) => ({ ...paths[key].metadata, slug: key.split('/').at(-1).replace('.md', '') }))
4
+ .map((key) => ({ ...paths[key].metadata, slug: key.split('/').at(-1).replace('.md', '') }))
5
- .sort((first, second) => new Date(second.date).getTime() - new Date(first.date).getTime());
5
+ .sort((first, second) => new Date(second.date).getTime() - new Date(first.date).getTime());
6
- return { posts };
6
+ return { posts };
7
7
  };
src/routes/posts/[slug]/+page.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { error } from '@sveltejs/kit';
2
2
 
3
3
  export async function load({ params }) {
4
- try {
4
+ try {
5
- const post = await import(`../../../posts/${params.slug}.md`);
5
+ const post = await import(`../../../posts/${params.slug}.md`);
6
- return {
6
+ return {
7
- content: post.default,
7
+ content: post.default,
8
- meta: post.metadata
8
+ meta: post.metadata,
9
- };
9
+ };
10
- } catch (e) {
10
+ } catch (e) {
11
- error(404, `Could not find ${params.slug}`);
11
+ error(404, `Could not find ${params.slug}`);
12
- }
12
+ }
13
13
  }
src/routes/sitemap.xml/+server.js CHANGED
@@ -3,13 +3,10 @@ import * as sitemap from 'super-sitemap';
3
3
  export const prerender = true;
4
4
 
5
5
  export async function GET() {
6
- return await sitemap.response({
6
+ return await sitemap.response({
7
- origin: 'https://pyrossh.dev',
7
+ origin: 'https://pyrossh.dev',
8
- paramValues: {
8
+ paramValues: {
9
- '/posts/[slug]': [
10
- 'eyecandy-golang-error-reporting',
9
+ '/posts/[slug]': ['eyecandy-golang-error-reporting', 'gopibot-to-the-rescue'],
11
- 'gopibot-to-the-rescue',
12
- ]
10
+ },
11
+ });
13
- }
12
+ }
14
- });
15
- };
svelte.config.js CHANGED
@@ -6,38 +6,38 @@ import { getHighlighter } 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/pyros.sh'
14
+ repository: 'https://github.com/pyrossh/pyros.sh',
15
- }
15
+ },
16
- ]
17
- ],
16
+ ],
17
+ ],
18
- highlight: {
18
+ highlight: {
19
- highlighter: async (code, lang = 'text') => {
19
+ highlighter: async (code, lang = 'text') => {
20
- const highlighter = await getHighlighter({
20
+ const highlighter = await getHighlighter({
21
- themes: ['dracula'],
21
+ themes: ['dracula'],
22
- langs: ['javascript', 'typescript', 'go']
22
+ langs: ['javascript', 'typescript', 'go'],
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
41
  };
42
42
 
43
43
  export default config;
tailwind.config.js CHANGED
@@ -1,72 +1,67 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
  export default {
3
- content: [
4
- './src/**/*.{html,js,svelte,ts}',
5
- ],
6
- theme: {
7
- fontFamily: {
8
- sans: 'system-ui',
9
- serif: 'system-ui',
10
- mono: 'monospace',
11
- logo: 'cursive'
12
- },
13
- extend: {
14
- typography: ({ theme }) => ({
15
- DEFAULT: {
16
- css: {
17
- maxWidth: "70rem",
18
- h1: {
19
- fontWeight: "500",
20
- marginTop: "1rem",
21
- },
22
- h2: {
23
- color: theme('colors.black'),
24
- },
25
- pre: {
26
- padding: "16px",
27
- borderRadius: "16px",
28
- fontSize: "0.8rem",
29
- fontFamily: "monospace",
30
- },
31
- '--tw-prose-body': theme('colors.black'),
32
- '--tw-prose-headings': theme('colors.gray[100]'),
33
- '--tw-prose-lead': theme('colors.black'),
34
- '--tw-prose-links': theme('colors.blue[900]'),
35
- '--tw-prose-bold': theme('colors.black'),
36
- '--tw-prose-counters': theme('colors.black'),
37
- '--tw-prose-bullets': theme('colors.black'),
38
- '--tw-prose-hr': theme('colors.black'),
39
- '--tw-prose-quotes': theme('colors.black'),
40
- '--tw-prose-quote-borders': theme('colors.black'),
41
- '--tw-prose-captions': theme('colors.black'),
42
- '--tw-prose-code': theme('colors.black'),
43
- '--tw-prose-pre-code': theme('colors.black'),
44
- '--tw-prose-pre-bg': theme('colors.black'),
45
- '--tw-prose-th-borders': theme('colors.black'),
46
- '--tw-prose-td-borders': theme('colors.black'),
47
- '--tw-prose-invert-body': theme('colors.black'),
48
- '--tw-prose-invert-headings': theme('colors.white'),
49
- '--tw-prose-invert-lead': theme('colors.black'),
50
- '--tw-prose-invert-links': theme('colors.blue[900]'),
51
- '--tw-prose-invert-bold': theme('colors.white'),
52
- '--tw-prose-invert-counters': theme('colors.black'),
53
- '--tw-prose-invert-bullets': theme('colors.black'),
54
- '--tw-prose-invert-hr': theme('colors.black'),
55
- '--tw-prose-invert-quotes': theme('colors.black'),
56
- '--tw-prose-invert-quote-borders': theme('colors.black'),
57
- '--tw-prose-invert-captions': theme('colors.black'),
58
- '--tw-prose-invert-code': theme('colors.white'),
59
- '--tw-prose-invert-pre-code': theme('colors.black'),
60
- '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
61
- '--tw-prose-invert-th-borders': theme('colors.black'),
62
- '--tw-prose-invert-td-borders': theme('colors.black'),
63
- },
64
- },
65
- }),
66
- },
67
- },
68
- plugins: [
69
- require('@tailwindcss/typography'),
70
- ],
71
- }
72
-
3
+ content: ['./src/**/*.{html,js,svelte,ts}'],
4
+ theme: {
5
+ fontFamily: {
6
+ sans: 'system-ui',
7
+ serif: 'system-ui',
8
+ mono: 'monospace',
9
+ logo: 'cursive',
10
+ },
11
+ extend: {
12
+ typography: ({ theme }) => ({
13
+ DEFAULT: {
14
+ css: {
15
+ maxWidth: '70rem',
16
+ h1: {
17
+ fontWeight: '500',
18
+ marginTop: '1rem',
19
+ },
20
+ h2: {
21
+ color: theme('colors.black'),
22
+ },
23
+ pre: {
24
+ padding: '16px',
25
+ borderRadius: '16px',
26
+ fontSize: '0.8rem',
27
+ fontFamily: 'monospace',
28
+ },
29
+ '--tw-prose-body': theme('colors.black'),
30
+ '--tw-prose-headings': theme('colors.gray[100]'),
31
+ '--tw-prose-lead': theme('colors.black'),
32
+ '--tw-prose-links': theme('colors.blue[900]'),
33
+ '--tw-prose-bold': theme('colors.black'),
34
+ '--tw-prose-counters': theme('colors.black'),
35
+ '--tw-prose-bullets': theme('colors.black'),
36
+ '--tw-prose-hr': theme('colors.black'),
37
+ '--tw-prose-quotes': theme('colors.black'),
38
+ '--tw-prose-quote-borders': theme('colors.black'),
39
+ '--tw-prose-captions': theme('colors.black'),
40
+ '--tw-prose-code': theme('colors.black'),
41
+ '--tw-prose-pre-code': theme('colors.black'),
42
+ '--tw-prose-pre-bg': theme('colors.black'),
43
+ '--tw-prose-th-borders': theme('colors.black'),
44
+ '--tw-prose-td-borders': theme('colors.black'),
45
+ '--tw-prose-invert-body': theme('colors.black'),
46
+ '--tw-prose-invert-headings': theme('colors.white'),
47
+ '--tw-prose-invert-lead': theme('colors.black'),
48
+ '--tw-prose-invert-links': theme('colors.blue[900]'),
49
+ '--tw-prose-invert-bold': theme('colors.white'),
50
+ '--tw-prose-invert-counters': theme('colors.black'),
51
+ '--tw-prose-invert-bullets': theme('colors.black'),
52
+ '--tw-prose-invert-hr': theme('colors.black'),
53
+ '--tw-prose-invert-quotes': theme('colors.black'),
54
+ '--tw-prose-invert-quote-borders': theme('colors.black'),
55
+ '--tw-prose-invert-captions': theme('colors.black'),
56
+ '--tw-prose-invert-code': theme('colors.white'),
57
+ '--tw-prose-invert-pre-code': theme('colors.black'),
58
+ '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
59
+ '--tw-prose-invert-th-borders': theme('colors.black'),
60
+ '--tw-prose-invert-td-borders': theme('colors.black'),
61
+ },
62
+ },
63
+ }),
64
+ },
65
+ },
66
+ plugins: [require('@tailwindcss/typography')],
67
+ };
tests/sitemap.test.js CHANGED
@@ -1,27 +1,27 @@
1
1
  import { expect, test } from '@playwright/test';
2
2
 
3
3
  test('/sitemap.xml is valid', async ({ page }) => {
4
- const response = await page.goto('/sitemap.xml');
4
+ const response = await page.goto('/sitemap.xml');
5
- expect(response.status()).toBe(200);
5
+ expect(response.status()).toBe(200);
6
6
 
7
- // Ensure XML is valid. Playwright parses the XML here and will error if it
7
+ // Ensure XML is valid. Playwright parses the XML here and will error if it
8
- // cannot be parsed.
8
+ // cannot be parsed.
9
- const urls = await page.$$eval('url', (urls) =>
9
+ const urls = await page.$$eval('url', (urls) =>
10
- urls.map((url) => ({
10
+ urls.map((url) => ({
11
- loc: url.querySelector('loc').textContent,
11
+ loc: url.querySelector('loc').textContent,
12
- // changefreq: url.querySelector('changefreq').textContent, // if you enabled in your sitemap
12
+ // changefreq: url.querySelector('changefreq').textContent, // if you enabled in your sitemap
13
- // priority: url.querySelector('priority').textContent,
13
+ // priority: url.querySelector('priority').textContent,
14
- }))
14
+ })),
15
- );
15
+ );
16
16
 
17
- // Sanity check
17
+ // Sanity check
18
- expect(urls.length).toBeGreaterThanOrEqual(5);
18
+ expect(urls.length).toBeGreaterThanOrEqual(5);
19
19
 
20
- // Ensure entries are in a valid format.
20
+ // Ensure entries are in a valid format.
21
- for (const url of urls) {
21
+ for (const url of urls) {
22
- expect(url.loc).toBeTruthy();
22
+ expect(url.loc).toBeTruthy();
23
- expect(() => new URL(url.loc)).not.toThrow();
23
+ expect(() => new URL(url.loc)).not.toThrow();
24
- // expect(url.changefreq).toBe('daily');
24
+ // expect(url.changefreq).toBe('daily');
25
- // expect(url.priority).toBe('0.7');
25
+ // expect(url.priority).toBe('0.7');
26
- }
26
+ }
27
- });
27
+ });
tests/test.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { expect, test } from '@playwright/test';
2
2
 
3
3
  test('index page has expected h1', async ({ page }) => {
4
- await page.goto('/');
4
+ await page.goto('/');
5
- await expect(page.getByRole('heading', { name: 'pyrossh' })).toBeVisible();
5
+ await expect(page.getByRole('heading', { name: 'pyrossh' })).toBeVisible();
6
6
  });
vite.config.js CHANGED
@@ -1,15 +1,11 @@
1
1
  import { enhancedImages } from '@sveltejs/enhanced-img';
2
2
  import { sveltekit } from '@sveltejs/kit/vite';
3
- import svg from '@poppanator/sveltekit-svg'
3
+ import svg from '@poppanator/sveltekit-svg';
4
4
  import { defineConfig } from 'vitest/config';
5
5
 
6
6
  export default defineConfig({
7
- plugins: [
8
- enhancedImages(),
7
+ plugins: [enhancedImages(), sveltekit(), svg()],
9
- sveltekit(),
10
- svg(),
11
- ],
12
- test: {
8
+ test: {
13
- include: ['src/**/*.{test,spec}.{js,ts}']
9
+ include: ['src/**/*.{test,spec}.{js,ts}'],
14
- }
10
+ },
15
11
  });