eclipsefdn-hugo-solstice-theme 0.1.12 → 0.1.13

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/config.toml CHANGED
@@ -272,10 +272,16 @@
272
272
  weight = 1
273
273
  parent = "resources-open-source"
274
274
 
275
+ [[menus.astro]]
276
+ name = "Professional Services"
277
+ url = "https://www.eclipse.org/os4biz/services/"
278
+ weight = 2
279
+ parent = "resources-open-source"
280
+
275
281
  [[menus.astro]]
276
282
  name = "Open Source Program Offices"
277
283
  url = "https://www.eclipse.org/os4biz/ospo/"
278
- weight = 2
284
+ weight = 3
279
285
  parent = "resources-open-source"
280
286
 
281
287
  [[menus.astro]]
@@ -0,0 +1,62 @@
1
+ ---
2
+ title: Paginated Video List
3
+ date: 2022-12-15
4
+ hide_sidebar: true
5
+ ---
6
+
7
+ Renders an aggregated, paginated and filterable list of videos from playlists.
8
+
9
+ {{< paginated_video_list count="4" src="paginated_video_list_playlists" >}}
10
+
11
+ ## How it works
12
+
13
+ This shortcode uses Hugo's [resources.GetRemote](https://gohugo.io/functions/resources/getremote/) function to fetch YouTube RSS feeds for each playlist in real-time during site build. This means:
14
+
15
+ - Content is fetched at build time, not runtime, ensuring fast page loads
16
+ - Videos are automatically updated when the site is rebuilt
17
+ - No API keys are required since it uses YouTube's public RSS feeds
18
+
19
+ Note that since resources.GetRemote works at build time, any changes to the YouTube playlists will only be reflected after rebuilding the site.
20
+
21
+ ## Parameters
22
+
23
+ #### Using a data file for playlists
24
+
25
+ You can use a data file to list out the playlists which you want to use for the `paginated_video_list` shortcode.
26
+ The parameter to specify the name of the data file is `src`.
27
+
28
+ ```md
29
+ {{</* paginated_video_list src="playlists" */>}}
30
+ ```
31
+
32
+ The example above will target `/data/playlists.yml`.
33
+
34
+ The data file should have an array at the top level. Within the array, you need an object with the `title` and `id` properties.
35
+
36
+ #### Having your data files work with localization
37
+
38
+ If you want to display different playlists for different locales, you can use the `src` parameter in combination with the `localize` parameter.
39
+
40
+ The `localize` parameter is a boolean.
41
+
42
+ ```md
43
+ {{</* paginated_video_list src="playlists" localize="true" */>}}
44
+ ```
45
+
46
+ The example above will target `/data/fr/playlists.yml` if the user's locale is "fr".
47
+
48
+ ### Setting a max description length
49
+
50
+ You can change the max description character length using the `description_max` shortcode parameter. The default value is `200`.
51
+
52
+ ```md
53
+ {{</* paginated_video_list src="playlists" description_max="100" */>}}
54
+ ```
55
+
56
+ ### Setting items per page
57
+
58
+ You can control how many videos appear on each page using the `count` parameter. The default value is `6`.
59
+
60
+ ```md
61
+ {{</* paginated_video_list src="playlists" count="8" */>}}
62
+ ```
@@ -0,0 +1,12 @@
1
+ # Copyright (c) Eclipse Foundation
2
+ #
3
+ # This program and the accompanying materials are made
4
+ # available under the terms of the Eclipse Public License 2.0
5
+ # which is available at https://www.eclipse.org/legal/epl-2.0/
6
+ #
7
+ # SPDX-License-Identifier: EPL-2.0
8
+
9
+ - title: "SDV Community Interviews Sep 2022"
10
+ id: "PLy7t4z5SYNaSruNciCsq79vfquXnZ7iTi"
11
+ - title: "Virtual IoT 2022"
12
+ id: "PLy7t4z5SYNaQejP4OMb-i3hC7-fO_u03j"
@@ -0,0 +1,10 @@
1
+ {{/*
2
+ Copyright (c) 2025 Eclipse Foundation, Inc.
3
+
4
+ This program and the accompanying materials are made available under the
5
+ terms of the Eclipse Public License v. 2.0 which is available at
6
+ http://www.eclipse.org/legal/epl-2.0.
7
+
8
+ SPDX-License-Identifier: EPL-2.0
9
+ */}}
10
+ {{ .Inner | safeHTML }}
@@ -0,0 +1,39 @@
1
+ <!--
2
+ Copyright (c) Eclipse Foundation
3
+
4
+ This program and the accompanying materials are made
5
+ available under the terms of the Eclipse Public License 2.0
6
+ which is available at https://www.eclipse.org/legal/epl-2.0/
7
+
8
+ SPDX-License-Identifier: EPL-2.0
9
+ -->
10
+
11
+ {{ $params := dict
12
+ "description_max" (.Get "description_max" | default 200)
13
+ "count" (.Get "count" | default 6)
14
+ "filterable" (.Get "filterable" | default true)
15
+ }}
16
+
17
+ {{ $base := cond (eq (.Get "localize" | default "false") "false") .Site.Data (index .Site.Data .Page.Lang) }}
18
+ {{ $playlists := index $base (.Get "src") }}
19
+ {{ $store := .Store }}
20
+
21
+ {{ range $playlist := $playlists }}
22
+ {{ with resources.GetRemote (print "https://www.youtube.com/feeds/videos.xml?playlist_id=" $playlist.id) }}
23
+ {{ range $video := (.Content | transform.Unmarshal).entry }}
24
+ {{ $store.SetInMap "videos" (.title | urlize) (merge $video (dict "category" $playlist.title)) }}
25
+ {{ end }}
26
+ {{ end }}
27
+ {{ end }}
28
+
29
+ <div class="eclipsefdn-paginated-video-list" data-count="{{ $params.count }}" data-filterable="{{ $params.filterable }}">
30
+ {{ range sort ($store.GetSortedMapValues "videos") "published" "desc" }}
31
+ <div class="video-item"
32
+ data-title="{{ .title }}"
33
+ data-id="{{ .videoId }}"
34
+ data-category="{{ .category }}"
35
+ data-date='{{ time.Format "2 January 2006" .published }}'
36
+ data-description='{{ index .group "description" | truncate $params.description_max }}'
37
+ ></div>
38
+ {{ end }}
39
+ </div>
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "webpack.min.js",
5
5
  "author": "Christopher Guindon",
6
6
  "license": "EPL-2.0",
7
- "version": "0.1.12",
7
+ "version": "0.1.13",
8
8
  "bugs": {
9
9
  "url": "https://gitlab.eclipse.org/eclipsefdn/it/webdev/hugo-solstice-theme/-/issues"
10
10
  },
@@ -23,7 +23,7 @@
23
23
  "readmeFilename": "README.md",
24
24
  "dependencies": {
25
25
  "axios": "^1.7.7",
26
- "eclipsefdn-solstice-assets": "0.1.15",
26
+ "eclipsefdn-solstice-assets": "0.1.16",
27
27
  "json2yaml": "^1.1.0",
28
28
  "toml": "^3.0.0"
29
29
  },