astro-pure 1.3.7 → 1.3.9

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.
@@ -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-bold transition-colors sm:text-lg max-sm:w-full'
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-primary-foreground p-1'>
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(--primary-foreground) / var(--un-bg-opacity, 1));
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(--primary-foreground) / var(--un-bg-opacity));
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-semibold group-[.not-top]:ms-2 sm:group-[.not-top]:ms-3'
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>
@@ -1,31 +1,24 @@
1
1
  ---
2
2
  import { Image } from 'astro:assets'
3
3
  import { render, type CollectionEntry, type CollectionKey } from 'astro:content'
4
- import type { HTMLTag, Polymorphic } from 'astro/types'
5
4
 
6
5
  import { cn } from '../../utils'
7
6
  import { Button, FormattedDate, Icon } from '../user'
8
7
 
9
- type Props<Tag extends HTMLTag> = Polymorphic<{ as: Tag }> & {
10
- post: CollectionEntry<CollectionKey>
8
+ type Props<T extends CollectionKey> = {
9
+ post: CollectionEntry<T>
11
10
  detailed?: boolean
12
11
  class?: string
13
12
  }
14
13
 
15
- const { as: Tag = 'div', post, detailed = false, class: className } = Astro.props
16
-
14
+ const { post, detailed = false, class: className } = Astro.props
17
15
  const { id, data } = post
18
-
19
16
  const { remarkPluginFrontmatter } = await render(post)
20
17
  const postDate = data.updatedDate ?? data.publishDate
21
18
  ---
22
19
 
23
20
  <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
- )}
21
+ class={cn('post-preview', className)}
29
22
  style={detailed &&
30
23
  data.heroImage?.color &&
31
24
  `--preview-highlight:color-mix(in srgb,${data.heroImage.color} 40%,hsl(var(--foreground)/var(--un-text-opacity,1)));
@@ -33,8 +26,8 @@ const postDate = data.updatedDate ?? data.publishDate
33
26
  >
34
27
  <a
35
28
  class={cn(
36
- 'group/link w-full flex flex-col transition-all hover:text-primary',
37
- !detailed && 'sm:flex-row',
29
+ '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',
30
+ detailed && 'max-sm:px-4 sm:py-5',
38
31
  detailed && data.heroImage && 'max-md:pt-24'
39
32
  )}
40
33
  href={`/blog/${id}`}
@@ -44,18 +37,20 @@ const postDate = data.updatedDate ?? data.publishDate
44
37
  detailed && data.heroImage && (
45
38
  <Image
46
39
  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/card:opacity-70 md:h-full md:w-3/5'
40
+ 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
41
  loading='eager'
49
42
  {...data.heroImage}
50
43
  />
51
44
  )
52
45
  }
46
+ <div
47
+ class={cn('relative flex flex-col gap-1', !detailed && 'sm:flex-row sm:items-center')}
48
+ style='z-index:1'
49
+ >
50
+ <FormattedDate class='min-w-[95px] text-xs' date={postDate} />
53
51
 
54
- <FormattedDate class='min-w-[95px] py-1 text-xs' date={postDate} />
55
-
56
- <Tag class='z-10 flex-grow'>
57
52
  {/* title */}
58
- <div class='flex justify-between'>
53
+ <div class='flex justify-between flex-grow'>
59
54
  <div class={detailed && 'font-medium'}>
60
55
  {data.draft && <span class='text-red-500'>(Draft) </span>}
61
56
  {data.title}
@@ -69,16 +64,16 @@ const postDate = data.updatedDate ?? data.publishDate
69
64
  stroke-width='2.5'
70
65
  stroke-linecap='round'
71
66
  stroke-linejoin='round'
72
- class='preview-redirect my-1 stroke-muted-foreground group-hover/link:stroke-primary'
67
+ class='preview-redirect my-1 stroke-muted-foreground group-hover:stroke-primary'
73
68
  ><line
74
69
  x1='5'
75
70
  y1='12'
76
71
  x2='19'
77
72
  y2='12'
78
- class='translate-x-4 scale-x-0 transition-all duration-300 ease-in-out group-hover/link:translate-x-1 group-hover/link:scale-x-100'
73
+ 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
74
  ></line><polyline
80
75
  points='12 5 19 12 12 19'
81
- class='translate-x-0 transition-all duration-300 ease-in-out group-hover/link:translate-x-1'
76
+ class='translate-x-0 transition-all duration-300 ease-in-out group-hover:translate-x-1'
82
77
  ></polyline></svg
83
78
  >
84
79
  </div>
@@ -88,13 +83,13 @@ const postDate = data.updatedDate ?? data.publishDate
88
83
  {/* desc */}
89
84
  <p
90
85
  class={cn(
91
- 'line-clamp-2 pt-1 text-sm text-muted-foreground sm:line-clamp-3',
86
+ 'line-clamp-2 text-sm text-muted-foreground sm:line-clamp-3',
92
87
  data.heroImage && 'sm:me-24'
93
88
  )}
94
89
  >
95
90
  {data.description}
96
91
  </p>
97
- <div class='flex items-center gap-2 py-1.5 text-sm italic leading-4 text-muted-foreground sm:py-3'>
92
+ <div class='py-2 flex items-center gap-2 text-sm italic leading-4 text-muted-foreground'>
98
93
  {/* reading time */}
99
94
  <span class='flex items-center gap-1'>
100
95
  <Icon name='time' class='size-4' />
@@ -108,67 +103,66 @@ const postDate = data.updatedDate ?? data.publishDate
108
103
  </span>
109
104
  )}
110
105
  </div>
106
+ {data.tags.length > 0 && (
107
+ <object>
108
+ <ul class='tag-list mt-1 flex gap-2'>
109
+ {data.tags.map((tag: string) => (
110
+ <li>
111
+ <Button as='a' title={tag} href={`/tags/${tag}`} variant='pill' />
112
+ </li>
113
+ ))}
114
+ </ul>
115
+ </object>
116
+ )}
111
117
  </>
112
118
  )
113
119
  }
114
- </Tag>
120
+ </div>
115
121
  </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
122
 
130
- <style>
131
- .post-preview {
132
- --preview-highlight-final: var(
133
- --preview-highlight,
134
- hsl(var(--primary) / var(--un-text-opacity, 1))
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;
123
+ <style>
124
+ .post-preview {
125
+ --preview-highlight-final: var(
126
+ --preview-highlight,
127
+ hsl(var(--primary) / var(--un-text-opacity, 1))
128
+ );
148
129
  }
149
- & > a .preview-redirect {
150
- stroke: var(--preview-highlight-final) !important;
130
+ .post-preview:hover {
131
+ & > a,
132
+ & .tag-list a {
133
+ background-color: var(
134
+ --preview-highlight-bg,
135
+ hsl(var(--muted) / var(--un-bg-opacity, 1))
136
+ ) !important;
137
+ }
138
+ & > a,
139
+ & .tag-list a:hover {
140
+ color: var(--preview-highlight-final) !important;
141
+ }
142
+ & > a .preview-redirect {
143
+ stroke: var(--preview-highlight-final) !important;
144
+ }
151
145
  }
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
146
  .cover-image {
165
- mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
166
- -ms-mask-image: -ms-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
147
+ mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
148
+ -ms-mask-image: -ms-linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
167
149
  -webkit-mask-image: -webkit-linear-gradient(
168
- to top,
150
+ to right,
169
151
  rgba(0, 0, 0, 0) 0%,
170
152
  rgba(0, 0, 0, 1) 100%
171
153
  );
172
154
  }
173
- }
174
- </style>
155
+
156
+ @media (max-width: 768px) {
157
+ .cover-image {
158
+ mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
159
+ -ms-mask-image: -ms-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%);
160
+ -webkit-mask-image: -webkit-linear-gradient(
161
+ to top,
162
+ rgba(0, 0, 0, 0) 0%,
163
+ rgba(0, 0, 0, 1) 100%
164
+ );
165
+ }
166
+ }
167
+ </style>
168
+ </li>
@@ -16,8 +16,8 @@ const toc = generateToc(headings)
16
16
  ---
17
17
 
18
18
  <toc-heading class={className} {...props}>
19
- <h2 class='font-semibold'>TABLE OF CONTENTS</h2>
20
- <ul class='mt-4 text-card-foreground'>
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-input'
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 [&.is-read]:text-input [&.highlight-bg-translucent]:bg-muted',
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-primary-foreground no-underline',
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
@@ -19,8 +19,8 @@ const { width } = Astro.props
19
19
  .mdx-repl {
20
20
  background: linear-gradient(
21
21
  135deg,
22
- hsl(var(--primary) / 0.05) 0%,
23
- hsl(var(--muted) / 0.2) 100%
22
+ hsl(var(--primary) / 0.1) 0%,
23
+ hsl(var(--background) / 1) 100%
24
24
  );
25
25
  }
26
26
 
@@ -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(--primary-foreground) / var(--un-bg-opacity, 1));
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-primary-foreground max-sm:px-2 sm:min-w-[82px] sm:text-right'>
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.7",
5
+ "version": "1.3.9",
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.9",
44
- "astro": "^5.16.0",
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.9"
48
+ "unocss": "^66.5.10"
49
49
  }
50
50
  }
@@ -172,11 +172,7 @@ export const ThemeConfigSchema = () =>
172
172
  content: z.object({
173
173
  externalLinks: z.object({
174
174
  /** Content to show for external links */
175
- content: z
176
- .string()
177
- .optional()
178
- .default(' ↗')
179
- .describe('Content to show for external links'),
175
+ content: z.string().optional().default(' ↗').describe('Content to show for external links'),
180
176
  /** Properties for the external links element */
181
177
  properties: z
182
178
  .record(z.string())