lightnet 3.4.6 → 3.5.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +42 -10
  2. package/__e2e__/fixtures/basics/node_modules/.bin/astro +2 -2
  3. package/__e2e__/fixtures/basics/package.json +2 -2
  4. package/exports/components.ts +1 -0
  5. package/package.json +8 -7
  6. package/src/astro-integration/config.ts +6 -3
  7. package/src/components/HeroSection.astro +35 -7
  8. package/src/components/SearchSection.astro +16 -0
  9. package/src/components/Section.astro +20 -4
  10. package/src/i18n/translations/TRANSLATION-STATUS.md +1 -1
  11. package/src/i18n/translations/de.yml +1 -2
  12. package/src/i18n/translations/en.yml +3 -8
  13. package/src/i18n/translations/ru.yml +1 -2
  14. package/src/i18n/translations/uk.yml +1 -2
  15. package/src/i18n/translations.ts +0 -1
  16. package/src/layouts/Page.astro +1 -0
  17. package/src/layouts/components/PageNavigation.astro +13 -7
  18. package/src/pages/details-page/components/main-details/AudioPlayer.astro +1 -1
  19. package/src/pages/details-page/components/main-details/Cover.astro +1 -0
  20. package/src/pages/search-page/SearchPageRoute.astro +10 -40
  21. package/src/pages/search-page/components/LoadingSkeleton.tsx +19 -0
  22. package/src/pages/search-page/components/SearchFilter.astro +65 -0
  23. package/src/pages/search-page/components/SearchFilter.tsx +33 -84
  24. package/src/pages/search-page/components/SearchList.astro +50 -0
  25. package/src/pages/search-page/components/SearchList.tsx +117 -0
  26. package/src/pages/search-page/components/SearchListItem.tsx +105 -0
  27. package/src/pages/search-page/components/Select.tsx +5 -5
  28. package/src/pages/search-page/hooks/use-search-query-param.ts +31 -0
  29. package/src/pages/search-page/hooks/use-search.ts +103 -49
  30. package/src/pages/search-page/utils/search-filter-translations.ts +20 -0
  31. package/src/pages/search-page/utils/search-query.ts +76 -0
  32. package/src/pages/search-page/utils/search-translations.ts +1 -12
  33. package/src/pages/search-page/Search.tsx +0 -71
  34. package/src/pages/search-page/components/ResultList.tsx +0 -135
  35. package/src/pages/search-page/types.ts +0 -11
  36. package/src/pages/search-page/utils/use-provided-translations.ts +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # lightnet
2
2
 
3
+ ## 3.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#273](https://github.com/LightNetDev/LightNet/pull/273) [`5b0b24f`](https://github.com/LightNetDev/LightNet/commit/5b0b24f58a6b8df8a3bc7dc66b751981f4e0498e) Thanks [@smn-cds](https://github.com/smn-cds)! - Add `disableHorizontalPadding` option to `Section` component.
8
+
9
+ - [#273](https://github.com/LightNetDev/LightNet/pull/273) [`5b0b24f`](https://github.com/LightNetDev/LightNet/commit/5b0b24f58a6b8df8a3bc7dc66b751981f4e0498e) Thanks [@smn-cds](https://github.com/smn-cds)! - Add lightnet config option `searchPage.hideHeaderSearchIcon`
10
+
11
+ Set to true, this will remove the search magnifier icon from the header bar. For example this option can
12
+ be useful if a site directly provides the search on the homepage.
13
+
14
+ - [#273](https://github.com/LightNetDev/LightNet/pull/273) [`5b0b24f`](https://github.com/LightNetDev/LightNet/commit/5b0b24f58a6b8df8a3bc7dc66b751981f4e0498e) Thanks [@smn-cds](https://github.com/smn-cds)! - Implement infinite scroll for search results.
15
+
16
+ - [#273](https://github.com/LightNetDev/LightNet/pull/273) [`5b0b24f`](https://github.com/LightNetDev/LightNet/commit/5b0b24f58a6b8df8a3bc7dc66b751981f4e0498e) Thanks [@smn-cds](https://github.com/smn-cds)! - Add `SearchSection` component.
17
+
18
+ Add the search to your homepage as simple as:
19
+
20
+ ```astro
21
+ ---
22
+ import { Page, SearchSection } from "lightnet/components"
23
+ ---
24
+
25
+ <Page>
26
+ <SearchSection />
27
+ </Page>
28
+ ```
29
+
30
+ - [#273](https://github.com/LightNetDev/LightNet/pull/273) [`5b0b24f`](https://github.com/LightNetDev/LightNet/commit/5b0b24f58a6b8df8a3bc7dc66b751981f4e0498e) Thanks [@smn-cds](https://github.com/smn-cds)! - Add optional search input to `HeroSection`.
31
+
32
+ Enable it by setting the HeroSection's `showSearch` property to `true`.
33
+ By default `showSearch` is set to `false`.
34
+
35
+ - [#273](https://github.com/LightNetDev/LightNet/pull/273) [`5b0b24f`](https://github.com/LightNetDev/LightNet/commit/5b0b24f58a6b8df8a3bc7dc66b751981f4e0498e) Thanks [@smn-cds](https://github.com/smn-cds)! - Add fields to search index
36
+
37
+ The search text input also searches language, type and categories of a media item in the current site language.
38
+
39
+ Pro tip: Search for "theology | book" to find theology books. The [extended search syntax](https://www.fusejs.io/examples.html#extended-search) can do even more...
40
+
41
+ - [#273](https://github.com/LightNetDev/LightNet/pull/273) [`5b0b24f`](https://github.com/LightNetDev/LightNet/commit/5b0b24f58a6b8df8a3bc7dc66b751981f4e0498e) Thanks [@smn-cds](https://github.com/smn-cds)! - Update Translations
42
+ - remove `ln.search.more-results`. Because search now uses infinite scroll there is no need for this button label anymore 🎉.
43
+ - change value of `ln.search.placeholder` from "Search by title, author or description..." to "Search media...". Search now also searches on categories, type, language and id of a media item.
44
+
3
45
  ## 3.4.6
4
46
 
5
47
  ### Patch Changes
@@ -37,7 +79,6 @@
37
79
  ### Patch Changes
38
80
 
39
81
  - [#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:
40
-
41
82
  - Improve image quality on search result items
42
83
  - Limit the size of the media list image
43
84
  - Streamline details page cover image variants
@@ -120,7 +161,6 @@
120
161
  - [#234](https://github.com/LightNetDev/LightNet/pull/234) [`1cb0dc0`](https://github.com/LightNetDev/LightNet/commit/1cb0dc0ef2d7a3ecb5d2a37a36f2f2e8fa97a756) Thanks [@smn-cds](https://github.com/smn-cds)! - Renames custom details pages prop `slug` to `mediaId`.
121
162
 
122
163
  - [#234](https://github.com/LightNetDev/LightNet/pull/234) [`1cb0dc0`](https://github.com/LightNetDev/LightNet/commit/1cb0dc0ef2d7a3ecb5d2a37a36f2f2e8fa97a756) Thanks [@smn-cds](https://github.com/smn-cds)! - Streamline handling of components. Make sure all components including a section are suffixed with `Section`.
123
-
124
164
  - Removes `Gallery` export
125
165
  - Adds `MediaGallerySection` that includes the section component
126
166
  - Renames `Hero` to `HeroSection`
@@ -128,7 +168,6 @@
128
168
  - Renames `MediaItemList` to `MediaList`
129
169
 
130
170
  - [#234](https://github.com/LightNetDev/LightNet/pull/234) [`1cb0dc0`](https://github.com/LightNetDev/LightNet/commit/1cb0dc0ef2d7a3ecb5d2a37a36f2f2e8fa97a756) Thanks [@smn-cds](https://github.com/smn-cds)! - Improve Section
131
-
132
171
  - rename maxWidth values: `full` => `wide`, `prose` => `narrow`
133
172
  - add marginTop settings: `none`, `sm`, `lg`
134
173
 
@@ -159,7 +198,6 @@
159
198
  ### Minor Changes
160
199
 
161
200
  - [#228](https://github.com/LightNetDev/LightNet/pull/228) [`b3bb5cc`](https://github.com/LightNetDev/LightNet/commit/b3bb5cc97a4f14ccb46c68f9dcdbe73d74563452) Thanks [@smn-cds](https://github.com/smn-cds)! - Add builtin languages
162
-
163
201
  - Russian
164
202
  - Ukrainian
165
203
 
@@ -186,7 +224,6 @@
186
224
  ### Minor Changes
187
225
 
188
226
  - [#220](https://github.com/LightNetDev/LightNet/pull/220) [`e10c96f`](https://github.com/LightNetDev/LightNet/commit/e10c96fb850db6d043c9bc0c929170c271979492) Thanks [@smn-cds](https://github.com/smn-cds)! - Update Tailwind CSS to v4
189
-
190
227
  - updates `tailwindcss` dependency to version ^4.
191
228
  - `@astro/tailwindcss` dependency has been replaced with `@tailwindcss/vite`
192
229
  - removes the use of `tailwind.config.js` inside site projects
@@ -224,7 +261,6 @@
224
261
  This update introduces major changes on our translation system.
225
262
 
226
263
  Changes:
227
-
228
264
  - Translations are now stored inside `.yml` files.
229
265
  - Added i18next as our translation engine
230
266
  - Translations now support a flat i18next syntax including (pluralization, contextualization, interpolation)
@@ -292,7 +328,6 @@
292
328
  - [#183](https://github.com/LightNetDev/lightnet/pull/183) [`9c0bb8d`](https://github.com/LightNetDev/lightnet/commit/9c0bb8d2508f8bfbb18dd224a36e7f5d75f89268) Thanks [@smn-cds](https://github.com/si-fab)! - Makes logo config optional.
293
329
 
294
330
  - [#183](https://github.com/LightNetDev/lightnet/pull/183) [`9c0bb8d`](https://github.com/LightNetDev/lightnet/commit/9c0bb8d2508f8bfbb18dd224a36e7f5d75f89268) Thanks [@smn-cds](https://github.com/si-fab)! - Rename `Section` component properties
295
-
296
331
  - change property name `width` to `maxWidth`
297
332
  - change property value `content` to `prose`
298
333
 
@@ -305,7 +340,6 @@
305
340
  Prefixing custom translation strings with `custom.` is non mandatory but recommended as it improves validation.
306
341
 
307
342
  This is changed:
308
-
309
343
  - rename translate parameter `fallbackToKey` to `allowFixedStrings`.
310
344
  - change behavior of the translate function. If `allowFixedStrings` is set to `true`, return the translation key if no translation is found. But fail if the key starts with `custom.` or `ln.` prefix.
311
345
  - change example to reflect the new convention of prefixing custom translation keys with `custom.`.
@@ -375,7 +409,6 @@
375
409
  - [#176](https://github.com/LightNetDev/lightnet/pull/176) [`6b4a664`](https://github.com/LightNetDev/lightnet/commit/6b4a66490079b0688577e6052ab9d7f2d0686170) Thanks [@smn-cds](https://github.com/si-fab)! - Extend Astro.locals.i18n object
376
410
 
377
411
  Provide:
378
-
379
412
  - `defaultLocale`
380
413
  - `currentLocale`
381
414
  - `locales`
@@ -396,7 +429,6 @@
396
429
  - [#174](https://github.com/LightNetDev/lightnet/pull/174) [`bb011bf`](https://github.com/LightNetDev/lightnet/commit/bb011bfef8c2d7745e3c3417f7f6ef608867e184) Thanks [@smn-cds](https://github.com/si-fab)! - Update Astro to version 5.
397
430
 
398
431
  Fix your project by doing this:
399
-
400
432
  - move `/src/content/config.ts` to `/src/content.config.ts`.
401
433
  - update tsconfig.json to match the following:
402
434
 
@@ -6,9 +6,9 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.8.1_@types+node@22.15.29_jiti@2.4.2_lightningcss@1.29.1_rollup@4.41.1_terser@5.39.0_typescript@5.8.3_yaml@2.8.0/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.8.1_@types+node@22.15.29_jiti@2.4.2_lightningcss@1.29.1_rollup@4.41.1_terser@5.39.0_typescript@5.8.3_yaml@2.8.0/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.10.1_@types+node@24.0.8_jiti@2.4.2_lightningcss@1.29.1_rollup@4.44.1_terser@5.39.0_typescript@5.8.3_yaml@2.8.0/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.10.1_@types+node@24.0.8_jiti@2.4.2_lightningcss@1.29.1_rollup@4.44.1_terser@5.39.0_typescript@5.8.3_yaml@2.8.0/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.8.1_@types+node@22.15.29_jiti@2.4.2_lightningcss@1.29.1_rollup@4.41.1_terser@5.39.0_typescript@5.8.3_yaml@2.8.0/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.8.1_@types+node@22.15.29_jiti@2.4.2_lightningcss@1.29.1_rollup@4.41.1_terser@5.39.0_typescript@5.8.3_yaml@2.8.0/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
11
+ export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.10.1_@types+node@24.0.8_jiti@2.4.2_lightningcss@1.29.1_rollup@4.44.1_terser@5.39.0_typescript@5.8.3_yaml@2.8.0/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.10.1_@types+node@24.0.8_jiti@2.4.2_lightningcss@1.29.1_rollup@4.44.1_terser@5.39.0_typescript@5.8.3_yaml@2.8.0/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
14
  exec "$basedir/node" "$basedir/../astro/astro.js" "$@"
@@ -7,8 +7,8 @@
7
7
  "@astrojs/react": "^4.3.0",
8
8
  "@astrojs/tailwind": "^6.0.2",
9
9
  "@lightnet/decap-admin": "^3.1.1",
10
- "astro": "^5.8.1",
11
- "lightnet": "^3.4.4",
10
+ "astro": "^5.10.1",
11
+ "lightnet": "^3.5.0",
12
12
  "react": "^19.1.0",
13
13
  "react-dom": "^19.1.0",
14
14
  "sharp": "^0.33.5",
@@ -4,6 +4,7 @@ export { default as HighlightSection } from "../src/components/HighlightSection.
4
4
  export { default as Icon } from "../src/components/Icon"
5
5
  export { default as MediaGallerySection } from "../src/components/MediaGallerySection.astro"
6
6
  export { default as MediaList } from "../src/components/MediaList.astro"
7
+ export { default as SearchSection } from "../src/components/SearchSection.astro"
7
8
  export { default as Section } from "../src/components/Section.astro"
8
9
  export { default as VideoPlayer } from "../src/components/VideoPlayer.astro"
9
10
  export { default as MarkdownPage } from "../src/layouts/MarkdownPage.astro"
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "lightnet",
3
3
  "type": "module",
4
4
  "license": "MIT",
5
- "version": "3.4.6",
5
+ "version": "3.5.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/LightNetDev/lightnet",
@@ -45,17 +45,18 @@
45
45
  "@iconify-json/mdi": "^1.2.3",
46
46
  "@iconify/tailwind": "^1.2.0",
47
47
  "@tailwindcss/typography": "^0.5.16",
48
- "@types/react": "^19.1.6",
48
+ "@tanstack/react-virtual": "^3.13.12",
49
+ "@types/react": "^19.1.8",
49
50
  "daisyui": "^4.12.24",
50
51
  "fuse.js": "^7.1.0",
51
- "i18next": "^25.2.1",
52
- "marked": "^15.0.12",
52
+ "i18next": "^25.3.0",
53
+ "marked": "^16.0.0",
53
54
  "yaml": "^2.8.0"
54
55
  },
55
56
  "devDependencies": {
56
- "@playwright/test": "^1.52.0",
57
- "@types/node": "^22.15.29",
58
- "vitest": "^3.1.4"
57
+ "@playwright/test": "^1.53.2",
58
+ "@types/node": "^22.15.34",
59
+ "vitest": "^3.2.4"
59
60
  },
60
61
  "scripts": {
61
62
  "test": "vitest",
@@ -203,11 +203,14 @@ export const configSchema = z.object({
203
203
  searchPage: z
204
204
  .object({
205
205
  /**
206
- * When this is set to true, search results will be initially
207
- * filtered by site language. The filter will only be set when there
208
- * is any media item in the site language.
206
+ * Set this to true, to initially filter search results by current site language.
207
+ * The filter will only be set when there is any media item in the site language.
209
208
  */
210
209
  filterByLocale: z.boolean().default(false),
210
+ /**
211
+ * Set this to true, to remove the search magnifier icon from the header bar.
212
+ */
213
+ hideHeaderSearchIcon: z.boolean().default(false),
211
214
  })
212
215
  .optional(),
213
216
  })
@@ -2,6 +2,8 @@
2
2
  import type { ImageMetadata } from "astro"
3
3
  import { Image } from "astro:assets"
4
4
 
5
+ import Icon from "./Icon"
6
+
5
7
  interface Props {
6
8
  image: ImageMetadata
7
9
  title?: string
@@ -11,6 +13,7 @@ interface Props {
11
13
  subtitleSize?: "sm" | "md" | "lg" | "xl"
12
14
  subtitleClass?: string
13
15
  className?: string
16
+ showSearch?: boolean
14
17
  }
15
18
  const {
16
19
  image,
@@ -21,6 +24,7 @@ const {
21
24
  titleClass,
22
25
  subtitleClass,
23
26
  className,
27
+ showSearch = false,
24
28
  } = Astro.props
25
29
 
26
30
  const titleSizes = {
@@ -36,26 +40,27 @@ const subtitleSizes = {
36
40
  lg: "text-lg sm:text-xl md:text-3xl",
37
41
  xl: "text-xl sm:text-2xl md:text-4xl",
38
42
  } as const
43
+
44
+ const t = Astro.locals.i18n.t
39
45
  ---
40
46
 
41
47
  <div class="w-full">
42
48
  <div class="group relative">
43
49
  <Image
44
- class="h-72 w-full object-cover object-center md:h-[20rem] lg:h-[24rem] xl:h-[30rem]"
50
+ class="h-[20rem] w-full object-cover object-center lg:h-[24rem] xl:h-[30rem]"
45
51
  src={image}
46
- widths={[320, 768, 1280, 2560, 3000]}
47
- sizes="100vw"
48
- loading="eager"
52
+ layout="full-width"
53
+ priority={true}
49
54
  alt=""
50
55
  />
51
56
  <div
52
- class="bg-gradient-radial absolute top-0 flex h-full w-full flex-col items-center justify-center gap-6 from-black/30 to-black/40 p-4 text-center text-gray-50"
57
+ class="bg-gradient-radial absolute top-0 flex h-full w-full flex-col items-center justify-center from-black/30 to-black/40 p-4 text-center text-gray-50"
53
58
  class:list={[className]}
54
59
  >
55
60
  {
56
61
  title && (
57
62
  <h1
58
- class="max-w-screen-md font-bold transition-transform duration-1000 group-hover:scale-[102%]"
63
+ class="max-w-screen-md font-bold tracking-tight transition-transform duration-1000 group-hover:scale-[102%]"
59
64
  class:list={[titleSizes[titleSize], titleClass]}
60
65
  >
61
66
  {title}
@@ -65,7 +70,7 @@ const subtitleSizes = {
65
70
  {
66
71
  subtitle && (
67
72
  <p
68
- class="max-w-screen-sm font-bold"
73
+ class="mt-1 max-w-screen-sm font-bold md:mt-2"
69
74
  class:list={[
70
75
  "sm:text-lg md:text-2xl",
71
76
  subtitleSizes[subtitleSize],
@@ -76,6 +81,29 @@ const subtitleSizes = {
76
81
  </p>
77
82
  )
78
83
  }
84
+ {
85
+ showSearch && (
86
+ <form
87
+ action={`/${Astro.currentLocale}/media`}
88
+ method="get"
89
+ class="dy-join group mt-6 w-full max-w-sm rounded-2xl shadow-md outline-2 outline-offset-2 outline-gray-400 group-focus-within:outline md:mt-10 md:max-w-md"
90
+ >
91
+ <input
92
+ class="dy-input dy-join-item grow rounded-2xl bg-gray-100/95 text-gray-900 placeholder-gray-500 shadow-inner focus:outline-none"
93
+ enterkeyhint="search"
94
+ type="search"
95
+ name="search"
96
+ placeholder={t("ln.search.placeholder")}
97
+ />
98
+ <button
99
+ type="submit"
100
+ class="dy-btn dy-join-item rounded-2xl border-gray-100/95 bg-gray-800 text-gray-50 hover:bg-gray-950 hover:text-gray-300"
101
+ >
102
+ <Icon className="mdi--magnify" ariaLabel={t("ln.search.title")} />
103
+ </button>
104
+ </form>
105
+ )
106
+ }
79
107
  <slot />
80
108
  </div>
81
109
  </div>
@@ -0,0 +1,16 @@
1
+ ---
2
+ import SearchFilter from "../pages/search-page/components/SearchFilter.astro"
3
+ import SearchList from "../pages/search-page/components/SearchList.astro"
4
+ import Section, { type Props as SectionProps } from "./Section.astro"
5
+
6
+ // we need the semi-colon for the astro compiler :(
7
+ // prettier-ignore
8
+ type Props = Omit<SectionProps, "disableHorizontalPadding" | "maxWidth">;
9
+ ---
10
+
11
+ <Section {...Astro.props} disableHorizontalPadding={true} maxWidth="narrow">
12
+ <div class="px-4 md:px-8">
13
+ <SearchFilter />
14
+ </div>
15
+ <SearchList />
16
+ </Section>
@@ -1,5 +1,5 @@
1
1
  ---
2
- interface Props {
2
+ export interface Props {
3
3
  /**
4
4
  * Id to set to the section element.
5
5
  * For example this can be used to reference it inside anchors.
@@ -21,6 +21,13 @@ interface Props {
21
21
  * @default "lg"
22
22
  */
23
23
  marginTop?: "sm" | "lg" | "none"
24
+ /**
25
+ * Remove padding from the left and right side of the content.
26
+ * This will not apply to the section title.
27
+ *
28
+ * @default false
29
+ */
30
+ disableHorizontalPadding?: boolean
24
31
  /**
25
32
  * Title on top of the section.
26
33
  */
@@ -35,6 +42,7 @@ const {
35
42
  id,
36
43
  maxWidth = "wide",
37
44
  marginTop = "lg",
45
+ disableHorizontalPadding = false,
38
46
  title,
39
47
  className,
40
48
  } = Astro.props
@@ -52,13 +60,21 @@ const marginTopValues = {
52
60
  ---
53
61
 
54
62
  <section
55
- class="mx-auto px-4 md:px-8"
56
- class:list={[maxWidths[maxWidth], marginTopValues[marginTop], className]}
63
+ class="mx-auto"
64
+ class:list={[
65
+ maxWidths[maxWidth],
66
+ marginTopValues[marginTop],
67
+ !disableHorizontalPadding && "px-4 md:px-8",
68
+ className,
69
+ ]}
57
70
  id={id}
58
71
  >
59
72
  {
60
73
  title && (
61
- <h2 class="mb-10 text-2xl font-bold text-gray-700 sm:mb-12 sm:text-3xl">
74
+ <h2
75
+ class="mb-10 text-2xl font-bold text-gray-700 sm:mb-12 sm:text-3xl"
76
+ class:list={[disableHorizontalPadding && "px-4 md:px-8"]}
77
+ >
62
78
  {title}
63
79
  </h2>
64
80
  )
@@ -1,6 +1,6 @@
1
1
  # Translation status
2
2
 
3
- This report provides an overview of all built-in languages and the current progress of their translations.
3
+ This autogenerated report shows all built-in languages and the current status of their translations.
4
4
 
5
5
  ## **DE** ([de.yml](./de.yml))
6
6
 
@@ -16,8 +16,7 @@ ln.home.title: Startseite
16
16
  ln.search.all-categories: Alle Kategorien
17
17
  ln.search.all-languages: Alle Sprachen
18
18
  ln.search.all-types: Alle Typen
19
- ln.search.more-results: Mehr Ergebnisse
20
19
  ln.search.no-results: Keine Ergebnisse
21
- ln.search.placeholder: Suche in Titel, Autor, Beschreibung...
20
+ ln.search.placeholder: Medien durchsuchen...
22
21
  ln.search.title: Suche
23
22
  ln.share.url-copied-to-clipboard: Link in die Zwischenablage kopiert
@@ -61,11 +61,11 @@ ln.external-link: External link
61
61
  # Used on: https://sk8-ministries.pages.dev/en/media/ (not visible)
62
62
  ln.search.title: Search
63
63
 
64
- # Placeholder text for the main search box.
65
- # English: Search by title, author or description...
64
+ # Placeholder text for the search input to search for media items.
65
+ # English: Search media...
66
66
  #
67
67
  # Used on: https://sk8-ministries.pages.dev/en/media/
68
- ln.search.placeholder: Search by title, author or description...
68
+ ln.search.placeholder: Search media...
69
69
 
70
70
  # Filter option to display content in all languages.
71
71
  #
@@ -85,11 +85,6 @@ ln.search.all-types: All types
85
85
  # Used on: https://sk8-ministries.pages.dev/en/media/
86
86
  ln.search.all-categories: All categories
87
87
 
88
- # Button label to load more search results.
89
- #
90
- # English: More results
91
- ln.search.more-results: More results
92
-
93
88
  # Message displayed when no search results are found.
94
89
  #
95
90
  # English: No results
@@ -8,11 +8,10 @@ ln.languages: Языки
8
8
  ln.type: Тип
9
9
  ln.external-link: Внешняя ссылка
10
10
  ln.search.title: Поиск
11
- ln.search.placeholder: Поиск по названию, автору, описанию...
11
+ ln.search.placeholder: Поиск медиа...
12
12
  ln.search.all-languages: Все языки
13
13
  ln.search.all-types: Все типы
14
14
  ln.search.all-categories: Все категории
15
- ln.search.more-results: Больше результатов
16
15
  ln.search.no-results: Нет результатов
17
16
  ln.details.open: Открыть
18
17
  ln.details.share: Поделиться
@@ -8,11 +8,10 @@ ln.languages: Мови
8
8
  ln.type: Тип
9
9
  ln.external-link: Зовнішнє посилання
10
10
  ln.search.title: Пошук
11
- ln.search.placeholder: Пошук за назвою, автором, описом...
11
+ ln.search.placeholder: Пошук медіа...
12
12
  ln.search.all-languages: Усі мови
13
13
  ln.search.all-types: Усі типи
14
14
  ln.search.all-categories: Усі категорії
15
- ln.search.more-results: Більше результатів
16
15
  ln.search.no-results: Немає результатів
17
16
  ln.details.open: Відкрити
18
17
  ln.details.share: Поділитися
@@ -66,7 +66,6 @@ export type LightNetTranslationKey =
66
66
  | "ln.search.all-categories"
67
67
  | "ln.search.all-languages"
68
68
  | "ln.search.all-types"
69
- | "ln.search.more-results"
70
69
  | "ln.search.no-results"
71
70
  | "ln.search.placeholder"
72
71
  | "ln.search.title"
@@ -35,6 +35,7 @@ const language = resolveLanguage(currentLocale)
35
35
  <ClientRouter />
36
36
  </head>
37
37
  <body
38
+ transition:animate="none"
38
39
  class="flex min-h-screen flex-col overflow-y-scroll bg-gray-50 text-gray-900"
39
40
  >
40
41
  <Header />
@@ -32,13 +32,19 @@ const t = Astro.locals.i18n.t
32
32
  ---
33
33
 
34
34
  <nav class="-me-3 flex items-center">
35
- <a
36
- class="hover:text-primary flex p-3 text-gray-600"
37
- aria-label={t("ln.search.title")}
38
- data-astro-prefetch="viewport"
39
- href={searchPagePath(Astro.currentLocale)}
40
- ><Icon className="mdi--magnify" ariaLabel="" /></a
41
- >
35
+ {
36
+ !config.searchPage?.hideHeaderSearchIcon && (
37
+ <a
38
+ class="hover:text-primary flex p-3 text-gray-600"
39
+ aria-label={t("ln.search.title")}
40
+ data-astro-prefetch="viewport"
41
+ href={searchPagePath(Astro.currentLocale)}
42
+ >
43
+ <Icon className="mdi--magnify" ariaLabel="" />
44
+ </a>
45
+ )
46
+ }
47
+
42
48
  <LanguagePicker />
43
49
 
44
50
  {
@@ -14,7 +14,7 @@ if (!src.endsWith(".mp3")) {
14
14
  }
15
15
  ---
16
16
 
17
- <audio class="rounded-xl" class:list={[className]} src={src} controls></audio>
17
+ <audio class="rounded-2xl" class:list={[className]} src={src} controls></audio>
18
18
 
19
19
  <style>
20
20
  audio::-webkit-media-controls-enclosure {
@@ -26,6 +26,7 @@ const isPortraitImage = image.height > image.width
26
26
  src={image}
27
27
  quality="high"
28
28
  loading="eager"
29
+ fetchpriority="high"
29
30
  />
30
31
  {
31
32
  style === "book" && (
@@ -1,51 +1,21 @@
1
1
  ---
2
- import config from "virtual:lightnet/config"
3
-
4
- import { getCategories } from "../../content/get-categories"
5
- import { contentLanguages } from "../../content/get-languages"
6
- import { getMediaTypes } from "../../content/get-media-types"
7
2
  import Page from "../../layouts/Page.astro"
8
- import Search from "./Search"
9
- import { provideTranslations } from "./utils/search-translations"
3
+ import SearchFilter from "./components/SearchFilter.astro"
4
+ import SearchList from "./components/SearchList.astro"
10
5
 
11
6
  export { getLocalePaths as getStaticPaths } from "../../i18n/get-locale-paths"
12
7
 
13
- const { t, currentLocale } = Astro.locals.i18n
14
-
15
- const categories: Record<string, string> = {}
16
- for (const { id, name } of await getCategories(currentLocale, t)) {
17
- categories[id] = name
18
- }
19
-
20
- const mediaTypes = (await getMediaTypes())
21
- .map((type) => ({
22
- id: type.id,
23
- label: t(type.data.label),
24
- icon: type.data.icon,
25
- }))
26
- .sort((a, b) => a.label.localeCompare(b.label, currentLocale))
27
-
28
- const translatedContentLanguages = contentLanguages
29
- .map((language) => ({
30
- ...language,
31
- name: t(language.label),
32
- }))
33
- .sort((a, b) => a.name.localeCompare(b.name, currentLocale))
34
-
35
- const filterByLocale = !!config.searchPage?.filterByLocale
8
+ const { t } = Astro.locals.i18n
36
9
  ---
37
10
 
38
11
  <Page>
39
12
  <div class="mx-auto max-w-screen-md">
40
- <Search
41
- client:only="react"
42
- contentLanguages={translatedContentLanguages}
43
- mediaTypes={mediaTypes}
44
- translations={provideTranslations(t)}
45
- locale={currentLocale}
46
- direction={Astro.locals.i18n.direction}
47
- categories={categories}
48
- filterByLocale={filterByLocale}
49
- />
13
+ <div class="px-4 md:px-8">
14
+ <h1 class="mb-4 mt-8 text-4xl md:mb-8 md:mt-12 md:text-5xl">
15
+ {t("ln.search.title")}
16
+ </h1>
17
+ <SearchFilter />
18
+ </div>
19
+ <SearchList />
50
20
  </div>
51
21
  </Page>
@@ -0,0 +1,19 @@
1
+ import Icon from "../../../components/Icon"
2
+
3
+ export default function LoadingSkeleton({ direction }: { direction: string }) {
4
+ return (
5
+ <div className="flex h-52 animate-pulse items-center overflow-hidden py-2 sm:h-64">
6
+ <div className="h-36 w-36 shrink-0 rounded-md bg-gray-200"></div>
7
+ <div className="ms-5 flex grow flex-col gap-3">
8
+ <div className="h-4 w-1/2 rounded-md bg-gray-200 md:h-6"></div>
9
+ <div className="h-4 w-3/4 rounded-md bg-gray-200 md:h-6"></div>
10
+ <div className="h-4 w-5/6 rounded-md bg-gray-200 md:h-6"></div>
11
+ </div>
12
+ <Icon
13
+ className="mdi--chevron-right my-auto me-4 ms-2 hidden shrink-0 text-2xl text-gray-300 sm:block"
14
+ flipIcon={direction === "rtl"}
15
+ ariaLabel=""
16
+ />
17
+ </div>
18
+ )
19
+ }