diff --git a/_config.yml b/_config.yml index ad2ca04..6470c0e 100644 --- a/_config.yml +++ b/_config.yml @@ -24,6 +24,9 @@ exclude: ["node_modules/", "*.gemspec", "*.gem", "Gemfile", "Gemfile.lock", "pac # Enable or disable the site search search_enabled: true +# Enable or disable heading anchors +heading_anchors: true + # Aux links for the upper right navigation aux_links: "Just the Docs on GitHub": @@ -41,3 +44,11 @@ ga_tracking: UA-2709176-10 plugins: - jekyll-seo-tag + +compress_html: + clippings: all + comments: all + endings: all + startings: [] + blank_lines: false + profile: false diff --git a/_includes/head.html b/_includes/head.html index 58d211c..7aa7abb 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 %} @@ -27,11 +27,14 @@ {% endif %} {% if site.search_enabled != nil %} - + {% endif %} - + {% seo %} + + {% include head_custom.html %} + diff --git a/_includes/head_custom.html b/_includes/head_custom.html new file mode 100644 index 0000000..e69de29 diff --git a/_includes/js/custom.js b/_includes/js/custom.js new file mode 100644 index 0000000..e69de29 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/_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 %} + @@ -6,22 +10,23 @@
-