# HG changeset patch # User Sergey Budnevitch # Date 1652191647 -14400 # Node ID fdf1464e19775bbd3e38dbcd2401c767b836bf64 # Parent a3aee2697d4e0068370df1fc7fdb9c593bdbe92f Moved banner to the external file to make partial rollout possible. An idea is to have several banners and show them with different probability specified by split directive in the nginx.conf diff --git a/GNUmakefile b/GNUmakefile --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,7 @@ OUT = libxslt TEXT = text +BANNER = banner ZIP = gzip NGINX_ORG = /data/www/nginx.org SHELL = ./umasked.sh @@ -45,6 +46,7 @@ COMMON_DEPS = \ xslt/style.xslt \ xslt/body.xslt \ xslt/menu.xslt \ + xslt/banner.xslt \ xslt/ga.xslt \ xslt/content.xslt \ @@ -313,14 +315,15 @@ gzip: rsync_gzip $(MAKE) do_gzip rsync_gzip: - $(CHMOD) $(OUT) $(TEXT) - $(RSYNC) --delete --exclude='*.gz' $(OUT)/ $(TEXT)/ $(ZIP)/ + $(CHMOD) $(OUT) $(TEXT) $(BANNER) + $(RSYNC) --delete --exclude='*.gz' $(OUT)/ $(TEXT)/ $(BANNER) $(ZIP)/ do_gzip: $(addsuffix .gz, $(wildcard $(ZIP)/*.html)) \ $(addsuffix .gz, \ $(foreach lang, $(LANGS), \ $(foreach dir, . docs docs/dev docs/faq docs/http docs/mail docs/njs docs/stream, \ $(wildcard $(ZIP)/$(lang)/$(dir)/*.html)))) \ + $(addsuffix .gz, $(wildcard $(ZIP)/$(BANNER)/*.html)) \ $(ZIP)/index.rss.gz \ $(ZIP)/LICENSE.gz \ $(ZIP)/en/CHANGES.gz \ diff --git a/banner/banner.html b/banner/banner.html new file mode 100644 --- /dev/null +++ b/banner/banner.html @@ -0,0 +1,2 @@ + Registration is now open for the free Microservices March Kubernetes event.
+ Click here to enroll. diff --git a/xsls/article.xsls b/xsls/article.xsls --- a/xsls/article.xsls +++ b/xsls/article.xsls @@ -26,6 +26,7 @@ X:include href = "link.xslt"; X:include href = "style.xslt"; X:include href = "body.xslt"; X:include href = "menu.xslt"; +X:include href = "banner.xslt"; X:include href = "ga.xslt"; X:include href = "content.xslt"; X:include href = "books.xslt"; @@ -49,6 +50,8 @@ X:template = "/article | /module" { !style (lang="@lang") + !banner () + !ga () diff --git a/xsls/banner.xsls b/xsls/banner.xsls new file mode 100644 --- /dev/null +++ b/xsls/banner.xsls @@ -0,0 +1,34 @@ + + +X:stylesheet { + +X:var BANNER = "'/banner/banner.html'"; + +X:template banner_link () { + X:if "substring-after($DIRNAME, '/')" { + !{ concat($ROOT, $BANNER) } + } else { + !{ substring-after($BANNER, '/') } + } +} + +X:template banner () { + + + +} + +} diff --git a/xsls/body.xsls b/xsls/body.xsls --- a/xsls/body.xsls +++ b/xsls/body.xsls @@ -18,9 +18,6 @@ X:template body (lang) {
diff --git a/xsls/error.xsls b/xsls/error.xsls --- a/xsls/error.xsls +++ b/xsls/error.xsls @@ -26,6 +26,7 @@ X:include href = "link.xslt"; X:include href = "style.xslt"; X:include href = "body.xslt"; X:include href = "menu.xslt"; +X:include href = "banner.xslt"; X:include href = "ga.xslt"; X:include href = "content.xslt"; @@ -35,6 +36,8 @@ X:template = "/error" { !style (lang="@lang") + !banner () + !ga () diff --git a/xsls/news.xsls b/xsls/news.xsls --- a/xsls/news.xsls +++ b/xsls/news.xsls @@ -27,6 +27,7 @@ X:include href = "link.xslt"; X:include href = "style.xslt"; X:include href = "body.xslt"; X:include href = "menu.xslt"; +X:include href = "banner.xslt"; X:include href = "ga.xslt"; X:include href = "content.xslt"; @@ -41,6 +42,8 @@ X:template = "/news" { !style (lang="@lang") + !banner () + !ga () diff --git a/xslt/article.xslt b/xslt/article.xslt --- a/xslt/article.xslt +++ b/xslt/article.xslt @@ -27,6 +27,7 @@ + @@ -48,7 +49,7 @@ <xsl:value-of select="@name"/> - + diff --git a/xslt/banner.xslt b/xslt/banner.xslt new file mode 100644 --- /dev/null +++ b/xslt/banner.xslt @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/xslt/body.xslt b/xslt/body.xslt --- a/xslt/body.xslt +++ b/xslt/body.xslt @@ -19,9 +19,6 @@
diff --git a/xslt/error.xslt b/xslt/error.xslt --- a/xslt/error.xslt +++ b/xslt/error.xslt @@ -27,6 +27,7 @@ + @@ -34,7 +35,7 @@ <xsl:value-of select="@name"/> - + diff --git a/xslt/news.xslt b/xslt/news.xslt --- a/xslt/news.xslt +++ b/xslt/news.xslt @@ -28,6 +28,7 @@ + @@ -39,7 +40,7 @@ <xsl:value-of select="@name"/> <xsl:if test="$YEAR"> <xsl:text>: </xsl:text> <xsl:value-of select="$YEAR"/> </xsl:if> - +