astro-pure 1.2.4 → 1.2.5
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/bun.lockb +0 -0
- package/components/advanced/Comment.astro +8 -8
- package/components/advanced/GithubCard.astro +2 -2
- package/components/advanced/Quote.astro +1 -3
- package/components/basic/Footer.astro +2 -2
- package/components/basic/Header.astro +2 -2
- package/components/basic/ThemeProvider.astro +1 -1
- package/components/pages/PFSearch.astro +5 -5
- package/components/pages/PostPreview.astro +4 -4
- package/components/user/Aside.astro +1 -1
- package/components/user/Button.astro +1 -1
- package/components/user/Card.astro +1 -1
- package/components/user/CardListChildren.astro +1 -1
- package/components/user/Collapse.astro +1 -4
- package/components/user/Steps.astro +5 -5
- package/components/user/Tabs.astro +5 -5
- package/index.ts +2 -5
- package/package.json +2 -4
- package/scripts/index.js +1 -0
- package/utils/class-merge.ts +17 -0
- package/utils/index.ts +1 -1
- package/utils/tailwind.ts +0 -7
package/bun.lockb
CHANGED
|
Binary file
|
|
@@ -61,18 +61,18 @@ const { class: className } = Astro.props
|
|
|
61
61
|
/* Font size */
|
|
62
62
|
--waline-font-size: 16px;
|
|
63
63
|
/* Basic color */
|
|
64
|
-
--waline-white: hsl(var(--background) / var(--
|
|
64
|
+
--waline-white: hsl(var(--background) / var(--un-bg-opacity, 1));
|
|
65
65
|
--waline-light-grey: #999;
|
|
66
66
|
--waline-dark-grey: #666;
|
|
67
67
|
/* Theme color */
|
|
68
|
-
--waline-theme-color: hsl(var(--foreground) / var(--
|
|
69
|
-
--waline-active-color: hsl(var(--primary) / var(--
|
|
68
|
+
--waline-theme-color: hsl(var(--foreground) / var(--un-text-opacity, 1));
|
|
69
|
+
--waline-active-color: hsl(var(--primary) / var(--un-text-opacity, 1));
|
|
70
70
|
/* Layout */
|
|
71
|
-
--waline-color: hsl(var(--muted-foreground) / var(--
|
|
72
|
-
--waline-bg-color: hsl(var(--muted) / var(--
|
|
73
|
-
--waline-bg-color-light: hsl(var(--input) / var(--
|
|
71
|
+
--waline-color: hsl(var(--muted-foreground) / var(--un-text-opacity, 1));
|
|
72
|
+
--waline-bg-color: hsl(var(--muted) / var(--un-bg-opacity, 1));
|
|
73
|
+
--waline-bg-color-light: hsl(var(--input) / var(--un-text-opacity, 1));
|
|
74
74
|
--waline-bg-color-hover: #f0f0f0;
|
|
75
|
-
--waline-border-color: hsl(var(--border) / var(--
|
|
75
|
+
--waline-border-color: hsl(var(--border) / var(--un-border-opacity, 1));
|
|
76
76
|
--waline-disable-bg-color: #f8f8f8;
|
|
77
77
|
--waline-disable-color: #bbb;
|
|
78
78
|
--waline-code-bg-color: #282c34;
|
|
@@ -82,7 +82,7 @@ const { class: className } = Astro.props
|
|
|
82
82
|
--waline-avatar-size: 3.25rem;
|
|
83
83
|
--waline-m-avatar-size: calc(var(--waline-avatar-size) * 9 / 13);
|
|
84
84
|
/* Badge */
|
|
85
|
-
--waline-badge-color: hsl(var(--border) / var(--
|
|
85
|
+
--waline-badge-color: hsl(var(--border) / var(--un-border-opacity, 1));
|
|
86
86
|
--waline-badge-font-size: 0.775em;
|
|
87
87
|
/* Info */
|
|
88
88
|
--waline-info-bg-color: var(--waline-bg-color-light);
|
|
@@ -13,7 +13,7 @@ const [owner, repoName] = repo.split('/')
|
|
|
13
13
|
<a
|
|
14
14
|
href={`https://github.com/${repo}`}
|
|
15
15
|
target='_blank'
|
|
16
|
-
class='group block flex flex-col gap-y-2 rounded-xl border
|
|
16
|
+
class='group block flex flex-col gap-y-2 rounded-xl border px-5 py-4 transition-colors hover:bg-muted hover:text-muted-foreground'
|
|
17
17
|
>
|
|
18
18
|
<div class='flex items-center justify-between'>
|
|
19
19
|
<div class='flex items-center gap-x-2 text-foreground group-hover:text-primary'>
|
|
@@ -70,7 +70,7 @@ const [owner, repoName] = repo.split('/')
|
|
|
70
70
|
.loading .gh-text {
|
|
71
71
|
color: transparent;
|
|
72
72
|
border-radius: calc(var(--radius) - 3px);
|
|
73
|
-
background-color: hsl(var(--primary-foreground) / var(--
|
|
73
|
+
background-color: hsl(var(--primary-foreground) / var(--un-text-opacity));
|
|
74
74
|
animation: pulsate 2s infinite linear;
|
|
75
75
|
user-select: none;
|
|
76
76
|
}
|
|
@@ -5,9 +5,7 @@ const { class: className } = Astro.props
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<quote-component class={cn('not-prose inline-block', className)}>
|
|
8
|
-
<div
|
|
9
|
-
class='flex flex-row items-center gap-x-3 rounded-full border border-border px-4 py-2 text-sm shadow-sm'
|
|
10
|
-
>
|
|
8
|
+
<div class='flex flex-row items-center gap-x-3 rounded-full border px-4 py-2 text-sm shadow-sm'>
|
|
11
9
|
<span class='relative flex items-center justify-center'>
|
|
12
10
|
<span
|
|
13
11
|
class='absolute size-2 animate-ping rounded-full border border-green-400 bg-green-400 opacity-75'
|
|
@@ -15,7 +15,7 @@ social.rss = {
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
<footer class='mx-auto mb-5 mt-16'>
|
|
18
|
-
<div class='border-t
|
|
18
|
+
<div class='border-t pt-5'>
|
|
19
19
|
<div class='flex items-center gap-y-3 max-sm:flex-col sm:justify-between sm:gap-y-0'>
|
|
20
20
|
<div
|
|
21
21
|
class='flex items-center gap-x-4 gap-y-2 text-muted-foreground max-sm:flex-col [&_a:hover]:text-primary [&_a]:text-foreground'
|
|
@@ -24,7 +24,7 @@ social.rss = {
|
|
|
24
24
|
footerConf.registration && (
|
|
25
25
|
<a
|
|
26
26
|
class='text-xs'
|
|
27
|
-
style='color:hsl(var(--muted-foreground)/var(--
|
|
27
|
+
style='color:hsl(var(--muted-foreground)/var(--un-text-opacity,1))'
|
|
28
28
|
href={footerConf.registration.url}
|
|
29
29
|
target='_blank'
|
|
30
30
|
>
|
|
@@ -180,8 +180,8 @@ import { Icon } from '../user'
|
|
|
180
180
|
visibility: visible;
|
|
181
181
|
bottom: -1rem;
|
|
182
182
|
opacity: 1;
|
|
183
|
-
background-color: hsl(var(--muted) / var(--
|
|
184
|
-
border-bottom-color: hsl(var(--border) / var(--
|
|
183
|
+
background-color: hsl(var(--muted) / var(--un-bg-opacity, 1));
|
|
184
|
+
border-bottom-color: hsl(var(--border) / var(--un-border-opacity, 1));
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
const { message } = (e as CustomEvent).detail
|
|
31
31
|
const toast = document.createElement('div')
|
|
32
32
|
toast.className =
|
|
33
|
-
'animate fixed bottom-8 z-20 px-4 py-2 bg-muted text-foreground rounded-lg border
|
|
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'
|
|
34
34
|
toast.innerHTML = `<svg width='22' height='22' viewBox='0 0 24 24' fill='currentColor'>${Icons.info}</svg> <span>${message}</span>`
|
|
35
35
|
document.body.appendChild(toast)
|
|
36
36
|
setTimeout(() => {
|
|
@@ -56,11 +56,11 @@ import '@pagefind/default-ui/css/ui.css'
|
|
|
56
56
|
<style>
|
|
57
57
|
#site-search {
|
|
58
58
|
--pagefind-ui-scale: 0.8;
|
|
59
|
-
--pagefind-ui-primary: hsl(var(--primary) / var(--
|
|
60
|
-
--pagefind-ui-text: hsl(var(--foreground) / var(--
|
|
61
|
-
--pagefind-ui-background: hsl(var(--muted) / var(--
|
|
62
|
-
--pagefind-ui-border: hsl(var(--border) / var(--
|
|
63
|
-
--pagefind-ui-tag: hsl(var(--muted-foreground) / var(--
|
|
59
|
+
--pagefind-ui-primary: hsl(var(--primary) / var(--un-bg-opacity, 1));
|
|
60
|
+
--pagefind-ui-text: hsl(var(--foreground) / var(--un-text-opacity, 1));
|
|
61
|
+
--pagefind-ui-background: hsl(var(--muted) / var(--un-bg-opacity, 1));
|
|
62
|
+
--pagefind-ui-border: hsl(var(--border) / var(--un-border-opacity, 1));
|
|
63
|
+
--pagefind-ui-tag: hsl(var(--muted-foreground) / var(--un-text-opacity, 1));
|
|
64
64
|
--pagefind-ui-border-width: 2px;
|
|
65
65
|
--pagefind-ui-border-radius: calc(var(--radius) + 2px);
|
|
66
66
|
--pagefind-ui-image-border-radius: calc(var(--radius) + 2px);
|
|
@@ -22,13 +22,13 @@ const postDate = data.updatedDate ?? data.publishDate
|
|
|
22
22
|
|
|
23
23
|
<li
|
|
24
24
|
class={cn(
|
|
25
|
-
'post-preview group/card flex flex-col relative rounded-2xl border
|
|
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
26
|
detailed && 'max-sm:px-4 sm:py-5',
|
|
27
27
|
className
|
|
28
28
|
)}
|
|
29
29
|
style={detailed &&
|
|
30
30
|
data.heroImage?.color &&
|
|
31
|
-
`--preview-highlight:color-mix(in srgb,${data.heroImage.color} 40%,hsl(var(--foreground)/var(--
|
|
31
|
+
`--preview-highlight:color-mix(in srgb,${data.heroImage.color} 40%,hsl(var(--foreground)/var(--un-text-opacity,1)));
|
|
32
32
|
--preview-highlight-bg:hsl(from ${data.heroImage.color} h s l/20%)`}
|
|
33
33
|
>
|
|
34
34
|
<a
|
|
@@ -131,7 +131,7 @@ const postDate = data.updatedDate ?? data.publishDate
|
|
|
131
131
|
.post-preview {
|
|
132
132
|
--preview-highlight-final: var(
|
|
133
133
|
--preview-highlight,
|
|
134
|
-
hsl(var(--primary) / var(--
|
|
134
|
+
hsl(var(--primary) / var(--un-text-opacity, 1))
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
137
|
.post-preview:hover {
|
|
@@ -139,7 +139,7 @@ const postDate = data.updatedDate ?? data.publishDate
|
|
|
139
139
|
& .tag-list a {
|
|
140
140
|
background-color: var(
|
|
141
141
|
--preview-highlight-bg,
|
|
142
|
-
hsl(var(--muted) / var(--
|
|
142
|
+
hsl(var(--muted) / var(--un-bg-opacity, 1))
|
|
143
143
|
) !important;
|
|
144
144
|
}
|
|
145
145
|
& > a,
|
|
@@ -6,7 +6,7 @@ const { as: Tag = 'a', class: className, title, href, style = 'button', ...props
|
|
|
6
6
|
|
|
7
7
|
<Tag
|
|
8
8
|
class={cn(
|
|
9
|
-
'group inline-flex items-center gap-x-1 rounded-lg bg-muted border
|
|
9
|
+
'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-primary-foreground no-underline',
|
|
10
10
|
!href && 'cursor-default',
|
|
11
11
|
style === 'pill' && 'rounded-xl',
|
|
12
12
|
className
|
|
@@ -6,7 +6,7 @@ const { as: Tag = 'div', class: className, href, heading, subheading, date } = A
|
|
|
6
6
|
|
|
7
7
|
<Tag
|
|
8
8
|
class={cn(
|
|
9
|
-
'not-prose block relative rounded-2xl border
|
|
9
|
+
'not-prose block relative rounded-2xl border bg-muted px-5 py-3',
|
|
10
10
|
href && 'transition-all hover:border-foreground/25 hover:shadow-sm',
|
|
11
11
|
className
|
|
12
12
|
)}
|
|
@@ -6,7 +6,7 @@ type Props = { main?: boolean; children: CardList }
|
|
|
6
6
|
const { main = false, children } = Astro.props
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
<ul class={cn('flex flex-col gap-y-1', !main && 'list-disc ms-5')}>
|
|
9
|
+
<ul class={cn('flex flex-col gap-y-1', !main && 'subitem list-disc ms-5')}>
|
|
10
10
|
{
|
|
11
11
|
children.map((child) => {
|
|
12
12
|
const Tag = child.link ? 'a' : 'p'
|
|
@@ -10,10 +10,7 @@ const { class: className, title, ...props } = Astro.props
|
|
|
10
10
|
|
|
11
11
|
<collapse-component class='group/expand'>
|
|
12
12
|
<div
|
|
13
|
-
class={cn(
|
|
14
|
-
'rounded-xl border border-border px-3 my-4 sm:px-4 group-[.expanded]/expand:bg-muted',
|
|
15
|
-
className
|
|
16
|
-
)}
|
|
13
|
+
class={cn('rounded-xl border px-3 my-4 sm:px-4 group-[.expanded]/expand:bg-muted', className)}
|
|
17
14
|
{...props}
|
|
18
15
|
>
|
|
19
16
|
<slot name='before' />
|
|
@@ -45,10 +45,10 @@ const { html } = processSteps(content)
|
|
|
45
45
|
font-size: 0.8125rem;
|
|
46
46
|
font-weight: 600;
|
|
47
47
|
text-align: center;
|
|
48
|
-
color: hsl(var(--foreground) / var(--
|
|
49
|
-
background-color: hsl(var(--primary-foreground) / var(--
|
|
48
|
+
color: hsl(var(--foreground) / var(--un-text-opacity, 1));
|
|
49
|
+
background-color: hsl(var(--primary-foreground) / var(--un-bg-opacity, 1));
|
|
50
50
|
border-radius: 99rem;
|
|
51
|
-
box-shadow: inset 0 0 0 1px hsl(var(--border) / var(--
|
|
51
|
+
box-shadow: inset 0 0 0 1px hsl(var(--border) / var(--un-border-opacity, 1));
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/* Vertical guideline linking list numbers. */
|
|
@@ -60,7 +60,7 @@ const { html } = processSteps(content)
|
|
|
60
60
|
bottom: var(--bullet-margin);
|
|
61
61
|
inset-inline-start: calc((var(--bullet-size) - var(--guide-width)) / 2);
|
|
62
62
|
width: var(--guide-width);
|
|
63
|
-
background-color: hsl(var(--border) / var(--
|
|
63
|
+
background-color: hsl(var(--border) / var(--un-border-opacity, 1));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/* Adjust first item inside a step so that it aligns vertically with the number
|
|
@@ -76,7 +76,7 @@ const { html } = processSteps(content)
|
|
|
76
76
|
margin-top: 0;
|
|
77
77
|
transform: translateY(var(--shift-y));
|
|
78
78
|
margin-bottom: var(--shift-y);
|
|
79
|
-
color: hsl(var(--foreground) / var(--
|
|
79
|
+
color: hsl(var(--foreground) / var(--un-text-opacity, 1));
|
|
80
80
|
}
|
|
81
81
|
.sl-steps > li > :first-child:where(h1, h2, h3, h4, h5, h6) {
|
|
82
82
|
--lh: calc(1.2em);
|
|
@@ -110,7 +110,7 @@ if (isSynced) {
|
|
|
110
110
|
[role='tablist'] {
|
|
111
111
|
display: flex;
|
|
112
112
|
list-style: none;
|
|
113
|
-
border-bottom: 2px solid hsl(var(--border) / var(--
|
|
113
|
+
border-bottom: 2px solid hsl(var(--border) / var(--un-border-opacity, 1));
|
|
114
114
|
padding: 0;
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -123,14 +123,14 @@ if (isSynced) {
|
|
|
123
123
|
gap: 0.5rem;
|
|
124
124
|
padding: 0.2rem 1.25rem;
|
|
125
125
|
text-decoration: none;
|
|
126
|
-
border-bottom: 2px solid hsl(var(--border) / var(--
|
|
127
|
-
color: hsl(var(--foreground) / var(--
|
|
126
|
+
border-bottom: 2px solid hsl(var(--border) / var(--un-border-opacity, 1));
|
|
127
|
+
color: hsl(var(--foreground) / var(--un-text-opacity, 1));
|
|
128
128
|
outline-offset: -0.1875rem;
|
|
129
129
|
overflow-wrap: initial;
|
|
130
130
|
}
|
|
131
131
|
.tab [role='tab'][aria-selected='true'] {
|
|
132
|
-
color: hsl(var(--primary) / var(--
|
|
133
|
-
border-color: hsl(var(--primary) / var(--
|
|
132
|
+
color: hsl(var(--primary) / var(--un-text-opacity, 1));
|
|
133
|
+
border-color: hsl(var(--primary) / var(--un-text-opacity, 1));
|
|
134
134
|
font-weight: 600;
|
|
135
135
|
}
|
|
136
136
|
|
package/index.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process'
|
|
2
|
-
import
|
|
2
|
+
import { dirname, relative } from 'node:path'
|
|
3
3
|
import { fileURLToPath } from 'node:url'
|
|
4
4
|
// Astro
|
|
5
5
|
import type { AstroIntegration, RehypePlugins, RemarkPlugins } from 'astro'
|
|
6
6
|
// Integrations
|
|
7
7
|
import mdx from '@astrojs/mdx'
|
|
8
8
|
import sitemap from '@astrojs/sitemap'
|
|
9
|
-
import tailwind from '@astrojs/tailwind'
|
|
10
9
|
import rehypeExternalLinks from 'rehype-external-links'
|
|
11
10
|
|
|
12
11
|
import { remarkAddZoomable, remarkReadingTime } from './plugins/remark-plugins'
|
|
@@ -23,6 +22,7 @@ export default function AstroPureIntegration(opts: UserInputConfig): AstroIntegr
|
|
|
23
22
|
hooks: {
|
|
24
23
|
'astro:config:setup': async ({ config, updateConfig }) => {
|
|
25
24
|
let userConfig = parseWithFriendlyErrors(
|
|
25
|
+
// @ts-ignore
|
|
26
26
|
UserConfigSchema,
|
|
27
27
|
opts,
|
|
28
28
|
'Invalid config passed to astro-pure integration'
|
|
@@ -37,9 +37,6 @@ export default function AstroPureIntegration(opts: UserInputConfig): AstroIntegr
|
|
|
37
37
|
if (!allIntegrations.find(({ name }) => name === '@astrojs/mdx')) {
|
|
38
38
|
integrations.push(mdx({ optimize: true }))
|
|
39
39
|
}
|
|
40
|
-
if (!allIntegrations.find(({ name }) => name === '@astrojs/tailwind')) {
|
|
41
|
-
integrations.push(tailwind({ applyBaseStyles: false }))
|
|
42
|
-
}
|
|
43
40
|
|
|
44
41
|
// Add supported remark plugins based on user config.
|
|
45
42
|
if (userConfig.integ.mediumZoom.enable)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-pure",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "A simple, clean but powerful blog theme build by astro.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "CWorld",
|
|
@@ -37,13 +37,11 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@astrojs/mdx": "^4.0.3",
|
|
39
39
|
"@astrojs/sitemap": "^3.2.1",
|
|
40
|
-
"@astrojs/tailwind": "^5.1.3",
|
|
41
40
|
"@pagefind/default-ui": "^1.3.0",
|
|
42
41
|
"astro": "^5.0.3",
|
|
43
42
|
"hast-util-select": "^6.0.3",
|
|
44
43
|
"node-html-parser": "^7.0.1",
|
|
45
44
|
"pagefind": "^1.2.0",
|
|
46
|
-
"rehype-external-links": "^3.0.0"
|
|
47
|
-
"tailwind-merge": "^2.5.5"
|
|
45
|
+
"rehype-external-links": "^3.0.0"
|
|
48
46
|
}
|
|
49
47
|
}
|
package/scripts/index.js
CHANGED
|
@@ -31,6 +31,7 @@ switch (args._[0]) {
|
|
|
31
31
|
break
|
|
32
32
|
case 'help':
|
|
33
33
|
console.log('Usage:')
|
|
34
|
+
console.log(' check - Check envirionment and run corresponding adaption code')
|
|
34
35
|
console.log(' new [args] - Create new post on blog collection')
|
|
35
36
|
console.log(' info - Show this info message')
|
|
36
37
|
console.log(' help - Show this help message')
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { clsx, type ClassValue } from './clsx'
|
|
2
|
+
|
|
3
|
+
export function simpleMerge(...classes: string[]): string {
|
|
4
|
+
const uniqueClasses = new Set<string>()
|
|
5
|
+
|
|
6
|
+
classes.forEach((cls) => {
|
|
7
|
+
if (cls) {
|
|
8
|
+
cls.split(' ').forEach((c) => uniqueClasses.add(c))
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
return Array.from(uniqueClasses).join(' ')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function cn(...inputs: ClassValue[]) {
|
|
16
|
+
return simpleMerge(clsx(inputs))
|
|
17
|
+
}
|
package/utils/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { default as mdastToString } from './mdast-util-to-string'
|
|
|
4
4
|
export { default as getReadingTime } from './reading-time'
|
|
5
5
|
|
|
6
6
|
// Tailwind cn
|
|
7
|
-
export { cn } from './
|
|
7
|
+
export { cn } from './class-merge'
|
|
8
8
|
|
|
9
9
|
// Date
|
|
10
10
|
export { getFormattedDate } from './date'
|