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

This commit is contained in:
Cassandra Targett 2017-06-09 17:06:27 -05:00
parent 072e72097c
commit f434e34d5c
3 changed files with 24 additions and 12 deletions

View File

@ -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}/" />

View File

@ -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}"

View File

@ -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 %}