Correctly slugify distill TOC (#519)

* Correctly slugify distill TOC

* Add special character to demo distill post's TOC
This commit is contained in:
Maruan 2022-01-03 08:50:53 -05:00 committed by GitHub
parent 17329fca3a
commit b715177d13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -73,11 +73,11 @@
<nav class="l-text figcaption">
<h3>Contents</h3>
{% for section in page.toc -%}
<div><a href="#{{ section.name | downcase | replace: ' ','-' }}">{{ section.name }}</a></div>
<div><a href="#{{ section.name | slugify }}">{{ section.name }}</a></div>
{% if section.subsections -%}
<ul>
{% for subsection in section.subsections -%}
<li><a href="#{{ subsection.name | downcase | replace: ' ','-' }}">{{ subsection.name }}</a></li>
<li><a href="#{{ subsection.name | slugify }}">{{ subsection.name }}</a></li>
{% endfor %}
</ul>
{%- endif -%}

View File

@ -36,7 +36,7 @@ toc:
- name: Footnotes
- name: Code Blocks
- name: Layouts
- name: Other Typography
- name: Other Typography?
# Below is an example of injecting additional post-specific styles.
# If you use this post as a template, delete this _styles block.
@ -173,7 +173,7 @@ It does not interrupt the normal flow of `.l-body` sized text except on mobile s
***
## Other Typography
## Other Typography?
Emphasis, aka italics, with *asterisks* (`*asterisks*`) or _underscores_ (`_underscores_`).
@ -279,4 +279,4 @@ Here's a line for us to start with.
This line is separated from the one above by two newlines, so it will be a *separate paragraph*.
This line is also a separate paragraph, but...
This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
This line is only separated by a single newline, so it's a separate line in the *same paragraph*.