From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 10 13:04:48 2019 Received: (at submit) by debbugs.gnu.org; 10 Jul 2019 17:04:48 +0000 Received: from localhost ([127.0.0.1]:36492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlG1Q-0000xQ-74 for submit@debbugs.gnu.org; Wed, 10 Jul 2019 13:04:48 -0400 Received: from lists.gnu.org ([209.51.188.17]:44261) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlG1N-0000xH-K9 for submit@debbugs.gnu.org; Wed, 10 Jul 2019 13:04:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42163) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlG1M-0004JT-Fm for guix-patches@gnu.org; Wed, 10 Jul 2019 13:04:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_40,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlG1L-0000nU-7g for guix-patches@gnu.org; Wed, 10 Jul 2019 13:04:44 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:45576) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hlG1K-0000fG-UG for guix-patches@gnu.org; Wed, 10 Jul 2019 13:04:43 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45kQXR0PWKz1rWTR for ; Wed, 10 Jul 2019 19:04:38 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45kQXQ6f8jz1qqkC for ; Wed, 10 Jul 2019 19:04:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 1ksh6WO976Wa for ; Wed, 10 Jul 2019 19:04:38 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-60-166.dynamic.mnet-online.de [188.174.60.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Wed, 10 Jul 2019 19:04:38 +0200 (CEST) Received: from lenashee.goebel-consult.de (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 6CCFF600AB for ; Wed, 10 Jul 2019 19:04:41 +0200 (CEST) From: Hartmut Goebel To: guix-patches@gnu.org Subject: [PATCH] website: Add "permalinks" to package entries in package-list. Date: Wed, 10 Jul 2019 19:04:37 +0200 Message-Id: <20190710170437.3672-1-h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.18.0.10 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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/app= s/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")) " =E2=80=94 " - ,(package-synopsis-shtml package))) + ,(package-synopsis-shtml package)) + (a + (@ (class "headerlink") (title "Permalink to this package") + (href ,(string-append "#" (package-name package)))) + " =C2=B6")) =20 (div (@ (class "package-description")) diff --git a/website/static/packages/css/package-list.css b/website/stati= c/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; +} --=20 2.21.0