File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,20 @@ <h3><a href="https://github.com/ircv3/ircv3-specifications/milestone/4">Roadmap<
7878 </ div >
7979
8080 {% for post in site.posts limit:10 %}
81+ {% comment %} add a prefix to ids to avoid duplicates within the same page {% endcomment %}
82+ {% assign h3_prefix = '< h3 id ="' | append: post.id | append: '-' | replace_first: '/', '' %}
83+ {% assign h4_prefix = '<h4 id= "' | append: post.id | append: '-' | replace_first: '/', '' %}
84+ {% assign h5_prefix = '< h5 id ="' | append: post.id | append: '-' | replace_first: '/', '' %}
85+ {% assign h6_prefix = '<h6 id= "' | append: post.id | append: '-' | replace_first: '/', '' %}
8186 < div class ="post ">
8287 < h3 > < a href ="{{ post.url }} "> {{ post.title | xml_escape }}</ a > < span class ="meta "> {{ post.date | date_to_string }}</ span > </ h3 >
8388 < div class ="post-content ">
84- {{ post.content }}
89+ {{ post.content
90+ | replace: '< h6 id ="', h6_prefix
91+ | replace: '<h5 id= "', h5_prefix
92+ | replace: '< h4 id ="', h4_prefix
93+ | replace: '<h3 id= "', h3_prefix
94+ }}
8595 </ div >
8696 </ div>
8797 {% endfor %}
You can’t perform that action at this time.
0 commit comments