diff --git a/data/samples/html/travel_journal.html b/data/samples/html/travel_journal.html index cbc07cc..3e921d2 100644 --- a/data/samples/html/travel_journal.html +++ b/data/samples/html/travel_journal.html @@ -2,38 +2,166 @@ - Coastal Escape — Travel Story - + + + Coastal Escape — Travel Journal -
-

Three days on the blue coast

-

Wind, salt, and a notebook full of sketches

-
-
-

Travel · Sample journal · BloggerEasy

-

We arrived at dusk as the fishing boats returned. The harbor smelled of citrus and diesel, - and every doorway seemed to open toward the sea.

-

What to keep in a theme

-

Long-form travel posts need a clear hero, readable body type, and gentle section breaks. - This fixture is meant to convert cleanly into Blogger XML.

-

Packing notes

-

Light layers, a spare battery, and patience for golden hour. Leave room in the bag for a shell - or two — not for the shelf, for the story.

-
+
+
+

Field notes · Mediterranean coast

+

Three days on the blue coast

+

Wind, salt, and a notebook full of sketches

+
+
+ +
+

Travel · Sample journal · BloggerEasy travel_journal

+
+

Harbor at dusk

+
June 14, 2026
+

We arrived as the fishing boats returned. The harbor smelled of citrus and diesel, + and every doorway seemed to open toward the sea.

+

Pack light layers, a spare battery, and patience for golden hour.

+
+
+

What a theme should keep

+
June 15, 2026
+

Long-form travel posts need a clear hero, readable body type, and gentle section breaks. + This fixture converts cleanly into Blogger XML with a skin and Blog widget.

+
+
+

Shells for the story

+
June 16, 2026
+

Leave room in the bag for a shell or two — not for the shelf, for the story. + Tomorrow we take the cliff path north and write until the ink runs dry.

+
+
diff --git a/docs/screenshots/demo-travel_journal.png b/docs/screenshots/demo-travel_journal.png new file mode 100644 index 0000000..903de00 Binary files /dev/null and b/docs/screenshots/demo-travel_journal.png differ diff --git a/src/bloggereasy/cli.py b/src/bloggereasy/cli.py index 716a03a..0b5e45b 100644 --- a/src/bloggereasy/cli.py +++ b/src/bloggereasy/cli.py @@ -340,6 +340,7 @@ def _sample_for_template(template: str) -> Path: "portfolio": "portfolio.html", "portfolio_photo": "portfolio_photo.html", "simple": "minimal_blog.html", + "travel_journal": "travel_journal.html", } if template not in PRESETS: console.print( diff --git a/src/bloggereasy/theme/presets.py b/src/bloggereasy/theme/presets.py index 36bae81..850b5b0 100644 --- a/src/bloggereasy/theme/presets.py +++ b/src/bloggereasy/theme/presets.py @@ -62,6 +62,12 @@ "dense": False, "accent": "#0055aa", }, + "travel_journal": { + "layout_hint": "single-column", + "dark": False, + "dense": False, + "accent": "#0ea5e9", + }, } diff --git a/tests/test_theme_travel_journal.py b/tests/test_theme_travel_journal.py new file mode 100644 index 0000000..41c1af8 --- /dev/null +++ b/tests/test_theme_travel_journal.py @@ -0,0 +1,50 @@ +"""Theme pack sample: travel_journal (Fixes #28). + +Verifies the travel_journal preset generates valid Blogger XML from the +self-contained HTML fixture, containing a b:skin block and a Blog widget. +""" + +from __future__ import annotations + +from pathlib import Path + +from bloggereasy.integrations.sdk import generate_from_html +from bloggereasy.theme.presets import PRESETS +from bloggereasy.theme.validate import validate_theme_file + +SAMPLES = Path(__file__).resolve().parents[1] / "data" / "samples" / "html" + + +def test_travel_journal_preset_registered() -> None: + assert "travel_journal" in PRESETS + assert PRESETS["travel_journal"]["accent"] == "#0ea5e9" + assert PRESETS["travel_journal"]["layout_hint"] == "single-column" + + +def test_travel_journal_sample_exists() -> None: + assert (SAMPLES / "travel_journal.html").is_file() + + +def test_gen_html_travel_journal_produces_skin_and_blog_widget(tmp_path: Path) -> None: + src = SAMPLES / "travel_journal.html" + out = tmp_path / "travel_journal.xml" + result = generate_from_html(src, out, template="travel_journal") + + assert result["validation"]["ok"], result["validation"] + assert out.exists() + + # Hero-led journal stays single-column for readable diary flow + assert result["structure"]["layout"] != "two-column" + title = (result["structure"].get("title") or "").lower() + assert "coast" in title or "travel" in title or "journal" in title or "escape" in title + + xml = out.read_text(encoding="utf-8") + assert "xmlns:b=" in xml + assert "b:skin" in xml + assert "type='Blog'" in xml or 'type="Blog"' in xml + # travel_journal accent should be pushed into the skin + assert "0ea5e9" in xml + assert "Template: travel_journal" in xml + + v = validate_theme_file(out) + assert v["ok"] is True