' +
'
' +
diff --git a/_plugins/generate_links.rb b/_plugins/generate_links.rb
index 3ab16a8d..a0b348f2 100644
--- a/_plugins/generate_links.rb
+++ b/_plugins/generate_links.rb
@@ -44,8 +44,14 @@ def register_id(page, id, title, ids, titles)
end
end
+ def render_title(page, title)
+ context = page.site.site_payload['site']
+ template = Liquid::Template.parse(title)
+ return template.render('site' => context)
+ end
+
public
-
+
def generate_links(page, ids, titles)
#puts page.relative_path
# Must have to get it parsed by jekyll, these links will be part of the site.data.links array as well, do not touch them
@@ -81,7 +87,7 @@ def generate_links(page, ids, titles)
link_data = {
"id" => page_id + "##{heading_id}",
"url" => page_url + "##{heading_id}",
- "title" => '"' + heading.text + '"',
+ "title" => '"' + render_title(page, heading.text) + '"',
}
#register_id(page, link_data["id"], link_data["title"], ids, titles)
@@ -104,7 +110,7 @@ def generate_links(page, ids, titles)
link_data = {
"id" => anchor_id,
"url" => page_url + "##{anchor_name}",
- "title" => '"' + (anchor_text.empty? ? anchor_id : anchor_text) + '"',
+ "title" => '"' + (anchor_text.empty? ? anchor_id : render_title(page, anchor_text)) + '"',
}
#register_id(page, link_data["id"], link_data["title"], ids, titles)
@@ -114,7 +120,7 @@ def generate_links(page, ids, titles)
end
# Create links data for the page itself too
- page_title = page.data["title"]
+ page_title = render_title(page, page.data["title"])
page_link_data = {
"id" => page_id,
"url" => page_url,
diff --git a/doc/_doc-guide/02_Tools/01_Self_made_tools/01_Tests/README.md b/doc/_doc-guide/02_Tools/01_Self_made_tools/01_Tests/README.md
index 6bffc87e..5511ac8b 100644
--- a/doc/_doc-guide/02_Tools/01_Self_made_tools/01_Tests/README.md
+++ b/doc/_doc-guide/02_Tools/01_Self_made_tools/01_Tests/README.md
@@ -61,6 +61,10 @@ options {
};
```
+## Tests of custom markdown in header [[source]] and [[with turumturum id|doc-jekyll-extensions#titleid-markdown-extension]]
+
+## Tests of liquid expression {{ site.lunr.test_text_1 }} in header of {{ site.title }}
+
---------------------
Introduction to {{ site.product.short_name }} is a test for pages without description/subtitle, but text part between the title and the first heading which can have tooltips too this way.