samredai commented on a change in pull request #63:
URL: https://github.com/apache/iceberg-docs/pull/63#discussion_r826489366
##########
File path: landing-page/layouts/_default/single.html
##########
@@ -2,11 +2,25 @@
<head>
<link href="{{ .Site.BaseURL }}/css/markdown.css" rel="stylesheet">
<link href="{{ .Site.BaseURL }}/css/katex.min.css" rel="stylesheet">
+ <script>
+ function addAnchor(element) {
+ element.insertAdjacentHTML('beforeend', `<a href="#${element.id}"
class="anchortag" ariaLabel="Anchor"> 🔗 </a>` )
+ }
+ document.addEventListener('DOMContentLoaded', function () {
+ var headers = document.querySelectorAll('h1[id], h2[id], h3[id],
h4[id]')
+ if (headers) {
+ headers.forEach(addAnchor)
+ }
+ });
Review comment:
I added a comment describing what this does. I think h1-h4 is common for
anchor tags since people usually don't need an anchor tag link to drill all the
way down to an h5. (We could probably get away with h1-h3)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]