lightnet 4.1.1 → 4.2.0
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/CHANGELOG.md +16 -0
- package/package.json +9 -9
- package/src/layouts/MarkdownPage.astro +6 -6
- package/src/layouts/Page.astro +28 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# lightnet
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#394](https://github.com/LightNetDev/LightNet/pull/394) [`d8a1a2d`](https://github.com/LightNetDev/LightNet/commit/d8a1a2d9049b0fe0d37402f9e2435480fcaa0e15) - LightNet now adds a `data-should-track` attribute to the root `html` element
|
|
8
|
+
for `Page` and `MarkdownPage` layouts by default. Analytics integrations can
|
|
9
|
+
use this attribute to decide whether a page should be tracked.
|
|
10
|
+
|
|
11
|
+
You can opt out for an individual page by passing `disableShouldTrack` to
|
|
12
|
+
`Page` or `MarkdownPage`. This change does not add analytics on its own; it
|
|
13
|
+
only exposes a per-page signal for integrations such as `@lightnet/plausible`.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#394](https://github.com/LightNetDev/LightNet/pull/394) [`d8a1a2d`](https://github.com/LightNetDev/LightNet/commit/d8a1a2d9049b0fe0d37402f9e2435480fcaa0e15) - Update dependencies
|
|
18
|
+
|
|
3
19
|
## 4.1.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "LightNet makes it easy to run your own digital media library.",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "4.
|
|
6
|
+
"version": "4.2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/LightNetDev/lightnet",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"tailwindcss": ">=3.4.0 <4.0.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@astrojs/react": "^5.0.
|
|
55
|
-
"@iconify-json/lucide": "^1.2.
|
|
54
|
+
"@astrojs/react": "^5.0.5",
|
|
55
|
+
"@iconify-json/lucide": "^1.2.108",
|
|
56
56
|
"@iconify-json/mdi": "^1.2.3",
|
|
57
57
|
"@iconify/tailwind": "^1.2.0",
|
|
58
58
|
"@tailwindcss/typography": "^0.5.19",
|
|
@@ -61,19 +61,19 @@
|
|
|
61
61
|
"embla-carousel": "^8.6.0",
|
|
62
62
|
"embla-carousel-wheel-gestures": "^8.1.0",
|
|
63
63
|
"fuse.js": "^7.3.0",
|
|
64
|
-
"i18next": "^26.0
|
|
65
|
-
"lucide-react": "^1.
|
|
64
|
+
"i18next": "^26.2.0",
|
|
65
|
+
"lucide-react": "^1.16.0",
|
|
66
66
|
"marked": "^18.0.3",
|
|
67
67
|
"postcss": "^8.5.14",
|
|
68
68
|
"postcss-load-config": "^6.0.1",
|
|
69
|
-
"yaml": "^2.
|
|
69
|
+
"yaml": "^2.9.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@playwright/test": "^1.
|
|
72
|
+
"@playwright/test": "^1.60.0",
|
|
73
73
|
"@types/react": "^19.2.14",
|
|
74
|
-
"astro": "^6.3.
|
|
74
|
+
"astro": "^6.3.3",
|
|
75
75
|
"typescript": "^6.0.3",
|
|
76
|
-
"vitest": "^4.1.
|
|
76
|
+
"vitest": "^4.1.6",
|
|
77
77
|
"@internal/e2e-test-utils": "^0.0.1"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
import Page from "./Page.astro"
|
|
2
|
+
import Page, { type Props as PageProps } from "./Page.astro"
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
type Props = {
|
|
4
|
+
type Props = PageProps & {
|
|
6
5
|
className?: string
|
|
7
|
-
}
|
|
6
|
+
}
|
|
7
|
+
const { className, ...pageProps } = Astro.props
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
<Page>
|
|
10
|
+
<Page {...pageProps}>
|
|
11
11
|
<article
|
|
12
12
|
class="prose mx-auto mt-8 max-w-screen-md px-4 prose-img:rounded-md sm:mt-16 md:px-8"
|
|
13
|
-
class:list={[
|
|
13
|
+
class:list={[className]}
|
|
14
14
|
>
|
|
15
15
|
<slot />
|
|
16
16
|
</article>
|
package/src/layouts/Page.astro
CHANGED
|
@@ -12,14 +12,35 @@ import Footer from "./components/Footer.astro"
|
|
|
12
12
|
import Header from "./components/Header.astro"
|
|
13
13
|
import ViewTransition from "./components/ViewTransition.astro"
|
|
14
14
|
|
|
15
|
-
interface Props {
|
|
15
|
+
export interface Props {
|
|
16
|
+
/**
|
|
17
|
+
* Title of the page to be shown in browser tab.
|
|
18
|
+
*/
|
|
16
19
|
title?: string
|
|
20
|
+
/**
|
|
21
|
+
* Meta description for the page.
|
|
22
|
+
*/
|
|
17
23
|
description?: string
|
|
24
|
+
/**
|
|
25
|
+
* Css classes to apply to main element.
|
|
26
|
+
*/
|
|
18
27
|
mainClass?: string
|
|
28
|
+
/**
|
|
29
|
+
* Locale to override current locale from path.
|
|
30
|
+
*/
|
|
19
31
|
locale?: string
|
|
32
|
+
/**
|
|
33
|
+
* Disables the `should-track` attribute on the root `html` element for
|
|
34
|
+
* pages that should be excluded from analytics tracking.
|
|
35
|
+
*
|
|
36
|
+
* The `should-track`` attribute does not enable tracking on its own; it is intended to be picked up by
|
|
37
|
+
* analytics providers that choose to respect it. e.g. @lightnet/plausible-analytics
|
|
38
|
+
*/
|
|
39
|
+
disableShouldTrack?: boolean
|
|
20
40
|
}
|
|
21
41
|
|
|
22
|
-
const { title, description, mainClass, locale } =
|
|
42
|
+
const { title, description, mainClass, locale, disableShouldTrack } =
|
|
43
|
+
Astro.props
|
|
23
44
|
const { currentLocale: pathCurrentLocale, tConfigField } = Astro.locals.i18n
|
|
24
45
|
const currentLocale = locale ?? pathCurrentLocale
|
|
25
46
|
const configTitle = tConfigField(config.title, config)
|
|
@@ -27,7 +48,11 @@ const { direction } = resolveLanguage(currentLocale)
|
|
|
27
48
|
---
|
|
28
49
|
|
|
29
50
|
<!doctype html>
|
|
30
|
-
<html
|
|
51
|
+
<html
|
|
52
|
+
lang={currentLocale}
|
|
53
|
+
dir={direction}
|
|
54
|
+
data-ln-should-track={disableShouldTrack ? undefined : true}
|
|
55
|
+
>
|
|
31
56
|
<head>
|
|
32
57
|
<meta charset="UTF-8" />
|
|
33
58
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|