astro-pure 1.4.2 → 1.4.3

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.
@@ -25,7 +25,6 @@ const footerLink1 = footerConf.links?.filter(({ pos }) => pos === 1) || []
25
25
  <div>
26
26
  {footerLink1.map(({ title, link, style }, index) => (
27
27
  <>
28
- <!- prettier-ignore -->
29
28
  <a href={link} target='_blank' class={style}>{title}</a>
30
29
  {index < footerLink1.length - 1 && <span class='mx-1'>•</span>}
31
30
  </>
@@ -17,21 +17,21 @@ import '@pagefind/default-ui/css/ui.css'
17
17
  </site-search>
18
18
 
19
19
  <script>
20
+ // const shouldStrip = this.dataset.stripTrailingSlash !== undefined
21
+ // const stripTrailingSlash = (path: string) => path.replace(/(.)\/(#.*)?$/, '$1$2')
22
+ // const formatURL = shouldStrip ? stripTrailingSlash : (path: string) => path
23
+ const formatURL = (path: string) => path.replace(/(.)\/(#.*)?$/, '$1$2')
24
+
20
25
  class SiteSearch extends HTMLElement {
21
26
  constructor() {
22
27
  super()
23
- // const shouldStrip = this.dataset.stripTrailingSlash !== undefined
24
- // const stripTrailingSlash = (path: string) => path.replace(/(.)\/(#.*)?$/, '$1$2')
25
- // const formatURL = shouldStrip ? stripTrailingSlash : (path: string) => path
26
- const formatURL = (path: string) => path.replace(/(.)\/(#.*)?$/, '$1$2')
27
-
28
28
  window.addEventListener('DOMContentLoaded', () => {
29
29
  // if (import.meta.env.DEV) return
30
30
  const onIdle = window.requestIdleCallback || ((cb) => setTimeout(cb, 1))
31
31
  onIdle(async () => {
32
32
  // @ts-expect-error — Missing types for @pagefind/default-ui package.
33
33
  const { PagefindUI } = await import('@pagefind/default-ui')
34
- new PagefindUI({
34
+ const pagefindUI = new PagefindUI({
35
35
  element: '#site-search',
36
36
  baseUrl: import.meta.env.BASE_URL,
37
37
  bundlePath: `${import.meta.env.BASE_URL.replace(/\/$/, '')}/pagefind/`,
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.4.2",
5
+ "version": "1.4.3",
6
6
  "homepage": "https://astro-pure.js.org/",
7
7
  "author": "CWorld",
8
8
  "license": "Apache-2.0",
@@ -40,11 +40,14 @@
40
40
  "@astrojs/mdx": "5.0.3",
41
41
  "@astrojs/sitemap": "3.7.2",
42
42
  "@pagefind/default-ui": "^1.5.0",
43
- "@unocss/reset": "^66.6.7",
44
43
  "astro": "6.1.3",
45
44
  "hast-util-select": "^6.0.4",
46
45
  "node-html-parser": "^7.1.0",
47
- "pagefind": "^1.5.0",
48
- "unocss": "^66.6.7"
46
+ "pagefind": "^1.5.0"
47
+ },
48
+ "devDependencies": {
49
+ "@unocss/astro": "^66.6.8",
50
+ "@unocss/reset": "^66.6.7",
51
+ "unocss": "^66.6.8"
49
52
  }
50
53
  }
@@ -89,14 +89,14 @@ async function parseOpenGraph(pageUrl: string) {
89
89
  const description = getMetaProperty('og:description') || getMetaName('description')
90
90
  const image = urlOrNull(
91
91
  getMetaProperty('og:image:secure_url') ||
92
- getMetaProperty('og:image:url') ||
93
- getMetaProperty('og:image')
92
+ getMetaProperty('og:image:url') ||
93
+ getMetaProperty('og:image')
94
94
  )
95
95
  const imageAlt = getMetaProperty('og:image:alt')
96
96
  const video = urlOrNull(
97
97
  getMetaProperty('og:video:secure_url') ||
98
- getMetaProperty('og:video:url') ||
99
- getMetaProperty('og:video')
98
+ getMetaProperty('og:video:url') ||
99
+ getMetaProperty('og:video')
100
100
  )
101
101
  const videoType = getMetaProperty('og:video:type')
102
102
  const url =
@@ -63,17 +63,17 @@ module.exports = (args, opts) => {
63
63
  })
64
64
  })
65
65
 
66
- ;[]
67
- .concat(opts.string)
68
- .filter(Boolean)
69
- .forEach((key) => {
70
- flags.strings[key] = true
71
- if (aliases[key]) {
72
- ;[].concat(aliases[key]).forEach((k) => {
73
- flags.strings[k] = true
74
- })
75
- }
76
- })
66
+ ;[]
67
+ .concat(opts.string)
68
+ .filter(Boolean)
69
+ .forEach((key) => {
70
+ flags.strings[key] = true
71
+ if (aliases[key]) {
72
+ ;[].concat(aliases[key]).forEach((k) => {
73
+ flags.strings[k] = true
74
+ })
75
+ }
76
+ })
77
77
 
78
78
  var defaults = opts.default || {}
79
79
 
@@ -145,9 +145,9 @@ module.exports = (args, opts) => {
145
145
  key.split('.'),
146
146
  value
147
147
  )
148
- ;(aliases[key] || []).forEach((x) => {
149
- setKey(argv, x.split('.'), value)
150
- })
148
+ ; (aliases[key] || []).forEach((x) => {
149
+ setKey(argv, x.split('.'), value)
150
+ })
151
151
  }
152
152
 
153
153
  Object.keys(flags.bools).forEach((key) => {
@@ -164,8 +164,6 @@ module.exports = (args, opts) => {
164
164
  var i, arg, key, next, m, value, letters, broken, j
165
165
  for (i = 0; i < args.length; i++) {
166
166
  arg = args[i]
167
- key
168
- next
169
167
 
170
168
  if (/^--.+=/.test(arg)) {
171
169
  // Using [\s\S] instead of . because js doesn't support the
@@ -264,9 +262,9 @@ module.exports = (args, opts) => {
264
262
  if (!hasKey(argv, k.split('.'))) {
265
263
  setKey(argv, k.split('.'), defaults[k])
266
264
 
267
- ;(aliases[k] || []).forEach((x) => {
268
- setKey(argv, x.split('.'), defaults[k])
269
- })
265
+ ; (aliases[k] || []).forEach((x) => {
266
+ setKey(argv, x.split('.'), defaults[k])
267
+ })
270
268
  }
271
269
  })
272
270
 
@@ -89,7 +89,7 @@ const errorMap: z.ZodErrorMap = (baseError, ctx) => {
89
89
  .map(([key, error]) =>
90
90
  key === baseErrorPath
91
91
  ? // Avoid printing the key again if it's a base error
92
- `> ${getTypeOrLiteralMsg(error)}`
92
+ `> ${getTypeOrLiteralMsg(error)}`
93
93
  : `> ${prefix(key, getTypeOrLiteralMsg(error))}`
94
94
  )
95
95
 
package/virtual.d.ts CHANGED
@@ -1 +1,4 @@
1
- /// <reference path="./types/module.d.ts" />
1
+ declare module 'virtual:config' {
2
+ const Config: import('./types/user-config').UserConfig
3
+ export default Config
4
+ }
package/types/module.d.ts DELETED
@@ -1,4 +0,0 @@
1
- declare module 'virtual:config' {
2
- const Config: import('./user-config').UserConfig
3
- export default Config
4
- }