Skip to content

Commit

Permalink
Correctly slugify distill TOC (#519)
Browse files Browse the repository at this point in the history
* Correctly slugify distill TOC

* Add special character to demo distill post's TOC
  • Loading branch information
alshedivat committed Jan 3, 2022
1 parent 17329fc commit b715177
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _layouts/distill.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ <h1>{{ page.title }}</h1>
<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 -%}
Expand Down
6 changes: 3 additions & 3 deletions _posts/2018-12-22-distill.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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_`).

Expand Down Expand Up @@ -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*.

0 comments on commit b715177

Please sign in to comment.