- Add shared BlogMD renderer (static/js/markdown.js): marked + DOMPurify
+ highlight.js pipeline with GFM support, heading id slugger with
CJK-aware anchors, syntax highlighting, per-block copy button and
language badge, lazy images with lightbox, external links opened
safely in new tabs, tables wrapped for small screens.
- Add .md-body typography styles (static/css/markdown.css) so articles,
comments and editor previews render with proper headings, tables,
lists, blockquotes and code blocks (previously the prose classes had
no effect because the Tailwind typography plugin is not loaded).
- Fix marked options that were set after parsing and removed from
marked v4+ (mangle/headerIds no-ops).
- Pin CDN versions (marked 15.0.12, dompurify 3.4.13, highlight.js
11.12.0) instead of floating 'latest' URLs.
- Wire EasyMDE preview/side-by-side to BlogMD in admin and user
article editors; use BlogMD for comment bodies on the article page,
admin comment list and comment preview.
- Serve /static in main.go and deploy it in install_linux.sh.
- Add custom publish time field to article create/edit forms
- Support datetime-local input for manual time setting
- Auto-set on first publish if left blank
- Works for both admin and user article forms
- Display last updated time on article detail page
- Show both published time and last updated time
- Auto-maintained by GORM on each update
- Format: YYYY-MM-DD HH:MM
- Add i18n support for new fields
- article_published_at: Published Time / 发布时间
- article_published_at_hint: Leave blank to auto-set on publish / 留空则在发布时自动设置
- article_last_updated: Last Updated / 最后更新
- Update handlers and templates
- handlers/article.go: Add parsePublishedAt/formatPublishedAt functions
- handlers/home.go: Add formatUpdateTime function
- handlers/my_articles.go: Support custom publish time in user articles
- templates: Add datetime-local inputs and time display
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Add AdminRequired middleware to all /admin routes for proper authorization
- Restrict admin panel, comments, users, settings to admin role only
- Create separate /my/articles routes for regular users to manage their own articles
- Add MyArticlesPage handler for users to view/edit/delete their own content
- Update navigation menus with role-based visibility
- Admin dropdown shows only 'Admin Panel' link, other features in dashboard
- Regular users see 'My Articles' link in profile dropdown
- Add i18n translations for 'my_articles' and 'comment_manage' keys
- Fix permission boundary issues where author role could access admin settings
Security improvements:
- Platform settings now require admin role
- Comment moderation requires admin role
- User management requires admin role
- Regular users can only manage their own articles
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>