diff --git a/solr/solr-ref-guide/src/_includes/head.html b/solr/solr-ref-guide/src/_includes/head.html
index de0bd440ebd..ac20a72f9eb 100755
--- a/solr/solr-ref-guide/src/_includes/head.html
+++ b/solr/solr-ref-guide/src/_includes/head.html
@@ -4,7 +4,7 @@
{% comment %}NOTE: explicitly using the GUIDE version here (not solr) {% endcomment %}
-
diff --git a/solr/solr-ref-guide/src/_layouts/page.html b/solr/solr-ref-guide/src/_layouts/page.html
index 137cd447fac..22f88e6909f 100755
--- a/solr/solr-ref-guide/src/_layouts/page.html
+++ b/solr/solr-ref-guide/src/_layouts/page.html
@@ -1,7 +1,8 @@
---
layout: default
---
-
+{% comment %}NOTE: page_id is also definied in default.html{% endcomment %}
+{% assign page_id = page.url | split: '/' | last | remove: '.html' %}
@@ -53,7 +54,7 @@ layout: default
- {% assign scrollnav = site.data.scrollnav[page.shortname] %}
+ {% assign scrollnav = site.data.scrollnav[page_id] %}
{% if scrollnav %}
diff --git a/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java b/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
index b1f0cf39373..cb2361ae700 100644
--- a/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
+++ b/solr/solr-ref-guide/tools/BuildNavAndPDFBody.java
@@ -208,7 +208,7 @@ public class BuildNavAndPDFBody {
/** Simple struct for modeling the key metadata for dealing with page navigation */
public static final class Page {
public final File file;
- public final String title;
+ public final String title; // NOTE: has html escape codes in it
public final String shortname;
public final String permalink;
public final List
kidShortnames;
@@ -218,23 +218,33 @@ public class BuildNavAndPDFBody {
public final List kids;
private final List mutableKids;
public Page(File file, DocumentHeader header) {
+ if (! file.getName().endsWith(".adoc")) {
+ throw new RuntimeException(file + " has does not end in '.adoc' - this code can't be used");
+ }
+
this.file = file;
this.title = header.getDocumentTitle().getMain();
+
+ this.shortname = file.getName().replaceAll("\\.adoc$","");
+ this.permalink = this.shortname + ".html";
// TODO: do error checking if attribute metadata we care about is missing
Map attrs = header.getAttributes();
- this.shortname = (String) attrs.get("page-shortname");
- this.permalink = (String) attrs.get("page-permalink");
- // TODO: SOLR-11531: we should eliminate these attributes and not depend on them in jekyll, ...
- // ...but for now at least be sure they are consistent with the filename
- if (! file.getName().equals(shortname + ".adoc") ) {
- throw new RuntimeException(file + " has a mismatched shortname: " + shortname);
+ // TODO: SOLR-11541: we should eliminate these attributes
+ // ...but for now at least be sure they are consistent
+ if (attrs.containsKey("page-shortname")) {
+ String explicit = (String) attrs.get("page-shortname");
+ if (! shortname.equals(explicit)) {
+ throw new RuntimeException(file + " ("+shortname+") has a mismatched page-shortname: " + explicit);
+ }
}
- if (! permalink.equals(shortname + ".html") ) {
- throw new RuntimeException(file + " has a mismatched permalink: " + permalink);
+ if (attrs.containsKey("page-permalink")) {
+ String explicit = (String) attrs.get("page-permalink");
+ if (! permalink.equals(explicit)) {
+ throw new RuntimeException(file + "("+permalink+") has a mismatched permalink: " + explicit);
+ }
}
-
if (attrs.containsKey("page-children")) {
String kidsString = ((String) attrs.get("page-children")).trim();