From dbf4b96a51f4d09979ed8aba8aed3a24b5a3e79f Mon Sep 17 00:00:00 2001 From: Julia Kent <46687291+jukent@users.noreply.github.com> Date: Tue, 28 Jun 2022 10:46:25 -0600 Subject: [PATCH 01/11] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 215fc07..88c9932 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # projectpythiatutorials.github.io Root site for the ProjectPythiaTutorials GitHub Pages + +projectpythiacookbooks.github.io From 7f9a26449d180335bf100a062e02c67fd374e122 Mon Sep 17 00:00:00 2001 From: Max Grover Date: Tue, 28 Jun 2022 12:01:53 -0500 Subject: [PATCH 02/11] update cookbook link info (#11) --- site/cookbook_gallery.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/cookbook_gallery.yaml b/site/cookbook_gallery.yaml index c0d8ddd..139475c 100644 --- a/site/cookbook_gallery.yaml +++ b/site/cookbook_gallery.yaml @@ -1,5 +1,5 @@ - title: Radar Cookbook - url: https://projectpythiatutorials.github.io/radar-cookbook/landing-page.html + url: https://cookbooks.projectpythia.org/radar-cookbook/README.html description: | This Project Pythia Cookbook covers the basics of working with weather radar data in Python. authors: @@ -9,5 +9,5 @@ domains: - radar packages: - - py-art - \ No newline at end of file + - Py-ART + From 68b66391b3d2aa98b02d0637a34c6e5fbc731b43 Mon Sep 17 00:00:00 2001 From: Julia Kent <46687291+jukent@users.noreply.github.com> Date: Wed, 29 Jun 2022 08:58:21 -0600 Subject: [PATCH 03/11] Add Status Badges to gallery cards (#14) * add submodule * using cookbook status badges * delete subdomain repos * rm gitmodules and

* url to cookbook_url * un-escaped html for badge div * play with css --- site/_extensions/gallery_generator.py | 39 ++++++++++++++++++++++++--- site/_static/custom.css | 10 ++++++- site/cookbook_gallery.yaml | 4 +-- site/index.md | 17 +++++++----- 4 files changed, 57 insertions(+), 13 deletions(-) diff --git a/site/_extensions/gallery_generator.py b/site/_extensions/gallery_generator.py index d638b0f..a294996 100644 --- a/site/_extensions/gallery_generator.py +++ b/site/_extensions/gallery_generator.py @@ -5,6 +5,29 @@ from truncatehtml import truncate +def _generate_url_from_repo(repo): + cookbook_url = f'https://cookbooks.projectpythia.org/{repo}/README.html' + return cookbook_url + + +def _generate_github_url_from_repo(repo): + github_url = f'https://github.com/ProjectPythiaCookbooks/{repo}' + return github_url + + +#def _get_thumbnail_url(repo): +# github_url = _generate_github_url_from_repo(repo) +# return f'{github_url}/thumbnail.png' + + +def _generate_status_badge_html(repo): + github_url = _generate_github_url_from_repo(repo) + + return f""" + nightly-build + Binder + """ + def _generate_sorted_tag_keys(all_items): key_set = set(itertools.chain(*[item['tags'].keys() for item in all_items])) @@ -71,13 +94,19 @@ def build_from_items(items, filename, title='Gallery', subtitle=None, subtext=No # Build the gallery file panels_body = [] for item in items: + repo = item['repo'] + #thumbnail = _get_thumbnail_url(repo) + cookbook_url = _generate_url_from_repo(repo) + status_badges = _generate_status_badge_html(repo) + if not item.get('thumbnail'): item['thumbnail'] = '/_static/images/ebp-logo.png' thumbnail = item['thumbnail'] + tag_list = sorted((itertools.chain(*item['tags'].values()))) tag_list_f = [tag.replace(' ', '-') for tag in tag_list] - tags = [f'{tag}' for tag in tag_list_f] + tags = [f'{tag}' for tag in tag_list_f] tags = '\n'.join(tags) tag_class_str = ' '.join(tag_list_f) @@ -122,7 +151,7 @@ def build_from_items(items, filename, title='Gallery', subtitle=None, subtext=No {institutions_str}

{item['description']}

{tags}

-

Visit Website

+

Visit Website

""" @@ -137,7 +166,7 @@ def build_from_items(items, filename, title='Gallery', subtitle=None, subtext=No @@ -44,12 +44,12 @@ Packages :footer: p-1 --- -:column: + tagged-card py-art radar +:column: + tagged-card Py-ART radar