diff options
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | minify_html.sed | 6 | ||||
-rw-r--r-- | xsl/layout.xsl | 2 |
3 files changed, 16 insertions, 4 deletions
@@ -5,6 +5,9 @@ version = $(shell git rev-parse --short HEAD) versioned_jpg = 's/.*/.jpg?&/' versioned_png = 's/.*/.png?&/' +#versioned_jpg='s/.*/.&.jpg/' +#versioned_png='s/.*/.&.png/' + version_args = --stringparam versioned_jpg $(shell echo $(version) | sed $(versioned_jpg)) --stringparam versioned_png $(shell echo $(version) | sed $(versioned_png)) xsltproc=xsltproc --stringparam stylesheet "$(shell cat style/style.min.css)" --stringparam version $(version) $(version_args) @@ -13,12 +16,15 @@ fix_doctype=sed 's/ SYSTEM "about:legacy-compat"//' to_html=$(fix_doctype) | xsltproc xsl/convert-xhtml-to-html.xsl - | $(fix_doctype) | sed -e 's/<br><\/br>/<br>/g' -e 's/<\/img>//g' -e 's/<\/link>//g' -e 's/<\/meta>//g' -e 's/<html xmlns="http:\/\/www.w3.org\/1999\/xhtml"/<html/' +#html_minify=./node_modules/.bin/html-minifier --html5 --remove-optional-tags --use-short-doctype --remove-attribute-quotes +html_minify=sed -f minify_html.sed + pages=$(shell xsltproc xsl/main_filenames.xsl main.xml) pages_gen=$(pages:%.xml=%$(suffix)) pages_gen_html=$(pages:%.xml=%.html) -common_depend=main.xml $(wildcard xsl/*.xsl) Makefile checkmark.svg style/style.min.css +common_depend=main.xml $(wildcard xsl/*.xsl) Makefile checkmark.svg style/style.min.css minify_html.sed DEFAULT_VERBOSITY=0 @@ -51,10 +57,10 @@ html: $(pages_gen_html) $(V_XSLT) $(xsltproc) --stringparam suffix $(link_suffix) $< | $(fix_doctype) > $@ %.html: %.xml %.xsl $(common_depend) - $(V_XSLT) $(xsltproc) --stringparam suffix .html $< | $(to_html) > $@ + $(V_XSLT) $(xsltproc) --stringparam suffix .html $< | $(to_html) | $(html_minify) > $@ %.html: %.xml $(common_depend) - $(V_XSLT) $(xsltproc) --stringparam suffix .html $< | $(to_html) > $@ + $(V_XSLT) $(xsltproc) --stringparam suffix .html $< | $(to_html) | $(html_minify) > $@ style/style.min.css: style/style.css style/font.css $(V_CSS) node_modules/.bin/postcss -u postcss-import -u postcss-css-variables style/style.css | node_modules/.bin/cleancss > style/style.min.css diff --git a/minify_html.sed b/minify_html.sed new file mode 100644 index 0000000..2a9761d --- /dev/null +++ b/minify_html.sed @@ -0,0 +1,6 @@ +s/<\(body\|head\)>//g +s/<\/\(body\|head\|html\)>//g + +s/<\/\(li\|p\)>//g + +s/="\([a-zA-Z0-9_:.\/#&;@-]*\)"/=\1/g diff --git a/xsl/layout.xsl b/xsl/layout.xsl index 21d466d..4554df0 100644 --- a/xsl/layout.xsl +++ b/xsl/layout.xsl @@ -56,7 +56,7 @@ <br/> <xsl:text>Die Kostenlose Analyse schafft Klarheit darĂ¼ber, welches Umsatzpotential Ihre Idee bietet.</xsl:text> </a> - <a class="redbox" style="text-align: center" + <a class="redbox" style="text-align:center" href="https://beraterboerse.kfw.de/index.php?ac=consultant_projects&id=100021"> <xsl:text>Referenzen</xsl:text> </a> |