From ffbc8924b598f72bda49d3d190c7b668f8da08a0 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 30 Jun 2022 10:04:59 +0100 Subject: [PATCH] Autoformat includes/layouts Let VSCode autoformat these so the indentation is more consistent. --- _includes/footer.html | 74 ++++++--- _includes/head.html | 26 ++-- _includes/jekyll-toc.html | 312 ++++++++++++++++++-------------------- _includes/nav.html | 17 ++- _layouts/article.html | 14 +- _layouts/default.html | 25 +-- 6 files changed, 242 insertions(+), 226 deletions(-) diff --git a/_includes/footer.html b/_includes/footer.html index 3bf511f15bd..6e1932dfb6e 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -5,11 +5,13 @@
- squirrel illustration + squirrel illustration

{{ t.footer.contribute.heading }}

{{ t.footer.contribute.description }}

- + {{ t.footer.contribute.button }}

@@ -18,52 +20,76 @@

{{ t.footer.contribute.heading }}

-
+
- bird illustration -

{{ t.footer.subscribe.heading }}

-

{{ t.footer.subscribe.description }}

+ bird illustration +

{{ t.footer.subscribe.heading }}

+

{{ t.footer.subscribe.description }}

-
+
- - - -
-
+ + + +
+
+
+
- -
-
+
-

fine print

+

fine + print

{% capture code %} - {% assign code_label = t.footer.byline.code_label %} - + {% assign code_label = t.footer.byline.code_label %} + + + {% endcapture %} {% capture love %} - {% assign love_label = t.footer.byline.love_label %} - + {% assign love_label = t.footer.byline.love_label %} + + + + {% endcapture %} {% capture github %} - + + + + {% endcapture %} {% capture friends %} - {% assign friends_label = t.footer.byline.friends_label %} - {{ friends_label }} + {% assign friends_label = t.footer.byline.friends_label %} + {{ friends_label + }} {% endcapture %} {% assign byline = t.footer.byline.format %} - {{ byline | replace: "[code]", code | replace: "[love]", love | replace: "[github]", github | replace: "[friends]", friends }} + {{ byline | replace: "[code]", code | replace: "[love]", love | replace: "[github]", github | replace: + "[friends]", friends }}
diff --git a/_includes/head.html b/_includes/head.html index 6349cd761bd..df1ea4f4d07 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -4,20 +4,20 @@ - + {% seo %} {% if page.lang and page.untranslated != true and site.data.locales.size > 1 %} - {% assign locales = site.data.locales | sort %} - {% for locale in locales %} - {% assign lang = locale[0] %} - {% assign page_lang_slash = page.lang | append: '/' | prepend: '/' %} - {% assign default_url = page.url | replace: page_lang_slash, '/' %} - {% if lang == "en" %} - - - {% else %} - - {% endif %} - {% endfor %} + {% assign locales = site.data.locales | sort %} + {% for locale in locales %} + {% assign lang = locale[0] %} + {% assign page_lang_slash = page.lang | append: '/' | prepend: '/' %} + {% assign default_url = page.url | replace: page_lang_slash, '/' %} + {% if lang == "en" %} + + + {% else %} + + {% endif %} + {% endfor %} {% endif %} diff --git a/_includes/jekyll-toc.html b/_includes/jekyll-toc.html index 662fe88ba7e..fb2547eba0d 100644 --- a/_includes/jekyll-toc.html +++ b/_includes/jekyll-toc.html @@ -1,186 +1,166 @@ {% capture tocWorkspace %} - {% comment %} - Copyright (c) 2017 Vladimir "allejo" Jimenez - - Permission is hereby granted, free of charge, to any person - obtaining a copy of this software and associated documentation - files (the "Software"), to deal in the Software without - restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following - conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - {% endcomment %} - {% comment %} - Version 1.2.0 - https://github.com/allejo/jekyll-toc - - "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe - - Usage: - {% include jekyll-toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %} - - Parameters: - * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll - - Optional Parameters: - * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC - * class (string) : '' - a CSS class assigned to the TOC - * id (string) : '' - an ID to assigned to the TOC - * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored - * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored - * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list - * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level - * submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%' placeholder which is the current "submenu" heading level - * base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content - * anchor_class (string) : '' - add custom class(es) for each anchor element - * skip_no_ids (bool) : false - skip headers that do not have an `id` attribute - - Output: - An ordered or unordered list representing the table of contents of a markdown block. This snippet will only - generate the table of contents and will NOT output the markdown given to it - {% endcomment %} - - {% capture newline %} - {% endcapture %} - {% assign newline = newline | rstrip %} - - {% capture deprecation_warnings %}{% endcapture %} - - {% if include.baseurl %} - {% capture deprecation_warnings %}{{ deprecation_warnings }}{{ newline }}{% endcapture %} +{% comment %} +Copyright (c) 2017 Vladimir "allejo" Jimenez + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +{% endcomment %} +{% comment %} +Version 1.2.0 +https://github.com/allejo/jekyll-toc + +"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe + +Usage: +{% include jekyll-toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %} + +Parameters: +* html (string) - the HTML of compiled markdown generated by kramdown in Jekyll + +Optional Parameters: +* sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC +* class (string) : '' - a CSS class assigned to the TOC +* id (string) : '' - an ID to assigned to the TOC +* h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored +* h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored +* ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list +* item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is +the current heading level +* submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%' +placeholder which is the current "submenu" heading level +* base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content +* anchor_class (string) : '' - add custom class(es) for each anchor element +* skip_no_ids (bool) : false - skip headers that do not have an `id` attribute + +Output: +An ordered or unordered list representing the table of contents of a markdown block. This snippet will only +generate the table of contents and will NOT output the markdown given to it +{% endcomment %} + +{% capture newline %} +{% endcapture %} +{% assign newline = newline | rstrip %} + + +{% capture deprecation_warnings %}{% endcapture %} + +{% if include.baseurl %} +{% capture deprecation_warnings %}{{ deprecation_warnings }} +{{ newline }}{% endcapture %} +{% endif %} + +{% if include.skipNoIDs %} +{% capture deprecation_warnings %}{{ deprecation_warnings }} +{{ newline }}{% endcapture %} +{% endif %} + +{% capture jekyll_toc %}{% endcapture %} +{% assign orderedList = include.ordered | default: false %} +{% assign baseURL = include.base_url | default: include.baseurl | default: '' %} +{% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %} +{% assign minHeader = include.h_min | default: 1 %} +{% assign maxHeader = include.h_max | default: 6 %} +{% assign nodes = include.html | strip | split: ' + maxHeader %} + {% continue %} {% endif %} - {% if include.skipNoIDs %} - {% capture deprecation_warnings %}{{ deprecation_warnings }}{{ newline }}{% endcapture %} + {% assign _workspace = node | split: '' + | first }}>{% endcapture %} +{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} + +{% if include.item_class and include.item_class != blank %} +{% capture listItemClass %} class="{{ include.item_class | replace: '%level%', currLevel | split: '.' | join: ' ' }}"{% +endcapture %} +{% endif %} + +{% if include.submenu_class and include.submenu_class != blank %} +{% assign subMenuLevel = currLevel | minus: 1 %} +{% capture subMenuClass %} class="{{ include.submenu_class | replace: '%level%', subMenuLevel | split: '.' | join: ' ' +}}"{% endcapture %} +{% endif %} + +{% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture +%} + +{% if htmlID %} +{% capture anchorAttributes %} href="{% if baseURL %}{{ baseURL }}{% endif %}#{{ htmlID }}"{% endcapture %} + +{% if include.anchor_class %} +{% capture anchorAttributes %}{{ anchorAttributes }} class="{{ include.anchor_class | split: '.' | join: ' ' }}"{% +endcapture %} +{% endif %} + +{% capture listItem %}{{ anchorBody }}{% endcapture %} + {% elsif skipNoIDs == true %} + {% continue %} + {% else %} + {% capture listItem %}{{ anchorBody }}{% endcapture %} {% endif %} - {% capture jekyll_toc %}{% endcapture %} - {% assign orderedList = include.ordered | default: false %} - {% assign baseURL = include.base_url | default: include.baseurl | default: '' %} - {% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %} - {% assign minHeader = include.h_min | default: 1 %} - {% assign maxHeader = include.h_max | default: 6 %} - {% assign nodes = include.html | strip | split: ' maxHeader %} - {% continue %} - {% endif %} - - {% assign _workspace = node | split: '' | first }}>{% endcapture %} - {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} - - {% if include.item_class and include.item_class != blank %} - {% capture listItemClass %} class="{{ include.item_class | replace: '%level%', currLevel | split: '.' | join: ' ' }}"{% endcapture %} - {% endif %} - - {% if include.submenu_class and include.submenu_class != blank %} - {% assign subMenuLevel = currLevel | minus: 1 %} - {% capture subMenuClass %} class="{{ include.submenu_class | replace: '%level%', subMenuLevel | split: '.' | join: ' ' }}"{% endcapture %} - {% endif %} - - {% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %} - - {% if htmlID %} - {% capture anchorAttributes %} href="{% if baseURL %}{{ baseURL }}{% endif %}#{{ htmlID }}"{% endcapture %} - - {% if include.anchor_class %} - {% capture anchorAttributes %}{{ anchorAttributes }} class="{{ include.anchor_class | split: '.' | join: ' ' }}"{% endcapture %} - {% endif %} - - {% capture listItem %}{{ anchorBody }}{% endcapture %} - {% elsif skipNoIDs == true %} - {% continue %} - {% else %} - {% capture listItem %}{{ anchorBody }}{% endcapture %} - {% endif %} - - {% if currLevel > lastLevel %} - {% capture jekyll_toc %}{{ jekyll_toc }}<{{ listModifier }}{{ subMenuClass }}>{% endcapture %} - {% elsif currLevel < lastLevel %} - {% assign repeatCount = lastLevel | minus: currLevel %} - - {% for i in (1..repeatCount) %} - {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} - {% endfor %} + {% if currLevel > lastLevel %} + {% capture jekyll_toc %}{{ jekyll_toc }}<{{ listModifier }}{{ subMenuClass }}>{% endcapture %} + {% elsif currLevel < lastLevel %} {% assign repeatCount=lastLevel | minus: currLevel %} {% for i in + (1..repeatCount) %} {% capture jekyll_toc %}{{ jekyll_toc }} + {% endcapture %} + {% endfor %} - {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} - {% else %} - {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} - {% endif %} + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% else %} + {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} + {% endif %} - {% capture jekyll_toc %}{{ jekyll_toc }}{{ listItem }}{% endcapture %} + {% capture jekyll_toc %}{{ jekyll_toc }}{{ listItem }}{% endcapture %} {% assign lastLevel = currLevel %} {% assign firstHeader = false %} - {% endfor %} + {% endfor %} - {% assign repeatCount = minHeader | minus: 1 %} - {% assign repeatCount = lastLevel | minus: repeatCount %} - {% for i in (1..repeatCount) %} - {% capture jekyll_toc %}{{ jekyll_toc }}{% endcapture %} - {% endfor %} + {% assign repeatCount = minHeader | minus: 1 %} + {% assign repeatCount = lastLevel | minus: repeatCount %} + {% for i in (1..repeatCount) %} + {% capture jekyll_toc %}{{ jekyll_toc }} + {% endcapture %} + {% endfor %} - {% if jekyll_toc != '' %} + {% if jekyll_toc != '' %} {% assign rootAttributes = '' %} {% if include.class and include.class != blank %} - {% capture rootAttributes %} class="{{ include.class | split: '.' | join: ' ' }}"{% endcapture %} + {% capture rootAttributes %} class="{{ include.class | split: '.' | join: ' ' }}"{% endcapture %} {% endif %} {% if include.id and include.id != blank %} - {% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %} + {% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %} {% endif %} {% if rootAttributes %} - {% assign nodes = jekyll_toc | split: '>' %} - {% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %} - {% endif %} - {% endif %} -{% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc -}} + {% assign nodes = jekyll_toc | split: '>' %} + {% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %} + {% endif %} + {% endif %} + {% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc -}} diff --git a/_includes/nav.html b/_includes/nav.html index d25cc143864..5a63da061fb 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -2,7 +2,8 @@