-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
return all available tags in
/status.json
Previously, tags that were not assigned to transcripts were not available in the JSON because `.Site.Taxonomies.tags` returns only tags that have been assigned to content/transcript. To solve this, we create `all_tags.json` as part of the prebuild step in order to have access to all the tags available from Optech. This commit also switches the temporay source from which we were fetching the tags/topics as now we can get them directly from "https://bitcoinops.org/topics.json"
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 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
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 |
---|---|---|
@@ -1,9 +1,16 @@ | ||
{{ with resources.GetRemote "https://www.kouloumos.com/topics.json" }} | ||
{{ with resources.GetRemote "https://bitcoinops.org/topics.json" }} | ||
{{ $topics := unmarshal .Content }} | ||
{{ $allTags := slice }} {{/* Initialize an empty slice to store all tags */}} | ||
{{ range $topics }} | ||
{{ $allTags = $allTags | append .slug }} {{/* Add the tag slug to the slice */}} | ||
{{/* 1. */}} {{ $string := jsonify . }} | ||
{{/* 2. */}} {{ $filename := printf "tags/%s/_index.md" (urlize .slug) }} | ||
{{/* 3. */}} {{ $resource := resources.FromString $filename $string }} | ||
{{/* 4. */}} {{ $file := $resource.RelPermalink }} | ||
{{ end }} | ||
{{/* Save the list of all tags to a data file */}} | ||
{{ $dataFilename := "data/all_tags.json" }} | ||
{{ $tagsString := jsonify $allTags }} | ||
{{ $dataResource := resources.FromString $dataFilename $tagsString }} | ||
{{ $dataFile := $dataResource.RelPermalink }} | ||
{{ end }} |
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