Vorlage fuer eigene Ableger-Installationen: Website + CMS-Code

Bereinigt von Pilot-Spezifika (echte Inhalte, Erzbistum-Hamburg-Bezuege,
Domain-Werte) - install.env und hugo.toml [params] mit generischen
Platzhaltern. docs/ komplett entfernt: Konzept, Manifest, Installations-
anleitungen leben jetzt auf der Projekt-Website statt redundant im Repo,
README verweist dorthin. Decap-CMS-Version von einer floatenden ^3.0.0
auf ein festes 3.15.1 gepinnt.
This commit is contained in:
2026-08-23 14:37:54 +02:00
commit 5e9da58d23
65 changed files with 5073 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env ruby
# Translates the form field "veroeffentlicht" (Decap, positive polarity: on
# = published) into Hugo's native draft field (inverted: draft: true =
# unpublished) - only in the local _content copy (not in the content repo),
# before every Hugo build. Decap cannot write a boolean field inverted into
# a differently named frontmatter field, hence this translation step
# instead of a direct CMS mapping. Must run before
# compute-methoden-sichtbarkeit.rb, which in turn reads the draft field set
# here for variants (that script aborts if it still finds untranslated
# "veroeffentlicht" fields, see there).
require_relative 'lib/frontmatter'
root = File.expand_path('..', __dir__)
varianten_dir = File.join(root, '_content', 'varianten')
changed = 0
if Dir.exist?(varianten_dir)
Dir.glob(File.join(varianten_dir, '*', 'index.md')).each do |file|
result = Frontmatter.read(file)
next unless result
fm, body = result
# Missing "veroeffentlicht" (e.g. a variant committed directly via the
# PR path, bypassing Decap's boolean widget with its "default: false")
# must translate to unpublished, not be skipped untranslated - a
# missing "draft" frontmatter key defaults to visible in Hugo, so
# skipping this file entirely would publish it unintentionally.
veroeffentlicht = fm.key?('veroeffentlicht') ? fm.delete('veroeffentlicht') == true : false
fm['draft'] = !veroeffentlicht
Frontmatter.write(file, fm, body, feldreihenfolge: Frontmatter::VARIANTEN_FELDER)
changed += 1
end
end
puts "veroeffentlicht -> draft übersetzt: #{changed} Variante(n)"