From a1f2e7078027140526ac20da83c5ab0acbfca05a Mon Sep 17 00:00:00 2001 From: marko Date: Mon, 30 Dec 2024 13:14:50 +0100 Subject: [PATCH] WIP: redesign pandoc template from scratch --- homepage/cwsvJudo/Makefile.heliohost | 38 +-- homepage/cwsvJudo/Makefile.heliohost.config | 15 ++ .../materialize-fromScratch.html | 116 +++++++++ .../pandocTemplate/materialize.pandocTemplate | 225 ------------------ homepage/cwsvJudo/src/css/code.css | 3 + homepage/cwsvJudo/src/css/fonts.css | 5 + 6 files changed, 161 insertions(+), 241 deletions(-) create mode 100644 homepage/cwsvJudo/Makefile.heliohost.config create mode 100644 homepage/cwsvJudo/pandocTemplate/materialize-fromScratch.html delete mode 100644 homepage/cwsvJudo/pandocTemplate/materialize.pandocTemplate create mode 100644 homepage/cwsvJudo/src/css/code.css create mode 100644 homepage/cwsvJudo/src/css/fonts.css diff --git a/homepage/cwsvJudo/Makefile.heliohost b/homepage/cwsvJudo/Makefile.heliohost index 86c0553..99d8ab7 100644 --- a/homepage/cwsvJudo/Makefile.heliohost +++ b/homepage/cwsvJudo/Makefile.heliohost @@ -1,8 +1,6 @@ #! /usr/bin/env make -f -CSSO = node_modules/csso-cli/bin/csso - -RES_LIST = 64 128 256 512 +include Makefile.heliohost.config cssFiles = $(wildcard src/css/*.css) mdFiles = $(wildcard src/md/*.md) @@ -11,13 +9,10 @@ ampFiles = $(patsubst src/md/%.md, build/amp/%.php, $(mdFiles)) phpLibFiles = $(wildcard phpLib/cwsvJudo/*.php) phpLib/phpcount/phpcount.php configFiles = $(wildcard config/*.php) -distDir=./build/dist/heliohost -pandocTemplate=pandocTemplate/materialize.pandocTemplate - LN = ln -f .PHONY: all -all: pages +all: build/css/cwsvJudo.css pages # @todo This should only be temporary. Better outsource the graphics to it's own Makefile. make -j graphiken make build/css/cwsvJudo.css @@ -29,16 +24,19 @@ clean: .PHONY: installDependencies installDependencies: if [ ! -d "submodules" ]; then mkdir submodules; fi +# - nodejs + # if [ ! -d "submodules/node" ]; then cd submodules; git clone https://github.com/nodejs/node.git; fi + # cd submodules/node; git fetch; git checkout v22.12.0; ./configure; make -j4; # - bulma # - bulma.css - if [ ! -d "submodules/bulma" ]; then cd submodules; git clone https://github.com/jgthms/bulma; fi - cd submodules/bulma; git fetch; git checkout 1.0.2; + # if [ ! -d "submodules/bulma" ]; then cd submodules; git clone https://github.com/jgthms/bulma; fi + # cd submodules/bulma; git fetch; git checkout 1.0.2; # - bulma templates - if [ ! -d "submodules/bulma-templates" ]; then cd submodules; git clone https://github.com/BulmaTemplates/bulma-templates; fi - cd submodules/bulma-templates; git fetch; git checkout 0.9.4.2; + # if [ ! -d "submodules/bulma-templates" ]; then cd submodules; git clone https://github.com/BulmaTemplates/bulma-templates; fi + # cd submodules/bulma-templates; git fetch; git checkout 0.9.4.2; # - materialize-css if [ ! -d "submodules/materialize" ]; then cd submodules; git clone https://github.com/materializecss/materialize; fi - cd submodules/materialize; git fetch; git checkout v2.2.1; npm install; npm run release; + cd submodules/materialize; git fetch; git checkout $(VERSION_MATERIALIZE); npm install; npm audit fix; npm run release; # copy/link all together to get a "distributable" package # (distributable means: That directory can be uploaded va ftp) @@ -51,8 +49,8 @@ dist: all mkdir -p $(distDir)/httpdocs/ressourcen/css mkdir -p $(distDir)/httpdocs/ressourcen/js # - bulma - $(LN) ./submodules/bulma/css/bulma.min.css $(distDir)/httpdocs/ressourcen/css/ - $(LN) ./submodules/bulma-templates/css/hello-parallax.css $(distDir)/httpdocs/ressourcen/css/ + # $(LN) ./submodules/bulma/css/bulma.min.css $(distDir)/httpdocs/ressourcen/css/ + # $(LN) ./submodules/bulma-templates/css/hello-parallax.css $(distDir)/httpdocs/ressourcen/css/ # - materializeCss $(LN) ./submodules/materialize/dist/css/materialize.min.css $(distDir)/httpdocs/ressourcen/css/ $(LN) ./submodules/materialize/dist/css/materialize.min.css.map $(distDir)/httpdocs/ressourcen/css/ @@ -64,6 +62,10 @@ dist: all mkdir -p $(distDir)/httpdocs/pages/shared find ./src/shared/ -type f -exec $(LN) {} $(distDir)/httpdocs/pages/shared \; +# structured data + mkdir -p $(distDir)/httpdocs/ressourcen/structuredData/json + find src/jsonSd -type f -exec $(LN) {} $(distDir)/httpdocs/ressourcen/structuredData/json \; + # php libs mkdir -p $(distDir)/httpdocs/ressourcen/phpLib/cwsvJudo find ./phpLib/cwsvJudo -type f -exec $(LN) {} $(distDir)/httpdocs/ressourcen/phpLib/cwsvJudo \; @@ -109,10 +111,10 @@ dist: all docker-compose restart .PHONY: pages -pages: $(pandocTemplate) $(phpFiles) +pages: Makefile.heliohost.config $(pandocTemplate) $(phpFiles) # build the materialize version of the page -build/materialize/%.php: src/md/%.md build/yaml/%.yaml $(pandocTemplate) +build/materialize/%.php: src/md/%.md build/yaml/%.yaml $(pandocTemplate) Makefile.heliohost.config mkdir -p build/materialize # create html/php code pandoc \ @@ -130,6 +132,10 @@ build/yaml/%.yaml: src/yaml/images.yaml src/yaml/navTargets.yaml src/yaml/mainNa mkdir -p build/yaml python tools/yamlMerge.py $^ > $@ +# combine css files into one +build/css/cwsvJudo.css: $(cssFiles) + cat $^ | $(CSSO) -o $@ + .PHONY: upload upload: all lftp -f scripts/upload-heliohost diff --git a/homepage/cwsvJudo/Makefile.heliohost.config b/homepage/cwsvJudo/Makefile.heliohost.config new file mode 100644 index 0000000..2ac1686 --- /dev/null +++ b/homepage/cwsvJudo/Makefile.heliohost.config @@ -0,0 +1,15 @@ +# Config settings + +# versions (git branches) to use +VERSION_MATERIALIZE = v2.1.1 + +# where to put the distribution +distDir = ./build/dist/heliohost +# which pandoc template to use +pandocTemplate = pandocTemplate/materialize-fromScratch.html + +# css optimizer to use +CSSO = node_modules/csso-cli/bin/csso + +# resolution list for the fav icons +RES_LIST = 64 128 256 512 diff --git a/homepage/cwsvJudo/pandocTemplate/materialize-fromScratch.html b/homepage/cwsvJudo/pandocTemplate/materialize-fromScratch.html new file mode 100644 index 0000000..2082f6b --- /dev/null +++ b/homepage/cwsvJudo/pandocTemplate/materialize-fromScratch.html @@ -0,0 +1,116 @@ + + + + + + + + + + $for(author-meta)$ + $endfor$ + $if(date-meta)$ + $endif$ + $if(keywords)$ + + $endif$ + $if(canonicalPath)$ + + $endif$ + $if(ampVersionLink)$ + + $endif$ + $if(phpTitleString)$ + + <?php echo( $phpTitleString$ );?> + + $else$$if(title)$ + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ + $endif$$endif$ + $if(phpDescriptionString)$ + + $else$$if(description)$ + + $endif$$endif$ + + $if(css)$$for(css)$ + + $endfor$$endif$ + + $if(extraCss)$$for(extraCss)$ + + $endfor$$endif$ + + $if(jsLibs)$$for(jsLibs)$ + + $endfor$$endif$ + + + + + +
+ +
+
+ +
+ + + + + + \ No newline at end of file diff --git a/homepage/cwsvJudo/pandocTemplate/materialize.pandocTemplate b/homepage/cwsvJudo/pandocTemplate/materialize.pandocTemplate deleted file mode 100644 index 8469262..0000000 --- a/homepage/cwsvJudo/pandocTemplate/materialize.pandocTemplate +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - - $for(author-meta)$ - - $endfor$ - $if(date-meta)$ - - $endif$ - $if(keywords)$ - - $endif$ - $if(canonicalPath)$ - - $endif$ - $if(ampVersionLink)$ - - $endif$ - $if(phpTitleString)$ - <?php echo( $phpTitleString$ );?> - - $else$$if(title)$ - $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ - $endif$ - $endif$ - $if(phpDescriptionString)$ - - $else$$if(description)$ - - $endif$$endif$ - - - - $if(css)$ - - $endif$ - - $if(quotes)$ - - $endif$ - $if(highlighting-css)$ - - $endif$ - $for(extraCss)$ - - $endfor$ - $if(math)$ - $math$ - $endif$ - - $if(jsonSdFiles)$ - $for(jsonSdFiles)$ - - $endfor$ - $endif$ - $if(jsLibs)$ - $for(jsLibs)$ - - $endfor$ - $endif$ - - - $for(header-includes)$ - $header-includes$ - $endfor$ - - - - -
- Judo im Chemnitzer WSV - Promo - - Judo - - - - - Judo im Chemnitzer WSV - Logo -
- - $if(mainNav)$ - - $endif$ - - $if(subNav)$ - - $endif$ - - $for(include-before)$ - $include-before$ - $endfor$ - $if(toc)$ - - $endif$ - -
- $body$ -
- - - - - - $for(include-after)$ - $include-after$ - $endfor$ - - - diff --git a/homepage/cwsvJudo/src/css/code.css b/homepage/cwsvJudo/src/css/code.css new file mode 100644 index 0000000..986738b --- /dev/null +++ b/homepage/cwsvJudo/src/css/code.css @@ -0,0 +1,3 @@ +code { + white-space: pre; +} diff --git a/homepage/cwsvJudo/src/css/fonts.css b/homepage/cwsvJudo/src/css/fonts.css new file mode 100644 index 0000000..0df3735 --- /dev/null +++ b/homepage/cwsvJudo/src/css/fonts.css @@ -0,0 +1,5 @@ +@font-face { + font-family: Orbitron-Medium; + font-display: fallback; + src: url(/ressourcen/fonts/Orbitron-Medium.otf); +}