diff --git a/.gitignore b/.gitignore index f5061cc2..0d628b7e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ output/ site/content/resources/mastodon.csv site/content/members.adoc site/content/stats.adoc +site/content/podcasts.adoc diff --git a/Makefile b/Makefile index 799ab95a..c4aeab9e 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ endif @echo 'JBang and JBake installations found.' build: prerequisites-check - cd resources; jbang site.java ../java-champions.yml ../site/content/ + cd resources; jbang site.java .. ../site/content/ cd site; jbake --bake server: build diff --git a/resources/site.java b/resources/site.java index 64a70f67..d0213b64 100644 --- a/resources/site.java +++ b/resources/site.java @@ -170,7 +170,10 @@ static class JavaChampion { public List status = new ArrayList<>(); String formatted() { - var b = new StringBuilder("|{counter:idx}\n") + var b = new StringBuilder() + .append("|[[") + .append(nameAsAnchor()) + .append("]]{counter:idx}\n") .append("|image:") .append(avatar) .append("[]"); @@ -217,6 +220,14 @@ boolean hasMastodon() { String asMastodonCsvEntry() { return social.getMastodonAccount() + ",true,false,"; } + + String nameAsAnchor() { + // URL Encoding would have been _cleaner_ but that doesn't create output that works with flexmark + // instead this method will strip whitespace and punctuation + return name + .replaceAll("\\s", "") + .replaceAll("\\p{Punct}", ""); + } } static class Country { diff --git a/site/assets/css/asciidoctor.css b/site/assets/css/asciidoctor.css index 2accfaf7..58ecb072 100644 --- a/site/assets/css/asciidoctor.css +++ b/site/assets/css/asciidoctor.css @@ -1,4 +1,6 @@ @import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.2.0/css/font-awesome.css); +/* Fix anchor offset (50px is collapsed navbar height + 10px buffer) */ +html { scroll-padding-top: 60px; } /* ========================================================================== Embedded content ========================================================================== */ /** Remove border when inside `a` element in IE 8/9. */ img { border: 0; }