Improve chapter anchor slugs
This commit is contained in:
parent
aaa6256e09
commit
3ef42983d6
2 changed files with 2 additions and 2 deletions
|
@ -61,7 +61,7 @@ http:
|
||||||
<<: *css_classes
|
<<: *css_classes
|
||||||
format: html
|
format: html
|
||||||
relative_urls: true
|
relative_urls: true
|
||||||
chapter_anchor_prefix: 'chapter-'
|
chapter_anchor_prefix: 'chapter'
|
||||||
|
|
||||||
rss:
|
rss:
|
||||||
<<: *paths
|
<<: *paths
|
||||||
|
|
|
@ -119,7 +119,7 @@ module Repubmark
|
||||||
|
|
||||||
def build_title_html
|
def build_title_html
|
||||||
anchor_prefix = String(config[:chapter_anchor_prefix]).strip
|
anchor_prefix = String(config[:chapter_anchor_prefix]).strip
|
||||||
anchor = %( id="#{anchor_prefix}#@slug") unless anchor_prefix.empty?
|
anchor = %( id="#{anchor_prefix}-#@slug") unless anchor_prefix.empty?
|
||||||
"<h#@level#{anchor}>#@title</h#@level>\n" if @level != 1
|
"<h#@level#{anchor}>#@title</h#@level>\n" if @level != 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue