1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-28 16:48:00 +02:00

bump astro

This commit is contained in:
Matthias Kretschmann 2023-08-30 20:58:04 +01:00
parent 9d301a4fab
commit d88f242f27
Signed by: m
GPG Key ID: 606EEEF3C479A91F
5 changed files with 1483 additions and 1538 deletions

2978
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,11 +23,11 @@
"new": "ts-node scripts/new.ts"
},
"dependencies": {
"@astrojs/react": "^2.3.2",
"@astrojs/rss": "^2.4.4",
"@astrojs/sitemap": "^2.0.2",
"@astrojs/react": "^3.0.0",
"@astrojs/rss": "^3.0.0",
"@astrojs/sitemap": "^3.0.0",
"@rainbow-me/rainbowkit": "^1.0.9",
"astro": "^2.10.15",
"astro": "^3.0.2",
"classnames": "^2.3.2",
"date-fns": "^2.30.0",
"dms2dec": "^1.1.0",
@ -43,11 +43,7 @@
"react-clipboard.js": "^2.0.16",
"react-dom": "^18.2.0",
"react-feather": "^2.0.10",
"rehype-react": "^7.2.0",
"remark-parse": "^10.0.2",
"remark-rehype": "^10.1.0",
"slugify": "^1.6.6",
"unified": "^11.0.2",
"use-debounce": "^9.0.4",
"viem": "^1.9.0",
"wagmi": "^1.3.10"

View File

@ -28,7 +28,7 @@ const canonicalURL = Astro.site + Astro.url.pathname.replace('/', '')
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />

View File

@ -1,19 +1,8 @@
---
type Props = {
body: string
}
// Extract lead paragraph from content
// Grab everything before more tag, or just first paragraph
let lead
const content = Astro.props.body
const separator = '<!-- more -->'
if (content.includes(separator)) {
lead = content.split(separator)[0]
} else {
lead = content.split('\n')[0]
lead: string
}
const { lead } = Astro.props
---
<style>

View File

@ -7,8 +7,18 @@ import Lead from './Lead.astro'
type Props = CollectionEntry<'articles' | 'links' | 'photos'>
const { collection, body } = Astro.props
console.log(Astro.props)
const { title, date, updated, image, linkurl } = Astro.props.data
// Extract lead paragraph from content
// Grab everything before more tag, or just first paragraph
let lead
const separator = '<!-- more -->'
if (collection === 'articles') {
lead = body.includes(separator)
? body.split(separator)[0]
: body.split('\n')[0]
}
---
<style>
@ -37,7 +47,7 @@ const { title, date, updated, image, linkurl } = Astro.props.data
<Title linkurl={linkurl} title={title} date={date} updated={updated} />
</header>
{collection === 'articles' && <Lead body={body} />}
{lead && <Lead lead={lead} />}
<div class="hero-image">
{image && <img width={1020} height={510} src={image} alt="" />}