docs: add implementation plan for WordPress theme (phase 3/5, design part)
This commit is contained in:
parent
7b5aa238f4
commit
7eacb31cbb
|
|
@ -0,0 +1,711 @@
|
|||
# WordPress-Theme (Phase 3/5, Design-Teil) Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. Before writing CSS in Task 2 and Task 5, load the frontend-design skill for visual-craft guidance (spacing, contrast, avoiding a templated look) — the exact color/font tokens are already fixed by the spec and must not be changed.
|
||||
|
||||
**Goal:** Individuelles PHP-Theme "friends-spessart" ist auf der VM installiert und
|
||||
aktiv, mit Startseite, News-Artikel- und Standardseiten-Templates, die die
|
||||
Design-Vorgaben aus `docs/superpowers/specs/2026-08-08-wordpress-theme-design.md`
|
||||
umsetzen.
|
||||
|
||||
**Architecture:** Klassisches (Non-Block) WordPress-Theme, handgeschriebenes CSS ohne
|
||||
Framework, selbst gehostete Google Fonts, ein Custom Post Type `news` für die
|
||||
Artikel-Inhalte. Alle Dateien werden per SSH direkt auf der VM unter
|
||||
`/var/www/freunde-des-spessart/wp-content/themes/friends-spessart/` angelegt (gleiches
|
||||
SSH-Muster wie Phase 1/2: Python + paramiko, `scratchpad/ssh_exec.py`).
|
||||
|
||||
**Tech Stack:** PHP (WordPress Theme API), CSS (Custom Properties für Design-Tokens),
|
||||
Vanilla JS (Mobile-Menü), selbst gehostete WOFF2-Fonts.
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- Theme-Verzeichnis: `/var/www/freunde-des-spessart/wp-content/themes/friends-spessart/`
|
||||
- Farbtokens (siehe Spec): Primärgrün `#4C7A2A`, Akzentgrün `#8BC34A`, Dunkelgrün
|
||||
`#23301C`, Orange `#E08A1E`, Sand `#F5F1E6`, Blau `#2D6E75`
|
||||
- Schriften: **Barlow Condensed** (Headlines, 600/700/800) und **Source Sans 3**
|
||||
(Fließtext, 400/600), beide selbst gehostet unter `assets/fonts/`, kein Laden von
|
||||
`fonts.googleapis.com` zur Laufzeit
|
||||
- Alle Dateien werden per `cat > datei << 'EOF' ... EOF` (gequoteter Delimiter!) über
|
||||
SSH geschrieben, damit PHP-`$`-Variablen nicht von der lokalen Shell interpretiert
|
||||
werden — siehe Lektion aus Phase 2 (vhost-Datei)
|
||||
- Nach jedem Task: `chown -R www-data:www-data /var/www/freunde-des-spessart/wp-content/themes/friends-spessart`
|
||||
- Custom Post Type `news` nutzt die eingebaute `post_tag`-Taxonomie (die alte Seite
|
||||
verwendet `tag-*`-Klassen auf Basis der Standard-WordPress-Tags, siehe
|
||||
`docs/struktur-alt.md`)
|
||||
- Verifikation der Templates erfolgt per Browser (Chrome DevTools/Claude-in-Chrome),
|
||||
nicht nur per `curl` — Layout/Farben/Fonts müssen visuell geprüft werden
|
||||
|
||||
---
|
||||
|
||||
### Task 1: Theme-Grundgerüst anlegen und aktivieren
|
||||
|
||||
**Files (auf der VM):**
|
||||
- Create: `wp-content/themes/friends-spessart/style.css`
|
||||
- Create: `wp-content/themes/friends-spessart/functions.php`
|
||||
- Create: `wp-content/themes/friends-spessart/index.php`
|
||||
|
||||
**Interfaces:**
|
||||
- Produziert: aktivierbares WordPress-Theme, das alle folgenden Tasks erweitern
|
||||
|
||||
- [ ] **Step 1: `style.css` mit Theme-Header anlegen**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
mkdir -p "$THEME"
|
||||
cat > "$THEME/style.css" << 'EOF'
|
||||
/*
|
||||
Theme Name: Friends des Spessarts
|
||||
Theme URI: https://freunde-des-spessarts.de
|
||||
Author: Freunde des Spessarts e.V.
|
||||
Description: Individuelles Theme fuer die Buergerbewegung Freunde des Spessarts.
|
||||
Version: 1.0
|
||||
Text Domain: friends-spessart
|
||||
*/
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 2: `index.php` als Fallback-Template anlegen**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/index.php" << 'EOF'
|
||||
<?php get_header(); ?>
|
||||
<main class="site-main container">
|
||||
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
|
||||
<article <?php post_class(); ?>>
|
||||
<h1><?php the_title(); ?></h1>
|
||||
<div class="entry-content"><?php the_content(); ?></div>
|
||||
</article>
|
||||
<?php endwhile; endif; ?>
|
||||
</main>
|
||||
<?php get_footer(); ?>
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 3: `functions.php` mit Theme-Setup anlegen**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/functions.php" << 'EOF'
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
function fds_theme_setup() {
|
||||
add_theme_support( 'title-tag' );
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
add_theme_support( 'html5', array( 'search-form', 'gallery', 'caption', 'style', 'script' ) );
|
||||
add_theme_support( 'custom-logo' );
|
||||
|
||||
register_nav_menus( array(
|
||||
'primary' => __( 'Hauptmenue', 'friends-spessart' ),
|
||||
) );
|
||||
|
||||
add_image_size( 'fds-teaser', 600, 600, true );
|
||||
add_image_size( 'fds-hero', 1920, 1080, true );
|
||||
}
|
||||
add_action( 'after_setup_theme', 'fds_theme_setup' );
|
||||
|
||||
function fds_enqueue_assets() {
|
||||
wp_enqueue_style( 'fds-style', get_stylesheet_directory_uri() . '/assets/css/main.css', array(), '1.0' );
|
||||
wp_enqueue_script( 'fds-main', get_stylesheet_directory_uri() . '/assets/js/main.js', array(), '1.0', true );
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'fds_enqueue_assets' );
|
||||
|
||||
require get_theme_file_path( '/inc/custom-post-type-news.php' );
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Platzhalter-Assets anlegen (damit die enqueue-Aufrufe nicht ins Leere laufen)**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
mkdir -p "$THEME/assets/css" "$THEME/assets/js" "$THEME/assets/fonts" "$THEME/inc"
|
||||
touch "$THEME/assets/css/main.css"
|
||||
echo "// Mobile-Menue folgt in Task 3" > "$THEME/assets/js/main.js"
|
||||
cat > "$THEME/inc/custom-post-type-news.php" << 'EOF'
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
// Custom-Post-Type "news" wird in Task 4 ergaenzt.
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 5: Theme aktivieren und verifizieren**
|
||||
|
||||
```bash
|
||||
cd /var/www/freunde-des-spessart
|
||||
chown -R www-data:www-data wp-content/themes/friends-spessart
|
||||
wp theme activate friends-spessart --allow-root
|
||||
wp theme status --allow-root
|
||||
```
|
||||
|
||||
Erwartet: `Success: Switched to 'Friends des Spessarts' theme.`, kein PHP-Fehler in der
|
||||
Ausgabe.
|
||||
|
||||
---
|
||||
|
||||
### Task 2: Design-Tokens, Basis-CSS und selbst gehostete Fonts
|
||||
|
||||
**Files (auf der VM):**
|
||||
- Modify: `wp-content/themes/friends-spessart/assets/css/main.css`
|
||||
- Create: `wp-content/themes/friends-spessart/assets/fonts/*.woff2`
|
||||
|
||||
**Interfaces:**
|
||||
- Produziert: CSS-Custom-Properties (`--color-primary` usw.), die alle folgenden
|
||||
Templates nutzen
|
||||
|
||||
**Vor Step 2 (CSS-Inhalt): frontend-design-Skill laden** für Hinweise zu Abstand,
|
||||
Kontrast und Vermeidung eines generischen Templates-Looks. Die Farbwerte/Schriften
|
||||
selbst stehen fest (siehe Global Constraints) und werden nicht geaendert.
|
||||
|
||||
- [ ] **Step 1: Google Fonts als WOFF2 herunterladen (selbst hosten)**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cd "$THEME/assets/fonts"
|
||||
UA="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
|
||||
curl -s -A "$UA" "https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Source+Sans+3:wght@400;600&display=swap" -o fonts.css
|
||||
grep -oE "https://fonts.gstatic.com/[^)]+" fonts.css | sort -u | while read -r url; do
|
||||
fname=$(printf '%s' "$url" | md5sum | cut -d' ' -f1).woff2
|
||||
curl -s "$url" -o "$fname"
|
||||
done
|
||||
ls -la
|
||||
```
|
||||
|
||||
Erwartet: mehrere `.woff2`-Dateien im Verzeichnis (eine pro Schriftschnitt/Subset).
|
||||
|
||||
- [ ] **Step 2: `@font-face`-Regeln aus `fonts.css` in eigene Datei uebertragen**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cd "$THEME/assets/fonts"
|
||||
python3 -c "
|
||||
import re
|
||||
with open('fonts.css') as f:
|
||||
css = f.read()
|
||||
urls = re.findall(r'https://fonts.gstatic.com/[^)]+', css)
|
||||
import hashlib
|
||||
for url in urls:
|
||||
fname = hashlib.md5(url.encode()).hexdigest() + '.woff2'
|
||||
css = css.replace(url, '../fonts/' + fname)
|
||||
with open('../css/fonts.css', 'w') as f:
|
||||
f.write(css)
|
||||
"
|
||||
cat ../css/fonts.css | head -20
|
||||
```
|
||||
|
||||
Erwartet: `../css/fonts.css` enthaelt `@font-face`-Bloecke mit lokalen
|
||||
`../fonts/<hash>.woff2`-Pfaden statt `fonts.gstatic.com`-URLs.
|
||||
|
||||
- [ ] **Step 3: `main.css` mit Design-Tokens und Basis-Styles schreiben**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/assets/css/main.css" << 'EOF'
|
||||
@import url('fonts.css');
|
||||
|
||||
:root {
|
||||
--color-primary: #4C7A2A;
|
||||
--color-accent-light: #8BC34A;
|
||||
--color-dark: #23301C;
|
||||
--color-orange: #E08A1E;
|
||||
--color-sand: #F5F1E6;
|
||||
--color-blue: #2D6E75;
|
||||
--font-headline: 'Barlow Condensed', Arial Narrow, sans-serif;
|
||||
--font-body: 'Source Sans 3', Arial, sans-serif;
|
||||
--space-1: 0.5rem;
|
||||
--space-2: 1rem;
|
||||
--space-3: 2rem;
|
||||
--space-4: 4rem;
|
||||
--radius-circle: 50%;
|
||||
}
|
||||
|
||||
*, *::before, *::after { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: var(--font-body);
|
||||
color: var(--color-dark);
|
||||
background: var(--color-sand);
|
||||
line-height: 1.6;
|
||||
}
|
||||
h1, h2, h3, h4 {
|
||||
font-family: var(--font-headline);
|
||||
font-weight: 800;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.02em;
|
||||
color: var(--color-primary);
|
||||
line-height: 1.1;
|
||||
margin: 0 0 var(--space-2);
|
||||
}
|
||||
a { color: var(--color-primary); }
|
||||
.container {
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 var(--space-2);
|
||||
}
|
||||
img { max-width: 100%; height: auto; display: block; }
|
||||
|
||||
.circle-crop {
|
||||
border-radius: var(--radius-circle);
|
||||
overflow: hidden;
|
||||
aspect-ratio: 1 / 1;
|
||||
}
|
||||
|
||||
.circle-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
border-radius: var(--radius-circle);
|
||||
background: var(--color-blue);
|
||||
color: #fff;
|
||||
font-family: var(--font-headline);
|
||||
font-weight: 700;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Browser-Check der Font-Ladung**
|
||||
|
||||
Chrome-DevTools/Claude-in-Chrome: `http://freunde-des-spessart.demo.mbo-tech-it.de/`
|
||||
öffnen, Netzwerk-Tab prüfen — `.woff2`-Dateien werden von der eigenen Domain geladen
|
||||
(nicht von `fonts.gstatic.com`), Statuscode 200.
|
||||
|
||||
---
|
||||
|
||||
### Task 3: Header, Footer, Navigation (inkl. mobilem Menü)
|
||||
|
||||
**Files (auf der VM):**
|
||||
- Create: `wp-content/themes/friends-spessart/header.php`
|
||||
- Create: `wp-content/themes/friends-spessart/footer.php`
|
||||
- Modify: `wp-content/themes/friends-spessart/assets/css/main.css` (Nav-Styles ergänzen)
|
||||
- Modify: `wp-content/themes/friends-spessart/assets/js/main.js`
|
||||
|
||||
**Interfaces:**
|
||||
- Konsumiert: `register_nav_menus( 'primary' )` aus Task 1
|
||||
- Produziert: `get_header()`/`get_footer()`, von allen weiteren Templates genutzt
|
||||
|
||||
- [ ] **Step 1: `header.php` schreiben**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/header.php" << 'EOF'
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
<body <?php body_class(); ?>>
|
||||
<?php wp_body_open(); ?>
|
||||
<header class="site-header">
|
||||
<div class="container site-header__inner">
|
||||
<a class="site-logo" href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<?php if ( has_custom_logo() ) { the_custom_logo(); } else { bloginfo( 'name' ); } ?>
|
||||
</a>
|
||||
<button class="menu-toggle" aria-label="Menü öffnen" aria-expanded="false">
|
||||
<span></span><span></span><span></span>
|
||||
</button>
|
||||
<nav class="main-nav" aria-label="Hauptnavigation">
|
||||
<?php
|
||||
wp_nav_menu( array(
|
||||
'theme_location' => 'primary',
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
) );
|
||||
?>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 2: `footer.php` schreiben**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/footer.php" << 'EOF'
|
||||
<footer class="site-footer">
|
||||
<div class="container site-footer__inner">
|
||||
<div class="site-footer__about">
|
||||
<strong><?php bloginfo( 'name' ); ?></strong>
|
||||
<p>Ein Herz für die Natur in unserem Spessart!</p>
|
||||
</div>
|
||||
<div class="site-footer__links">
|
||||
<a href="https://www.bund-naturschutz.de/" target="_blank" rel="noopener">BUND Naturschutz</a>
|
||||
<a href="https://www.lbv.de/" target="_blank" rel="noopener">LBV</a>
|
||||
<a href="https://www.ag-hafenlohrtal.de/" target="_blank" rel="noopener">AG Hafenlohrtal</a>
|
||||
</div>
|
||||
<p class="site-footer__copy">© <?php echo esc_html( date( 'Y' ) ); ?> <?php bloginfo( 'name' ); ?></p>
|
||||
</div>
|
||||
</footer>
|
||||
<?php wp_footer(); ?>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 3: Mobile-Menü-JS schreiben**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/assets/js/main.js" << 'EOF'
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var toggle = document.querySelector('.menu-toggle');
|
||||
var nav = document.querySelector('.main-nav');
|
||||
if (!toggle || !nav) return;
|
||||
toggle.addEventListener('click', function () {
|
||||
var isOpen = nav.classList.toggle('is-open');
|
||||
toggle.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
|
||||
});
|
||||
});
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Nav-/Header-/Footer-CSS an `main.css` anhängen**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat >> "$THEME/assets/css/main.css" << 'EOF'
|
||||
|
||||
.site-header { background: var(--color-primary); position: sticky; top: 0; z-index: 10; }
|
||||
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding: var(--space-1) var(--space-2); }
|
||||
.site-logo img { max-height: 56px; }
|
||||
.menu-toggle { display: block; background: none; border: 0; cursor: pointer; padding: var(--space-1); }
|
||||
.menu-toggle span { display: block; width: 24px; height: 3px; background: #fff; margin: 4px 0; }
|
||||
.main-nav { display: none; width: 100%; }
|
||||
.main-nav.is-open { display: block; }
|
||||
.main-nav ul { list-style: none; margin: 0; padding: var(--space-2) 0; }
|
||||
.main-nav a { display: block; padding: var(--space-1) 0; color: #fff; text-decoration: none; font-family: var(--font-headline); text-transform: uppercase; }
|
||||
|
||||
@media (min-width: 900px) {
|
||||
.menu-toggle { display: none; }
|
||||
.main-nav { display: block; width: auto; }
|
||||
.main-nav ul { display: flex; gap: var(--space-3); padding: 0; }
|
||||
}
|
||||
|
||||
.site-footer { background: var(--color-dark); color: #fff; margin-top: var(--space-4); padding: var(--space-4) 0 var(--space-2); }
|
||||
.site-footer__inner { display: grid; gap: var(--space-3); }
|
||||
.site-footer a { color: var(--color-accent-light); }
|
||||
.site-footer__copy { opacity: 0.7; font-size: 0.875rem; }
|
||||
|
||||
@media (min-width: 900px) {
|
||||
.site-footer__inner { grid-template-columns: 2fr 2fr 1fr; align-items: start; }
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 5: `index.php` auf Header/Footer umstellen (bereits in Task 1 enthalten) und Browser-Check**
|
||||
|
||||
Chrome-DevTools/Claude-in-Chrome: Startseite im mobilen Viewport (< 900px) öffnen —
|
||||
Hamburger-Button sichtbar, Klick öffnet die Navigation. Viewport ≥ 900px — horizontale
|
||||
Navigation ohne Hamburger sichtbar.
|
||||
|
||||
---
|
||||
|
||||
### Task 4: Custom Post Type "news" registrieren
|
||||
|
||||
**Files (auf der VM):**
|
||||
- Modify: `wp-content/themes/friends-spessart/inc/custom-post-type-news.php`
|
||||
|
||||
**Interfaces:**
|
||||
- Produziert: Post-Type `news` mit `post_tag`-Taxonomie, den Task 6 (Templates) und
|
||||
der spätere Migrations-Zyklus (eigener Plan) nutzen
|
||||
|
||||
- [ ] **Step 1: Post-Type registrieren**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/inc/custom-post-type-news.php" << 'EOF'
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
function fds_register_news_cpt() {
|
||||
register_post_type( 'news', array(
|
||||
'labels' => array(
|
||||
'name' => __( 'News', 'friends-spessart' ),
|
||||
'singular_name' => __( 'News-Artikel', 'friends-spessart' ),
|
||||
),
|
||||
'public' => true,
|
||||
'has_archive' => true,
|
||||
'rewrite' => array( 'slug' => 'news' ),
|
||||
'menu_icon' => 'dashicons-media-document',
|
||||
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
|
||||
'taxonomies' => array( 'post_tag' ),
|
||||
'show_in_rest' => true,
|
||||
) );
|
||||
}
|
||||
add_action( 'init', 'fds_register_news_cpt' );
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Permalinks neu spülen und verifizieren**
|
||||
|
||||
```bash
|
||||
cd /var/www/freunde-des-spessart
|
||||
wp rewrite flush --allow-root
|
||||
wp post-type list --allow-root | grep news
|
||||
```
|
||||
|
||||
Erwartet: Zeile für `news` erscheint in der Post-Type-Liste.
|
||||
|
||||
---
|
||||
|
||||
### Task 5: Startseiten-Template (`front-page.php`)
|
||||
|
||||
**Files (auf der VM):**
|
||||
- Create: `wp-content/themes/friends-spessart/front-page.php`
|
||||
- Modify: `wp-content/themes/friends-spessart/assets/css/main.css` (Hero-/Teaser-Styles)
|
||||
|
||||
**Interfaces:**
|
||||
- Konsumiert: `.circle-crop`, `.circle-badge` aus Task 2; `news`-Post-Type aus Task 4
|
||||
|
||||
**Vor Step 2 (CSS-Inhalt): frontend-design-Skill erneut konsultieren** für die
|
||||
Hero-/Teaser-Komposition (Bildausschnitt, Wellenform-Übergang) — Tokens bleiben fix.
|
||||
|
||||
- [ ] **Step 1: `front-page.php` schreiben (Hero, Wellen-Divider, News-Teaser)**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/front-page.php" << 'EOF'
|
||||
<?php get_header(); ?>
|
||||
|
||||
<section class="hero">
|
||||
<div class="hero__inner container">
|
||||
<h1 class="hero__title"><?php bloginfo( 'name' ); ?></h1>
|
||||
<p class="hero__claim">Ein Herz für die Natur in unserem Spessart!</p>
|
||||
</div>
|
||||
<svg class="hero__wave" viewBox="0 0 1440 80" preserveAspectRatio="none" aria-hidden="true">
|
||||
<path d="M0,40 C360,90 1080,-10 1440,40 L1440,80 L0,80 Z" fill="var(--color-sand)"></path>
|
||||
</svg>
|
||||
</section>
|
||||
|
||||
<section class="container news-teasers">
|
||||
<h2>Aktuelles</h2>
|
||||
<div class="news-teasers__grid">
|
||||
<?php
|
||||
$fds_news = new WP_Query( array( 'post_type' => 'news', 'posts_per_page' => 3 ) );
|
||||
if ( $fds_news->have_posts() ) :
|
||||
while ( $fds_news->have_posts() ) : $fds_news->the_post();
|
||||
?>
|
||||
<a class="news-teaser" href="<?php the_permalink(); ?>">
|
||||
<div class="circle-crop news-teaser__image">
|
||||
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'fds-teaser' ); } ?>
|
||||
</div>
|
||||
<h3><?php the_title(); ?></h3>
|
||||
</a>
|
||||
<?php
|
||||
endwhile;
|
||||
wp_reset_postdata();
|
||||
else :
|
||||
echo '<p>Noch keine News-Artikel vorhanden.</p>';
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Hero-/Teaser-CSS an `main.css` anhängen**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat >> "$THEME/assets/css/main.css" << 'EOF'
|
||||
|
||||
.hero { position: relative; background: linear-gradient(160deg, var(--color-primary), var(--color-dark)); color: #fff; padding: var(--space-4) 0 calc(var(--space-4) + 40px); text-align: center; }
|
||||
.hero__title { color: #fff; font-size: clamp(2.5rem, 6vw, 4rem); }
|
||||
.hero__claim { font-size: 1.25rem; font-style: italic; }
|
||||
.hero__wave { position: absolute; bottom: -1px; left: 0; width: 100%; height: 60px; display: block; }
|
||||
|
||||
.news-teasers { padding: var(--space-4) 0; }
|
||||
.news-teasers__grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
|
||||
.news-teaser { text-decoration: none; color: var(--color-dark); text-align: center; }
|
||||
.news-teaser__image { background: var(--color-accent-light); margin: 0 auto var(--space-2); width: 180px; }
|
||||
.news-teaser h3 { font-size: 1.1rem; }
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 3: Browser-Check der Startseite**
|
||||
|
||||
Chrome-DevTools/Claude-in-Chrome: `http://freunde-des-spessart.demo.mbo-tech-it.de/`
|
||||
öffnen. Erwartet: grüner Hero-Bereich mit Wellenform-Übergang zum Sand-Hintergrund,
|
||||
"Aktuelles"-Sektion mit (leeren, da noch kein Content) Kreis-Platzhaltern sichtbar,
|
||||
keine PHP-Warnungen/Fehler auf der Seite.
|
||||
|
||||
---
|
||||
|
||||
### Task 6: News-Artikel- und Standardseiten-Templates
|
||||
|
||||
**Files (auf der VM):**
|
||||
- Create: `wp-content/themes/friends-spessart/single-news.php`
|
||||
- Create: `wp-content/themes/friends-spessart/archive-news.php`
|
||||
- Create: `wp-content/themes/friends-spessart/page.php`
|
||||
- Modify: `wp-content/themes/friends-spessart/assets/css/main.css` (Artikel-/Seiten-Styles)
|
||||
|
||||
**Interfaces:**
|
||||
- Konsumiert: `news`-Post-Type aus Task 4, Header/Footer aus Task 3
|
||||
|
||||
- [ ] **Step 1: `single-news.php` schreiben**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/single-news.php" << 'EOF'
|
||||
<?php get_header(); ?>
|
||||
<main class="container content-layout">
|
||||
<article class="content-main">
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
<h1><?php the_title(); ?></h1>
|
||||
<?php if ( has_post_thumbnail() ) : ?>
|
||||
<div class="content-hero-image"><?php the_post_thumbnail( 'fds-hero' ); ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="entry-content"><?php the_content(); ?></div>
|
||||
<?php $tags = get_the_terms( get_the_ID(), 'post_tag' ); ?>
|
||||
<?php if ( $tags && ! is_wp_error( $tags ) ) : ?>
|
||||
<div class="entry-tags">
|
||||
<?php foreach ( $tags as $tag ) : ?>
|
||||
<span class="tag-pill"><?php echo esc_html( $tag->name ); ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endwhile; ?>
|
||||
</article>
|
||||
<aside class="content-sidebar">
|
||||
<h2>Weitere Themen</h2>
|
||||
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container' => false, 'fallback_cb' => false ) ); ?>
|
||||
</aside>
|
||||
</main>
|
||||
<?php get_footer(); ?>
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 2: `archive-news.php` schreiben**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/archive-news.php" << 'EOF'
|
||||
<?php get_header(); ?>
|
||||
<main class="container">
|
||||
<h1>Aktuelles</h1>
|
||||
<div class="news-teasers__grid">
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
<a class="news-teaser" href="<?php the_permalink(); ?>">
|
||||
<div class="circle-crop news-teaser__image">
|
||||
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'fds-teaser' ); } ?>
|
||||
</div>
|
||||
<h3><?php the_title(); ?></h3>
|
||||
</a>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<?php the_posts_pagination(); ?>
|
||||
</main>
|
||||
<?php get_footer(); ?>
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 3: `page.php` schreiben**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat > "$THEME/page.php" << 'EOF'
|
||||
<?php get_header(); ?>
|
||||
<main class="container content-layout">
|
||||
<article class="content-main content-main--wide">
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
<h1><?php the_title(); ?></h1>
|
||||
<div class="entry-content"><?php the_content(); ?></div>
|
||||
<?php endwhile; ?>
|
||||
</article>
|
||||
</main>
|
||||
<?php get_footer(); ?>
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 4: Artikel-/Seiten-CSS an `main.css` anhängen**
|
||||
|
||||
```bash
|
||||
THEME=/var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
cat >> "$THEME/assets/css/main.css" << 'EOF'
|
||||
|
||||
.content-layout { display: grid; gap: var(--space-3); padding: var(--space-4) 0; }
|
||||
.content-main--wide { grid-column: 1 / -1; }
|
||||
.content-hero-image { border-radius: 12px; overflow: hidden; margin-bottom: var(--space-3); }
|
||||
.entry-tags { margin-top: var(--space-3); display: flex; gap: var(--space-1); flex-wrap: wrap; }
|
||||
.tag-pill { background: var(--color-accent-light); color: var(--color-dark); padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.875rem; }
|
||||
.content-sidebar { background: #fff; padding: var(--space-3); border-radius: 12px; }
|
||||
|
||||
@media (min-width: 900px) {
|
||||
.content-layout { grid-template-columns: 3fr 1fr; align-items: start; }
|
||||
}
|
||||
EOF
|
||||
```
|
||||
|
||||
- [ ] **Step 5: Testinhalte anlegen und im Browser prüfen**
|
||||
|
||||
```bash
|
||||
cd /var/www/freunde-des-spessart
|
||||
wp post create --post_type=news --post_title="Testartikel für Theme-Abnahme" --post_status=publish --post_content="Dies ist ein Testartikel zur visuellen Pruefung des News-Templates." --allow-root
|
||||
wp post create --post_type=page --post_title="Testseite für Theme-Abnahme" --post_status=publish --post_content="Dies ist eine Testseite zur visuellen Pruefung des Standard-Templates." --allow-root
|
||||
```
|
||||
|
||||
Chrome-DevTools/Claude-in-Chrome: beide Testinhalte öffnen (URL aus der `wp post
|
||||
create`-Ausgabe), `/news/`-Archiv öffnen. Erwartet: Artikel zeigt Hauptspalte +
|
||||
Sidebar (Desktop) bzw. gestapelt (Mobile), Standardseite zeigt volle Breite, Archiv
|
||||
zeigt Kreis-Teaser-Grid, keine PHP-Fehler.
|
||||
|
||||
- [ ] **Step 6: Testinhalte wieder entfernen**
|
||||
|
||||
```bash
|
||||
cd /var/www/freunde-des-spessart
|
||||
wp post list --post_type=news --field=ID --allow-root | xargs -I{} wp post delete {} --force --allow-root
|
||||
wp post list --post_type=page --field=ID --allow-root | xargs -I{} wp post delete {} --force --allow-root
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Task 7: Chown, Gesamtverifikation, Commit der Theme-Dokumentation
|
||||
|
||||
**Files:**
|
||||
- Modify (lokal, Repo): `docs/struktur-alt.md` — kein Inhalt geändert, nur Verweis
|
||||
ergänzt (siehe Step 3)
|
||||
|
||||
**Interfaces:**
|
||||
- Konsumiert: alle vorherigen Tasks
|
||||
|
||||
- [ ] **Step 1: Dateibesitzer final korrigieren**
|
||||
|
||||
```bash
|
||||
chown -R www-data:www-data /var/www/freunde-des-spessart/wp-content/themes/friends-spessart
|
||||
```
|
||||
|
||||
- [ ] **Step 2: PHP-Fehlerlog prüfen**
|
||||
|
||||
```bash
|
||||
tail -50 /var/log/apache2/freunde-des-spessart-error.log
|
||||
```
|
||||
|
||||
Erwartet: keine PHP-Fatal-Errors/Warnings aus den neuen Theme-Dateien seit Task-1-Start.
|
||||
|
||||
- [ ] **Step 3: Kurzen Hinweis auf das aktive Theme im Repo dokumentieren**
|
||||
|
||||
```bash
|
||||
# Lokal, nicht auf der VM:
|
||||
echo "" >> docs/superpowers/specs/2026-08-08-wordpress-theme-design.md
|
||||
echo "## Status" >> docs/superpowers/specs/2026-08-08-wordpress-theme-design.md
|
||||
echo "" >> docs/superpowers/specs/2026-08-08-wordpress-theme-design.md
|
||||
echo "Theme \"friends-spessart\" umgesetzt und aktiv auf der VM unter" >> docs/superpowers/specs/2026-08-08-wordpress-theme-design.md
|
||||
echo "\`/var/www/freunde-des-spessart/wp-content/themes/friends-spessart/\`." >> docs/superpowers/specs/2026-08-08-wordpress-theme-design.md
|
||||
git add docs/superpowers/specs/2026-08-08-wordpress-theme-design.md
|
||||
git commit -m "docs: mark WordPress theme design as implemented"
|
||||
```
|
||||
|
||||
## Nach Abschluss
|
||||
|
||||
Das Theme ist fertig, wenn alle sieben Tasks verifiziert sind und die Startseite,
|
||||
ein News-Artikel und eine Standardseite im Browser (Desktop + Mobile-Viewport)
|
||||
korrekt mit den Design-Tokens aus der Spec dargestellt werden. Nächster Schritt:
|
||||
eigener Spec/Plan für den Massenimport der ~190 Content-Seiten aus
|
||||
`scrape/freunde-des-spessart-alt/` in dieses Theme.
|
||||
Loading…
Reference in New Issue