-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add partials for api settings and preview URL and refactor
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
- Loading branch information
1 parent
22e75a8
commit f6ad7a8
Showing
6 changed files
with
55 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
modules/youtube/layouts/partials/func/getYTPreviewUrl.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{- $config := site.Params.dnb.youtube -}} | ||
|
||
{{- $id := . -}} | ||
|
||
{{- $url := "https://i.ytimg.com/vi" -}} | ||
{{- if compare.Eq (collections.Index $config "thumbnail_source" | compare.Default 1) 1 -}} | ||
{{- $url = "https://ytimg.googleusercontent.com/vi" -}} | ||
{{- end -}} | ||
|
||
{{- $output := dict | ||
"maxres" (printf "%s/%s/maxresdefault.jpg" $url $id) | ||
"lowres" (printf "%s/%s/sddefault.jpg" $url $id) -}} | ||
|
||
{{- return $output -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{- $params := site.Params.dnb.youtube.apiparams -}} | ||
{{- $params = collections.Merge (dict "hl" site.Language.Lang) $params -}} | ||
{{- $paramsCollected := "" -}} | ||
{{- range $key, $value := $params -}} | ||
{{- $paramsCollected = fmt.Printf "%s&%s=%s" $paramsCollected $key $value -}} | ||
{{- end -}} | ||
{{- return $params -}} |
10 changes: 0 additions & 10 deletions
10
modules/youtube/layouts/partials/getYoutubePreviewUrl.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters