@@ -44,8 +44,14 @@ def register_id(page, id, title, ids, titles)
44
44
end
45
45
end
46
46
47
+ def render_title ( page , title )
48
+ context = page . site . site_payload [ 'site' ]
49
+ template = Liquid ::Template . parse ( title )
50
+ return template . render ( 'site' => context )
51
+ end
52
+
47
53
public
48
-
54
+
49
55
def generate_links ( page , ids , titles )
50
56
#puts page.relative_path
51
57
# 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)
81
87
link_data = {
82
88
"id" => page_id + "##{ heading_id } " ,
83
89
"url" => page_url + "##{ heading_id } " ,
84
- "title" => '"' + heading . text + '"' ,
90
+ "title" => '"' + render_title ( page , heading . text ) + '"' ,
85
91
}
86
92
#register_id(page, link_data["id"], link_data["title"], ids, titles)
87
93
@@ -104,7 +110,7 @@ def generate_links(page, ids, titles)
104
110
link_data = {
105
111
"id" => anchor_id ,
106
112
"url" => page_url + "##{ anchor_name } " ,
107
- "title" => '"' + ( anchor_text . empty? ? anchor_id : anchor_text ) + '"' ,
113
+ "title" => '"' + ( anchor_text . empty? ? anchor_id : render_title ( page , anchor_text ) ) + '"' ,
108
114
}
109
115
#register_id(page, link_data["id"], link_data["title"], ids, titles)
110
116
@@ -114,7 +120,7 @@ def generate_links(page, ids, titles)
114
120
end
115
121
116
122
# Create links data for the page itself too
117
- page_title = page . data [ "title" ]
123
+ page_title = render_title ( page , page . data [ "title" ] )
118
124
page_link_data = {
119
125
"id" => page_id ,
120
126
"url" => page_url ,
0 commit comments