Skip to content

Commit 59dce5c

Browse files
Merge remote-tracking branch 'origin/master' into leetcode
2 parents dd55464 + c8d6756 commit 59dce5c

File tree

12 files changed

+545
-288
lines changed

12 files changed

+545
-288
lines changed

astro.config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import sitemap from '@astrojs/sitemap'
44
import tailwindcss from '@tailwindcss/vite'
55
import { defineConfig } from 'astro/config'
66

7-
const parsePublishTime: RemarkPlugin = () => (tree, file) => {
7+
const parsePublishTime: RemarkPlugin = () => (_tree, file) => {
88
const maybeDateString = /\d+-\d+-\d+/.exec(file.path)
99
let authorOffsetDate = null
1010
if (maybeDateString) {

lostpixel.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ function pagePaths(): string[] {
3333
)
3434
const urlsRe = new RegExp(`${siteUrl}(/[^<]*)`, 'g')
3535
return Array.from(sitemapXml.matchAll(urlsRe)).map(([, url]) =>
36-
url.replaceAll('&amp;', '&'),
36+
// biome-ignore lint/style/noNonNullAssertion: guaranteed group at this point
37+
url!.replaceAll('&amp;', '&'),
3738
)
3839
}
3940

package-lock.json

Lines changed: 473 additions & 243 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,26 @@
2121
"private": true,
2222
"homepage": "https://github.com/john-kurkowski/john-kurkowski.github.io#readme",
2323
"dependencies": {
24-
"@astrojs/mdx": "^4.2.3",
24+
"@astrojs/mdx": "^4.2.6",
2525
"@astrojs/rss": "^4.0.11",
26-
"@astrojs/sitemap": "^3.3.0",
27-
"@tailwindcss/vite": "^4.1.0",
28-
"astro": "^5.5.6",
29-
"tailwindcss": "^4.1.0"
26+
"@astrojs/sitemap": "^3.3.1",
27+
"@tailwindcss/vite": "^4.1.5",
28+
"astro": "^5.7.10",
29+
"tailwindcss": "^4.1.5"
3030
},
3131
"devDependencies": {
3232
"@biomejs/biome": "^1.9.4",
33-
"@types/culori": "^2.1.1",
34-
"@types/node": "^22.13.17",
33+
"@types/culori": "^4.0.0",
34+
"@types/node": "^22.15.3",
3535
"culori": "^4.0.1",
3636
"husky": "^9.1.7",
37-
"lint-staged": "^15.5.0",
37+
"lint-staged": "^15.5.1",
3838
"lost-pixel": "^3.22.0",
3939
"prettier": "^3.5.3",
40-
"stylelint": "^16.17.0",
40+
"stylelint": "^16.19.1",
4141
"stylelint-config-html": "^1.1.0",
42-
"stylelint-config-standard": "^37.0.0",
43-
"typescript": "^5.8.2"
42+
"stylelint-config-standard": "^38.0.0",
43+
"typescript": "^5.8.3"
4444
},
4545
"lint-staged": {
4646
"*.css": ["stylelint --fix", "biome check --write"],

src/components/layouts/base.astro

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import { ClientRouter } from 'astro:transitions'
3+
import { siteMetadata } from '../../config/site'
34
45
import '../../css/main.css'
56
@@ -8,18 +9,18 @@ import Nav from './Nav.astro'
89
import Seo from './Seo.astro'
910
1011
const frontmatter = Astro.props.frontmatter || {}
11-
12-
const siteMetadata = {
13-
description:
14-
'With 14+ years in the game, I help frontend teams ship incrementally, with test coverage confidence, without rewrites. Debug any app, existing or legacy. Collaborate on distributed teams via docs, code review, and mentorship.',
15-
title: 'John Kurkowski - Senior Full Stack Web Developer',
16-
url: '/',
17-
}
1812
---
1913

2014
<html class='bg-secondary' lang='en-US'>
2115
<head>
22-
<Seo frontmatter={frontmatter} siteMetadata={siteMetadata} />
16+
<Seo frontmatter={frontmatter} siteMetadata={{ ...siteMetadata, url: '/' }} />
17+
<link rel="sitemap" href="/sitemap-index.xml" />
18+
<link
19+
href="/rss.xml"
20+
rel="alternate"
21+
title={siteMetadata.title}
22+
type="application/rss+xml"
23+
/>
2324
<ClientRouter />
2425
</head>
2526
<body>

src/config/site.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const siteMetadata = {
2+
description:
3+
'With 14+ years in the game, I help frontend teams ship incrementally, with test coverage confidence, without rewrites. Debug any app, existing or legacy. Collaborate on distributed teams via docs, code review, and mentorship.',
4+
title: 'John Kurkowski - Senior Full Stack Web Developer',
5+
} as const

src/pages/posts/[...slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import { getCollection, render } from 'astro:content'
33
4-
import { slugify } from './index.astro'
4+
import { slugify } from '../../utils/content'
55
66
export async function getStaticPaths() {
77
const blogEntries = await getCollection('posts')

src/pages/posts/index.astro

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,7 @@
11
---
2-
import Layout from '../../components/layouts/base.astro'
3-
4-
import type { CollectionEntry } from 'astro:content'
52
import { getCollection } from 'astro:content'
6-
7-
/**
8-
* Converts filename to a URL-safe slug.
9-
*
10-
* To preserve URLs this project has used for years, the return value differs
11-
* slightly from Astro's default `entry.id`. For example, the `&` character is
12-
* preserved.
13-
*/
14-
export function slugify(entry: CollectionEntry) {
15-
const maybeFilenameNoDateNoExt = /\d+-\d+-\d+-(.+)\./.exec(entry.filePath)
16-
if (!maybeFilenameNoDateNoExt) {
17-
throw new Error(`Invalid posts filename: ${entry.filePath}`)
18-
}
19-
20-
const [, filenameNoDateNoExt] = maybeFilenameNoDateNoExt
21-
return filenameNoDateNoExt
22-
}
3+
import Layout from '../../components/layouts/base.astro'
4+
import { slugify } from '../../utils/content'
235
246
const frontmatter = {
257
title: 'Articles',

src/pages/rss.xml.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { getCollection } from 'astro:content'
2+
import rss from '@astrojs/rss'
3+
import type { APIContext } from 'astro'
4+
import { siteMetadata } from '../config/site'
5+
import { slugify } from '../utils/content'
6+
7+
export async function GET(context: APIContext) {
8+
const posts = await getCollection('posts')
9+
return rss({
10+
title: siteMetadata.title,
11+
description: siteMetadata.description,
12+
site: context.site?.toString() ?? '',
13+
items: posts.map((post) => ({
14+
...post.data,
15+
link: `/posts/${slugify(post)}`,
16+
})),
17+
})
18+
}

src/scripts/oklch2rgb.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ import * as culori from 'culori'
1616
function oklch2rgb(oklchString: string): string {
1717
// biome-ignore lint/style/noNonNullAssertion: guaranteed to match when called in require.main
1818
const [, valuesString] = oklchString.match(/oklch\((.*?)\)/)!
19-
const values = valuesString.split('/').map((v) => Number.parseFloat(v))
19+
// biome-ignore lint/style/noNonNullAssertion: guaranteed group at this point
20+
const values = valuesString!.split('/').map((v) => Number.parseFloat(v))
2021

2122
const [l, c, h, alpha] = values
2223

2324
const parsed = culori.oklch({
2425
mode: 'oklch',
25-
l: l,
26+
l: l || 0,
2627
c: c || 0,
2728
h: h || 0,
2829
alpha: alpha !== undefined ? alpha : 1,

0 commit comments

Comments
 (0)