From 934354b80ad84cfe2ad429097733e46a720b4878 Mon Sep 17 00:00:00 2001 From: CuteShaun Date: Fri, 30 May 2025 15:58:25 -0700 Subject: [PATCH 1/6] fix: improve footer text contrast to meet WCAG 2.1 AA requirements --- docs/_sass/custom/custom.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/_sass/custom/custom.scss b/docs/_sass/custom/custom.scss index 6ffe95b8..099f07f8 100644 --- a/docs/_sass/custom/custom.scss +++ b/docs/_sass/custom/custom.scss @@ -6,3 +6,7 @@ div.site-header { div.site-logo { background-position: center center; } + +footer.site-footer { + color: #6A686D; +} From b740121b6e2e6e8be57ab88f51d38c198127a94c Mon Sep 17 00:00:00 2001 From: CuteShaun Date: Mon, 2 Jun 2025 22:53:07 -0700 Subject: [PATCH 2/6] fix: move footer from sidebar to main layout template, to meet accessibility standarts --- docs/_config.yml | 9 ++++ .../{ => components}/header_custom.html | 0 docs/_includes/components/sidebar.html | 22 +++++++++ docs/_layouts/default.html | 49 +++++++++++++++++++ docs/_sass/custom/custom.scss | 20 +++++++- 5 files changed, 99 insertions(+), 1 deletion(-) rename docs/_includes/{ => components}/header_custom.html (100%) create mode 100644 docs/_includes/components/sidebar.html create mode 100644 docs/_layouts/default.html diff --git a/docs/_config.yml b/docs/_config.yml index 8a0ff03d..f8340877 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -6,8 +6,17 @@ url: https://UCL-ARC.github.io/python-tooling color_scheme: dark +layouts_dir: _layouts + aux_links: Source repository: https://github.com/UCL-ARC/python-tooling aux_links_new_tab: true logo: "https://raw.githubusercontent.com/UCL-ARC/python-tooling/main/images/logo.svg" + +# defaults: +# - +# scope: +# path: "" # Means apply to all files +# values: +# layout: "default-custom" # Name of your custom layout diff --git a/docs/_includes/header_custom.html b/docs/_includes/components/header_custom.html similarity index 100% rename from docs/_includes/header_custom.html rename to docs/_includes/components/header_custom.html diff --git a/docs/_includes/components/sidebar.html b/docs/_includes/components/sidebar.html new file mode 100644 index 00000000..6bb849bc --- /dev/null +++ b/docs/_includes/components/sidebar.html @@ -0,0 +1,22 @@ +{%- comment -%} Include as: {%- include components/sidebar.html -%} Depends on: page(?), site. +Results in: HTML for the side bar. Includes: title.html, components/site_nav.html, +nav_footer_custom.html Overwrites: nav_footer_custom. Should not be cached, because +nav_footer_custom.html might depend on page. {%- endcomment -%} + + diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html new file mode 100644 index 00000000..b6aecb0b --- /dev/null +++ b/docs/_layouts/default.html @@ -0,0 +1,49 @@ + + + {% include head.html %} + + Skip to main content + {% include icons/icons.html %} + + {% if page.nav_enabled == true %} + {% include components/sidebar.html %} + {% elsif layout.nav_enabled == true and page.nav_enabled == nil %} + {% include components/sidebar.html %} + {% elsif site.nav_enabled != false and layout.nav_enabled == nil and page.nav_enabled == nil %} + {% include components/sidebar.html %} + {% endif %} + +
+ {% include components/header.html %} + +
+ {% include components/breadcrumbs.html %} +
+
+ {% if site.heading_anchors != false %} + {% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %} + {% else %} + {{ content }} + {% endif %} + + {% if page.has_toc != false %} + {% include components/children_nav.html %} + {% endif %} +
+
+
+ +
+ This site uses Just the Docs, a documentation theme for Jekyll. +
+ + {% if site.search_enabled != false %} + {% include components/search_footer.html %} + {% endif %} +
+ + {% if site.mermaid %} + {% include components/mermaid.html %} + {% endif %} + + diff --git a/docs/_sass/custom/custom.scss b/docs/_sass/custom/custom.scss index 099f07f8..3975c2bb 100644 --- a/docs/_sass/custom/custom.scss +++ b/docs/_sass/custom/custom.scss @@ -1,3 +1,9 @@ +html, +body { + height: 100%; + margin: 0; +} + div.site-header { max-height: 15em; height: 15em; @@ -7,6 +13,18 @@ div.site-logo { background-position: center center; } -footer.site-footer { +.main { + display: flex; + flex-direction: column; + min-height: 100%; +} + +.main-content-wrap { + flex: 1; +} + +.site-footer { + position: static; + width: 100%; color: #6A686D; } From 34eaebff1e11bb24a648bbc9d31b33f68f2c6c43 Mon Sep 17 00:00:00 2001 From: CuteShaun Date: Mon, 2 Jun 2025 23:40:36 -0700 Subject: [PATCH 3/6] fix: add anchor_icon component to avoid pre-commit prettier issue, remove components directory, pre-commit run --- docs/_config.yml | 7 --- docs/_includes/components/anchor_icon.html | 3 ++ docs/_includes/components/sidebar.html | 22 --------- .../{components => }/header_custom.html | 0 docs/_includes/sidebar.html | 25 ++++++++++ docs/_layouts/default.html | 47 +++++++++---------- docs/_sass/custom/custom.scss | 2 +- 7 files changed, 50 insertions(+), 56 deletions(-) create mode 100644 docs/_includes/components/anchor_icon.html delete mode 100644 docs/_includes/components/sidebar.html rename docs/_includes/{components => }/header_custom.html (100%) create mode 100644 docs/_includes/sidebar.html diff --git a/docs/_config.yml b/docs/_config.yml index f8340877..b1c4206e 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -13,10 +13,3 @@ aux_links: aux_links_new_tab: true logo: "https://raw.githubusercontent.com/UCL-ARC/python-tooling/main/images/logo.svg" - -# defaults: -# - -# scope: -# path: "" # Means apply to all files -# values: -# layout: "default-custom" # Name of your custom layout diff --git a/docs/_includes/components/anchor_icon.html b/docs/_includes/components/anchor_icon.html new file mode 100644 index 00000000..6dbcc24b --- /dev/null +++ b/docs/_includes/components/anchor_icon.html @@ -0,0 +1,3 @@ + diff --git a/docs/_includes/components/sidebar.html b/docs/_includes/components/sidebar.html deleted file mode 100644 index 6bb849bc..00000000 --- a/docs/_includes/components/sidebar.html +++ /dev/null @@ -1,22 +0,0 @@ -{%- comment -%} Include as: {%- include components/sidebar.html -%} Depends on: page(?), site. -Results in: HTML for the side bar. Includes: title.html, components/site_nav.html, -nav_footer_custom.html Overwrites: nav_footer_custom. Should not be cached, because -nav_footer_custom.html might depend on page. {%- endcomment -%} - - diff --git a/docs/_includes/components/header_custom.html b/docs/_includes/header_custom.html similarity index 100% rename from docs/_includes/components/header_custom.html rename to docs/_includes/header_custom.html diff --git a/docs/_includes/sidebar.html b/docs/_includes/sidebar.html new file mode 100644 index 00000000..bf15ea24 --- /dev/null +++ b/docs/_includes/sidebar.html @@ -0,0 +1,25 @@ +{%- comment -%} Include as: {%- include components/sidebar.html -%} Depends on: +page(?), site. Results in: HTML for the side bar. Includes: title.html, +components/site_nav.html, nav_footer_custom.html Overwrites: nav_footer_custom. +Should not be cached, because nav_footer_custom.html might depend on page. {%- +endcomment -%} + + diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index b6aecb0b..a743e9cc 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -1,17 +1,13 @@ - + {% include head.html %} Skip to main content - {% include icons/icons.html %} - - {% if page.nav_enabled == true %} - {% include components/sidebar.html %} - {% elsif layout.nav_enabled == true and page.nav_enabled == nil %} - {% include components/sidebar.html %} - {% elsif site.nav_enabled != false and layout.nav_enabled == nil and page.nav_enabled == nil %} - {% include components/sidebar.html %} - {% endif %} + {% include icons/icons.html %} {% if page.nav_enabled == true %} {% include + sidebar.html %} {% elsif layout.nav_enabled == true and page.nav_enabled == + nil %} {% include sidebar.html %} {% elsif site.nav_enabled != false and + layout.nav_enabled == nil and page.nav_enabled == nil %} {% include + sidebar.html %} {% endif %}
{% include components/header.html %} @@ -20,30 +16,29 @@ {% include components/breadcrumbs.html %}
- {% if site.heading_anchors != false %} - {% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %} - {% else %} - {{ content }} - {% endif %} - - {% if page.has_toc != false %} - {% include components/children_nav.html %} - {% endif %} + {% if site.heading_anchors != false %} {% capture raw_anchor_svg %} + {% include components/anchor_icon.html %} {% endcapture %} {% assign + anchor_svg = raw_anchor_svg | strip_newlines %} {% include + vendor/anchor_headings.html html=content beforeHeading="true" + anchorBody=anchor_svg anchorClass="anchor-heading" + anchorAttrs="aria-labelledby='%html_id%'" %} {% else %} {{ content + }} {% endif %} {% if page.has_toc != false %} {% include + components/children_nav.html %} {% endif %}
- This site uses Just the Docs, a documentation theme for Jekyll. + This site uses + Just the Docs, a documentation theme for Jekyll.
- {% if site.search_enabled != false %} - {% include components/search_footer.html %} - {% endif %} + {% if site.search_enabled != false %} {% include + components/search_footer.html %} {% endif %} - {% if site.mermaid %} - {% include components/mermaid.html %} - {% endif %} + {% if site.mermaid %} {% include components/mermaid.html %} {% endif %} diff --git a/docs/_sass/custom/custom.scss b/docs/_sass/custom/custom.scss index 3975c2bb..64e09908 100644 --- a/docs/_sass/custom/custom.scss +++ b/docs/_sass/custom/custom.scss @@ -26,5 +26,5 @@ div.site-logo { .site-footer { position: static; width: 100%; - color: #6A686D; + color: #6a686d; } From 94fe7339796efa7b127a5488427f32a7ea687124 Mon Sep 17 00:00:00 2001 From: CuteShaun Date: Tue, 3 Jun 2025 10:51:35 -0700 Subject: [PATCH 4/6] fix: replace new footer color with body text color --- docs/_sass/custom/custom.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_sass/custom/custom.scss b/docs/_sass/custom/custom.scss index 64e09908..9032c01b 100644 --- a/docs/_sass/custom/custom.scss +++ b/docs/_sass/custom/custom.scss @@ -26,5 +26,5 @@ div.site-logo { .site-footer { position: static; width: 100%; - color: #6a686d; + color: $body-text-color; } From e2bbcf08dfd04d61e2fcad6c3826d41693240110 Mon Sep 17 00:00:00 2001 From: CuteShaun Date: Tue, 3 Jun 2025 11:06:24 -0700 Subject: [PATCH 5/6] fix: ignore Liquid template expressions in link checker --- .github/workflows/links.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index ae5a1945..54a24ea5 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -30,6 +30,7 @@ jobs: # necessarily not real links - i.e. demos and to be filled by # cookiecutter values. args: "--verbose + --exclude \\{\\{.*\\}\\} --exclude https://forum.image.sc/ --exclude http://www.gnu.org --exclude http://fsf.org From fc226160cb834e53595118b9d36f84f35552b199 Mon Sep 17 00:00:00 2001 From: Sam Cunliffe Date: Wed, 4 Jun 2025 09:12:28 +0100 Subject: [PATCH 6/6] Ignore includes. --- .github/workflows/links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index d8f730f7..27eb5a97 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -30,12 +30,12 @@ jobs: # necessarily not real links - i.e. demos and to be filled by # cookiecutter values. args: "--verbose - --exclude \\{\\{.*\\}\\} --exclude https://forum.image.sc/ --exclude https://stackoverflow.com --exclude http://www.gnu.org --exclude http://fsf.org --exclude docs/pages + --exclude docs/_includes --exclude-path '{{cookiecutter.project_slug}}/README.md' --exclude-path 'tests/data' -- ."