Amtsbroschüre Leezen als einziges Beispiel bündeln
All checks were successful
Docker-Image veröffentlichen / publish (push) Successful in 52s
44
README.md
@ -11,10 +11,16 @@ docker compose up -d --build
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
Melde dich unter [localhost:4170](http://localhost:4170) mit dem Benutzernamen und Passwort aus `.env` an. Veröffentlichte Ausgaben sind über ihre Reader-Links ohne Studio-Anmeldung erreichbar. Für eine separate lokale Demo kannst du `DEMO_MODE=true` und `SAMPLE_DATA=true` setzen. [NACHTKAUF](http://localhost:4170/ausgabe/nachtkauf) ist die zwölfseitige Vorlage für den freien Editor. Öffne im Magazinmenü **Als Vorlage kopieren**, um einen eigenständigen bearbeitbaren Entwurf anzulegen.
|
||||
Melde dich unter [localhost:4170](http://localhost:4170) mit dem Benutzernamen und Passwort aus `.env` an. Veröffentlichte Ausgaben sind über ihre Reader-Links ohne Studio-Anmeldung erreichbar.
|
||||
|
||||
Mit `docker compose down` lässt sich der Stack anhalten und später mit denselben Daten starten. Die Volumes `folio_postgres` und `folio_files` enthalten alle Daten. `docker compose down -v` löscht beide Volumes einschließlich Ausgaben, Medien und Entwürfen.
|
||||
|
||||
## Beispielbroschüre und Demomodus
|
||||
|
||||
Mit `SAMPLE_DATA=true` wird die Amtsbroschüre Leezen mit 30 bearbeitbaren Seiten, den Medien und der Original-PDF beim Start einmalig eingerichtet. Sie erscheint im Studio und ist über [localhost:4170/ausgabe/amt-leezen](http://localhost:4170/ausgabe/amt-leezen) blätterbar. Eine bereits vorhandene Ausgabe mit derselben Adresse hat Vorrang.
|
||||
|
||||
`DEMO_MODE=true` überspringt die Studio-Anmeldung. Dieser Modus ist für eine lokale Vorschau mit einer Loopback-Adresse in `PUBLIC_BASE_URL` gedacht. Mit `DEMO_MODE=false` und `SAMPLE_DATA=true` steht die Beispielbroschüre in einem Studio mit Login bereit.
|
||||
|
||||
## Redaktion und Veröffentlichung
|
||||
|
||||
1. Lege ein Magazin an. Ziehe Elemente aus der Seitenleiste auf die freie A4-Fläche. Ziehe direkt am Element zum Verschieben, an den Eckgriffen zum Skalieren und am runden Griff zum Drehen. Tippen fügt einen Baustein ein und Ziehen auf der Seite funktioniert auch mit Touch. Die Ebenenliste wählt verdeckte Elemente aus und steuert die Reihenfolge. Ein Doppelklick bearbeitet Text direkt. Die Pfeiltasten bewegen das fokussierte Element um einen Seitenpixel, mit Umschalt um zehn. Position und Größe sind zusätzlich im Inspektor verfügbar. An bestehenden Flusslayouts reicht eine Ziehbewegung oder **Seite frei bearbeiten**, um das Layout zu übernehmen.
|
||||
@ -43,39 +49,3 @@ docker pull git.jfritzsche.de/jf/syncova-folio:latest
|
||||
- Frei positionierbare Bausteine mit gemeinsamem HTML-Renderer für Vorschau und Publikation. Der Baustein **HTML & CSS** unterstützt eigene statische Layouts, Tabellen, Listen, SVG-Grafiken und Inline-Stile. CSS bleibt auf seinen Rahmen beschränkt. Skripte, Formularübermittlungen und externe Medienquellen sind im Rahmen gesperrt. Eigene Bilder und Videos stehen über die Medienbausteine zur Verfügung.
|
||||
- PostgreSQL für Entwürfe, Versionen, Warteschlange und Zähler. Ein Docker-Volume enthält Uploads und erzeugte Dateien.
|
||||
- StPageFlip für die Animation und Chromium für die PDF-Erzeugung. Die Anwendung benötigt zur Laufzeit keine externen Dienste. Redaktionell gesetzte Links führen erst beim Anklicken zu ihrem Ziel.
|
||||
|
||||
## Beispielcover
|
||||
|
||||
Die drei JPEG-Dateien in `server/demo/` stammen aus einem Triptychon des eingebauten ImageGen-Tools.
|
||||
|
||||
<details>
|
||||
<summary>ImageGen-Prompt</summary>
|
||||
|
||||
> Generate one wide landscape 3:2 image, seamless grid of EXACTLY THREE flush and equal-width vertical photography panels, no gaps or borders. It will be split into three separate cover photos for a sophisticated German editorial magazine studio. Left third: rugged dramatic Italian Dolomites at blue hour with a placid alpine lake, pale mist, dark pine forest at its shores and moody teal blue tones, distant jagged mountain centrally framed. Center third: architectural interior with terracotta orange monumental stair and arch, warm tactile plaster, strong oblique sun with angular shadows, contemporary Mediterranean minimalism. Right third: bright glossy Sicilian yellow and orange citrus fruit on fresh deep-green branches, late afternoon garden, cinematic dark forest green on upper half. Distinct editorial fine art photography in each region, rich film tones, highly art-directed, credible, restrained. Fill full bleed to outer edges. Absolutely no lettering, text, people, UI, frames, watermarks or logos.
|
||||
|
||||
</details>
|
||||
|
||||
### NACHTKAUF
|
||||
|
||||
Die neun JPEG-Motive und der daraus geschnittene stumme WebM-Film liegen in [`server/demo/nightkauf/`](server/demo/nightkauf/). Das Atrium und beide Fotobögen wurden mit dem eingebauten ImageGen-Tool erzeugt.
|
||||
|
||||
<details>
|
||||
<summary>Cover · Atrium</summary>
|
||||
|
||||
> A single portrait 2:3 full-bleed editorial photograph for a fictional luxury night department store catalog, designed to be typeset later. Surreal yet photorealistic architectural photograph of a midnight-black mirrored atrium with a single luminous chartreuse circular halo framing a brutalist staircase, one small distant silhouette at the entrance, liquid chrome reflections, hard shadows, museum installation, 35mm film grain, elevated avant-garde fashion art direction. Composition centered with dark negative space on the top quarter and lower edge for type overlay. Palette near-black, cold silver, bright acid chartreuse #dcfc36. No letters, numerals, logos, watermarks or borders.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Fotobogen · Objekte und Mode</summary>
|
||||
|
||||
> One 3:2 landscape photographic contact sheet. EXACTLY four equal flush rectangular photo quadrants in a 2 by 2 grid with no spacing or margins, each a different luxury object editorial shot, suitable to be cropped individually. Top left: singular sculptural molten chrome table lamp in the form of a liquid silver dome on a glossy charcoal plinth, hard specular light. Top right: a large crumpled black technical nylon couture jacket on a torso mannequin with face out of frame in chartreuse spotlight. Bottom left: extravagant black cherry tart dusted with sugar, bright red candied cherries in an oval chrome dish, vermilion studio background. Bottom right: bright electric lavender satin clutch bag with a single polished metal handle floating against deep ultramarine, rich folds. Photorealistic high-fashion store editorial, coherent analog film and directional light. Each scene stays in its own quadrant. Absolutely no text, numerals, logos, borders, or watermarks.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Fotobogen · Bar, Duft und Architektur</summary>
|
||||
|
||||
> One 3:2 landscape contact sheet of four equal separate flush photo quadrants in a 2 by 2 grid, no dividers/gaps; each photograph for an avant-garde midnight department store lookbook. Top left: neon acid green aperitif with a spiral lemon peel in tall stemmed glass on black lacquer, boutique bar, film grain. Top right: architectural chrome escalators in a dimly lit brutalist department store, acid green horizontal lighting and dark forest shadows. Bottom left: two transparent sculptural perfume bottles with tinted deep cobalt glass and water reflections, no labels, highly editorial. Bottom right: ceiling of a futuristic mirrored fashion store in rich copper with hanging dark chrome spherical lights, industrial editorial photograph. Sophisticated architectural still life, real material textures, clean subjects. No letters, numbers, logos, text, people, or watermarks.
|
||||
|
||||
</details>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
name: syncova-folio
|
||||
services:
|
||||
app:
|
||||
image: syncova-folio:1.1.1
|
||||
image: syncova-folio:1.1.2
|
||||
build: .
|
||||
init: true
|
||||
restart: unless-stopped
|
||||
|
||||
14
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "syncova-folio",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "syncova-folio",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"dependencies": {
|
||||
"@fontsource-variable/manrope": "^5.2.8",
|
||||
"@radix-ui/react-dialog": "^1.1.15",
|
||||
@ -2080,7 +2080,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ee-first": {
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||
"license": "MIT"
|
||||
@ -2647,7 +2647,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/media-typer": {
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz",
|
||||
"integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==",
|
||||
"license": "MIT",
|
||||
@ -3032,7 +3032,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
||||
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
|
||||
"dev": true,
|
||||
@ -3410,7 +3410,7 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-router/node_modules/cookie": {
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
|
||||
"integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
|
||||
"license": "MIT",
|
||||
@ -3611,7 +3611,7 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
|
||||
"integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
|
||||
"license": "MIT",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "syncova-folio",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
BIN
server/demo/amt-leezen/amt-leezen.pdf
Normal file
11918
server/demo/amt-leezen/edition.json
Normal file
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 246 KiB |
|
After Width: | Height: | Size: 286 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 282 KiB |
|
After Width: | Height: | Size: 262 KiB |
|
After Width: | Height: | Size: 299 KiB |
|
After Width: | Height: | Size: 244 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 350 KiB |
|
After Width: | Height: | Size: 319 KiB |
|
After Width: | Height: | Size: 331 KiB |
|
After Width: | Height: | Size: 222 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 194 KiB |
|
After Width: | Height: | Size: 273 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 264 KiB |
|
After Width: | Height: | Size: 159 KiB |
|
After Width: | Height: | Size: 322 KiB |
|
After Width: | Height: | Size: 260 KiB |
|
After Width: | Height: | Size: 386 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 111 KiB |
|
After Width: | Height: | Size: 214 KiB |
|
After Width: | Height: | Size: 341 KiB |
|
After Width: | Height: | Size: 299 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 206 KiB |
|
After Width: | Height: | Size: 198 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 139 KiB |
|
After Width: | Height: | Size: 363 KiB |
|
After Width: | Height: | Size: 236 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 256 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 247 KiB |
|
After Width: | Height: | Size: 251 KiB |
|
After Width: | Height: | Size: 171 KiB |
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 290 KiB |
|
After Width: | Height: | Size: 277 KiB |
|
After Width: | Height: | Size: 252 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 112 KiB |
@ -1,173 +0,0 @@
|
||||
import { makeBlock, makePage } from '../../shared/magazine.js';
|
||||
|
||||
export const nightAssets = {
|
||||
atrium: 'Nächtliches Atrium mit leuchtendem Ring', chromlampe: 'Chromlampe Liquid No. 04',
|
||||
nylonjacke: 'Matt schwarze Nylonjacke im Neonschein', kirschtarte: 'Kirschtarte auf poliertem Silber',
|
||||
satintasche: 'Violette Satintasche mit Bügel', aperitif: 'Chartreusefarbener Aperitif im Stielglas',
|
||||
rolltreppen: 'Rolltreppen in einem schwach beleuchteten Kaufhaus', parfum: 'Kobaltblaue Parfumflakons auf Wasser',
|
||||
spiegelsaal: 'Spiegelsaal mit dunklen Kugelleuchten', film: 'NACHTKAUF · Sechs Sekunden nach Ladenschluss',
|
||||
};
|
||||
|
||||
const acid = '#e3fa44';
|
||||
const black = '#10110e';
|
||||
const white = '#f7f5ea';
|
||||
const lilac = '#d0b9ff';
|
||||
const blue = '#231bbb';
|
||||
const red = '#aa1423';
|
||||
|
||||
function item(type, x, y, width, height, properties = {}, appearance, angle = 0) {
|
||||
return { ...makeBlock(type), ...properties, frame: { x, y, width, height, angle }, ...(appearance && { appearance }) };
|
||||
}
|
||||
|
||||
function text(value, x, y, width, height, options = {}) {
|
||||
const { color, size = 28, font = 'sans', weight = 400, leading = 1.17, tracking = 0, align = 'left', angle = 0 } = options;
|
||||
return item('text', x, y, width, height, { text: value, align, style: 'body' }, { color, fontSize: size, font, weight, leading, tracking }, angle);
|
||||
}
|
||||
|
||||
const label = (value, x, y, width, color) => text(value, x, y, width, 35, { size: 17, color, font: 'mono', weight: 700, tracking: 1.8 });
|
||||
const headline = (value, x, y, width, height, color, size = 112, options = {}) => text(value, x, y, width, height, { size, color, weight: 900, leading: .89, tracking: -6, ...options });
|
||||
const box = (color, x, y, width, height, options = {}) => item('shape', x, y, width, height, { shape: options.shape || 'rectangle' }, { fill: color, ...options.paint }, options.angle);
|
||||
const line = (color, x, y, width) => box(color, x, y, width, 12, { shape: 'line' });
|
||||
const html = (markup, x, y, width, height) => item('html', x, y, width, height, { markup });
|
||||
const page = (title, background, color, blocks) => ({ ...makePage(title), background, color, blocks });
|
||||
|
||||
export function nightkaufDraft(media, online) {
|
||||
const photo = (name, x, y, width, height, options = {}) => item('image', x, y, width, height, { mediaId: media[name], alt: nightAssets[name] }, { fit: 'cover', position: options.position || 'center', radius: options.radius, opacity: options.opacity }, options.angle);
|
||||
const footer = (number, color) => [line(color, 45, 1045, 704), label('NACHTKAUF / 23:59', 45, 1066, 383, color), label(`SEITE ${number}`, 644, 1066, 120, color)];
|
||||
|
||||
return {
|
||||
title: 'NACHTKAUF', issue: '23:59 · Das Kaufhaus nach Ladenschluss',
|
||||
description: 'Ein fiktives Nachtkaufhaus in zwölf Seiten. Mode, Objekte und ein Abend, der um 23:59 erst beginnt.', cover: media.atrium,
|
||||
pages: [
|
||||
page('Cover · 23:59', black, white, [
|
||||
photo('atrium', 0, 0, 794, 1122),
|
||||
box(black, 0, 0, 794, 245, { paint: { opacity: 73 } }),
|
||||
line(acid, 46, 42, 702), label('JOURNAL 01 / NUR BEI NACHT', 46, 63, 590, acid),
|
||||
headline('NACHTKAUF', 41, 107, 725, 145, acid, 112, { tracking: -8 }),
|
||||
box(acid, 544, 835, 186, 128, { shape: 'ellipse', angle: -12 }),
|
||||
text('23:59', 562, 870, 148, 52, { color: black, size: 38, tracking: -1, weight: 900, align: 'center', angle: -12 }),
|
||||
box(black, 0, 976, 794, 146, { paint: { opacity: 81 } }),
|
||||
text('DAS KAUFHAUS NACH LADENSCHLUSS.', 48, 1008, 670, 57, { color: white, size: 32, weight: 800, tracking: -1.2 }),
|
||||
label('MODE / OBJEKTE / BAR / DUFT', 49, 1064, 688, acid),
|
||||
]),
|
||||
page('Willkommen nach Ladenschluss', acid, black, [
|
||||
label('EDITORIAL', 45, 48, 300, black),
|
||||
headline('DIE NACHT\nIST OFFEN.', 42, 129, 718, 251, black, 106, { tracking: -7 }),
|
||||
photo('rolltreppen', 86, 437, 614, 404, { angle: -5 }),
|
||||
box(lilac, 490, 721, 226, 92, { angle: 9 }),
|
||||
label('AB 23:59', 535, 752, 195, black),
|
||||
text('Das Licht ist runtergedimmt, die Rolltreppen laufen noch. Ein Kaufhaus für Dinge, die im Tageslicht zu laut wären.', 51, 875, 681, 128, { size: 28, font: 'serif', leading: 1.25 }),
|
||||
...footer('02', black),
|
||||
]),
|
||||
page('Etagenplan · Drei Stockwerke', blue, white, [
|
||||
label('ORIENTIERUNG IM HAUS', 46, 49, 500, lilac),
|
||||
headline('WAS WO\nPASSIERT.', 43, 119, 711, 252, white, 115),
|
||||
box(lilac, 44, 409, 703, 490),
|
||||
html(`<style>
|
||||
body{background:#d0b9ff;color:#191622;font-family:Arial,sans-serif;padding:4vw}
|
||||
table{width:100%;border-collapse:collapse} caption{text-align:left;font:bold 2.8vw monospace;padding:1vw 0 4vw}
|
||||
td{padding:3.6vw 1.4vw;border-top:.3vw solid #191622;font-size:3.25vw;vertical-align:top}
|
||||
strong{display:block;font-size:5.1vw;line-height:1.04;letter-spacing:-.08em} td:first-child{width:18%;font:700 3.5vw monospace}
|
||||
td:last-child{text-align:right;font:700 2.65vw monospace;white-space:nowrap} small{display:block;margin-top:1vw}
|
||||
</style><table><caption>ETAGEN / ROUTE</caption><tbody>
|
||||
<tr><td>02</td><td><strong>Bar & Duft</strong><small>Rouge, Nachtbar und Blue Noise.</small></td><td>S. 07–10</td></tr>
|
||||
<tr><td>01</td><td><strong>Mode & Editionen</strong><small>After Hours und Mondseide.</small></td><td>S. 05–06</td></tr>
|
||||
<tr><td>00</td><td><strong>Objekte</strong><small>Das Atelier für Licht und Metall.</small></td><td>S. 04</td></tr>
|
||||
</tbody></table>`, 44, 409, 703, 490),
|
||||
text('Erst nach oben. Dann der Neugier nach.', 45, 926, 680, 60, { size: 33, color: white, font: 'serif' }),
|
||||
...footer('03', lilac),
|
||||
]),
|
||||
page('Objekte · Liquid No. 04', white, black, [
|
||||
photo('chromlampe', 0, 280, 794, 515),
|
||||
label('LICHTOBJEKT / 00', 44, 49, 473, black),
|
||||
headline('LIQUID', 34, 119, 684, 183, black, 150, { tracking: -10 }),
|
||||
box(acid, 484, 672, 248, 130, { angle: -6 }),
|
||||
headline('340 €', 513, 709, 210, 78, black, 53, { tracking: -3, angle: -6 }),
|
||||
text('No. 04 / Tischleuchte', 45, 828, 682, 60, { size: 43, font: 'serif', tracking: -1.8 }),
|
||||
text('Polierter Metallguss, warmes Licht. Eine Leuchte, die selbst ausgeschaltet etwas im Raum verändert.', 46, 904, 689, 97, { size: 24, leading: 1.35 }),
|
||||
...footer('04', black),
|
||||
]),
|
||||
page('Mode · After Hours', black, white, [
|
||||
photo('nylonjacke', 0, 0, 794, 805, { position: 'right' }),
|
||||
box(black, 0, 0, 794, 162, { paint: { opacity: 55 } }),
|
||||
label('MODE / 01 / NACHTUNIFORM', 45, 43, 590, acid),
|
||||
box(black, -23, 516, 646, 241, { angle: -5, paint: { opacity: 92 } }),
|
||||
headline('AFTER\nHOURS', 44, 540, 544, 237, white, 110, { angle: -5 }),
|
||||
label('01.02 / JACKE AUS TECHNISCHEM NYLON', 46, 845, 680, acid),
|
||||
text('Überzeichnete Silhouette, matte Oberfläche. Lässt sich hoch schließen, wenn die Stadt abkühlt.', 44, 908, 490, 110, { size: 26, color: white, leading: 1.27 }),
|
||||
text('280 €', 539, 914, 207, 63, { size: 46, color: acid, weight: 900, align: 'right', tracking: -2 }),
|
||||
...footer('05', acid),
|
||||
]),
|
||||
page('Edition · Mondseide', lilac, black, [
|
||||
label('TASCHE AUS SATIN / 01.03', 44, 47, 656, blue),
|
||||
box(white, 97, 213, 575, 695, { angle: 7 }),
|
||||
photo('satintasche', 63, 295, 664, 480, { angle: -7 }),
|
||||
headline('MOND\nSEIDE', 40, 102, 670, 252, black, 122, { font: 'serif', weight: 700, angle: -6, tracking: -7 }),
|
||||
box(acid, 520, 733, 210, 134, { shape: 'ellipse', angle: 9 }),
|
||||
text('160 €', 550, 776, 145, 53, { size: 38, weight: 900, align: 'center', angle: 9 }),
|
||||
text('Satin in Violett mit einem Bügel aus poliertem Stahl. Für alles, was man nachts wirklich braucht.', 51, 915, 684, 97, { font: 'serif', size: 26, leading: 1.25 }),
|
||||
...footer('06', blue),
|
||||
]),
|
||||
page('Patisserie · Rouge', red, white, [
|
||||
photo('kirschtarte', 0, 0, 794, 661), box(red, 0, 0, 794, 220, { paint: { opacity: 87 } }),
|
||||
label('PATISSERIE / 02', 46, 44, 420, white),
|
||||
headline('ROUGE.', 41, 99, 718, 167, white, 140, { tracking: -9 }),
|
||||
text('Süßes zum Schluss.', 45, 700, 694, 62, { size: 49, color: white, font: 'serif', tracking: -2.7 }),
|
||||
html(`<style>
|
||||
body{background:#aa1423;color:#f7f5ea;font-family:Arial,sans-serif}
|
||||
table{width:100%;border-collapse:collapse} td{padding:2.25vw 0;border-bottom:1px solid #f7f5ea90;font-size:4.1vw}
|
||||
td:last-child{text-align:right;font-weight:700} tr:first-child td{border-top:1px solid #f7f5ea90}
|
||||
</style><table aria-label="Patisserie-Karte"><tbody><tr><td>Schwarzkirschtarte</td><td>12 €</td></tr><tr><td>Vanillecreme mit rosa Pfeffer</td><td>9 €</td></tr><tr><td>Espresso doppio</td><td>4 €</td></tr></tbody></table>`, 45, 794, 704, 188),
|
||||
...footer('07', white),
|
||||
]),
|
||||
page('Nachtbar · Grüner Blitz', black, acid, [
|
||||
label('NACHTBAR / 02', 45, 50, 520, acid),
|
||||
box(lilac, 19, 370, 697, 499, { angle: 8 }),
|
||||
photo('aperitif', 45, 264, 704, 592, { angle: -3 }),
|
||||
headline('GRÜNER\nBLITZ', 41, 120, 700, 243, acid, 112),
|
||||
box(acid, 500, 779, 252, 83, { angle: -7 }),
|
||||
text('NACHTDRINK / 14 €', 511, 805, 232, 39, { color: black, size: 22, font: 'mono', weight: 700, align: 'center', angle: -7 }),
|
||||
text('Kräuter, Zitrone und ein bitteres Finish. Auch alkoholfrei erhältlich.', 44, 919, 697, 100, { color: white, size: 27, font: 'serif', leading: 1.26 }),
|
||||
...footer('08', acid),
|
||||
]),
|
||||
page('Galerie · Blue Noise', blue, white, [
|
||||
label('DUFTATELIER / 02', 45, 48, 519, lilac),
|
||||
headline('BLUE\nNOISE', 41, 118, 710, 279, white, 130, { tracking: -7 }),
|
||||
item('gallery', 44, 410, 705, 442, { mediaIds: [media.parfum, media.spiegelsaal, media.chromlampe, media.aperitif], height: 30 }, { fit: 'cover' }),
|
||||
box(acid, 479, 780, 247, 85, { angle: -8 }),
|
||||
label('PARFUM / 96 €', 507, 808, 218, black),
|
||||
text('Kalter Stein, Wacholder und dunkles Holz. Vier Bilder zu einem Duft.', 45, 901, 694, 99, { color: white, size: 28, font: 'serif', leading: 1.23 }),
|
||||
...footer('09', lilac),
|
||||
]),
|
||||
page('Film · Sechs Sekunden nach Ladenschluss', black, acid, [
|
||||
label('BEWEGTBILD / NACHTKAUF JOURNAL', 46, 48, 670, acid),
|
||||
headline('SECHS\nSEKUNDEN.', 40, 115, 705, 248, acid, 113, { tracking: -7 }),
|
||||
box(lilac, 32, 400, 730, 460, { angle: -4 }),
|
||||
item('video', 44, 411, 706, 447, { mediaId: media.film, posterMediaId: media.spiegelsaal, text: 'NACHTKAUF / 23:59 · Motion Study' }, { color: white, fill: black, fontSize: 17 }),
|
||||
text('Ein Blick durch das Haus, bevor es wieder hell wird.', 45, 920, 690, 82, { color: white, size: 29, font: 'serif' }),
|
||||
...footer('10', acid),
|
||||
]),
|
||||
page('Einlass · Die Nachtkarte', acid, black, [
|
||||
label('NACHTKAUF / EINTRITT', 45, 47, 450, black),
|
||||
headline('DIE NACHT-\nKARTE', 43, 120, 710, 241, black, 109, { tracking: -6.5 }),
|
||||
box(black, 44, 404, 703, 309, { angle: -2 }),
|
||||
text('23:59 – 03:00', 75, 445, 644, 97, { size: 66, color: acid, weight: 900, tracking: -4, angle: -2 }),
|
||||
text('Die digitale Ausgabe passt in jede Jackentasche. Scanne den Code oder öffne das Flipbook direkt.', 79, 553, 580, 119, { size: 30, color: white, font: 'serif', leading: 1.2, angle: -2 }),
|
||||
item('qr', 49, 761, 195, 231, { text: 'Online-Ausgabe', url: online }, { color: black, fontSize: 16 }),
|
||||
item('button', 287, 785, 396, 80, { text: 'Flipbook öffnen', url: online }, { fill: black, color: acid, fontSize: 27, weight: 700, radius: 8 }),
|
||||
item('social', 292, 902, 391, 64, { text: 'Visuelle Inspiration · Instagram', url: 'https://www.instagram.com/' }, { color: black, fontSize: 22 }),
|
||||
...footer('11', black),
|
||||
]),
|
||||
page('Rückseite · Bis morgen Nacht', black, white, [
|
||||
photo('spiegelsaal', 0, 0, 794, 1122),
|
||||
box(black, 0, 0, 794, 1122, { paint: { opacity: 47 } }),
|
||||
label('NACHTKAUF JOURNAL / ENDE', 46, 52, 665, acid),
|
||||
box(acid, 434, 266, 320, 320, { shape: 'ellipse', paint: { opacity: 86 } }),
|
||||
headline('BIS\nMORGEN\nNACHT.', 42, 386, 716, 456, white, 151, { tracking: -10.5 }),
|
||||
box(black, 0, 944, 794, 178, { paint: { opacity: 82 } }),
|
||||
text('Ein fiktives Kaufhaus. Ein Beispiel für freie Gestaltung in Syncova. Folio.', 48, 977, 660, 68, { font: 'serif', size: 27, color: white }),
|
||||
label('AUSGABE 01 / 23:59', 50, 1064, 683, acid),
|
||||
]),
|
||||
],
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 106 KiB |
@ -7,7 +7,7 @@ import { magazines } from './magazines.js';
|
||||
import { library } from './library.js';
|
||||
import { HttpError, idSchema } from './model.js';
|
||||
import { releasePath, startPublishing } from './publisher.js';
|
||||
import { seed, seedNightkauf } from './seed.js';
|
||||
import { seed } from './seed.js';
|
||||
import { adminPassword, adminUsername, demoMode, pool, publicBase, setup, uploadPath } from './storage.js';
|
||||
|
||||
const app = express();
|
||||
@ -138,7 +138,6 @@ app.use((error, _req, res, next) => {
|
||||
|
||||
await setup();
|
||||
await seed();
|
||||
await seedNightkauf();
|
||||
const stopPublishing = startPublishing();
|
||||
const server = app.listen(port, '0.0.0.0', () => console.log(`Syncova. Folio auf Port ${port}`));
|
||||
function stop() {
|
||||
|
||||
@ -51,6 +51,11 @@ async function createPdf(draft, files) {
|
||||
|
||||
export const releasePath = (release, format) => join(releaseDir, `${release}.${format}`);
|
||||
|
||||
export async function renderPublication(draft, slug, releaseId) {
|
||||
const pages = await renderPages(draft, (id) => `/api/public/${slug}/media/${releaseId}/${id}`);
|
||||
return { pages, html: documentHtml(draft.title, pages) };
|
||||
}
|
||||
|
||||
async function writeArtifact(path, contents) {
|
||||
const temp = `${path}.tmp`;
|
||||
await fs.writeFile(temp, contents);
|
||||
@ -63,8 +68,7 @@ async function publish(job) {
|
||||
let committed = false;
|
||||
try {
|
||||
const files = await validatePublication(pool, job.draft);
|
||||
const pages = await renderPages(job.draft, (id) => `/api/public/${job.slug}/media/${job.id}/${id}`);
|
||||
const html = documentHtml(job.draft.title, pages);
|
||||
const { pages, html } = await renderPublication(job.draft, job.slug, job.id);
|
||||
const pdf = await createPdf(job.draft, files);
|
||||
await writeArtifact(htmlPath, html);
|
||||
await writeArtifact(pdfPath, pdf);
|
||||
|
||||
128
server/seed.js
@ -1,88 +1,82 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import { makeBlock, makePage } from '../shared/magazine.js';
|
||||
import { baseDraft } from './model.js';
|
||||
import { audit, publicBase, transaction, uploadPath } from './storage.js';
|
||||
import { nightAssets, nightkaufDraft } from './demo/nachtkauf.js';
|
||||
import { draftSchema, validatePublication } from './model.js';
|
||||
import { releasePath, renderPublication } from './publisher.js';
|
||||
import { audit, transaction, uploadPath } from './storage.js';
|
||||
|
||||
const editions = [
|
||||
{ slug: 'weitblick', title: 'Weitblick', issue: 'Ausgabe 04 · Das Alpenheft', cover: 'Dolomiten am Morgen', color: '#0e2e39', pages: ['Jenseits der Baumgrenze', 'Am stillen Ufer', 'Unterwegs im Fels', 'Ein letzter Blick'], text: 'Zwischen dunklem Wasser und kühlem Fels beginnt der Tag langsam. Ein Heft über die Landschaften, die uns den Atem anhalten lassen.' },
|
||||
{ slug: 'form-und-raum', title: 'Form & Raum', issue: 'Ausgabe 02 · Architektur', cover: 'Treppenhaus aus Terrakotta', color: '#682f1c', pages: ['Räume im Licht', 'Material und Handwerk', 'Der Blick nach draußen'], text: 'Sonnenlicht wandert über Terrakotta, und mit ihm verändert sich der Raum. Diese Ausgabe folgt dem Zusammenspiel von Material, Form und Zeit.' },
|
||||
{ slug: 'saison', title: 'Saison', issue: 'Ausgabe 01 · Eine Reise nach Süden', cover: 'Zitrusgarten in Sizilien', color: '#243722', pages: ['Im Zitrusgarten', 'Von Baum zu Tisch'], text: 'Wo Zitronen und Orangen wachsen, erzählt jede Jahreszeit eine eigene Geschichte. Wir folgen den Früchten vom Garten bis auf den Tisch.' },
|
||||
];
|
||||
const slug = 'amt-leezen';
|
||||
const bundle = new URL('./demo/amt-leezen/', import.meta.url);
|
||||
|
||||
const text = (value, style = 'body') => ({ ...makeBlock('text'), text: value, style });
|
||||
const picture = (mediaId, alt, height) => ({ ...makeBlock('image'), mediaId, alt, height });
|
||||
function remapBlockMedia(block, mediaIds) {
|
||||
if (block.type === 'gallery') {
|
||||
return { ...block, mediaIds: block.mediaIds.map((id) => mediaIds.get(id)) };
|
||||
}
|
||||
if (block.type === 'image' || block.type === 'video') {
|
||||
return {
|
||||
...block,
|
||||
mediaId: mediaIds.get(block.mediaId),
|
||||
...(block.posterMediaId && { posterMediaId: mediaIds.get(block.posterMediaId) }),
|
||||
};
|
||||
}
|
||||
return block;
|
||||
}
|
||||
|
||||
export async function seed() {
|
||||
if (process.env.SAMPLE_DATA !== 'true') return;
|
||||
|
||||
await transaction(async (db) => {
|
||||
const flag = await db.query("INSERT INTO settings (key) VALUES ('sample-v1') ON CONFLICT DO NOTHING RETURNING key");
|
||||
if (!flag.rowCount) return;
|
||||
const coverIds = [];
|
||||
for (const [index, edition] of editions.entries()) {
|
||||
const media = { id: crypto.randomUUID(), extension: 'jpg' };
|
||||
const bytes = await fs.readFile(new URL(`./demo/${edition.slug}.jpg`, import.meta.url));
|
||||
await fs.writeFile(uploadPath(media), bytes);
|
||||
const id = crypto.randomUUID();
|
||||
coverIds.push(media.id);
|
||||
const draft = baseDraft(edition.title, edition.issue, edition.text);
|
||||
draft.cover = media.id;
|
||||
draft.pages = [
|
||||
{ ...makePage('Titelseite'), layout: 'cover', background: edition.color, color: '#fff9ed', blocks: [text(edition.issue, 'caption'), text(edition.title, 'title'), picture(media.id, edition.cover, 92)] },
|
||||
...edition.pages.map((title, number) => ({ ...makePage(title), layout: 'single', blocks: [text(edition.title, 'caption'), text(title, 'heading'), picture(media.id, edition.cover, number === 0 ? 58 : 43), text(edition.text)] })),
|
||||
];
|
||||
await db.query("INSERT INTO media (id,name,mime,extension,bytes) VALUES ($1,$2,'image/jpeg','jpg',$3)", [media.id, edition.cover, bytes.length]);
|
||||
await db.query('INSERT INTO magazines (id,slug,draft,views,downloads,updated_at) VALUES ($1,$2,$3,$4,$5,now() - $6::interval)',
|
||||
[id, edition.slug, draft, index === 0 ? 2841 : 0, index === 0 ? 186 : 0, `${index} days`]);
|
||||
await db.query("INSERT INTO versions (magazine_id,revision,draft,reason) VALUES ($1,1,$2,'Angelegt')", [id, draft]);
|
||||
await audit(db, 'created', `„${edition.title}“ angelegt`);
|
||||
if (index === 0 || index === 2) {
|
||||
await db.query('INSERT INTO releases (id,magazine_id,revision,draft,publish_at) VALUES ($1,$2,1,$3,now() + $4::interval)',
|
||||
[crypto.randomUUID(), id, draft, index === 0 ? '0 days' : '7 days']);
|
||||
}
|
||||
}
|
||||
await db.query('INSERT INTO galleries (id,name,media_ids) VALUES ($1,$2,$3)', [crypto.randomUUID(), 'Beispielcover', coverIds]);
|
||||
});
|
||||
}
|
||||
|
||||
export async function seedNightkauf() {
|
||||
if (process.env.SAMPLE_DATA !== 'true') return;
|
||||
const paths = [];
|
||||
try {
|
||||
await transaction(async (db) => {
|
||||
const flag = await db.query("INSERT INTO settings (key) VALUES ('sample-nachtkauf-v1') ON CONFLICT DO NOTHING RETURNING key");
|
||||
const flag = await db.query(
|
||||
"INSERT INTO settings (key) VALUES ('sample-amt-leezen-v1') ON CONFLICT DO NOTHING RETURNING key",
|
||||
);
|
||||
if (!flag.rowCount) return;
|
||||
const media = {};
|
||||
for (const [key, name] of Object.entries(nightAssets)) {
|
||||
const video = key === 'film';
|
||||
const file = { id: crypto.randomUUID(), extension: video ? 'webm' : 'jpg' };
|
||||
const filename = video ? 'nachtkauf-film.webm' : `${key}.jpg`;
|
||||
const data = await fs.readFile(new URL(`./demo/nightkauf/${filename}`, import.meta.url));
|
||||
const existing = await db.query('SELECT id FROM magazines WHERE slug=$1', [slug]);
|
||||
if (existing.rowCount) return;
|
||||
|
||||
const edition = JSON.parse(await fs.readFile(new URL('edition.json', bundle), 'utf8'));
|
||||
const mediaIds = new Map(edition.media.map((file) => [file.id, crypto.randomUUID()]));
|
||||
const draft = draftSchema.parse({
|
||||
...edition.draft,
|
||||
cover: edition.draft.cover ? mediaIds.get(edition.draft.cover) : '',
|
||||
pages: edition.draft.pages.map((page) => ({
|
||||
...page, blocks: page.blocks.map((block) => remapBlockMedia(block, mediaIds)),
|
||||
})),
|
||||
});
|
||||
const id = crypto.randomUUID();
|
||||
const inserted = await db.query(
|
||||
'INSERT INTO magazines (id,slug,draft) VALUES ($1,$2,$3) ON CONFLICT (slug) DO NOTHING RETURNING id',
|
||||
[id, slug, draft],
|
||||
);
|
||||
if (!inserted.rowCount) return;
|
||||
|
||||
for (const source of edition.media) {
|
||||
const file = { ...source, id: mediaIds.get(source.id) };
|
||||
const path = uploadPath(file);
|
||||
paths.push(path);
|
||||
await fs.writeFile(path, data);
|
||||
await fs.copyFile(new URL(`media/${source.id}.${source.extension}`, bundle), path);
|
||||
await db.query('INSERT INTO media (id,name,mime,extension,bytes) VALUES ($1,$2,$3,$4,$5)',
|
||||
[file.id, name, video ? 'video/webm' : 'image/jpeg', file.extension, data.length]);
|
||||
media[key] = file.id;
|
||||
}
|
||||
const id = crypto.randomUUID();
|
||||
const gallery = ['parfum', 'spiegelsaal', 'chromlampe', 'aperitif'].map((key) => media[key]);
|
||||
await db.query('INSERT INTO galleries (id,name,media_ids) VALUES ($1,$2,$3)', [crypto.randomUUID(), 'NACHTKAUF · Blue Noise', gallery]);
|
||||
let slug = 'nachtkauf';
|
||||
let draft = nightkaufDraft(media, new URL(`/ausgabe/${slug}`, publicBase).href);
|
||||
const inserted = await db.query('INSERT INTO magazines (id,slug,draft) VALUES ($1,$2,$3) ON CONFLICT (slug) DO NOTHING', [id, slug, draft]);
|
||||
if (!inserted.rowCount) {
|
||||
slug = `nachtkauf-${id.slice(0, 8)}`;
|
||||
draft = nightkaufDraft(media, new URL(`/ausgabe/${slug}`, publicBase).href);
|
||||
await db.query('INSERT INTO magazines (id,slug,draft) VALUES ($1,$2,$3)', [id, slug, draft]);
|
||||
[file.id, file.name, file.mime, file.extension, file.bytes]);
|
||||
}
|
||||
|
||||
const files = await validatePublication(db, draft);
|
||||
const release = crypto.randomUUID();
|
||||
const { pages, html } = await renderPublication(draft, slug, release);
|
||||
const htmlPath = releasePath(release, 'html');
|
||||
const pdfPath = releasePath(release, 'pdf');
|
||||
paths.push(htmlPath, pdfPath);
|
||||
await fs.writeFile(htmlPath, html);
|
||||
await fs.copyFile(new URL('amt-leezen.pdf', bundle), pdfPath);
|
||||
const pdf = await fs.stat(pdfPath);
|
||||
|
||||
await db.query("INSERT INTO versions (magazine_id,revision,draft,reason) VALUES ($1,1,$2,'Beispielbroschüre angelegt')", [id, draft]);
|
||||
await db.query('INSERT INTO releases (id,magazine_id,revision,draft,publish_at) VALUES ($1,$2,1,$3,now())', [crypto.randomUUID(), id, draft]);
|
||||
await audit(db, 'created', '„NACHTKAUF“ als bearbeitbare Beispielbroschüre angelegt');
|
||||
await db.query(`INSERT INTO releases (id,magazine_id,revision,draft,publish_at,state,pages,media_ids,bytes,published_at)
|
||||
VALUES ($1,$2,1,$3,now(),'ready',$4,$5,$6,now())`,
|
||||
[release, id, draft, JSON.stringify(pages), files.map((file) => file.id), Buffer.byteLength(html) + pdf.size]);
|
||||
await db.query('UPDATE magazines SET current_release=$1 WHERE id=$2', [release, id]);
|
||||
await audit(db, 'created', '„Amt Leezen“ als bearbeitbare Beispielbroschüre angelegt');
|
||||
});
|
||||
} catch (error) {
|
||||
await Promise.all(paths.map((path) => fs.rm(path, { force: true })));
|
||||
await Promise.allSettled(paths.map((path) => fs.rm(path, { force: true })));
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||