Let admin and editor open /admin in a new tab from the public header and profile, so they can jump to the backend without leaving the site. Co-authored-by: Cursor <cursoragent@cursor.com>
4.9 KiB
4.9 KiB
LaraLog Features
Modern blog migrated from SaBlog-X: Filament admin, themes, plugins, sablog import, S3 attachments, Workerman AI queue.
Local development
- Site: http://laralog.test
- Admin: http://laralog.test/admin
- Account:
admin@laralog.test/password - Database: MySQL
laralog(Herd, root / empty password) - Remote:
git@gitea.neatcn.com:gouki/laralog.git
See README.md and docs/ for install, import, plugins, and themes.
Post editor layout
- Create/edit post uses left 2 : right 1 on PC at every breakpoint (not only
lg). - Left: title, full-width slug, category + format + status on one row (single-choice buttons), cover thumbnail (not full-width), then a tall body editor.
- Right group 1: published at, sticky level (none / light / strong / headline), comment status, excerpt, keywords.
- Right group 2: read password; membership plugin adds members-only + price here.
- Plugins must inject via
PostForm::appendToSidebar()/appendToAccessSection()so they do not break the 2:1 grid.
Sticky levels
sticky_level: 0 none, 1 light, 2 strong, 3 headline. Headline always stays first on home, category, tag, and search lists.- Saving a post keeps
is_stickyin sync (truewhen level > 0) so older themes still work. - List badges show the Chinese label, not a generic “sticky”.
Post preview
- Edit page and post table have 预览, opening
/show-{id}.shtmlin a new tab. - Filament v5 actions are
Filament\Actions\Action. The comments relation manager on the edit page must boot in tests, because a staleTables\Actions\Actionimport only fails when that Livewire table renders. - Guests still get 404 for drafts. Admin and editor can open unpublished posts and see a preview banner.
Frontend admin shortcut
- After login, admin and editor see 管理 in the site header. It opens
/adminin a new tab. - Regular members do not see it. The profile page has the same link for staff.
Admin chrome
- Top-right badge shows the current app environment (
local/prod/ others). - Top-right 网站 opens the public site in a new tab; 写文章 jumps to
/admin/posts/create. - Sidebar 管理 includes 页面缓存 (view URLs, hit rate, flush) and 语言 (current locale + available packs). Article translations are not built yet; the language page says so.
- Sidebar nav is compacted (Filament default
gap-y-7/py-8is too tall for this site).
Hello World plugin
- Enabling a plugin now runs that plugin's
database/migrationsautomatically. - Plugin boot / hook failures are isolated so one plugin cannot take down the whole admin.
/hello-worldstays available even ifhello_world_logsis missing.
Frontend feeds
- Header/footer RSS / Sitemap / llms.txt open in a new tab (
target="_blank"). /llms.txtis a core route (not a static file). Each request lists current published public posts so new articles show up immediately.- Full text for agents:
/posts/{slug}.md. Password / members-only posts are omitted. - These machine-readable paths are excluded from page cache.
Homepage list / full mode
- Same switch as old SaBlog: 浏览模式: 标准 | 列表.
list= title + excerpt cards.full= full rendered body on the home / category / tag / search lists.- Query
?view=listor?view=fullwins, then cookiell_home_view, then settinghome_view_mode. - Page cache key includes the view mode so the two layouts are not mixed.
Pagination and imported HTML
- Public pagers use
onEachSide(1)plus a compact6 / 316chip (old SaBlog.p_barlook), and the main column is CSS gridminmax(0, 1fr)so page chips stay in the content column. SablogHtmlNormalizerstrips leftover , turns SyntaxHighlightercodeText/dp-*lists into<pre><code>, and wraps stacked docker/shell<div>lines.- Render path always normalizes, so already-imported posts look right without rewriting the database. Persist with
php artisan sablog:fix-content --all. - Code blocks wrap / scroll inside the column instead of stretching the page.
Theme ads / inject
- All list and post views include
content_top/content_bottom(and post body) stacks. Saving 主题注入 flushes page cache. - Theme variables (old stylevars) render automatically:
ad_header→ header, leftover HTML vars such ashuangjinlian→ footer. sablog:importnow copies the oldstylevarstable intotheme_vars_{theme}.- Do not add a third half-finished skin. Tighten
sablogto match the old site; a new theme is a later, complete job.
Media library (xpier)
- Package:
xpier/filament-media-library(admin Media Library + MediaPicker). - Markdown body must store
or[name](media:ID), never a CDN/object-storage URL. HTML uses[media=ID]. - Insert flow: pick a file → Insert into body. Cover uses
cover_media_id. - Legacy sablog
[attach=ID]/{{attach:ID}}still render from Spatie media. - Details:
docs/media.md.