Commit Graph

24 Commits

Author SHA1 Message Date
popovskik 2d535db7d5 feat(cms): U4 one-command site build + local preview
Add tools/build_site.py: runs the full pipeline in dependency order
(build_content -> build_listings -> seo_inject --all --sitemap ->
build_botlinks -> build_search_index), each as a subprocess so a failing
step aborts the build before anything downstream runs (no partial
deploy). --check verifies non-destructively; --images also runs
optimize_images. This is what CI will run in U5.

Fix a build_content idempotence bug found via U4: the hero and
article-header regions were emitted with leading indentation while the
regex left the template's pre-tag whitespace in place, so indentation
compounded (+16 spaces) on every rebuild. First line is now unindented;
the full build is verified idempotent (identical git tree across two
runs). Added a fixpoint test (re-rendering a page's own output is
byte-identical) so this can't regress.

docs/local-preview.md: build + serve on :8000 in all three languages.
tools/README.md: document build_site + build_content.

26 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-08 17:04:00 +02:00
popovskik 8ff968739a feat(cms): U3 derive article dates from content/ front-matter
Replace the hand-maintained ARTICLE_DATES registry as the source of
truth with dates read from content/ front-matter, so publishing a post
via the CMS needs no manual registry edit (plan R4).

- tools/content_index.py: load_dates() reads content/ front-matter into
  {source_folder/slug: {published|modified: iso}}. Standalone (os+yaml),
  no import cycle with seo_inject.
- tools/seo_inject.py: ARTICLE_DATES is now {**static_fallback,
  **content_dates}; content wins. The static table is kept only as a
  fallback for entries not present in content/.
- migration now preserves the published-vs-modified distinction
  (date_type), so the switch is byte-identical: content-derived dates
  equal the old static table exactly (17/17, incl. the one 'modified').

Verified: full `seo_inject --all --sitemap` + build_listings +
build_botlinks run produces ZERO changes to any site page. build_content
--check still reproduces all 51 pages.

build_botlinks.py needs no change (it scrapes built pages, which are a
pure function of content/). Listings get content-driven dates for free
via seo_inject.ARTICLE_DATES.

tools/tests/test_content_index.py: 5 tests (dates == legacy registry,
merged registry unchanged, published/modified distinction, events key on
projects/<slug>, one ISO date per entry).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-08 16:47:03 +02:00
popovskik 596290acf8 feat(cms): U2 render content/ into detail pages (characterization-verified)
Add tools/build_content.py: renders every content/ entry into its blog /
news / event detail page by self-templating the page's own chrome and
replacing only content-derived regions (title, article header, hero,
body, and — for new pages only — the scrollspy).

Faithful reproduction, proven against the live site:
- body_format: html fragments injected verbatim, so guide-boxes, inline
  figures and event galleries render unchanged.
- scrollspy sidebars are preserved (labels are hand-curated, shorter than
  the H2s); only generated when a page has none.
- <title> suffix derived per page, so EN/SI " - MSOS", MK " - МСОС", and
  suffix-less event titles all reproduce exactly.
- hero /images/… rewritten to the page's ../../../ depth.
- ASCII-only console output (no cp1252 crash on Windows/CI).

tools/tests/test_build_content.py: 8 characterization tests; the core one
renders all 51 pages and asserts each is semantically equivalent
(whitespace/attr-order-insensitive) to the current page — the R5
no-regression guarantee.

Does NOT overwrite the committed pages; whether generated pages are
committed vs built fresh in CI is decided in U4/U5. Run:
  python tools/build_content.py --check   # verify equivalence
  python tools/build_content.py --write    # emit pages (for U4)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-08 16:36:11 +02:00
popovskik 9ddd0f88ef feat(cms): U1 content model + migration scaffold for blog/news/events
Establish content/ as the source of truth for editable content and
back-fill it from the existing detail pages, per U1 of the no-code CMS
plan.

- docs/content-model.md: front-matter schema (EN/MK/SI), body_format
  html-vs-markdown, content/events -> projects/ output mapping.
- tools/migrate_pages_to_content.py: bs4/yaml extractor; pulls title,
  subtitle, category, ISO date (from ARTICLE_DATES), hero image+caption;
  preserves the article body PLUS trailing sibling sections (event
  galleries) verbatim as body_format: html. Reports unparseable pages
  instead of emitting half-formed files.
- content/**: 51 files (17 entries x EN/MK/SI), 0 skips.
- tools/tests/test_migrate_roundtrip.py: 12 characterization tests
  (structured fields, news-has-no-subtitle, event gallery/lightbox
  preserved, Cyrillic UTF-8 round-trip, every page parses).
- .gitignore: ignore __pycache__/ and *.pyc.

U1 is unblocked and standalone. U2 (render content -> pages) is next;
U5/U6 remain blocked on Open Question Q1 (Gitea<->GitHub topology).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-08 16:18:29 +02:00
popovskik 0d49293693 GEO: FAQPage/NGO/Event schema + autonomous generation for new projects
Generative Engine Optimization pass so AI answer engines (ChatGPT, Gemini,
Perplexity, AI Overviews) can confidently identify and cite MSOS.

Schema (tools/seo_inject.py, propagated to all 231 pages):
- FAQPage JSON-LD parsed from the /faq/ Q&A blocks (33 Q&A x EN/MK/SI)
- Organization upgraded to NGO with entity-disambiguation fields:
  alternateName (all spellings), description, areaServed Slovenia,
  knowsLanguage, and foundingDate 2023-03-05
- Event JSON-LD on all 9 /projects/ recap pages (date + real location)

Autonomous for future content (no code edits to add a project):
- Event/Article dates auto-read from the English page's publish date;
  event city auto-detected from the body (Slovenian-city whitelist).
  ARTICLE_DATES/PROJECT_LOCATIONS are now optional overrides only.
  (Auto-detect corrected Paint & Wine to Nova Gorica.)
- build_listings.py: auto-date fallback so undated new content still lists
- pre-commit hook now runs seo_inject.py --all --sitemap first, then
  listings/botlinks, and re-stages changed pages (idempotent)

Docs: docs/geo-offsite-worklist.md - copy-paste-ready off-site plan
(Wikidata, Wikipedia fixes, directories, Google Business, AI-visibility tests).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-07 22:17:03 +02:00
popovskik 2d2e422372 About Us: overlay title on the hero images + rename nav item to "About Us"
- Rework the About Us hero so the eyebrow, title and description are overlaid on
  the auto-rotating team images (centred, white, text-shadowed) exactly like the
  landing hero, instead of sitting in a separate white band above them. Remove the
  old page-header band and move its text into the hero. All three languages.
- Rename the "Who We Are" menu item from "Our team" to "About Us"
  (MK "За нас", SI "O nas") across all pages; footer "About us" link unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 18:47:48 +02:00
popovskik 3eef7a9314 Add pre-commit hook to auto-sync News/homepage/bot pages
Versioned hook at tools/git-hooks/pre-commit runs build_listings.py and
build_botlinks.py on every commit and stages their output, so the News hub,
homepage "Latest news", /llms.txt and /links-for-bots/ always reflect the actual
Blog/Projects/News content — no manual step. Non-blocking: warns and proceeds if
Python or a generator fails. Activated with `git config core.hooksPath tools/git-hooks`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 18:32:55 +02:00
popovskik cf3fce2522 Interconnect News hub + homepage with Blog & Projects (real sync)
Rewrite tools/build_listings.py to treat the Blog, Projects and News detail
pages as the single source of truth. It now regenerates:
  - the News hub grid (all items, newest first, correct dates from ARTICLE_DATES)
  - the homepage "Latest news" block (top 3)
both marker-wrapped. Previously the News hub was hand-maintained with drifted,
hardcoded dates and only some blog posts; now adding a blog/event and running
the script flows through to News and the homepage automatically.

Card links/images are root-relative so they work on any host.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 18:27:40 +02:00
popovskik e12724bbd1 Bot pages: use root-relative links so they work on any host
The generated /links-for-bots/ pages linked to absolute https://msosorg.com/...
URLs, which 404 when the site is served from another host (e.g. local dev, or
before this branch is deployed). Switch the pages' navigation links to
root-relative (/llms.txt, /en/..., /links-for-bots/...). Canonical tags stay
absolute (SEO) and llms.txt keeps absolute URLs (llmstxt.org convention).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 18:18:32 +02:00
popovskik ac052c2b09 Bot pages: expose them in the footer under a "For bots" column
Previously /llms.txt and /links-for-bots/ existed but were not linked anywhere,
so users/bots couldn't find them. Following Proxify's pattern, add a "For bots"
footer column (all 225 pages, EN/MK/SI) linking to category link lists and an
AI summary page.

build_botlinks.py now also generates:
  /links-for-bots/blog|guide|projects/   per-section link lists (EN/MK/SI)
  /links-for-bots/about-msos/            "Hey AI, learn about us" summary
  /links-for-bots/  hub  +  /llms.txt

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 18:12:04 +02:00
popovskik d75dbc1edd Blog: add personal essay "How I coped with leaving home" (trilingual, prose)
Publish Vasil Handziski's personal essay in MK (original) with EN/SI AI-drafted
translations. Adds a prose article variant (no scrollspy sidebar, centred column,
custom byline) via .article-page--prose, plus blog index cards in all languages.
Converter now omits the "last checked" line when empty.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 17:37:14 +02:00
popovskik ae3f5e30c9 Blog: publish trilingual post 5 "Welcome Days" (EN/SI/MK)
Build the Welcome Days article in all three languages from the multilingual
source (# English / # Slovenščina / # Македонски sections + shared sources),
no machine translation. Date registered, SEO injected. Cards already existed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 17:29:03 +02:00
popovskik 3fed4db226 Blog: post 6 "Accommodation" now trilingual (MK/SI AI-drafted)
Add Macedonian and Slovenian versions of the accommodation post (AI-drafted,
flagged for native review), rebuild EN with a proper Student Welcome Guide link
and a real Sources section, and add MK/SI blog index cards. Converter now treats
a secondary "# Sources" heading as a section.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 17:26:32 +02:00
popovskik c7481ca998 Blog: publish trilingual posts 2-4 in EN/MK/SI from source content
Build full articles for "Learning Slovene", "Study in North Macedonia
(government scholarship)" and "Ad futura scholarship" in all three languages,
split from the trilingual Markdown sources (no machine translation). Dates
registered in ARTICLE_DATES and SEO re-injected per page. Blog index cards for
these already existed and now point to real content instead of stubs.

Hero images are placeholders pending topical photos.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 17:16:17 +02:00
popovskik 9d53216b08 Blog: add markdown->page converter + new post "Where to search for accommodation" (EN)
tools/build_blog.py converts a Markdown source into the site's scrollspy blog
article (title, header, hero, sidebar nav from ## headings, body). First output:
the new EN post "Where to search for student accommodation in Slovenia", added at
the top of the blog index (newest first), dated 2026-08-03, SEO injected.

MK/SI of this post and the rest of the blog batch (refresh 1-5, split trilingual
posts 2-4, personal essay post 7) still to come.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 17:09:09 +02:00
popovskik 195a48205c changes.txt #6: sync homepage "Latest news" from the News hub
Add tools/build_listings.py: copies the top 3 cards from each language's News
hub into the homepage "Latest news" block (marker-wrapped), so editing the News
page now updates the homepage. The News hub stays the hand-edited source of truth
(it may hold curated teaser cards without a detail page).

Also: fix the Gallery meta description (was a copy of the FAQ text) and add a
durable gallery override to seo_inject.py; refresh llms.txt / links-for-bots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 16:20:55 +02:00
popovskik c14a227ac7 changes.txt #2: AI/crawler discovery files (llms.txt + links-for-bots)
Add tools/build_botlinks.py which regenerates, from the pages already on disk:
- /llms.txt          llmstxt.org-style Markdown index (English, with descriptions)
- /links-for-bots/   a lightweight fully-linked crawl hub covering EN/MK/SI

Re-run `python tools/build_botlinks.py` after adding or removing pages; it only
reads each page's <title> and meta description, so it stays current automatically.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-05 16:10:38 +02:00
popovskik 661943bb34 feat(assistant): v2 — query-language detection, analytics, chips, auto-index
Addresses real gaps found in testing (a Macedonian question on an English
page returned nothing):

- Detect the language of the QUESTION (Cyrillic -> MK; Slovene markers -> SI;
  else the page language) and load that language's index + curated answers.
  Fixes cross-language questions.
- Expand curated multilingual intents (now incl. enrolment/eVŠ, deadlines,
  health, "what is MSOS", etc.) with stem keywords for better paraphrase
  matching. MK/SI answers machine-drafted — proofread before launch.
- Suggested-question chips on open (localized) to guide users.
- Privacy-safe analytics: fire a GA4 'assistant_query' event ONLY after the
  visitor accepts cookies (q text, result type, question vs page language) so
  the team can see real FAQs and unanswered questions.
- Move the widget to bottom-left on pages with the floating "Become a member"
  CTA so they never overlap. Design polish (chips, typing dots, launcher pulse).
- CI: rebuild the search index on every deploy (setup-python + build script)
  so the assistant stays in sync with content automatically. Build script is
  now path-portable (no hardcoded path).

Verified in a headless browser: MK-on-EN now answers correctly, chips work,
analytics event fires only with consent, become-a-member offset applies,
zero console errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-04 01:48:39 +02:00
popovskik f7f297bd65 feat: offline in-browser "Ask MSOS" assistant (no API, zero cost)
A privacy-friendly help widget that answers visitor questions from the
site's own content and links to the full page — runs 100% in the browser,
no API, no server, no per-token cost.

- tools/build_search_index.py: parses every EN/MK/SI page into ~720
  heading-level chunks per language -> assistant/index-<lang>.json
  (lazy-loaded only when the chat is opened; gzips to ~80 KB).
- assistant.js: dependency-free BM25 search + multilingual stopword
  filtering + a curated short-answer layer for common questions, plus an
  accessible chat widget (role=dialog, keyboard, aria). CSP-safe (self only).
- assistant.css: scoped .msa-* styles in the site's teal palette;
  responsive (full-screen panel on mobile).
- Injected on 208 pages (blog WIP excluded; picks it up when that lands).

Verified in a headless browser across EN/MK/SI: curated answers, search
fallback with correct ranking (rare terms win), correct deep links,
Cyrillic + Slovene diacritics, and zero console errors. Curated MK/SI
answers are machine-drafted — proofread before launch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-04 01:29:22 +02:00
popovskik f24fc704d6 Add GDPR cookie-consent banner (Consent Mode v2)
- consent.js: self-contained, non-blocking bottom banner in EN/MK/SI,
  remembers the choice in localStorage, links to the per-language cookie
  policy. Accept -> gtag consent 'update' granted; Decline stays denied.
- Head GA snippet restores a returning visitor's prior "granted" choice
  before the first hit; loads /consent.js on every page.
- Re-openable via window.msosOpenConsent() for a "manage cookies" link.

Verified in-browser: shows for new visitors, Accept grants + remembers,
reload keeps consent without re-prompting, Slovene text + /si/ policy link.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-02 18:30:35 +02:00
popovskik 9a6d2c335c Add Google Analytics 4 (G-WVYV807VSS) with Consent Mode v2
- gtag.js injected on all 201 pages via tools/seo_inject.py + on 404.html
- Consent Mode v2 defaults all storage to 'denied' (EEA-safe: tag loads,
  no tracking cookies until a consent banner grants analytics_storage)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-02 12:52:19 +02:00
popovskik 788084e094 Add article dates, brand OG image, launch SEO checklist
- Add datePublished/dateModified to Article JSON-LD on the 11 dated
  articles (curated once from EN, applied to all languages)
- Replace og-default.jpg with the official brand OG image (1200x630)
- Add docs/launch-seo-checklist.md (go-live steps: redirects, Search
  Console, analytics, rich-result validation, monitoring)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-02 12:38:20 +02:00
popovskik 314667f692 SEO polish: OG image, favicons, 404, article schema, image optimization
- Add branded 1200x630 og-default.jpg; article pages use their hero as
  og:image, others use the default
- Wire the existing (previously unlinked) favicon set into every page
- Add branded 404.html with root-absolute paths + noindex
- Emit Article + localized BreadcrumbList JSON-LD on all article pages
- Convert 74 heavy served photos to WebP (28MB -> 8.5MB, -70%), rewrite
  references, add loading=lazy/decoding=async to below-fold images and
  fetchpriority=high to heroes (protect LCP)
- Stop tracking images/original/ (458MB of unused source masters; kept on
  disk, gitignored) and ignore .playwright-mcp/

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-02 12:15:53 +02:00
popovskik b393859467 Add technical SEO foundation, MK/SI about-us + timeline, content fixes
SEO (all 201 pages, en/mk/si):
- Inject canonical, hreflang (en/mk/sl + x-default), Open Graph, Twitter
  cards and Organization JSON-LD via idempotent SEO:START/END block
- Generate multilingual sitemap.xml (xhtml:link alternates) + robots.txt
- Curated meta descriptions for lead-less pages (home, become-a-member,
  faq, news hub, my-route); every page now has a description
- Absolute URLs target final domain msosorg.com, not the temp host
- Add reusable tools/seo_inject.py (+ README)

Content fixes:
- Translate about-us and timeline-and-milestones into MK + SI, wire up
  their pages, and repair the previously-dead "Who We Are" nav links
  across all mk/si pages
- Remove duplicate en/projects/makedonska-studentska-vecer-vo-ljubljana
  (unreferenced; already covered by macedonian-student-night-in-ljubljana)

Locale correctness:
- Normalise Slovene pages to <html lang="sl"> (correct ISO 639-1)
- Map sl->si in main.js so the language-switcher highlight and newsletter
  i18n keep working on Slovene pages (data-lang="si" still maps to /si/)

MK/SI translations and descriptions are AI-drafted; flag for native review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-02 11:43:10 +02:00