astro-pure 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/advanced/GithubCard.astro +4 -4
- package/components/basic/Header.astro +1 -1
- package/components/basic/ThemeProvider.astro +2 -2
- package/components/pages/PostPreview.astro +68 -73
- package/components/pages/TOC.astro +2 -2
- package/components/pages/TOCHeading.astro +2 -2
- package/components/user/Button.astro +1 -1
- package/components/user/MdxRepl.astro +2 -2
- package/components/user/Steps.astro +1 -1
- package/components/user/Timeline.astro +1 -1
- package/package.json +4 -4
|
@@ -29,13 +29,13 @@ const [owner, repoName] = repo.split('/')
|
|
|
29
29
|
<div class='flex items-center gap-x-1 max-sm:flex-wrap'>
|
|
30
30
|
<span class='truncate text-base transition-colors sm:text-lg'>{owner}</span>
|
|
31
31
|
<span class='text-muted-foreground max-sm:hidden'>/</span>
|
|
32
|
-
<span class='truncate text-base font-
|
|
32
|
+
<span class='truncate text-base font-medium transition-colors sm:text-lg max-sm:w-full'
|
|
33
33
|
>{repoName}</span
|
|
34
34
|
>
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
38
|
-
<div class='flex-shrink-0 rounded-full bg-
|
|
38
|
+
<div class='flex-shrink-0 rounded-full bg-card p-1'>
|
|
39
39
|
<Icon name='github' />
|
|
40
40
|
</div>
|
|
41
41
|
</div>
|
|
@@ -83,7 +83,7 @@ const [owner, repoName] = repo.split('/')
|
|
|
83
83
|
.loading .load-block {
|
|
84
84
|
color: transparent;
|
|
85
85
|
border-radius: calc(var(--radius) - 3px);
|
|
86
|
-
background-color: hsl(var(--
|
|
86
|
+
background-color: hsl(var(--card) / var(--un-bg-opacity, 1));
|
|
87
87
|
animation: pulsate 2s infinite linear;
|
|
88
88
|
user-select: none;
|
|
89
89
|
}
|
|
@@ -94,7 +94,7 @@ const [owner, repoName] = repo.split('/')
|
|
|
94
94
|
opacity: 0.5;
|
|
95
95
|
}
|
|
96
96
|
:not(.loading) #gh-avatar {
|
|
97
|
-
background-color: hsl(var(--
|
|
97
|
+
background-color: hsl(var(--card) / var(--un-bg-opacity));
|
|
98
98
|
}
|
|
99
99
|
</style>
|
|
100
100
|
|
|
@@ -8,7 +8,7 @@ import { Icon } from '../user'
|
|
|
8
8
|
class='group sticky top-4 z-50 max-md:z-30 mb-12 flex items-center justify-between rounded-xl border border-transparent max-sm:py-1 sm:rounded-2xl'
|
|
9
9
|
>
|
|
10
10
|
<a
|
|
11
|
-
class='z-30 text-xl font-
|
|
11
|
+
class='z-30 text-xl font-medium group-[.not-top]:ms-2 sm:group-[.not-top]:ms-3'
|
|
12
12
|
style='transition:margin-inline 0.3s'
|
|
13
13
|
href='/'
|
|
14
14
|
aria-label='Brand'>{config.title}</a
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
listenThemeChange()
|
|
28
28
|
// Listen for toast event
|
|
29
29
|
document.addEventListener('toast', (e) => {
|
|
30
|
-
const { message } = (e as CustomEvent).detail
|
|
30
|
+
const { message, time } = (e as CustomEvent).detail
|
|
31
31
|
const toast = document.createElement('div')
|
|
32
32
|
toast.className =
|
|
33
33
|
'animate fixed bottom-8 z-20 px-4 py-2 bg-muted text-foreground rounded-lg border shadow-lg flex items-center gap-2'
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
document.body.appendChild(toast)
|
|
36
36
|
setTimeout(() => {
|
|
37
37
|
toast.remove()
|
|
38
|
-
}, 3000)
|
|
38
|
+
}, time || 3000)
|
|
39
39
|
})
|
|
40
40
|
</script>
|
|
@@ -6,26 +6,20 @@ import type { HTMLTag, Polymorphic } from 'astro/types'
|
|
|
6
6
|
import { cn } from '../../utils'
|
|
7
7
|
import { Button, FormattedDate, Icon } from '../user'
|
|
8
8
|
|
|
9
|
-
type Props<
|
|
10
|
-
post: CollectionEntry<
|
|
9
|
+
type Props<T extends CollectionKey> = {
|
|
10
|
+
post: CollectionEntry<T>
|
|
11
11
|
detailed?: boolean
|
|
12
12
|
class?: string
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const {
|
|
16
|
-
|
|
15
|
+
const { post, detailed = false, class: className } = Astro.props
|
|
17
16
|
const { id, data } = post
|
|
18
|
-
|
|
19
17
|
const { remarkPluginFrontmatter } = await render(post)
|
|
20
18
|
const postDate = data.updatedDate ?? data.publishDate
|
|
21
19
|
---
|
|
22
20
|
|
|
23
21
|
<li
|
|
24
|
-
class={cn(
|
|
25
|
-
'post-preview group/card flex flex-col relative rounded-2xl border bg-background transition-colors ease-in-out px-5 py-2.5 hover:bg-muted',
|
|
26
|
-
detailed && 'max-sm:px-4 sm:py-5',
|
|
27
|
-
className
|
|
28
|
-
)}
|
|
22
|
+
class={cn('post-preview', className)}
|
|
29
23
|
style={detailed &&
|
|
30
24
|
data.heroImage?.color &&
|
|
31
25
|
`--preview-highlight:color-mix(in srgb,${data.heroImage.color} 40%,hsl(var(--foreground)/var(--un-text-opacity,1)));
|
|
@@ -33,8 +27,8 @@ const postDate = data.updatedDate ?? data.publishDate
|
|
|
33
27
|
>
|
|
34
28
|
<a
|
|
35
29
|
class={cn(
|
|
36
|
-
'
|
|
37
|
-
|
|
30
|
+
'block w-full relative group rounded-2xl border bg-background transition-colors ease-in-out px-5 py-2.5 hover:bg-muted hover:text-primary',
|
|
31
|
+
detailed && 'max-sm:px-4 sm:py-5',
|
|
38
32
|
detailed && data.heroImage && 'max-md:pt-24'
|
|
39
33
|
)}
|
|
40
34
|
href={`/blog/${id}`}
|
|
@@ -44,18 +38,20 @@ const postDate = data.updatedDate ?? data.publishDate
|
|
|
44
38
|
detailed && data.heroImage && (
|
|
45
39
|
<Image
|
|
46
40
|
alt={data.heroImage.alt || data.title}
|
|
47
|
-
class='cover-image absolute end-0 top-0 z-0 h-2/3 w-full rounded-2xl object-cover opacity-50 transition-opacity duration-300 group-hover
|
|
41
|
+
class='cover-image absolute end-0 top-0 z-0 h-2/3 w-full rounded-2xl object-cover opacity-50 transition-opacity duration-300 group-hover:opacity-70 md:h-full md:w-3/5'
|
|
48
42
|
loading='eager'
|
|
49
43
|
{...data.heroImage}
|
|
50
44
|
/>
|
|
51
45
|
)
|
|
52
46
|
}
|
|
47
|
+
<div
|
|
48
|
+
class={cn('relative flex flex-col gap-1', !detailed && 'sm:flex-row sm:items-center')}
|
|
49
|
+
style='z-index:1'
|
|
50
|
+
>
|
|
51
|
+
<FormattedDate class='min-w-[95px] text-xs' date={postDate} />
|
|
53
52
|
|
|
54
|
-
<FormattedDate class='min-w-[95px] py-1 text-xs' date={postDate} />
|
|
55
|
-
|
|
56
|
-
<Tag class='z-10 flex-grow'>
|
|
57
53
|
{/* title */}
|
|
58
|
-
<div class='flex justify-between'>
|
|
54
|
+
<div class='flex justify-between flex-grow'>
|
|
59
55
|
<div class={detailed && 'font-medium'}>
|
|
60
56
|
{data.draft && <span class='text-red-500'>(Draft) </span>}
|
|
61
57
|
{data.title}
|
|
@@ -69,16 +65,16 @@ const postDate = data.updatedDate ?? data.publishDate
|
|
|
69
65
|
stroke-width='2.5'
|
|
70
66
|
stroke-linecap='round'
|
|
71
67
|
stroke-linejoin='round'
|
|
72
|
-
class='preview-redirect my-1 stroke-muted-foreground group-hover
|
|
68
|
+
class='preview-redirect my-1 stroke-muted-foreground group-hover:stroke-primary'
|
|
73
69
|
><line
|
|
74
70
|
x1='5'
|
|
75
71
|
y1='12'
|
|
76
72
|
x2='19'
|
|
77
73
|
y2='12'
|
|
78
|
-
class='translate-x-4 scale-x-0 transition-all duration-300 ease-in-out group-hover
|
|
74
|
+
class='translate-x-4 scale-x-0 transition-all duration-300 ease-in-out group-hover:translate-x-1 group-hover:scale-x-100'
|
|
79
75
|
></line><polyline
|
|
80
76
|
points='12 5 19 12 12 19'
|
|
81
|
-
class='translate-x-0 transition-all duration-300 ease-in-out group-hover
|
|
77
|
+
class='translate-x-0 transition-all duration-300 ease-in-out group-hover:translate-x-1'
|
|
82
78
|
></polyline></svg
|
|
83
79
|
>
|
|
84
80
|
</div>
|
|
@@ -88,13 +84,13 @@ const postDate = data.updatedDate ?? data.publishDate
|
|
|
88
84
|
{/* desc */}
|
|
89
85
|
<p
|
|
90
86
|
class={cn(
|
|
91
|
-
'line-clamp-2
|
|
87
|
+
'line-clamp-2 text-sm text-muted-foreground sm:line-clamp-3',
|
|
92
88
|
data.heroImage && 'sm:me-24'
|
|
93
89
|
)}
|
|
94
90
|
>
|
|
95
91
|
{data.description}
|
|
96
92
|
</p>
|
|
97
|
-
<div class='flex items-center gap-2
|
|
93
|
+
<div class='py-2 flex items-center gap-2 text-sm italic leading-4 text-muted-foreground'>
|
|
98
94
|
{/* reading time */}
|
|
99
95
|
<span class='flex items-center gap-1'>
|
|
100
96
|
<Icon name='time' class='size-4' />
|
|
@@ -108,67 +104,66 @@ const postDate = data.updatedDate ?? data.publishDate
|
|
|
108
104
|
</span>
|
|
109
105
|
)}
|
|
110
106
|
</div>
|
|
107
|
+
{data.tags.length > 0 && (
|
|
108
|
+
<object>
|
|
109
|
+
<ul class='tag-list mt-1 flex gap-2'>
|
|
110
|
+
{data.tags.map((tag: string) => (
|
|
111
|
+
<li>
|
|
112
|
+
<Button as='a' title={tag} href={`/tags/${tag}`} variant='pill' />
|
|
113
|
+
</li>
|
|
114
|
+
))}
|
|
115
|
+
</ul>
|
|
116
|
+
</object>
|
|
117
|
+
)}
|
|
111
118
|
</>
|
|
112
119
|
)
|
|
113
120
|
}
|
|
114
|
-
</
|
|
121
|
+
</div>
|
|
115
122
|
</a>
|
|
116
|
-
<!-- tags -->
|
|
117
|
-
{
|
|
118
|
-
detailed && data.tags && (
|
|
119
|
-
<ul class='tag-list mt-1 flex flex-wrap gap-2'>
|
|
120
|
-
{data.tags.map((tag: string) => (
|
|
121
|
-
<li>
|
|
122
|
-
<Button title={tag} href={`/tags/${tag}`} variant='pill' />
|
|
123
|
-
</li>
|
|
124
|
-
))}
|
|
125
|
-
</ul>
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
</li>
|
|
129
123
|
|
|
130
|
-
<style>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
.post-preview:hover {
|
|
138
|
-
&,
|
|
139
|
-
& .tag-list a {
|
|
140
|
-
background-color: var(
|
|
141
|
-
--preview-highlight-bg,
|
|
142
|
-
hsl(var(--muted) / var(--un-bg-opacity, 1))
|
|
143
|
-
) !important;
|
|
144
|
-
}
|
|
145
|
-
& > a,
|
|
146
|
-
& .tag-list a:hover {
|
|
147
|
-
color: var(--preview-highlight-final) !important;
|
|
124
|
+
<style>
|
|
125
|
+
.post-preview {
|
|
126
|
+
--preview-highlight-final: var(
|
|
127
|
+
--preview-highlight,
|
|
128
|
+
hsl(var(--primary) / var(--un-text-opacity, 1))
|
|
129
|
+
);
|
|
148
130
|
}
|
|
149
|
-
|
|
150
|
-
|
|
131
|
+
.post-preview:hover {
|
|
132
|
+
& > a,
|
|
133
|
+
& .tag-list a {
|
|
134
|
+
background-color: var(
|
|
135
|
+
--preview-highlight-bg,
|
|
136
|
+
hsl(var(--muted) / var(--un-bg-opacity, 1))
|
|
137
|
+
) !important;
|
|
138
|
+
}
|
|
139
|
+
& > a,
|
|
140
|
+
& .tag-list a:hover {
|
|
141
|
+
color: var(--preview-highlight-final) !important;
|
|
142
|
+
}
|
|
143
|
+
& > a .preview-redirect {
|
|
144
|
+
stroke: var(--preview-highlight-final) !important;
|
|
145
|
+
}
|
|
151
146
|
}
|
|
152
|
-
}
|
|
153
|
-
.cover-image {
|
|
154
|
-
mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
|
|
155
|
-
-ms-mask-image: -ms-linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
|
|
156
|
-
-webkit-mask-image: -webkit-linear-gradient(
|
|
157
|
-
to right,
|
|
158
|
-
rgba(0, 0, 0, 0) 0%,
|
|
159
|
-
rgba(0, 0, 0, 1) 100%
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
@media (max-width: 768px) {
|
|
164
147
|
.cover-image {
|
|
165
|
-
mask-image: linear-gradient(to
|
|
166
|
-
-ms-mask-image: -ms-linear-gradient(to
|
|
148
|
+
mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
|
|
149
|
+
-ms-mask-image: -ms-linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
|
|
167
150
|
-webkit-mask-image: -webkit-linear-gradient(
|
|
168
|
-
to
|
|
151
|
+
to right,
|
|
169
152
|
rgba(0, 0, 0, 0) 0%,
|
|
170
153
|
rgba(0, 0, 0, 1) 100%
|
|
171
154
|
);
|
|
172
155
|
}
|
|
173
|
-
|
|
174
|
-
|
|
156
|
+
|
|
157
|
+
@media (max-width: 768px) {
|
|
158
|
+
.cover-image {
|
|
159
|
+
mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
|
|
160
|
+
-ms-mask-image: -ms-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
|
|
161
|
+
-webkit-mask-image: -webkit-linear-gradient(
|
|
162
|
+
to top,
|
|
163
|
+
rgba(0, 0, 0, 0) 0%,
|
|
164
|
+
rgba(0, 0, 0, 1) 100%
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
169
|
+
</li>
|
|
@@ -16,8 +16,8 @@ const toc = generateToc(headings)
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
<toc-heading class={className} {...props}>
|
|
19
|
-
<h2 class='font-
|
|
20
|
-
<ul class='mt-4
|
|
19
|
+
<h2 class='font-medium'>TABLE OF CONTENTS</h2>
|
|
20
|
+
<ul class='mt-4'>
|
|
21
21
|
{toc.map((heading) => <TOCHeading heading={heading} />)}
|
|
22
22
|
</ul>
|
|
23
23
|
</toc-heading>
|
|
@@ -16,12 +16,12 @@ const text = rawText.endsWith('#') ? rawText.slice(0, -1) : rawText
|
|
|
16
16
|
<li>
|
|
17
17
|
<div class='relative'>
|
|
18
18
|
<span
|
|
19
|
-
class='absolute top-[5%] w-[2px] rounded transition-colors duration-300 [&.highlight-bg]:bg-primary [&.is-read]:bg-
|
|
19
|
+
class='absolute top-[5%] w-[2px] rounded transition-colors duration-300 [&.highlight-bg]:bg-primary [&.is-read]:bg-border'
|
|
20
20
|
></span>
|
|
21
21
|
<a
|
|
22
22
|
aria-label={`Scroll to section: ${text}`}
|
|
23
23
|
class={cn(
|
|
24
|
-
'toc-item line-clamp-2 px-3 py-1 ms-2 text-foreground/75 transition-all hover:text-foreground [&.highlight]:font-medium [&.highlight]:text-primary [&.
|
|
24
|
+
'toc-item line-clamp-2 px-3 py-1 ms-2 text-foreground/75 transition-all hover:text-foreground [&.highlight]:font-medium [&.highlight]:text-primary [&.highlight-bg-translucent]:bg-muted',
|
|
25
25
|
depth > 2 && 'ps-7'
|
|
26
26
|
)}
|
|
27
27
|
href={`#${slug}`}>{text}</a
|
|
@@ -17,7 +17,7 @@ const { as: Tag = 'a', class: className, title, href, variant = 'button', ...pro
|
|
|
17
17
|
|
|
18
18
|
<Tag
|
|
19
19
|
class={cn(
|
|
20
|
-
'group inline-flex items-center gap-x-1 rounded-lg bg-muted border px-2 py-1 text-sm text-muted-foreground transition-all hover:bg-
|
|
20
|
+
'group inline-flex items-center gap-x-1 rounded-lg bg-muted border px-2 py-1 text-sm text-muted-foreground transition-all hover:bg-card no-underline',
|
|
21
21
|
!href && 'cursor-default',
|
|
22
22
|
variant === 'pill' && 'rounded-xl',
|
|
23
23
|
className
|
|
@@ -46,7 +46,7 @@ const { html } = processSteps(content)
|
|
|
46
46
|
font-weight: 600;
|
|
47
47
|
text-align: center;
|
|
48
48
|
color: hsl(var(--foreground) / var(--un-text-opacity, 1));
|
|
49
|
-
background-color: hsl(var(--
|
|
49
|
+
background-color: hsl(var(--card) / var(--un-bg-opacity, 1));
|
|
50
50
|
border-radius: 99rem;
|
|
51
51
|
box-shadow: inset 0 0 0 1px hsl(var(--border) / var(--un-border-opacity, 1));
|
|
52
52
|
}
|
|
@@ -24,7 +24,7 @@ const { class: className, events, ...props } = Astro.props
|
|
|
24
24
|
/>
|
|
25
25
|
)}
|
|
26
26
|
<div class='flex gap-2 max-sm:flex-col'>
|
|
27
|
-
<samp class='w-fit grow-0 rounded-md py-1 text-sm max-sm:bg-
|
|
27
|
+
<samp class='w-fit grow-0 rounded-md py-1 text-sm max-sm:bg-card max-sm:px-2 sm:min-w-[82px] sm:text-right'>
|
|
28
28
|
{event.date}
|
|
29
29
|
</samp>
|
|
30
30
|
<div>
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "astro-pure",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "A simple, clean but powerful blog theme build by astro.",
|
|
5
|
-
"version": "1.3.
|
|
5
|
+
"version": "1.3.8",
|
|
6
6
|
"homepage": "https://astro-pure.js.org/",
|
|
7
7
|
"author": "CWorld",
|
|
8
8
|
"license": "Apache-2.0",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"@astrojs/mdx": "^4.3.12",
|
|
41
41
|
"@astrojs/sitemap": "^3.6.0",
|
|
42
42
|
"@pagefind/default-ui": "^1.4.0",
|
|
43
|
-
"@unocss/reset": "^66.5.
|
|
44
|
-
"astro": "^5.16.
|
|
43
|
+
"@unocss/reset": "^66.5.10",
|
|
44
|
+
"astro": "^5.16.3",
|
|
45
45
|
"hast-util-select": "^6.0.4",
|
|
46
46
|
"node-html-parser": "^7.0.1",
|
|
47
47
|
"pagefind": "^1.4.0",
|
|
48
|
-
"unocss": "^66.5.
|
|
48
|
+
"unocss": "^66.5.10"
|
|
49
49
|
}
|
|
50
50
|
}
|