lightnet 3.3.0 → 3.4.1

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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # lightnet
2
2
 
3
+ ## 3.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#254](https://github.com/LightNetDev/LightNet/pull/254) [`46c0f7c`](https://github.com/LightNetDev/LightNet/commit/46c0f7c693a46a7a2e06e72c4a333368aa8f7485) Thanks [@smn-cds](https://github.com/smn-cds)! - Improve responsive image variants:
8
+
9
+ - Improve image quality on search result items
10
+ - Limit the size of the media list image
11
+ - Streamline details page cover image variants
12
+ - Streamline gallery image variants
13
+
14
+ ## 3.4.0
15
+
16
+ ### Minor Changes
17
+
18
+ - [#252](https://github.com/LightNetDev/LightNet/pull/252) [`9573e88`](https://github.com/LightNetDev/LightNet/commit/9573e88515f66ade87cb187b59abba498527c693) Thanks [@smn-cds](https://github.com/smn-cds)! - Add config logo option `replacesTitle`. This will hide the title from the header bar.
19
+
3
20
  ## 3.3.0
4
21
 
5
22
  ### Minor Changes
@@ -8,7 +8,7 @@
8
8
  "@astrojs/tailwind": "^6.0.2",
9
9
  "@lightnet/decap-admin": "^3.1.0",
10
10
  "astro": "^5.6.1",
11
- "lightnet": "^3.3.0",
11
+ "lightnet": "^3.4.0",
12
12
  "react": "^19.1.0",
13
13
  "react-dom": "^19.1.0",
14
14
  "sharp": "^0.33.5",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "lightnet",
3
3
  "type": "module",
4
4
  "license": "MIT",
5
- "version": "3.3.0",
5
+ "version": "3.4.1",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/LightNetDev/lightnet",
@@ -153,7 +153,7 @@ export const configSchema = z.object({
153
153
  * Alt attribute to add for screen reader etc.
154
154
  * This can be a fixed string or a translation key.
155
155
  */
156
- alt: z.string().default(""),
156
+ alt: z.string().optional(),
157
157
  /**
158
158
  * Size in px to use for the logo on the header bar.
159
159
  * The size will be applied to the shorter side of your logo image.
@@ -161,6 +161,11 @@ export const configSchema = z.object({
161
161
  * Default is 28 px.
162
162
  */
163
163
  size: z.number().default(28),
164
+ /**
165
+ * Do not show the site title next to the logo.
166
+ * Set this to `true` if your logo already contains the title.
167
+ */
168
+ replacesTitle: z.boolean().default(false),
164
169
  })
165
170
  .optional(),
166
171
  /**
@@ -52,7 +52,7 @@ const items = itemsInput.filter((item) => !!item)
52
52
  class="h-full w-full object-contain"
53
53
  src={item.data.image}
54
54
  alt=""
55
- widths={[120, 160, 240, 320, 640]}
55
+ widths={[256, 512, 768, 1024]}
56
56
  sizes={
57
57
  "(max-width: 640px) calc(calc(100vw - 3.5rem ) / 2), " +
58
58
  "(max-width: 768px) calc(calc(100vw - 5rem ) / 3), " +
@@ -62,6 +62,7 @@ const mediaTypes = Object.fromEntries(
62
62
  <Image
63
63
  class="max-h-32 w-auto max-w-32 rounded-sm object-contain shadow-md"
64
64
  src={item.data.image}
65
+ width={256}
65
66
  alt=""
66
67
  />
67
68
  </div>
@@ -6,8 +6,7 @@ import config from "virtual:lightnet/config"
6
6
 
7
7
  import { resolveLanguage } from "../i18n/resolve-language"
8
8
  import Favicon from "./components/Favicon.astro"
9
- import PageNavigation from "./components/PageNavigation.astro"
10
- import PageTitle from "./components/PageTitle.astro"
9
+ import Header from "./components/Header.astro"
11
10
  import PreloadReact from "./components/PreloadReact"
12
11
 
13
12
  interface Props {
@@ -38,17 +37,7 @@ const language = resolveLanguage(currentLocale)
38
37
  <body
39
38
  class="flex min-h-screen flex-col overflow-y-scroll bg-gray-50 text-gray-900"
40
39
  >
41
- <header
42
- class="fixed top-0 z-50 h-14 w-full bg-white shadow-lg sm:h-20"
43
- transition:animate="none"
44
- >
45
- <div
46
- class="mx-auto flex h-full max-w-screen-xl justify-between px-4 md:px-8"
47
- >
48
- <PageTitle />
49
- <PageNavigation />
50
- </div>
51
- </header>
40
+ <Header />
52
41
  <main class="grow pb-8 pt-14 sm:py-20">
53
42
  <slot />
54
43
  </main>
@@ -0,0 +1,14 @@
1
+ ---
2
+ import PageNavigation from "./PageNavigation.astro"
3
+ import PageTitle from "./PageTitle.astro"
4
+ ---
5
+
6
+ <header
7
+ class="fixed top-0 z-50 h-14 w-full bg-white shadow-lg sm:h-20"
8
+ transition:animate="none"
9
+ >
10
+ <div class="mx-auto flex h-full max-w-screen-xl justify-between px-4 md:px-8">
11
+ <PageTitle />
12
+ <PageNavigation />
13
+ </div>
14
+ </header>
@@ -14,8 +14,10 @@ function getWidth(logo: ImageMetadata) {
14
14
  return Math.floor(size * Math.max(1, logo.width / logo.height))
15
15
  }
16
16
 
17
- const logoAlt = config.logo?.alt ?? ""
18
- const t = Astro.locals.i18n.t
17
+ const logoAlt =
18
+ config.logo?.alt ?? (config.logo?.replacesTitle ? config.title : "")
19
+
20
+ const { t } = Astro.locals.i18n
19
21
  ---
20
22
 
21
23
  <a
@@ -40,5 +42,5 @@ const t = Astro.locals.i18n.t
40
42
  loading="eager"
41
43
  />
42
44
  ))
43
- }{t(config.title)}</a
45
+ }{!config.logo?.replacesTitle && t(config.title)}</a
44
46
  >
@@ -32,7 +32,7 @@ async function createSearchItem(mediaItem: MediaItemEntry) {
32
32
  } = await getImage({
33
33
  src: image,
34
34
  format: "webp",
35
- width: 144,
35
+ width: 256,
36
36
  })
37
37
  return {
38
38
  title,
@@ -21,7 +21,7 @@ const isPortraitImage = image.height > image.width
21
21
  <Image
22
22
  class:list={isPortraitImage ? "h-52 w-auto sm:h-72" : "h-auto w-52 sm:w-72"}
23
23
  alt=""
24
- widths={[208, 288, 576, 864]}
24
+ widths={[256, 512, 768, 1024]}
25
25
  sizes="(max-width: 640px) 13rem, 18rem"
26
26
  src={image}
27
27
  quality="high"