Skip to content

Commit

Permalink
Add Gridding Cookbook to the gallery (#159)
Browse files Browse the repository at this point in the history
* Update cookbook_gallery.txt

* Fix bug for handling empty tags

* dual test for Nones

---------

Co-authored-by: Brian Rose <[email protected]>
  • Loading branch information
r-ford and brian-rose authored Aug 7, 2023
1 parent d09920a commit a36e86f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions site/_extensions/gallery_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def generate_repo_dicts(all_items):
gallery_info_dict = yaml.safe_load(requests.get(gallery_info_url).content)
thumbnail = gallery_info_dict["thumbnail"]
tag_dict = {
k: v for k, v in gallery_info_dict["tags"].items() if v[0] is not None
k: v for k, v in gallery_info_dict["tags"].items() if (v is not None and v[0] is not None)
}

except:
Expand All @@ -81,7 +81,7 @@ def generate_repo_dicts(all_items):
authors = config_dict["author"]
thumbnail = config_dict["thumbnail"]
tag_dict = {
k: v for k, v in config_dict["tags"].items() if v[0] is not None
k: v for k, v in config_dict["tags"].items() if (v is not None and v[0] is not None)
}

repo_dict = {
Expand Down
3 changes: 2 additions & 1 deletion site/cookbook_gallery.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ kerchunk-cookbook
xbatcher-ML-1-cookbook
dask-cookbook
ERA5_interactive-cookbook
web-map-feature-services-cookbook
web-map-feature-services-cookbook
gridding-cookbook

0 comments on commit a36e86f

Please sign in to comment.