eclipsefdn-hugo-solstice-theme 0.0.174 → 0.0.176

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.
@@ -201,6 +201,12 @@
201
201
  weight = 3
202
202
  parent = "dynamic"
203
203
 
204
+ [[main]]
205
+ name = "Video List"
206
+ url = "/components/video_list"
207
+ weight = 3
208
+ parent = "solstice"
209
+
204
210
  [[main]]
205
211
  name = "Users Display"
206
212
  url = "/components/user_display/"
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: Video List
3
+ date: 2022-12-15
4
+ hide_sidebar: true
5
+ ---
6
+
7
+ Renders a list of playlists. Accepts a comma-separated string of playlist IDs which correspond to IDs found on the [Media Link API](https://api.eclipse.org/).
8
+
9
+ {{< video_list playlist_ids="PLy7t4z5SYNaSruNciCsq79vfquXnZ7iTi, PLy7t4z5SYNaQejP4OMb-i3hC7-fO_u03j" src="playlists" >}}
10
+
11
+ ## Parameters
12
+
13
+ ### Providing playlist IDs
14
+
15
+ You can use the `playlist_ids` shortcode parameter to list out your playlist IDs. These need to be comma separated.
16
+
17
+ The playlist ID needs to be from a channel which is managed by the [Media Link API](https://api.eclipse.org/). You can find a JSON list of accepted channels [here](https://api.eclipse.org/media/youtube/managed_channels).
18
+
19
+ #### Using a data file for playlists
20
+
21
+ You can use a data file to list out the playlists which you want to use for the `video_list` shortcode.
22
+ The parameter to specify the name of the data file is `src`.
23
+
24
+ ```md
25
+ {{</* video_list src="playlists" */>}}
26
+ ```
27
+
28
+ The example above will target `/data/playlists.yml`.
29
+
30
+ The data file should have an array at the top level. Within the array, you need an object with the `playlist_id` property.
31
+
32
+ This can also be used in combination with `playlist_ids`.
33
+
34
+ #### Having your data files work with localization
35
+
36
+ If you want to display different playlists for different locales, you can use the `src` parameter in combination with the `localize` parameter.
37
+
38
+ The `localize` parameter is a boolean.
39
+
40
+ ```md
41
+ {{</* video_list src="playlists" localize="true" */>}}
42
+ ```
43
+
44
+ The example above will target `/data/fr/playlists.yml` if the user's locale is "fr".
45
+
46
+ ### Setting a max description length
47
+
48
+ You can change the max description character length using the `description_max` shortcode parameter. The default value is `200`.
49
+
50
+ ```md
51
+ {{</* video_list playlist_ids="PLy7t4z5SYNaSruNciCsq79vfquXnZ7iTi" description_max="300" */>}}
52
+ ```
@@ -0,0 +1 @@
1
+ - playlist_id: PLy7t4z5SYNaRj46WedNTnAXLLHwuk3nro
@@ -22,15 +22,15 @@
22
22
  <div class="yamm-content">
23
23
  <div class="row">
24
24
  <div class="col-sm-24">
25
- <p><strong>{{ i18n "search-section-label" }}</strong></p>
26
- <div class="row">
27
- <div class="col-md-24">
28
- <div id="custom-search-form" class="reset-box-sizing">
29
- <script async src="https://cse.google.com/cse.js?cx={{ .Site.Params.gcse }}"></script>
30
- <gcse:searchbox-only gname="main" resultsUrl="{{- .Site.Params.gcse_result_url | default "https://www.eclipse.org/home/search" }}"></gcse:searchbox-only>
31
- </div>
25
+ <p>
26
+ <strong>{{ i18n "search-section-label" }}</strong>
27
+ </p>
28
+ <form action="https://www.eclipse.org/home/search" method="get">
29
+ <div class="form-group">
30
+ <input class="form-control margin-bottom-10" type="textfield" name="q" placeholder="Search">
31
+ <input class="btn btn-primary" type="submit" value="Submit">
32
32
  </div>
33
- </div>
33
+ </form>
34
34
  </div>
35
35
  </div>
36
36
  </div>
@@ -0,0 +1,26 @@
1
+ {{ $playlist_ids := .Get "playlist_ids" | default "" }}
2
+ {{ $description_max := .Get "description_max" | default 200 }}
3
+ {{ $template_id := .Get "template_id" | default "" }}
4
+ {{ $src := .Get "src" }}
5
+ {{ $localize := .Get "localize" | default "false" }}
6
+
7
+ {{ if $src }}
8
+ {{ $currLang := .Page.Lang }}
9
+ {{ if ne $localize "false" }}
10
+ {{ .Scratch.Set "base" (index .Site.Data $currLang) }}
11
+ {{ else }}
12
+ {{ .Scratch.Set "base" .Site.Data }}
13
+ {{ end }}
14
+ {{ $base := .Scratch.Get "base" }}
15
+ {{ $data := index $base $src }}
16
+ {{ range $data }}
17
+ {{ $playlist_ids = printf "%s, %s" $playlist_ids .playlist_id }}
18
+ {{ end }}
19
+ {{ end }}
20
+
21
+ <div
22
+ class="eclipsefdn-video-list"
23
+ data-playlist-ids="{{ $playlist_ids }}"
24
+ {{ with $description_max -}} data-description-max-length="{{ . }}" {{- end }}
25
+ {{ with $template_id -}} data-template-id="{{ . }}" {{- end }}
26
+ ></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.0.174",
7
+ "version": "0.0.176",
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": "^0.21.1",
26
- "eclipsefdn-solstice-assets": "^0.0.212",
26
+ "eclipsefdn-solstice-assets": "0.0.213",
27
27
  "json2yaml": "^1.1.0",
28
28
  "toml": "^3.0.0"
29
29
  },