Mercurial > hg > nginx-site
changeset 721:81ad082bc837
Simplified things by including books.xslt, download.xslt and security.xslt
into article.xslt, and always using article.xslt to generate HTMLs. While
here, moved versions.xml from common dependencies to article dependencies.
Fixed menu in 404.html by applying templates from menu.xslt, and fixed its
dependency on DTD.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Fri, 12 Oct 2012 09:10:31 +0000 |
parents | 9934338f83af |
children | 91dd4a7fadbb |
files | GNUmakefile xml/en/GNUmakefile xml/ru/GNUmakefile xsls/article.xsls xsls/books.xsls xsls/download.xsls xsls/error.xsls xsls/security.xsls |
diffstat | 8 files changed, 25 insertions(+), 174 deletions(-) [+] |
line wrap: on
line diff
--- a/GNUmakefile +++ b/GNUmakefile @@ -46,7 +46,6 @@ endef COMMON_DEPS = \ xml/menu.xml \ - xml/versions.xml \ xml/i18n.xml \ dtd/content.dtd \ xslt/dirname.xslt \ @@ -59,11 +58,15 @@ COMMON_DEPS = \ ARTICLE_DEPS = \ $(COMMON_DEPS) \ + xml/versions.xml \ dtd/article.dtd \ dtd/module.dtd \ xslt/article.xslt \ + xslt/books.xslt \ + xslt/directive.xslt \ xslt/donate.xslt \ - xslt/directive.xslt \ + xslt/download.xslt \ + xslt/security.xslt \ xslt/versions.xslt \ NEWS_DEPS = \ @@ -71,21 +74,6 @@ NEWS_DEPS = \ dtd/news.dtd \ xslt/news.xslt \ -DOWNLOAD_DEPS = \ - $(COMMON_DEPS) \ - dtd/article.dtd \ - xslt/download.xslt \ - -SECURITY_DEPS = \ - $(COMMON_DEPS) \ - dtd/article.dtd \ - xslt/security.xslt \ - -BOOK_DEPS = \ - $(COMMON_DEPS) \ - dtd/article.dtd \ - xslt/books.xslt \ - LANGS = en ru cn he ja tr all: news arx 404 $(LANGS) @@ -120,10 +108,11 @@ include $(foreach lang, $(LANGS), xml/$ $(OUT)/404.html: \ xml/404.xml \ xml/menu.xml \ - dtd/article.dtd \ - dtd/content.dtd \ - xslt/ga.xslt \ - xslt/error.xslt + dtd/error.dtd \ + xslt/error.xslt \ + xslt/dirname.xslt \ + xslt/menu.xslt \ + xslt/ga.xslt $(call XSLT, xslt/error.xslt, $<, $@) $(OUT)/%.html: xml/%.xml \
--- a/xml/en/GNUmakefile +++ b/xml/en/GNUmakefile @@ -100,16 +100,6 @@ REFS_HTML = $(foreach name, $(REFS), $(O $(OUT)/$(DOC_LANG)/support.html \ $(OUT)/$(DOC_LANG)/donation.html \ -$(OUT)/$(DOC_LANG)/download.html: \ - xml/$(DOC_LANG)/download.xml \ - $(DOWNLOAD_DEPS) - $(call XSLT, xslt/download.xslt, $<, $@) - -$(OUT)/$(DOC_LANG)/security_advisories.html: \ - xml/$(DOC_LANG)/security_advisories.xml \ - $(SECURITY_DEPS) - $(call XSLT, xslt/security.xslt, $<, $@) - $(OUT)/$(DOC_LANG)/docs/index.html: \ $(DOCS_XML) \ $(REFS_XML) \ @@ -126,8 +116,3 @@ xml/$(DOC_LANG)/docs/dirindex.xml: \ $(OUT)/$(DOC_LANG)/docs/faq.html: \ $(FAQ_XML) \ - -$(OUT)/$(DOC_LANG)/books.html: \ - xml/$(DOC_LANG)/books.xml \ - $(BOOK_DEPS) - $(call XSLT, xslt/books.xslt, $<, $@)
--- a/xml/ru/GNUmakefile +++ b/xml/ru/GNUmakefile @@ -87,11 +87,6 @@ REFS_HTML = $(foreach name, $(REFS), $(O $(FAQ_HTML) \ $(OUT)/$(DOC_LANG)/support.html \ -$(OUT)/$(DOC_LANG)/download.html: \ - xml/$(DOC_LANG)/download.xml \ - $(DOWNLOAD_DEPS) - $(call XSLT, xslt/download.xslt, $<, $@) - $(OUT)/$(DOC_LANG)/docs/index.html: \ $(DOCS_XML) \ $(REFS_XML) \
--- a/xsls/article.xsls +++ b/xsls/article.xsls @@ -26,10 +26,13 @@ X:include href = "link.xslt"; X:include href = "style.xslt"; X:include href = "body.xslt"; X:include href = "menu.xslt"; -X:include href = "donate.xslt"; +X:include href = "ga.xslt"; +X:include href = "content.xslt"; +X:include href = "books.xslt"; X:include href = "directive.xslt"; -X:include href = "content.xslt"; -X:include href = "ga.xslt"; +X:include href = "donate.xslt"; +X:include href = "download.xslt"; +X:include href = "security.xslt"; X:include href = "versions.xslt";
--- a/xsls/books.xsls +++ b/xsls/books.xsls @@ -5,45 +5,6 @@ X:stylesheet { -X:output method="html" version="4.0" indent="no" encoding="utf-8"; - -X:strip-space elements = "*"; - -<!-- - -- a current directory of a XSLT script is where the script is stored, - -- but not where XSLT processor has been started to run the script - --> -X:param XML = "'../xml'"; -X:param YEAR; - -X:var LINK = "/article/@link"; - -X:include href = "dirname.xslt"; -X:include href = "link.xslt"; -X:include href = "style.xslt"; -X:include href = "body.xslt"; -X:include href = "menu.xslt"; -X:include href = "ga.xslt"; -X:include href = "content.xslt"; - - -X:template = "/article" { - <html><head> - - <title> !{@name} </title> - - !style (lang="@lang") - - !ga () - - </head> - - !body (lang="@lang") - - </html> -} - - X:template = "book" { <table><tr>
--- a/xsls/download.xsls +++ b/xsls/download.xsls @@ -5,46 +5,6 @@ X:stylesheet { -X:output method="html" version="4.0" indent="no" encoding="utf-8"; - -X:strip-space elements = "*"; - -<!-- - -- a current directory of a XSLT script is where the script is stored, - -- but not where XSLT processor has been started to run the script - --> -X:param XML = "'../xml'"; -X:param YEAR; - -X:var LINK = "/article/@link"; -X:var LANG = "/article/@lang"; - -X:include href = "dirname.xslt"; -X:include href = "link.xslt"; -X:include href = "style.xslt"; -X:include href = "body.xslt"; -X:include href = "menu.xslt"; -X:include href = "ga.xslt"; -X:include href = "content.xslt"; - - -X:template = "/article" { - <html><head> - - <title> !{@name} </title> - - !style (lang="@lang") - - !ga () - - </head> - - !body (lang="@lang") - - </html> -} - - X:template = "download" { <table width="100%"> !! "item"; </table> }
--- a/xsls/error.xsls +++ b/xsls/error.xsls @@ -5,8 +5,6 @@ X:stylesheet { -X:include href = "ga.xslt"; - X:output method="html" version="4.0" indent="no" encoding="utf-8"; X:strip-space elements = "*"; @@ -16,6 +14,15 @@ X:strip-space elements = "*"; -- but not where XSLT processor has been started to run the script --> X:param XML = "'../xml'"; +X:param YEAR; +X:param TRANS; + +X:var LINK = "/error/@link"; +X:var LANG = "/error/@lang"; + +X:include href = "dirname.xslt"; +X:include href = "menu.xslt"; +X:include href = "ga.xslt"; X:template = "/error" { @@ -49,14 +56,4 @@ X:template = "/error" { </html> } - -X:template = "menu/item" { - <a href="{@href}"> !{ normalize-space(text()) } </a> <br/> } - - -X:template = "menu/item[not(@href)]" { - !{ normalize-space(text()) } <br/> -} - -}
--- a/xsls/security.xsls +++ b/xsls/security.xsls @@ -5,45 +5,6 @@ X:stylesheet { -X:output method="html" version="4.0" indent="no" encoding="utf-8"; - -X:strip-space elements = "*"; - -<!-- - -- a current directory of a XSLT script is where the script is stored, - -- but not where XSLT processor has been started to run the script - --> -X:param XML = "'../xml'"; -X:param YEAR; - -X:var LINK = "/article/@link"; - -X:include href = "dirname.xslt"; -X:include href = "link.xslt"; -X:include href = "style.xslt"; -X:include href = "body.xslt"; -X:include href = "menu.xslt"; -X:include href = "ga.xslt"; -X:include href = "content.xslt"; - - -X:template = "/article" { - <html><head> - - <title> !{@name} </title> - - !style (lang="@lang") - - !ga () - - </head> - - !body (lang="@lang") - - </html> -} - - X:template = "security" { <ul> !!; </ul> }