WIP: groundstone for letting all subpages use the same template

This commit is contained in:
marko
2025-07-16 13:35:33 +02:00
parent 4e25454507
commit d9567a62e8
10 changed files with 706 additions and 990 deletions

View File

@@ -22,9 +22,11 @@ all: build/css/cwsvJudo.css images
# minimizing wallpaper sizes
build/graphiken/wallpapers/%.jpg: graphiken/wallpapers/%.jpg
# guetzli $^ $@
$(LN) $^ $@
mkdir -p build/graphiken/wallpapers
guetzli $^ $@
# $(LN) $^ $@
build/graphiken/wallpapers/%.svg: graphiken/wallpapers/%.svg
mkdir -p build/graphiken/wallpapers
$(LN) $^ $@
.PHONY: images
@@ -85,13 +87,22 @@ dist: all
# - lazysizes
$(LN) ./submodules/lazysizes/lazysizes.min.js $(distDir)/httpdocs/ressourcen/js/
# page data
# pages
mkdir -p $(distWebRoot)/pages/responsive
find src/pages/responsive -type f -exec $(LN) {} $(distWebRoot)/pages/responsive \;
mkdir -p $(distWebRoot)/pages/responsive/phpLibs/cwsvJudo
find src/pages/responsive/phpLibs/cwsvJudo -type f -exec $(LN) {} $(distWebRoot)/pages/responsive/phpLibs/cwsvJudo \;
# page data
# - new system to save page data
# - all page data resides in same directory
# - each page gets own directory
# - each page directory contains:
# - a meta.json
# - optional: markdown files
cp -Rl src/page_data $(distDir)/pages
# structured data
mkdir -p $(distDir)/httpdocs/ressourcen/structuredData/json
find src/jsonSd -type f -exec $(LN) {} $(distDir)/httpdocs/ressourcen/structuredData/json \;
@@ -150,16 +161,16 @@ dist: all
$(LN) ./src/htaccess/heliohost/pages/responsive/.htaccess $(distDir)/httpdocs/pages/responsive/.htaccess
# config files
$(LN) ./configs/heliohost/pages.config.inc.php $(distDir)/httpdocs/pages/responsive/config.inc.php
$(LN) ./configs/heliohost/pages.config.inc.php $(distDir)/httpdocs/pages/responsive/config.php
# @todo shouldn't be used any more
mkdir -p $(distDir)/.local
$(LN) configs/heliohost/config.json $(distDir)/.local/config.json
$(LN) configs/heliohost/secrets.json $(distDir)/.local/secrets.json
# @todo shouldn't be used any more
$(LN) configs/local/db.config.php $(distDir)/.local/db.config.php
# docker-compose restart
docker-compose restart
.PHONY: pages
pages: Makefile.heliohost.config $(pandocTemplate) $(phpFiles)
@@ -186,6 +197,7 @@ build/yaml/%.yaml: src/yaml/images.yaml src/yaml/navTargets.yaml src/yaml/mainNa
# combine css files into one
build/css/cwsvJudo.css: $(cssFiles)
mkdir -p build/css
cat $^ | $(CSSO) -o $@
# .PHONY: download_material_icons

View File

@@ -6,6 +6,9 @@
"user": "cwsvjudo_marko",
"dbCharset": "ISO-8859-1",
"outCharset": "UTF-8"
},
"paths":{
"wallpapers": "/ressourcen/graphiken/wallpapers"
}
}
}

View File

@@ -1,24 +1,26 @@
<?php
/// Die Basisdomain, unter der die Hauptseite zu erreichen ist
// $baseDomain = "cwsvjudo.bplaced.net";
$baseDomain = "cwsvjudo.helioho.st";
$baseDomain = "cwsvjudo.de";
/// Subdomain, unter dem dieses Verzeichnis zu finden ist (falls der Fall gegeben ist)
$subDomain = "";
$subDomain = "";
/// homeverzeichnis auf dem server
$home = "/home/cwsvjudo.helioho.st";
$home = "/home/cwsvjudo.de";
/// Basis(/Root)-Verzeichnis auf dem Server (für Dateizugriffe, insbesondere phpIncludes)
/// (ist eigentlich das serve verzeichnis, aka www-data)
$basePath = join(separator: "/", array: [$home, "httpdocs"]);
$basePath = join(separator: "/", array: [$home, "httpdocs"]);
/// Url zum Zugriff auf "shared Data" unter der Hauptadresse
$baseUrl = "http://".$baseDomain;
/// Die kanonische Url dieses Verzeichnisses (unter welcher
/// Domainadresse die Seiten dieses Verzeichnisses bevorzugt zu
/// erreichen seien sollen, also entweder eine SubdomainUrl, oder die
$baseUrl = "http://" . $baseDomain;
/// Die kanonische Url dieses Verzeichnisses (unter welcher
/// Domainadresse die Seiten dieses Verzeichnisses bevorzugt zu
/// erreichen seien sollen, also entweder eine SubdomainUrl, oder die
/// baseUrl mit dem Verzeichnis angehängt)
/// Achtung: Gedacht für eine einheitliche Bezeichnung bei internem
/// Verlinken. Der canonicalLink im Header ist bei ampSeiten nicht die
/// eigene Adresse, sondern die (kanonische) Adresse der "normalen"
/// Achtung: Gedacht für eine einheitliche Bezeichnung bei internem
/// Verlinken. Der canonicalLink im Header ist bei ampSeiten nicht die
/// eigene Adresse, sondern die (kanonische) Adresse der "normalen"
/// Version der Seite.
$canonicalBaseUrl = "https://".(empty($subDomain)?"":($subDomain.".")).$baseDomain;
$canonicalBaseUrl =
"https://" . (empty($subDomain) ? "" : $subDomain . ".") . $baseDomain;
?>

View File

@@ -6,6 +6,9 @@
"user": "cwsvjudo_marko",
"dbCharset": "UTF-8",
"outCharset": "UTF-8"
},
"paths":{
"wallpapers": "/ressourcen/graphiken/wallpapers"
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -15,6 +15,7 @@ services:
volumes:
# this line maps the content of ./html in your pc to the /var/www/html of the container
- ./build/dist/heliohost/httpdocs:/var/www/html
- ./build/dist/heliohost/pages:/home/cwsvjudo.de/pages
- ./configs/localDocker/config.json:/home/cwsvjudo.de/.local/config.json
- ./configs/localDocker/secrets.json:/home/cwsvjudo.de/.local/secrets.json
db:

View File

@@ -14,22 +14,26 @@
/* responsive font sizes */
/* small */
.card-content{
font-size: 3cqw;
}
/* medium */
@media only screen and (min-width: 600px) {
.card-content {
font-size: 2cqw;
}
}
/* large */
@media only screen and (min-width: 992px) {
.card-content {
font-size: 1.5cqw;
}
}
/* eXtra large */
@media only screen and (min-width: 1200px) {
.card-content {
font-size: 1.25cqw;

View File

@@ -12,6 +12,14 @@
# Url-Rewriting aktivieren
RewriteEngine on
# if the requested resource doesn't exist as ...
# - file or ...
RewriteCond %{REQUEST_FILENAME} !-f
# - directory ...
RewriteCond %{REQUEST_FILENAME} !-d
# then append the (first) directory part as query string
RewriteRule ^(.*?)/?$ /pages/responsive/index.php?page=$1 [L]
# Die angeforderte Ressource ist nicht bereits in dem Zielverzeichnis:
RewriteCond %{REQUEST_URI} !^/pages/responsive/

View File

@@ -0,0 +1,13 @@
{
"head": {
"navTargets": [
{
"url": "training",
"caption": "Training",
"title": "Trainingszeiten und -orte der Judoka des Chemnitzer WSV"
}
]
},
"main": {},
"footer": {}
}

View File

@@ -2,17 +2,12 @@
<?php
require_once "bootstrap.php";
$directory_paths = [
"wallpapers" => "/ressourcen/graphiken/wallpapers",
];
$page = $_GET["page"] ?? "index";
$mainNav = [
[
"url" => "training",
"caption" => "Training",
"title" => "Trainingszeiten und -orte der Judoka des Chemnitzer WSV",
],
];
$meta = json_decode(
json: file_get_contents(filename: $home . "/pages/" . $page . "/meta.json"),
associative: true
);
$promos = [
[
@@ -78,16 +73,17 @@ $sections = [
$wallpapers = [
[
"src" => $directory_paths["wallpapers"] . "/osae-komi.svg",
"data-src" => $directory_paths["wallpapers"] . "/osae-komi.jpg",
"src" => $config["cwsvJudo"]["paths"]["wallpapers"] . "/osae-komi.svg",
"data-src" =>
$config["cwsvJudo"]["paths"]["wallpapers"] . "/osae-komi.jpg",
],
[
"src" => $directory_paths["wallpapers"] . "/nage.svg",
"data-src" => $directory_paths["wallpapers"] . "/nage.jpg",
"src" => $config["cwsvJudo"]["paths"]["wallpapers"] . "/nage.svg",
"data-src" => $config["cwsvJudo"]["paths"]["wallpapers"] . "/nage.jpg",
],
[
"src" => $directory_paths["wallpapers"] . "/kata.svg",
"data-src" => $directory_paths["wallpapers"] . "/kata.jpg",
"src" => $config["cwsvJudo"]["paths"]["wallpapers"] . "/kata.svg",
"data-src" => $config["cwsvJudo"]["paths"]["wallpapers"] . "/kata.jpg",
],
];
@@ -167,37 +163,11 @@ function main($sections, $wallpapers)
<header>
<nav class="nav navbar">
<div class="nav-wrapper" style="font-family: 'Orbitron-Medium', Impact, Charcoal, sans-serif;">
<!-- <img style="height:100%;width:auto;" width="128" height="104" title="Judo im Chemnitzer WSV"
alt="Judo im Chemnitzer WSV - Logo" src="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.128w.png"
srcset="/ressourcen/graphiken/logos/cwsvJudoLogoWappen.256w.png 2x"> -->
<a href="/" class="brand-logo">
<span>cwsvJudo</span>
</a>
<?php mainNavTargets($mainNav); ?>
<?php mainNavTargets($meta["head"]["navTargets"]); ?>
</div>
<!-- <div class="nav-content">
$if(subNav)$
<ul class="tabs tabs-transparent">
$for(subNav)$
<li class="tab">
<a href="$subNav.url$" $if(subNav.caption)$title="$subNav.caption$" $endif$
$if(subNav.active)$class="activeNav" $endif$> -->
<!-- $if(subNav.icon)$
<img src="$if(subNav.icon.src)$$subNav.icon.src$$else$$subNav.icon$$endif$"
$if(subNav.caption)$ alt="$subNav.caption$" $else$ $if(subNav.icon.alt)$
alt="$subNav.icon.alt$" $endif$ $endif$ $if(subNav.icon.width)$
width="$subNav.icon.width$" $endif$ $if(subNav.icon.height)$
height="$subNav.icon.height$" $endif$ $if(subNav.icon.title)$
title="$subNav.icon.title$" $endif$ $if(subNav.icon.srcset)$
srcset="$subNav.icon.srcset$" $endif$>
$endif$ -->
<!-- $if(subNav.caption)$<span>$subNav.caption$</span>$endif$
</a>
</li>
$endfor$
</ul>
$endif$
</div> -->
</nav>
</header>
@@ -205,32 +175,29 @@ function main($sections, $wallpapers)
<?php main($sections, $wallpapers); ?>
</main>
<footer class="page-footer">
<div class="container">
<div class="row">
<div class="l6 s12">
<a
title="Seite auf HTML 5 Konformität prüfen"
href="http://validator.w3.org/check?uri=<?php echo urlencode(
getCurPagesUrl()
); ?>"
>
<i class="material-icons">html</i>5
</a>
<div class="container">
<div class="row">
<div class="l6 s12">
<a
title="Seite auf HTML 5 Konformität prüfen"
href="http://validator.w3.org/check?uri=<?php echo urlencode(
getCurPagesUrl()
); ?>"
>
<i class="material-icons">html</i>5
</a>
</div>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2025 Copyright Text
<a class="right" href="#!">More Links</a>
<div class="footer-copyright">
<div class="container">
© 2025 Copyright Text
<a class="right" href="#!">More Links</a>
</div>
</div>
</div>
</footer>
<!--JavaScript at end of body for optimized loading-->
<!-- Import external libraries -->
<!-- - materialize framework -->
@@ -247,15 +214,6 @@ function main($sections, $wallpapers)
// specify options here
}
),
carousels: M.Carousel.init(
document.querySelectorAll('.carousel'), {
dist: -50,
fullWidth: true,
indicators: true,
noWrap: true,
numVisible: 1,
}
),
} // end instances
});
</script>