Complete implementation of v1.2.0 "IndieWeb Features" release. ## Phase 1: Custom Slugs - Optional custom slug field in note creation form - Auto-sanitization (lowercase, hyphens only) - Uniqueness validation with auto-numbering - Read-only after creation to preserve permalinks - Matches Micropub mp-slug behavior ## Phase 2: Author Discovery + Microformats2 - Automatic h-card discovery from IndieAuth identity URL - 24-hour caching with graceful fallback - Never blocks login (per ADR-061) - Complete h-entry, h-card, h-feed markup - All required Microformats2 properties - rel-me links for identity verification - Passes IndieWeb validation ## Phase 3: Media Upload - Upload up to 4 images per note (JPEG, PNG, GIF, WebP) - Automatic optimization with Pillow - Auto-resize to 2048px - EXIF orientation correction - 95% quality compression - Social media-style layout (media top, text below) - Optional captions for accessibility - Integration with all feed formats (RSS, ATOM, JSON Feed) - Date-organized storage with UUID filenames - Immutable caching (1 year) ## Database Changes - migrations/006_add_author_profile.sql - Author discovery cache - migrations/007_add_media_support.sql - Media storage ## New Modules - starpunk/author_discovery.py - h-card discovery and caching - starpunk/media.py - Image upload, validation, optimization ## Documentation - 4 new ADRs (056, 057, 058, 061) - Complete design specifications - Developer Q&A with 40+ questions answered - 3 implementation reports - 3 architect reviews (all approved) ## Testing - 56 new tests for v1.2.0 features - 842 total tests in suite - All v1.2.0 feature tests passing ## Dependencies - Added: mf2py (Microformats2 parser) - Added: Pillow (image processing) Version: 1.2.0-rc.1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
71 lines
2.2 KiB
HTML
71 lines
2.2 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}{{ note.slug }} - StarPunk{% endblock %}
|
|
|
|
{% block content %}
|
|
<article class="h-entry">
|
|
{# Detect if note has explicit title (starts with # heading) - per Q22 #}
|
|
{% set has_explicit_title = note.content.strip().startswith('#') %}
|
|
|
|
{# p-name only if note has explicit title (per Q22) #}
|
|
{% if has_explicit_title %}
|
|
<h1 class="p-name">{{ note.title }}</h1>
|
|
{% endif %}
|
|
|
|
{# Media display at TOP (v1.2.0 Phase 3, per ADR-057) #}
|
|
{% if note.media %}
|
|
<div class="note-media">
|
|
{% for item in note.media %}
|
|
<figure class="media-item">
|
|
<img src="{{ url_for('public.media_file', path=item.path) }}"
|
|
alt="{{ item.caption or 'Image' }}"
|
|
class="u-photo"
|
|
width="{{ item.width }}"
|
|
height="{{ item.height }}">
|
|
{% if item.caption %}
|
|
<figcaption>{{ item.caption }}</figcaption>
|
|
{% endif %}
|
|
</figure>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{# e-content: note content BELOW media (per ADR-057) #}
|
|
<div class="e-content">
|
|
{{ note.html|safe }}
|
|
</div>
|
|
|
|
<footer class="note-meta">
|
|
{# u-url and u-uid same for notes (per Q23) #}
|
|
<a class="u-url u-uid" href="{{ url_for('public.note', slug=note.slug, _external=True) }}">
|
|
<time class="dt-published" datetime="{{ note.created_at.isoformat() }}">
|
|
{{ note.created_at.strftime('%B %d, %Y at %I:%M %p') }}
|
|
</time>
|
|
</a>
|
|
|
|
{# dt-updated if note was modified #}
|
|
{% if note.updated_at and note.updated_at != note.created_at %}
|
|
<span class="updated">
|
|
(Updated: <time class="dt-updated" datetime="{{ note.updated_at.isoformat() }}">{{ note.updated_at.strftime('%B %d, %Y') }}</time>)
|
|
</span>
|
|
{% endif %}
|
|
|
|
{# Author h-card (nested within h-entry per Q20) #}
|
|
{% if author %}
|
|
<div class="p-author h-card">
|
|
<a class="p-name u-url" href="{{ author.url or author.me }}">
|
|
{{ author.name or author.url or author.me }}
|
|
</a>
|
|
{% if author.photo %}
|
|
<img class="u-photo" src="{{ author.photo }}" alt="{{ author.name or 'Author' }}" width="48" height="48">
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</footer>
|
|
|
|
<nav class="note-nav">
|
|
<a href="/">Back to all notes</a>
|
|
</nav>
|
|
</article>
|
|
{% endblock %}
|