You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2023/03/26 14:47:07 UTC

[comdev-site] branch master updated: Add header link hover

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/comdev-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 023370b  Add header link hover
023370b is described below

commit 023370be95fa276af018a613d8bf84b9eefc4e59
Author: Sebb <se...@apache.org>
AuthorDate: Sun Mar 26 15:47:00 2023 +0100

    Add header link hover
---
 layouts/_default/_markup/render-heading.html | 5 +++++
 static/css/main.css                          | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html
new file mode 100644
index 0000000..6e02d60
--- /dev/null
+++ b/layouts/_default/_markup/render-heading.html
@@ -0,0 +1,5 @@
+<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
+{{- if and (ge .Level 1) (le .Level 4) }}{{" " -}}
+<a class="headerlink" title="Permalink" href="#{{ .Anchor | safeURL }}">&para;</a>
+{{- end -}}
+</h{{ .Level }}>
diff --git a/static/css/main.css b/static/css/main.css
index 519b025..b7ccc4a 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -20,3 +20,10 @@ footer.page-footer .footer-copyright {
   background-color: rgba(0,0,0,0.2);
 }
 
+.headerlink {
+  visibility: hidden;
+}
+
+dt:hover > .headerlink, p:hover > .headerlink, td:hover > .headerlink, h1:hover > .headerlink, h2:hover > .headerlink, h3:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, h6:hover > .headerlink {
+  visibility: visible
+}