# 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 -r a3aee2697d4e -r fdf1464e1977 GNUmakefile --- a/GNUmakefile Thu May 05 18:31:47 2022 +0100 +++ b/GNUmakefile Tue May 10 18:07:27 2022 +0400 @@ -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 @@ xslt/style.xslt \ xslt/body.xslt \ xslt/menu.xslt \ + xslt/banner.xslt \ xslt/ga.xslt \ xslt/content.xslt \ @@ -313,14 +315,15 @@ $(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 -r a3aee2697d4e -r fdf1464e1977 banner/banner.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/banner/banner.html Tue May 10 18:07:27 2022 +0400 @@ -0,0 +1,2 @@ + Registration is now open for the free Microservices March Kubernetes event.
+ Click here to enroll. diff -r a3aee2697d4e -r fdf1464e1977 xsls/article.xsls --- a/xsls/article.xsls Thu May 05 18:31:47 2022 +0100 +++ b/xsls/article.xsls Tue May 10 18:07:27 2022 +0400 @@ -26,6 +26,7 @@ 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 @@ !style (lang="@lang") + !banner () + !ga () diff -r a3aee2697d4e -r fdf1464e1977 xsls/banner.xsls --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xsls/banner.xsls Tue May 10 18:07:27 2022 +0400 @@ -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 -r a3aee2697d4e -r fdf1464e1977 xsls/body.xsls --- a/xsls/body.xsls Thu May 05 18:31:47 2022 +0100 +++ b/xsls/body.xsls Tue May 10 18:07:27 2022 +0400 @@ -18,9 +18,6 @@
diff -r a3aee2697d4e -r fdf1464e1977 xsls/error.xsls --- a/xsls/error.xsls Thu May 05 18:31:47 2022 +0100 +++ b/xsls/error.xsls Tue May 10 18:07:27 2022 +0400 @@ -26,6 +26,7 @@ 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 @@ !style (lang="@lang") + !banner () + !ga () diff -r a3aee2697d4e -r fdf1464e1977 xsls/news.xsls --- a/xsls/news.xsls Thu May 05 18:31:47 2022 +0100 +++ b/xsls/news.xsls Tue May 10 18:07:27 2022 +0400 @@ -27,6 +27,7 @@ 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 @@ !style (lang="@lang") + !banner () + !ga () diff -r a3aee2697d4e -r fdf1464e1977 xslt/article.xslt --- a/xslt/article.xslt Thu May 05 18:31:47 2022 +0100 +++ b/xslt/article.xslt Tue May 10 18:07:27 2022 +0400 @@ -27,6 +27,7 @@ + @@ -48,7 +49,7 @@ <xsl:value-of select="@name"/> - + diff -r a3aee2697d4e -r fdf1464e1977 xslt/banner.xslt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xslt/banner.xslt Tue May 10 18:07:27 2022 +0400 @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r a3aee2697d4e -r fdf1464e1977 xslt/body.xslt --- a/xslt/body.xslt Thu May 05 18:31:47 2022 +0100 +++ b/xslt/body.xslt Tue May 10 18:07:27 2022 +0400 @@ -19,9 +19,6 @@
diff -r a3aee2697d4e -r fdf1464e1977 xslt/error.xslt --- a/xslt/error.xslt Thu May 05 18:31:47 2022 +0100 +++ b/xslt/error.xslt Tue May 10 18:07:27 2022 +0400 @@ -27,6 +27,7 @@ + @@ -34,7 +35,7 @@ <xsl:value-of select="@name"/> - + diff -r a3aee2697d4e -r fdf1464e1977 xslt/news.xslt --- a/xslt/news.xslt Thu May 05 18:31:47 2022 +0100 +++ b/xslt/news.xslt Tue May 10 18:07:27 2022 +0400 @@ -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> - +