You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2020/02/16 17:23:57 UTC
[lucene-site] branch master updated: LUCENE-8987: Template the
htaccess file, so latest version number gets inserted automatically
This is an automated email from the ASF dual-hosted git repository.
uschindler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-site.git
The following commit(s) were added to refs/heads/master by this push:
new 4af12c3 LUCENE-8987: Template the htaccess file, so latest version number gets inserted automatically
4af12c3 is described below
commit 4af12c3b4320f84d5cfa7a645b9fdf991292e7e8
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Sun Feb 16 18:23:42 2020 +0100
LUCENE-8987: Template the htaccess file, so latest version number gets inserted automatically
---
pelicanconf.py | 2 ++
content/.htaccess => themes/lucene/templates/htaccess.template | 8 ++++----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/pelicanconf.py b/pelicanconf.py
index ddace3e..6a77272 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -85,6 +85,8 @@ EXTRA_PATH_METADATA = {
STATIC_PATHS = ['.']
+TEMPLATE_PAGES = {'htaccess.template': '.htaccess'}
+
PLUGIN_PATHS = ['./plugins']
PLUGINS = [
'extract_toc',
diff --git a/content/.htaccess b/themes/lucene/templates/htaccess.template
similarity index 94%
rename from content/.htaccess
rename to themes/lucene/templates/htaccess.template
index 1194362..b4552b0 100644
--- a/content/.htaccess
+++ b/themes/lucene/templates/htaccess.template
@@ -54,10 +54,10 @@ RedirectMatch temp ^/solr/api$ /solr/api/
# Other pages can always be redirected to the "most current" released javadocs
# using "temp" instead of permanent so crawlers know that they
# might change again in the future
-RedirectMatch temp ^/core/api/(.*) /core/8_4_1/$1
-RedirectMatch temp ^/solr/api/org/(.*) /solr/8_4_1/solr-core/org/$1
-RedirectMatch temp ^/solr/api/(.*) /solr/8_4_1/$1
-RedirectMatch temp ^/solr/guide/(?!index.html)([a-z].*) /solr/guide/8_4/$1
+RedirectMatch temp ^/core/api/(.*) /core/{{ LUCENE_LATEST_RELEASE | replace(".", "_") }}/$1
+RedirectMatch temp ^/solr/api/org/(.*) /solr/{{ LUCENE_LATEST_RELEASE | replace(".", "_") }}/solr-core/org/$1
+RedirectMatch temp ^/solr/api/(.*) /solr/{{ LUCENE_LATEST_RELEASE | replace(".", "_") }}/$1
+RedirectMatch temp ^/solr/guide/(?!index.html)([a-z].*) /solr/guide/{{ LUCENE_LATEST_RELEASE.rsplit(".", 1) | first | replace(".", "_") }}/$1
# Solr Tutorial is now in the Solr Ref Guide
# should redirect automatically to latest version