Subject: bug#36579: closed ([PATCH] website: Add "permalinks" to package entries in package-list.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 08 Aug 2019 12:22:05 +0000

Your bug report

#36579: [PATCH] website: Add "permalinks" to package entries in package-list.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
36579: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36579
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: [PATCH] website: Add "permalinks" to package entries in package-list.
From: Hartmut Goebel <[email-masked]>
To: [email-masked]
Date: Thu, 8 Aug 2019 14:21:21 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Obsolete due to new website design

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | [email-masked]               |
| www.crazy-compilers.com | compilers which you thought are impossible |

Subject: [PATCH] website: Add "permalinks" to package entries in package-list.
From: Hartmut Goebel <[email-masked]>
To: [email-masked]
Date: Wed, 10 Jul 2019 19:04:37 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

* website/apps/packages/templates/components.scm
  (detailed-package-preview): Add an id attribute and a link to itself
  to each package entry headline.
* website/static/packages/css/package-list.css: Add style rules
  to show the permalink symbol only when hovering over the
  headline.
---
 .../apps/packages/templates/components.scm    |  8 ++++++--
 website/static/packages/css/package-list.css  | 19 ++++++++++++++++++-
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/website/apps/packages/templates/components.scm b/website/apps/packages/templates/components.scm
index 96e4296..7352402 100644
--- a/website/apps/packages/templates/components.scm
+++ b/website/apps/packages/templates/components.scm
@@ -41,13 +41,17 @@
   `(div
     (@ (class "package-preview"))
     (h3
-     (@ (class "package-name"))
+     (@ (class "package-name") (id ,(package-name package)))
      ,(package-name package) " " ,(package-version package) " "
      ,(if (package-issues? package) '(span (@ (class "red-tag")) "") " ")
      (span
       (@ (class "package-synopsis"))
       " — "
-      ,(package-synopsis-shtml package)))
+      ,(package-synopsis-shtml package))
+      (a
+       (@ (class "headerlink") (title "Permalink to this package")
+	  (href ,(string-append "#" (package-name package))))
+       " ¶"))
 
     (div
      (@ (class "package-description"))
diff --git a/website/static/packages/css/package-list.css b/website/static/packages/css/package-list.css
index 10f079b..2e9e352 100644
--- a/website/static/packages/css/package-list.css
+++ b/website/static/packages/css/package-list.css
@@ -40,4 +40,21 @@
     display: inline-block;
     height: 13px;
     width: 22px;
-}
\ No newline at end of file
+}
+
+a.headerlink {
+    visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink,
+caption:hover > a.headerlink,
+p.caption:hover > a.headerlink,
+div.code-block-caption:hover > a.headerlink {
+    visibility: visible;
+}
-- 
2.21.0