docs: 开发规范/教程/demo 全套 + 修复插件运行期自动加载缺口
- demo 插件 plugins/demo.hello-world:演示短代码过滤器、comment.created 钩子、路由+命名空间视图、迁移+模型、后台设置页、filament.post_form 表单注入 - demo 主题 themes/demo:最小可运行主题(覆盖 partials + 绿色系样式) - 教程 docs/tutorial-plugin.md / docs/tutorial-theme.md(10 分钟上手);规范 docs/development.md(代码/插件/主题/队列/测试/提交) - README 增加开发者文档导航与上手示例 - 修复关键缺口:插件类原来靠 composer.json 硬编码加载,第三方 ZIP 安装的插件无法加载;现改为启动时扫描 plugins/*/src 运行期注册 PSR-4(register 阶段,保证 Filament 面板解析插件页面前就绪),composer.json 移除硬编码 - 测试:demo 插件 3 个用例 + demo 主题渲染;全量 89 通过
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
/* Demo 主题:绿色系,仅演示核心布局。新主题请参照 sablog/modern 补全移动端断点 */
|
||||
:root {
|
||||
--d-accent: #059669;
|
||||
--d-accent-dark: #047857;
|
||||
--d-bg: #f6f8f7;
|
||||
--d-text: #1f2937;
|
||||
--d-muted: #6b7280;
|
||||
--d-border: #e2e8e4;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
||||
background: var(--d-bg);
|
||||
color: var(--d-text);
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
a { color: var(--d-accent); text-decoration: none; }
|
||||
a:hover { color: var(--d-accent-dark); }
|
||||
|
||||
.d-container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
|
||||
|
||||
/* 头部 */
|
||||
.d-header { background: #fff; border-bottom: 3px solid var(--d-accent); }
|
||||
.d-header .d-container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 14px; padding-bottom: 14px; }
|
||||
.d-logo { font-size: 20px; font-weight: 800; color: var(--d-accent); }
|
||||
.d-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
|
||||
.d-nav a.active { color: var(--d-accent-dark); font-weight: 700; }
|
||||
.d-search input { border: 1px solid var(--d-border); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
|
||||
.d-link-btn { background: none; border: none; color: var(--d-accent); cursor: pointer; font-size: 14px; }
|
||||
|
||||
/* 主体两栏 */
|
||||
.main-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; padding: 24px 16px; }
|
||||
.main-layout .content { min-width: 0; }
|
||||
|
||||
/* 内容卡片(默认视图自带 .post-card/.post-full/.list-title 等类) */
|
||||
.post-card, .post-full, .comments-section, .alert, .toc, .paywall {
|
||||
background: #fff;
|
||||
border: 1px solid var(--d-border);
|
||||
border-radius: 10px;
|
||||
padding: 16px 18px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
/* 侧边栏 */
|
||||
.widget { background: #fff; border: 1px solid var(--d-border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
|
||||
.widget h3 { margin: 0 0 10px; font-size: 14px; color: var(--d-accent-dark); }
|
||||
|
||||
/* 页脚 */
|
||||
.d-footer { background: #fff; border-top: 3px solid var(--d-accent); text-align: center; font-size: 13px; color: var(--d-muted); padding: 18px 0; margin-top: 24px; }
|
||||
.d-footer p { margin: 4px 0; }
|
||||
|
||||
/* 按钮 */
|
||||
.btn { display: inline-block; background: var(--d-accent); color: #fff; border: none; padding: 8px 18px; border-radius: 6px; font-size: 14px; cursor: pointer; }
|
||||
.btn:hover { background: var(--d-accent-dark); color: #fff; }
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.main-layout { grid-template-columns: 1fr; }
|
||||
.d-header .d-container { flex-direction: column; align-items: flex-start; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"title": "Demo 演示主题",
|
||||
"version": "1.0.0",
|
||||
"description": "主题开发教程配套示例:只覆盖 partials(head/header/footer)+ 自定义配色,其余页面回退默认视图",
|
||||
"author": "LaraLog",
|
||||
"inject_points": [
|
||||
"head",
|
||||
"header",
|
||||
"footer"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<footer class="d-footer">
|
||||
<div class="d-container">
|
||||
<p>© {{ date('Y') }} {{ $siteName }}@if($siteIcp) · <a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">{{ $siteIcp }}</a>@endif</p>
|
||||
<p>由 LaraLog 驱动 · Demo 主题</p>
|
||||
</div>
|
||||
</footer>
|
||||
@stack('theme:footer')
|
||||
@stack('theme:body_end')
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ $pageTitle ?? $siteName }}</title>
|
||||
<meta name="description" content="{{ $pageDescription ?? $siteDescription }}">
|
||||
@if(($pageKeywords ?? '') !== '')
|
||||
<meta name="keywords" content="{{ $pageKeywords }}">
|
||||
@endif
|
||||
<meta name="generator" content="LaraLog">
|
||||
<link rel="canonical" href="{{ url()->current() }}">
|
||||
<link rel="alternate" type="application/rss+xml" title="{{ $siteName }}" href="{{ route('feed.rss') }}">
|
||||
{{-- 主题资产:/themes/demo/assets/style.css --}}
|
||||
<link rel="stylesheet" href="{{ theme('asset', 'style.css') }}">
|
||||
@stack('head')
|
||||
@stack('theme:head')
|
||||
</head>
|
||||
@@ -0,0 +1,25 @@
|
||||
<header class="d-header">
|
||||
<div class="d-container">
|
||||
<a href="{{ route('home') }}" class="d-logo">{{ $siteName }}</a>
|
||||
<nav class="d-nav">
|
||||
<a href="{{ route('home') }}" class="{{ request()->routeIs('home') ? 'active' : '' }}">首页</a>
|
||||
<a href="{{ route('archives') }}" class="{{ request()->routeIs('archives*') ? 'active' : '' }}">归档</a>
|
||||
<a href="{{ route('tags') }}" class="{{ request()->routeIs('tags*') ? 'active' : '' }}">标签</a>
|
||||
<a href="{{ route('links') }}" class="{{ request()->routeIs('links') ? 'active' : '' }}">友链</a>
|
||||
<form class="d-search" action="{{ route('search') }}" method="get">
|
||||
<input type="search" name="q" placeholder="搜索..." value="{{ request('q', request('keyword', '')) }}">
|
||||
</form>
|
||||
@auth
|
||||
<a href="{{ route('profile') }}">{{ auth()->user()->name }}</a>
|
||||
<form action="{{ route('logout') }}" method="post" class="inline-form">
|
||||
@csrf
|
||||
<button type="submit" class="d-link-btn">退出</button>
|
||||
</form>
|
||||
@else
|
||||
<a href="{{ route('login') }}">登录</a>
|
||||
<a href="{{ route('register') }}">注册</a>
|
||||
@endauth
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
@stack('theme:header')
|
||||
Reference in New Issue
Block a user