From b3f52fedad707ef820cafa5b775146f2ebddbabc Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 4 May 2019 21:59:33 +0200 Subject: [PATCH 01/27] Added html compression --- _config.yml | 10 +++++++++- _includes/head.html | 10 +++++----- _layouts/default.html | 4 ++++ _layouts/vendor/compress.html | 10 ++++++++++ 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 _layouts/vendor/compress.html diff --git a/_config.yml b/_config.yml index 4b93827..f202cdb 100644 --- a/_config.yml +++ b/_config.yml @@ -37,4 +37,12 @@ color_scheme: nil ga_tracking: UA-2709176-10 plugins: - - jekyll-seo-tag \ No newline at end of file + - jekyll-seo-tag + +compress_html: + clippings: all + comments: all + endings: all + startings: [] + blank_lines: false + profile: false \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index 13cdbaf..0789ea5 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -6,13 +6,13 @@ {{ page.title }} - {{ site.title }} {% if page.description %} - + {% endif %} {% endif %} - + - + {% if site.ga_tracking != nil %} + {% endif %} - + diff --git a/_layouts/default.html b/_layouts/default.html index 2d5fe6b..c2d1c99 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,3 +1,7 @@ +--- +layout: vendor/compress +--- + diff --git a/_layouts/vendor/compress.html b/_layouts/vendor/compress.html new file mode 100644 index 0000000..bb34487 --- /dev/null +++ b/_layouts/vendor/compress.html @@ -0,0 +1,10 @@ +--- +# Jekyll layout that compresses HTML +# v3.1.0 +# http://jch.penibelst.de/ +# © 2014–2015 Anatol Broder +# MIT License +--- + +{% capture _LINE_FEED %} +{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment or site.compress_html.ignore.envs == "all" %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "" %}{% endif %}{% unless _pre_before contains "" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " ;; ;" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %}
Step Bytes
raw {{ content | size }}{% if _profile_endings %}
endings {{ _profile_endings }}{% endif %}{% if _profile_startings %}
startings {{ _profile_startings }}{% endif %}{% if _profile_comments %}
comments {{ _profile_comments }}{% endif %}{% if _profile_collapse %}
collapse {{ _profile_collapse }}{% endif %}{% if _profile_clippings %}
clippings {{ _profile_clippings }}{% endif %}
{% endif %}{% endif %} From f4ee29d0c33eef84ffb91e27c36ea9f7c4a7c6d6 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 4 May 2019 22:20:36 +0200 Subject: [PATCH 02/27] Fixed script tags --- docs/configuration.md | 12 ++++++------ docs/customization.md | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 4a4caef..095fc20 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -47,16 +47,16 @@ color_scheme: "dark" diff --git a/docs/customization.md b/docs/customization.md index f3fe1c0..11d4526 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -35,16 +35,16 @@ color_scheme: "dark" From 03e2345833f92d6f3841db66bffd0f2ed8461bf2 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 4 May 2019 22:22:56 +0200 Subject: [PATCH 03/27] Added anchor headings --- _includes/vendor/anchor_headings.html | 100 ++++++++++++++++++++++++++ _layouts/anchor_headings.html | 5 ++ _layouts/default.html | 2 +- _sass/anchor_headings.scss | 12 ++++ assets/css/just-the-docs.scss | 1 + 5 files changed, 119 insertions(+), 1 deletion(-) create mode 100755 _includes/vendor/anchor_headings.html create mode 100644 _layouts/anchor_headings.html create mode 100644 _sass/anchor_headings.scss diff --git a/_includes/vendor/anchor_headings.html b/_includes/vendor/anchor_headings.html new file mode 100755 index 0000000..25397df --- /dev/null +++ b/_includes/vendor/anchor_headings.html @@ -0,0 +1,100 @@ +{% capture headingsWorkspace %} + {% comment %} + Version 1.0.3 + https://github.com/allejo/jekyll-anchor-headings + + "Be the pull request you wish to see in the world." ~Ben Balter + + Usage: + {% include anchor_headings.html html=content %} + + Parameters: + * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll + + Optional Parameters: + * beforeHeading (bool) : false - Set to true if the anchor should be placed _before_ the heading's content + * anchorBody (string) : '' - The content that will be placed inside the anchor; the `%heading%` placeholder is available + * anchorClass (string) : '' - The class(es) that will be used for each anchor. Separate multiple classes with a space + * anchorTitle (string) : '' - The `title` attribute that will be used for anchors + * h_min (int) : 1 - The minimum header level to build an anchor for; any header lower than this value will be ignored + * h_max (int) : 6 - The maximum header level to build an anchor for; any header greater than this value will be ignored + * bodyPrefix (string) : '' - Anything that should be inserted inside of the heading tag _before_ its anchor and content + * bodySuffix (string) : '' - Anything that should be inserted inside of the heading tag _after_ its anchor and content + + Output: + The original HTML with the addition of anchors inside of all of the h1-h6 headings. + {% endcomment %} + + {% assign minHeader = include.h_min | default: 1 %} + {% assign maxHeader = include.h_max | default: 6 %} + {% assign beforeHeading = include.beforeHeading %} + {% assign nodes = include.html | split: ' + {% if headerLevel == 0 %} + {% if nextChar != '<' and nextChar != '' %} + {% capture node %}' | first }}>{% endcapture %} + {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} + + + {% capture anchor %}{% endcapture %} + + {% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %} + {% capture anchor %}href="#{{ html_id}}"{% endcapture %} + + {% if include.anchorClass %} + {% capture anchor %}{{ anchor }} class="{{ include.anchorClass }}"{% endcapture %} + {% endif %} + + {% if include.anchorTitle %} + {% capture anchor %}{{ anchor }} title="{{ include.anchorTitle | replace: '%heading%', header }}"{% endcapture %} + {% endif %} + + {% capture anchor %}{{ include.anchorBody | replace: '%heading%', header | default: '' }}{% endcapture %} + + + {% if beforeHeading %} + {% capture anchor %}{{ anchor }} {% endcapture %} + {% else %} + {% capture anchor %} {{ anchor }}{% endcapture %} + {% endif %} + {% endif %} + + {% capture new_heading %} + diff --git a/_sass/anchor_headings.scss b/_sass/anchor_headings.scss new file mode 100644 index 0000000..da55202 --- /dev/null +++ b/_sass/anchor_headings.scss @@ -0,0 +1,12 @@ +a.anchor_heading { + visibility: hidden; +} + +h1:hover > a.anchor_heading, +h2:hover > a.anchor_heading, +h3:hover > a.anchor_heading, +h4:hover > a.anchor_heading, +h5:hover > a.anchor_heading, +h6:hover > a.anchor_heading { + visibility: visible; +} \ No newline at end of file diff --git a/assets/css/just-the-docs.scss b/assets/css/just-the-docs.scss index 6a2eefa..b6d17d5 100644 --- a/assets/css/just-the-docs.scss +++ b/assets/css/just-the-docs.scss @@ -41,4 +41,5 @@ @import "./search"; @import "./tables"; @import "./code"; +@import "./anchor_headings"; @import "./utilities/utilities"; From 94f2aaf9648992ffcb72368cbef4e27ce92badbb Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 4 May 2019 23:18:56 +0200 Subject: [PATCH 04/27] Added table wrappers, fixed anchor headings --- _layouts/anchor_headings.html | 5 ----- _layouts/default.html | 5 +++-- _layouts/table_wrappers.html | 7 +++++++ _sass/tables.scss | 11 ++++++----- 4 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 _layouts/anchor_headings.html create mode 100644 _layouts/table_wrappers.html diff --git a/_layouts/anchor_headings.html b/_layouts/anchor_headings.html deleted file mode 100644 index efec628..0000000 --- a/_layouts/anchor_headings.html +++ /dev/null @@ -1,5 +0,0 @@ ---- -layout: vendor/compress ---- - -{% include vendor/anchor_headings.html html=content anchorBody="#" anchorClass="anchor_heading" %} \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index 0b3928d..0ee5dcc 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,5 +1,5 @@ --- -layout: anchor_headings +layout: table_wrappers --- @@ -57,7 +57,8 @@ layout: anchor_headings {% endif %} {% endunless %}
- {{ content }} + + {% include vendor/anchor_headings.html html=content anchorBody="#" anchorClass="anchor_heading" %} {% if page.has_children == true and page.has_toc != false %}
diff --git a/_layouts/table_wrappers.html b/_layouts/table_wrappers.html new file mode 100644 index 0000000..cc6187a --- /dev/null +++ b/_layouts/table_wrappers.html @@ -0,0 +1,7 @@ +--- +layout: vendor/compress +--- + +{% assign content_ = content | replace: '', '
' %} +{{ content_ }} \ No newline at end of file diff --git a/_sass/tables.scss b/_sass/tables.scss index 39bc0dc..c5be606 100644 --- a/_sass/tables.scss +++ b/_sass/tables.scss @@ -3,18 +3,19 @@ // // stylelint-disable max-nesting-depth, selector-no-type, selector-max-type -table { +.table-wrapper { display: block; width: 100%; max-width: 100%; margin-bottom: $sp-5; overflow-x: auto; - border-collapse: separate; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.05); +} - @include mq(sm) { - display: table; - } +table { + display: table; + min-width: 100%; + border-collapse: separate; } th, From 0142d2874b44b2cf9dc5b8d74e4ff500381e0f88 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Fri, 10 May 2019 05:08:57 +0200 Subject: [PATCH 05/27] Enabled customization of html head --- _includes/head.html | 2 ++ _includes/head_custom.html | 0 2 files changed, 2 insertions(+) create mode 100644 _includes/head_custom.html diff --git a/_includes/head.html b/_includes/head.html index 0789ea5..47e2491 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -31,4 +31,6 @@ {% seo %} + +{% include head_custom.html %} diff --git a/_includes/head_custom.html b/_includes/head_custom.html new file mode 100644 index 0000000..e69de29 From 8c603aac1e10f7cbc6e70e74465b1fbcdd74ca24 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sun, 12 May 2019 14:12:00 +0200 Subject: [PATCH 06/27] Improved layout, unified spacing/font-sizes/border-radius/box-shadow --- _includes/title.html | 1 + _layouts/default.html | 82 ++++++++++++++++--------------- _sass/buttons.scss | 2 +- _sass/layout.scss | 91 +++++++++++++++++++++++++---------- _sass/navigation.scss | 35 ++------------ _sass/search.scss | 74 ++++++++++++++-------------- _sass/support/_variables.scss | 11 +---- _sass/tables.scss | 29 +---------- assets/js/just-the-docs.js | 10 ++-- 9 files changed, 157 insertions(+), 178 deletions(-) create mode 100644 _includes/title.html diff --git a/_includes/title.html b/_includes/title.html new file mode 100644 index 0000000..f6d5669 --- /dev/null +++ b/_includes/title.html @@ -0,0 +1 @@ +{{ site.title }} \ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index 0ee5dcc..3a18b58 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -10,8 +10,10 @@ layout: table_wrappers
-