From ccebf3cd4e10363cf92e662617ade28259438033 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 29 Oct 2023 16:07:39 +0800 Subject: [PATCH] Add anchor tags for headers --- .eleventy.js | 14 ++++- _site/css/style.css | 10 ++++ _site/download.html | 31 ++++++++--- _site/index.html | 6 +-- _site/news.html | 124 ++++++++++++++++++++++---------------------- css/style.css | 10 ++++ download.liquid | 31 ++++++++--- package.json | 1 + 8 files changed, 146 insertions(+), 81 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 8f8c0ac..d8631bb 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,4 +1,6 @@ -module.exports = function(eleventyConfig) { +const markdownItAnchor = require("markdown-it-anchor"); + +module.exports = (eleventyConfig) => { // Copy files as-is eleventyConfig.addPassthroughCopy("img"); eleventyConfig.addPassthroughCopy("css"); @@ -6,6 +8,14 @@ module.exports = function(eleventyConfig) { eleventyConfig.addPassthroughCopy("favicon.ico"); eleventyConfig.addPassthroughCopy("favicon.svg"); - // Ignore files + // Ignored files eleventyConfig.ignores.add("README.md"); + + eleventyConfig.amendLibrary("md", (mdLib) => { + // https://github.com/valeriangalliat/markdown-it-anchor#usage + const options = { + permalink: markdownItAnchor.permalink.headerLink() + }; + mdLib.use(markdownItAnchor, options); + }); }; diff --git a/_site/css/style.css b/_site/css/style.css index df893fd..62bd8ca 100644 --- a/_site/css/style.css +++ b/_site/css/style.css @@ -72,6 +72,11 @@ h2 { margin: 0; } +h2 a.header-anchor { + color: inherit; + text-decoration: none; +} + h3 { /* background-color: #ADD15A; */ border-bottom: 1px solid #d9dee1; @@ -84,6 +89,11 @@ h3 { margin: 15px 0 10px; } +h3 a.header-anchor { + color: inherit; + text-decoration: none; +} + img { border: 0; display: block; diff --git a/_site/download.html b/_site/download.html index 06ecf72..6eb5848 100644 --- a/_site/download.html +++ b/_site/download.html @@ -51,7 +51,9 @@

Downloads

-

Public Key for PGP Signing

+

+ Public Key for PGP Signing +

Starting from v3.3.4 all source tarballs and binaries are signed.

@@ -67,7 +69,9 @@

Public Key for PGP Signing


-

Windows 10 / 11

+

+ Windows 10 / 11 +

Windows icon @@ -146,7 +150,9 @@

Windows 10 / 11


-

macOS Catalina / Big Sur / Monterey

+

+ macOS Catalina / Big Sur / Monterey +

macOS icon @@ -229,7 +235,10 @@

macOS Catalina / Big Sur / Monterey


-

Linux

+ +

+ Linux +

linux icon @@ -313,7 +322,9 @@

Linux


-

Source Tarball

+

+ Source Tarball +

tarball icon @@ -379,7 +390,10 @@

Source Tarball


-

Other Binary Packages

+ +

+ Other Binary Packages +

Select operating system: @@ -549,7 +563,10 @@ src:


-

Old Release Archive

+ +

+ Old Release Archive +

  • FossHub
  • SourceForge
  • diff --git a/package.json b/package.json index ce89de0..dd37d54 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "devDependencies": { "@11ty/eleventy": "^2.0.0", "html-validate": "*", + "markdown-it-anchor": "*", "prettier": "*", "stylelint": "*", "stylelint-config-standard": "*",