feat(templates): Add microformats2 h-feed and p-category markup for tags

Implement Phase 2 of v1.3.0 per microformats-tags-design.md

Template Updates:
- templates/index.html: Add h-feed properties (u-url, enhanced p-author with u-photo/p-note, feed-level u-photo)
- templates/index.html: Add p-category markup with rel="tag" to note previews
- templates/note.html: Add p-category markup with rel="tag" for tags
- templates/note.html: Enhance author h-card with u-photo and p-note (hidden for parsers)
- templates/note.html: Document u-photo placement outside e-content per draft spec
- templates/tag.html: Create new tag archive template with h-feed structure

Key Decisions Applied:
- Tags ordered alphabetically by display_name (ready for backend)
- rel="tag" on all p-category links per microformats2 spec
- Author bio (p-note) hidden with display: none for semantic parsing
- Dual u-photo elements intentional for parser compatibility
- Graceful fallback when author photo/bio not available

Templates are backward compatible and ready for backend integration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-10 11:35:11 -07:00
parent f10d0679da
commit 377027e79a
4 changed files with 251 additions and 5 deletions

View File

@@ -13,7 +13,8 @@
<h1 class="p-name">{{ note.title }}</h1>
{% endif %}
{# Media display at TOP (v1.2.0 Phase 3, per ADR-057) #}
{# u-photo placement: Per draft spec, u-photo must be direct child of h-entry, #}
{# NOT inside e-content. Media is rendered ABOVE e-content to meet this requirement. #}
{{ display_media(note.media) }}
{# e-content: note content BELOW media (per ADR-057) #}
@@ -36,14 +37,29 @@
</span>
{% endif %}
{# Tags / Categories #}
{# rel="tag" per microformats2 p-category specification #}
{% if note.tags %}
<div class="note-tags">
{% for tag in note.tags %}
<a class="p-category" rel="tag" href="{{ url_for('public.tag', tag=tag.name) }}">
{{ tag.display_name }}
</a>
{% endfor %}
</div>
{% endif %}
{# Author h-card (nested within h-entry per Q20) #}
{% if author %}
<div class="p-author h-card">
{% if author.photo %}
<img class="u-photo" src="{{ author.photo }}" alt="{{ author.name or 'Author' }}" width="48" height="48">
{% endif %}
<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">
{% if author.note %}
<span class="p-note" style="display: none;">{{ author.note }}</span>
{% endif %}
</div>
{% endif %}