From 5a4b19fd39183e1a162a1e32b9ddea98c8f033ff Mon Sep 17 00:00:00 2001 From: Julia Kent <46687291+jukent@users.noreply.github.com> Date: Tue, 19 Dec 2023 14:52:16 -0700 Subject: [PATCH 01/13] Update cookbook_gallery.txt (#186) --- site/cookbook_gallery.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/site/cookbook_gallery.txt b/site/cookbook_gallery.txt index e701407..23b6bb6 100644 --- a/site/cookbook_gallery.txt +++ b/site/cookbook_gallery.txt @@ -14,3 +14,4 @@ gridding-cookbook vapor-python-cookbook advanced-viz-cookbook unstructured-grid-viz-cookbook +na-cordex-viz-cookbook From 1298724890d782576a535057565bb67f680bab25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:16:51 -0700 Subject: [PATCH 02/13] Bump peter-evans/create-pull-request from 5 to 6 (#190) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5 to 6. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v5...v6) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update-cookbook-gallery.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-cookbook-gallery.yaml b/.github/workflows/update-cookbook-gallery.yaml index 1e12e67..e66f73f 100644 --- a/.github/workflows/update-cookbook-gallery.yaml +++ b/.github/workflows/update-cookbook-gallery.yaml @@ -118,7 +118,7 @@ jobs: - name: Create pull request id: cpr - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6 with: commit-message: 'Update cookbook gallery' committer: GitHub From d31ebdb1ea4fe7ebd0345e470ddb2ab597faf9b8 Mon Sep 17 00:00:00 2001 From: Orhan Eroglu <32553057+erogluorhan@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:34:10 -0600 Subject: [PATCH 03/13] Start using the updated theme (#194) * Update several files to use the newer versioned theme * Use updated NSF NCAR logo * Update environment file * Switch from sphinx-panels to sphinx-design * Update environment.yml * Update environment.yml * Update nightly-build.yaml * Update publish-site.yaml --- .github/workflows/nightly-build.yaml | 2 +- .github/workflows/publish-site.yaml | 2 +- environment.yml | 9 +- site/_extensions/gallery_generator.py | 147 +++++++++--------- site/_static/custom.css | 26 ++++ .../images/logos/NCAR-contemp-logo-blue.svg | 1 - .../NSF-NCAR_Lockup-UCAR-Dark_102523.svg | 1 + site/conf.py | 25 +-- 8 files changed, 121 insertions(+), 92 deletions(-) delete mode 100644 site/_static/images/logos/NCAR-contemp-logo-blue.svg create mode 100644 site/_static/images/logos/NSF-NCAR_Lockup-UCAR-Dark_102523.svg diff --git a/.github/workflows/nightly-build.yaml b/.github/workflows/nightly-build.yaml index 008a692..1531944 100644 --- a/.github/workflows/nightly-build.yaml +++ b/.github/workflows/nightly-build.yaml @@ -19,4 +19,4 @@ jobs: if: ${{ github.repository_owner == 'ProjectPythia' }} uses: ProjectPythia/projectpythia.github.io/.github/workflows/sphinx-link-checker.yaml@main with: - path_to_source: 'site' \ No newline at end of file + path_to_source: 'site' diff --git a/.github/workflows/publish-site.yaml b/.github/workflows/publish-site.yaml index 76947b3..1283327 100644 --- a/.github/workflows/publish-site.yaml +++ b/.github/workflows/publish-site.yaml @@ -20,4 +20,4 @@ jobs: needs: build uses: ProjectPythia/cookbook-actions/.github/workflows/deploy-book.yaml@main with: - publish_dir: 'site/_build/html' \ No newline at end of file + publish_dir: 'site/_build/html' diff --git a/environment.yml b/environment.yml index c8d466a..b052e37 100644 --- a/environment.yml +++ b/environment.yml @@ -3,13 +3,10 @@ channels: - conda-forge - nodefaults dependencies: +- cffconvert - matplotlib - myst-nb - pandas -- pip -- pyyaml - pre-commit -- sphinx-panels -- cffconvert -- pip: - - sphinx-pythia-theme +- pyyaml +- sphinx-pythia-theme diff --git a/site/_extensions/gallery_generator.py b/site/_extensions/gallery_generator.py index cbb7c31..f088fd7 100644 --- a/site/_extensions/gallery_generator.py +++ b/site/_extensions/gallery_generator.py @@ -1,5 +1,4 @@ import itertools, json, yaml, pathlib, subprocess, requests -from textwrap import dedent from truncatehtml import truncate @@ -61,7 +60,7 @@ def generate_repo_dicts(all_items): cookbook_title = citation_dict["title"] description = citation_dict["description"] creators = citation_dict["creators"] - names = [item.get("name") for item in creators] + names = [creator.get("name") for creator in creators] authors = ", ".join(names) gallery_info_url = f"https://raw.githubusercontent.com/ProjectPythia/{repo}/main/_gallery_info.yml" @@ -132,16 +131,16 @@ def _generate_tag_menu(repo_dicts, tag_key): ) return f""" - -""" + + """ def generate_menu(repo_dicts, submit_btn_txt=None, submit_btn_link=None): @@ -174,7 +173,7 @@ def build_from_repos( ): # Build the gallery file - panels_body = [] + grid_body = [] for repo_dict in repo_dicts: repo = repo_dict["repo"] github_url = repo_dict["github_url"] @@ -199,7 +198,8 @@ def build_from_repos( for tag in tag_list_f ] tags = "\n".join(tags) - tag_class_str = " ".join(tag_list_f) + + # tag_class_str = " ".join(tag_list_f) description = repo_dict["description"] ellipsis_str = ' ... more' @@ -207,70 +207,71 @@ def build_from_repos( if ellipsis_str in short_description: modal_str = f""" - -""" + + """ + modal_str = '\n'.join([m.lstrip() for m in modal_str.split('\n')]) else: modal_str = "" - - panels_body.append( - f"""\ ---- -:column: + tagged-card {tag_class_str} - - -{modal_str} - -+++ -
-{tags} -
{status_badges}
-
- -""" - ) - - panels_body = "\n".join(panels_body) + new_card = f"""\ + :::{{grid-item-card}} + :shadow: md + :class-footer: card-footer + + {modal_str} + + +++ + +
+ {tags} +
{status_badges}
+
+ + ::: + + """ + + grid_body.append('\n'.join([m.lstrip() for m in new_card.split('\n')])) + + + grid_body = "\n".join(grid_body) stitle = f"#### {subtitle}" if subtitle else "" stext = subtext if subtext else "" - panels = f""" -# {title} - -{stitle} -{stext} - -{menu_html} - -````{{panels}} -:column: col-12 -:card: +mb-4 w-100 -:header: d-none -:body: p-3 m-0 -:footer: p-1 - -{dedent(panels_body)} -```` + grid = f""" + # {title} + {'=' * len(title)} + + {stitle} + {stext} + + {menu_html} + + ::::{{grid}} 1 + :gutter: 4 + + {grid_body} + + + + """ - - -""" + grid = '\n'.join([m.lstrip() for m in grid.split('\n')]) - pathlib.Path(f"{filename}.md").write_text(panels) + pathlib.Path(f"{filename}.md").write_text(grid) diff --git a/site/_static/custom.css b/site/_static/custom.css index 7804720..97d45a9 100644 --- a/site/_static/custom.css +++ b/site/_static/custom.css @@ -1,3 +1,19 @@ +:root { + --pst-color-border: rgba(0, 0, 0, 0.125) !important; +} + +.bd-main .bd-content .bd-article-container { + max-width: 100%; /* default is 60em */ +} +.bd-page-width { + max-width: 100%; /* default is 88rem */ +} + +.sd-card-footer { + background: rgba(var(--spt-color-gray-100), 1) !important; + padding: 4px; +} + main.banner-main #project-pythia { padding-top: 1rem; padding-bottom: 1rem; @@ -74,12 +90,22 @@ main.banner-main #project-pythia { margin: auto 0; padding: 0; max-width: 160px; + background: transparent !important; } .card-subtitle { font-size: 0.8rem; } + .my-2 { + color: inherit; + } + + .text-decoration-none { + text-decoration: none; + color: inherit; + } + @media (max-width: 576px) { .modal { padding: 2rem; diff --git a/site/_static/images/logos/NCAR-contemp-logo-blue.svg b/site/_static/images/logos/NCAR-contemp-logo-blue.svg deleted file mode 100644 index 3bcda63..0000000 --- a/site/_static/images/logos/NCAR-contemp-logo-blue.svg +++ /dev/null @@ -1 +0,0 @@ -NCAR-contemp-logo-blue.a diff --git a/site/_static/images/logos/NSF-NCAR_Lockup-UCAR-Dark_102523.svg b/site/_static/images/logos/NSF-NCAR_Lockup-UCAR-Dark_102523.svg new file mode 100644 index 0000000..4eb4ded --- /dev/null +++ b/site/_static/images/logos/NSF-NCAR_Lockup-UCAR-Dark_102523.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/site/conf.py b/site/conf.py index 668033d..f601cc2 100644 --- a/site/conf.py +++ b/site/conf.py @@ -24,7 +24,7 @@ project = "Project Pythia Cookbooks" author = 'the Project Pythia Community' -copyright = "2022" +copyright = "2024" # -- General configuration --------------------------------------------------- @@ -33,7 +33,7 @@ # ones. extensions = [ "myst_nb", - "sphinx_panels", + "sphinx_design", "cookbook_gallery_generator", ] @@ -84,7 +84,9 @@ # HTML Theme-specific Options html_theme_options = { - "google_analytics_id": "G-T52X8HNYE8", + 'analytics': { + 'google_analytics_id': 'G-T52X8HNYE8', + }, "github_url": "https://github.com/ProjectPythia", "twitter_url": "https://twitter.com/project_pythia", "icon_links": [ @@ -95,7 +97,11 @@ "type": "fontawesome", } ], - "logo_link": "https://projectpythia.org", + 'logo': { + 'link': 'https://projectpythia.org', + }, + 'navbar_align': 'left', + 'navbar_start': ['navbar-logo'], "navbar_links": [ {"name": "Home", "url": "https://projectpythia.org"}, {"name": "Foundations", "url": "https://foundations.projectpythia.org"}, @@ -104,24 +110,23 @@ {"name": "Community", "url": "https://projectpythia.org/#join-us"}, {"name": "Blog", "url": "https://projectpythia.org/blog.html"}, ], + 'navbar_end': ['navbar-icon-links'], "page_layouts": { "index": "page-standalone.html", }, + 'secondary_sidebar_items': [], "footer_logos": { - "NCAR": "_static/images/logos/NCAR-contemp-logo-blue.svg", + "NCAR": "_static/images/logos/NSF-NCAR_Lockup-UCAR-Dark_102523.svg", "Unidata": "_static/images/logos/Unidata_logo_horizontal_1200x300.svg", "UAlbany": "_static/images/logos/UAlbany-A2-logo-purple-gold.svg", }, - "extra_navbar": ('Theme by Project Pythia'), + 'footer_start': ['footer-logos', 'footer-menu', 'footer-info', 'footer-extra'], } -# Panels config -panels_add_bootstrap_css = False - # MyST config myst_enable_extensions = ["amsmath", "colon_fence", "deflist", "html_image"] myst_url_schemes = ["http", "https", "mailto"] -jupyter_execute_notebooks = "off" +nb_execution_mode = 'off' myst_heading_anchors = 3 # Don't run the link checker on immutable DOI links From 6c214efe45b64954dc79c2eb11f1fcd5fd2e28c1 Mon Sep 17 00:00:00 2001 From: Julia Kent <46687291+jukent@users.noreply.github.com> Date: Fri, 29 Mar 2024 13:50:09 -0600 Subject: [PATCH 04/13] Update footer-menu.html (#193) --- site/_templates/footer-menu.html | 1 + 1 file changed, 1 insertion(+) diff --git a/site/_templates/footer-menu.html b/site/_templates/footer-menu.html index f10872f..d06c8da 100644 --- a/site/_templates/footer-menu.html +++ b/site/_templates/footer-menu.html @@ -9,6 +9,7 @@

{{ _("About") }}

  • {{ _("How to use Pythia Foundations") }}
  • {{ _("The Project Team") }}
  • {{ _("How to Cite") }}
  • +
  • {{ _("Metrics") }}