Skip to content

Commit e815a16

Browse files
authored
Expand colophon entries for hash navigation (#47)
https://chatgpt.com/s/cd_68ba01ddab7c819182005c5994b10aec
1 parent 2ebdb9d commit e815a16

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

build_colophon.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,22 @@ def get_most_recent_date(page_data):
274274
</div>
275275
"""
276276

277-
# Close the HTML
277+
# Close the HTML with script that expands the correct tool
278278
html_content += """
279+
<script>
280+
document.addEventListener('DOMContentLoaded', () => {
281+
const hash = window.location.hash.slice(1);
282+
if (hash) {
283+
const element = document.getElementById(hash);
284+
if (element) {
285+
const details = element.querySelector('details');
286+
if (details) {
287+
details.open = true;
288+
}
289+
}
290+
}
291+
});
292+
</script>
279293
</body>
280294
</html>
281295
"""

0 commit comments

Comments
 (0)