From nobody Fri Jul 15 09:58:25 2022 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LkmyT4GWgz4TFdm for ; Fri, 15 Jul 2022 09:58:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LkmyT2lTVz3cQk; Fri, 15 Jul 2022 09:58:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657879105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QkHJLaVL6hKl2ELM22ukdinlfdkrYOydiSHZkpCQsWU=; b=Nsr7E2WchZMPIugaMJ+fOLda49pynZUl8E7Yo39zutHsHxCr4CfCOz+gXKrQa1konefMhC hSldCkJC7pLFhrc4WUOewVobl+Q505YWNkklY5hGky118yCH5QuE2LcsXrtjOGX21kc+CQ U+zVxaCU7nv1zJNUVP4FJCsaqVTOvC3vxoINnwKaMGEZoB2vfkfVhaVNAFQdGduEx9hW44 UIFw9Q6m/pvoqflYU9gsbe/kSWKOSp5UVNxBhR87xdzDmJxC0PlXcGPVbSFORaprB6BagS U9tcpQqzC2rdjfneudBr7hK//+xzvlNB6cIYIg1qBSh+BgFXYsOFxmGKDAFkiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LkmyT1ngkzdf5; Fri, 15 Jul 2022 09:58:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26F9wPG0096879; Fri, 15 Jul 2022 09:58:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26F9wPWD096878; Fri, 15 Jul 2022 09:58:25 GMT (envelope-from git) Date: Fri, 15 Jul 2022 09:58:25 GMT Message-Id: <202207150958.26F9wPWD096878@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Sergio Carlavilla Delgado Subject: git: 52e33b2723 - main - Activate section anchors in the Documentation Portal List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: carlavilla X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52e33b2723159afc28ecdad36dae5bc51e52e47c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657879105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QkHJLaVL6hKl2ELM22ukdinlfdkrYOydiSHZkpCQsWU=; b=A3ZIHJGNO15Mf2Y6OywIPC0f7NyCo+CuEcHLgquyvw8G92zITsaY0BYGl3fW2HJ5LvCXPs UMw7jQWILfVYUpXxy3q2yE//2bppb0pXc/KKY/GOqcXwzR7n71g4l9eE5KGJydcwM8f7iU gfY5OfZihmx27ReMNnhRNOaUgM4Jyg+T0K1c5TDIph9loyaEUP2LrQvcRJRYDU47CdEIRT M9zQ0O64nnPOVs6iCUGMk0o1osmDTPeoTiX4golks5PCzusVK9e/alflDTkGSYCoeoD2B+ Mtl+Oo3/GgKgudpH3lYXn4ix6JY7/L1bDcGypIPLGzgcinPKwCaJnfhuVdpe+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657879105; a=rsa-sha256; cv=none; b=HzXxHDFqLeBzMwd1onYFwbAcJLkiIWjE1OkuJDGNWzhUlcwRr9IMCBVSb/iEAcUHMt1J5p DAxI1yFMuXnVs3KNiNlBgAg6x8BBgbhhChwr1Dp/fsCZydem+D3FPfGZuV8UKY8drayeJE 1WTxc1EQNcZCoGpjMbBl8l1JucRSIyEvgu4MZNyOhrcwWc24RvbVmBgX+wGaNahv2y/PFr Ql8aN8FFxj6QDYIbtwO/KRJBPKRGpIoRivF1f9p8oZN2lUBNvNqw8bT09D2tsmy4PLF0/4 vlQelpD9rB59BSIc0dZI6FcMiwfereM+HFRc1OfR6qKDuIRhf4H/6K3Osw6GLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by carlavilla: URL: https://cgit.FreeBSD.org/doc/commit/?id=52e33b2723159afc28ecdad36dae5bc51e52e47c commit 52e33b2723159afc28ecdad36dae5bc51e52e47c Author: Sergio Carlavilla Delgado AuthorDate: 2022-07-15 09:52:35 +0000 Commit: Sergio Carlavilla Delgado CommitDate: 2022-07-15 09:52:35 +0000 Activate section anchors in the Documentation Portal Right now every heading except the main one will display an anchor when the cursor is over the heading. In this way parts of the documentation can be easily shared only clicking in the anchor. --- documentation/config/_default/config.toml | 1 + .../themes/beastie/assets/styles/global.scss | 73 ++++++++-------------- 2 files changed, 28 insertions(+), 46 deletions(-) diff --git a/documentation/config/_default/config.toml b/documentation/config/_default/config.toml index 087c0f5576..770088c989 100644 --- a/documentation/config/_default/config.toml +++ b/documentation/config/_default/config.toml @@ -37,6 +37,7 @@ enableGitInfo = true env-beastie = true isOnline = true skip-front-matter = true + sectanchors = true [outputs] home = [ "HTML" ] diff --git a/documentation/themes/beastie/assets/styles/global.scss b/documentation/themes/beastie/assets/styles/global.scss index c6e2bbaf6d..765d81b672 100644 --- a/documentation/themes/beastie/assets/styles/global.scss +++ b/documentation/themes/beastie/assets/styles/global.scss @@ -316,59 +316,40 @@ h6 { font-size: var(--size-300); } -h2, -h3, -h4, -h5, -h6 { - border-bottom: 1px solid var(--lines-color); -} +h2 > .anchor, +h3 > .anchor, +h4 > .anchor, +h5 > .anchor, +h6 > .anchor { + text-decoration: none; -h1 .anchor, -h2 .anchor, -h3 .anchor, -h4 .anchor, -h5 .anchor, -h6 .anchor, -h1 .link, -h2 .link, -h3 .link, -h4 .link, -h5 .link, -h6 .link { - text-decoration: none !important; - color: var(--global-font-color); + &:hover { + text-decoration: none; + } } -h1 .anchor, -h2 .anchor, -h3 .anchor, -h4 .anchor, -h5 .anchor, -h6 .anchor { +h2 > .anchor::before, +h3 > .anchor::before, +h4 > .anchor::before, +h5 > .anchor::before, +h6 > .anchor::before { visibility: hidden; - font-weight: normal; - margin-right: 5px; + margin-right: .3rem; + content: "#"; + color: var(--global-font-color); } -h1 .anchor::before, -h2 .anchor::before, -h3 .anchor::before, -h4 .anchor::before, -h5 .anchor::before, -h6 .anchor::before { - content: "\00a7"; -} +h2, +h3, +h4, +h5, +h6 { + border-bottom: 1px solid var(--lines-color); -h1:hover .anchor, -h2:hover .anchor, -h3:hover .anchor, -h4:hover .anchor, -h5:hover .anchor, -h6:hover .anchor { - visibility: visible; - font-weight: normal; - margin-right: 5px; + &:hover .anchor::before { + visibility: visible; + transition: visibility 0s easy 0s; + } } hr {