Skip to content

Commit 91c5602

Browse files
authored
Merge pull request #154 from ember-learn/on-this-page-prefix
add prefixHeaderId to on-this-page links
2 parents 00a281e + 0638f33 commit 91c5602

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

addon/components/on-this-page.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<ul>
66
{{#each @toc as |toc|}}
77
<li>
8-
<a href="#{{toc.id}}">{{toc.text}}</a>
8+
<a href="#{{this.headerPrefix}}{{toc.id}}">{{toc.text}}</a>
99
</li>
1010
{{/each}}
1111
</ul>

addon/components/on-this-page.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Component from '@glimmer/component';
2+
import config from 'ember-get-config';
3+
4+
export default class OnThisPageComponent extends Component {
5+
headerPrefix = config?.showdown?.prefixHeaderId ?? '';
6+
}

0 commit comments

Comments
 (0)