M7: Templates port + HTML5 semantic markup#17
Merged
Merged
Conversation
Foundation for the M7 templates port:
- base.html with HTML5 semantic skeleton (header / main / aside /
footer). Includes a NOINDEX meta for private/secret-URL sites,
matches the 2007 behavior.
- partials/site_header.html — site title, subtitle, primary nav
(recent changes / settings / design / signin·signout). Shows a
"Claim this site" banner above the header when the site is
unclaimed.
- partials/site_sidebar.html — page list + new-page form.
- partials/design_style.html — exposes the design row as CSS custom
properties (--header-color, --title-font, etc) so the M9
stylesheet rewrite can reference them without coordinating with
this template.
- partials/form_error.html — inline form error block.
- jottit/chrome.py — Flask context_processor that surfaces site,
pages, design, is_signed_in, is_unclaimed, and a few helpers to
every template.
- list_pages() DB helper for the sidebar.
Two simple existing templates (notfound, deleted) are ported to
{% extends "base.html" %} as a smoke test. The bigger
view/edit/admin/history templates land in subsequent commits.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the M2 placeholder textarea-only form with a real front page: hero with the Jottit tagline, a content textarea, and an optional custom-subdomain field that funnels into `public_url` on the index POST handler. The form is autofocused on the textarea and lives in a single <article> so the apex page reads cleanly even without the per-site chrome (header / sidebar are hidden when g.site is None). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
view_page now extends base.html, uses semantic <article> / <header> / <footer> / <time>, and exposes RSS / JSON Feed `<link rel="alternate">` in the head. Browsing an old revision (?r=N) gets a banner with prev/next/latest navigation and a "Revert page to this revision" form for editors. edit_page extends base.html with a single edit form; Save and Cancel sit alongside a Delete button on named pages (Delete is hidden for the home page since it can't be deleted). new_site() now seeds the design row with `system-ui, sans-serif` instead of `Lucida_Grande` — the default reaches the visitor's OS font without shipping a webfont, and the value still works as a literal font-family in the design CSS custom property. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
claim_site, signin, forgot_password, and change_password now all extend base.html and use the shared form_error partial. Each one is a single <article> with semantic <header>, <form>, <fieldset> / <legend> for grouped radio inputs, and <button> elements (no more <input type="submit">). Also fixes a relative-URL bug in the placeholder signin template: its "Forgot your password?" link pointed at "site/forgot-password", which from /site/signin resolves to /site/site/forgot-password. The new template uses a bare "forgot-password" sibling href. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
All five admin templates now extend base.html and share the form chrome via the form_error partial: - admin_settings: title / subtitle / email / security plus a nav list of the other admin pages (change-site-address, change- password, design, export, delete). - admin_change_site_address: single input with pattern hint. - admin_change_password: current + new password. - admin_design: <fieldset>-grouped 13-field design form. - admin_delete: confirmation form with a destructive-styled button. <button type="submit"> throughout (no more <input type="submit">); destructive actions get a .destructive class hook so M9 can style them red. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Extend base.html and use semantic markup (article, header, ol, time). History and changes templates link RSS/JSON feed alternates from <head>. Diff body wrapped in a <section class="diff-body">. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ties) Five-file split so the M8 CSS rewrite has clean seams: - tokens.css: design custom properties + spacing scale - reset.css: small custom reset - base.css: element-level styling (h1-h6, a, button, inputs, code, …) - components.css: layout + named regions (.page grid, .site-header, .revisions, .revision-banner, .form, …) - utilities.css: one-off helpers (.visually-hidden, .muted-ish) Linked from base.html with five separate <link> tags so HTTP/2 can serve them in parallel and each file rewrites independently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port the 2007 Jinja 1 templates to Jinja2 over modern HTML5 semantic markup, with a shared base layout and partials so the placeholder templates from M3-M6 stop duplicating doctype + chrome.
Approach
base.htmlcarries doctype,<head>, header / main / aside / footer.partials/site_header.html,partials/site_sidebar.html,partials/design_style.html,partials/form_error.htmlhold the shared chrome.jottit/chrome.pyis a Flaskcontext_processorthat exposessite,pages,design,is_signed_in,is_unclaimed,site_root_path,page_slugto every template.Test plan
base.html+ partials + context processor + portnotfound.html/deleted.htmlindex.html)🤖 Generated with Claude Code