Skip to content

Apache Lucene open-source search software

SOLR-10616: parameterize Guide HTML path in sitemap.xml

Cassandra Targettf434e34d5c7b
diff --git a/solr/solr-ref-guide/build.xml b/solr/solr-ref-guide/build.xml
index 4e009929de3..6a610b1e5f3 100644
--- a/solr/solr-ref-guide/build.xml
+++ b/solr/solr-ref-guide/build.xml
@@ -44,34 +44,45 @@
</filterchain>
</loadresource>
<!-- NOTE: ${solr-guide-version} is the version of this ref-guide.
-
+
By default, we assume this is the same as ${solr-docs-version} with a "-DRAFT" suffix
When releasing, specify an explicit value of this property on the command line.
-
+
NOTE: the ${solr-guide-version} used *may* be different from the version of Solr the guide
covers if we decide to do a bug-fix release of the ref-guide
-
+
Examples: (assume branch_6_1 where version=6.1.SOMETHING)
-
+
Basic nightly/local build of the 6.1 guide...
-
+
=> ant build-pdf
-
+
Official release build of the 6.1 guide...
-
+
=> ant build-pdf -Dsolr-guide-version=6.1
-
+
Release of a "6.1.1" ref guide, correcting some serious error in the docs
(even if there is no 6.1.1 version - or if we've alreayd released up to 6.1.5 - of Solr itself)
-
+
=> ant build-pdf -Dsolr-guide-version=6.1.1
-
+
-->
<property name="solr-guide-version" value="${solr-docs-version}-DRAFT" />
<condition property="solr-guide-draft-status" value="" else="DRAFT">
<matches pattern="^\d+\.\d+(|\.\d+)$" string="${solr-guide-version}" />
</condition>
+ <loadresource property="solr-guide-version-path">
+ <!-- NOTE: This is the ${solr-guide-version} as a path suitable for use publishing the HTML -->
+ <propertyresource name="solr-guide-version"/>
+ <filterchain>
+ <tokenfilter>
+ <filetokenizer/>
+ <replaceregex pattern="^(\d+)\.(\d+)(-DRAFT)?.*" replace="\1_\2\3" flags="s"/>
+ </tokenfilter>
+ </filterchain>
+ </loadresource>
+
<property name="solr-javadocs" value="https://lucene.apache.org/solr/${solr-docs-version-path}/" />
<property name="lucene-javadocs" value="https://lucene.apache.org/core/${solr-docs-version-path}/" />
diff --git a/solr/solr-ref-guide/src/_config.yml.template b/solr/solr-ref-guide/src/_config.yml.template
index 0db495e78a8..9d40209324b 100755
--- a/solr/solr-ref-guide/src/_config.yml.template
+++ b/solr/solr-ref-guide/src/_config.yml.template
@@ -55,7 +55,7 @@ defaults:
search: true
# needed for sitemap.xml
-url: https://home.apache.org/~ctargett/RefGuidePOC/jekyll-full
+url: https://lucene.apache.org/solr/guide/
# Asciidoc settings - disabled so we can use asciidoctor instead
asciidoc: {}
@@ -71,6 +71,7 @@ asciidoc: {}
solr-attributes: &solr-attributes-ref
solr-guide-draft-status: "${solr-guide-draft-status}"
solr-guide-version: "${solr-guide-version}"
+ solr-guide-version-path: "${solr-guide-version-path}"
solr-docs-version: "${solr-docs-version}"
solr-javadocs: "${solr-javadocs}"
lucene-javadocs: "${lucene-javadocs}"
diff --git a/solr/solr-ref-guide/src/sitemap.xml b/solr/solr-ref-guide/src/sitemap.xml
index d5fa97aae93..ba2032d4027 100755
--- a/solr/solr-ref-guide/src/sitemap.xml
+++ b/solr/solr-ref-guide/src/sitemap.xml
@@ -10,7 +10,7 @@ search: exclude
{% for page in site.pages %}
{% unless page.search == "exclude" %}
<url>
- <loc>{{site.url}}{{page.url}}</loc>
+ <loc>{{site.url}}{{site.solr-attributes.solr-guide-version-path}}{{page.url}}</loc>
</url>
{% endunless %}
{% endfor %}