diff --git a/_includes/heading-link.html b/_includes/heading-link.html new file mode 100644 index 00000000..3df621aa --- /dev/null +++ b/_includes/heading-link.html @@ -0,0 +1,14 @@ +{% comment %} +Use this partial when headings links aren't generated through markdown. +Add this partial within the heading you want to link. +Heading id must be the same as the slug passed to this partial. +{% endcomment %} + diff --git a/_includes/methods/method.html b/_includes/methods/method.html index c9d1965e..8529c983 100644 --- a/_includes/methods/method.html +++ b/_includes/methods/method.html @@ -6,9 +6,11 @@

{{ this_method.title }} {% endif %}

-

What

+ {% capture what_heading_slug %}what-{{ this_method.title | slugify }}{% endcapture %} +

What {% include "heading-link.html", slug: what_heading_slug %}

{{ this_method.what }}

-

Why

+ {% capture why_heading_slug %}why-{{ this_method.title | slugify }}{% endcapture %} +

Why {% include "heading-link.html", slug: why_heading_slug %}

{{ this_method.why }}