forked from ringcentral/slate
-
Notifications
You must be signed in to change notification settings - Fork 159
Using the same link for several menu items
Niklas Frick edited this page Nov 10, 2018
·
1 revision
If you have several menu items with the same name, only the first link will work. Nevertheless it is possible to use links with the same name.
For this you have to make the following adjustments in the config.rb file:
- Replace the standard require with the following code
# Unique header generation
require './lib/nesting_unique_head.rb'
- Adjust the markdown renderer
# Markdown
set :markdown_engine, :redcarpet
set :markdown,
# some more config here
renderer: NestingUniqueHeadCounter
This change will nest your links under your h1 Titles. Let's say you have the following structure:
# (H1) Accounts
## (H2) Authentication
# (H1) Requests
## (H2) Authentication
Both authentication links will work now by creating the following anchor links:
#accounts
#accounts-authentication
#requests
#requests-authentication