Rebuild Laysense site with Webman and SQLite CMS
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<?php if ($articles): ?>
|
||||
<ul class="admin-list">
|
||||
<?php foreach ($articles as $item): ?>
|
||||
<li>
|
||||
<div><strong><?= $e($item['title']) ?></strong>
|
||||
<small><?= $e(Repository::CATEGORIES[$item['category']]) ?> · <?= $item['status'] === 'published' ? '已发布' : '草稿' ?> · <?= $e(View::date($item['updated_at'])) ?></small>
|
||||
</div>
|
||||
<a class="button button-outline" href="/admin/articles/<?= $e($item['id']) ?>">编辑文章</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p class="empty-state">暂无文章。</p>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<a class="back-link" href="/admin/articles">返回文章列表</a>
|
||||
<header class="admin-heading">
|
||||
<h1><?= $e($title) ?></h1>
|
||||
<?php if ($articleId && $article['status'] === 'published' && $article['slug'] !== ''): ?>
|
||||
<a class="button button-outline" href="/articles/<?= $e($article['slug']) ?>">查看公开页面</a>
|
||||
<?php endif ?>
|
||||
</header>
|
||||
<?= View::fragment('admin-feedback', compact('error', 'saved')) ?>
|
||||
<form class="admin-form admin-panel" method="post" action="/admin/articles/<?= $e($articleId ?? 'new') ?>">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="version" value="<?= $e($article['version']) ?>">
|
||||
<label>文章标题<input name="title" value="<?= $e($article['title']) ?>" required maxlength="120"></label>
|
||||
<div class="form-grid">
|
||||
<label>网址标识<input name="slug" value="<?= $e($article['slug']) ?>" required maxlength="100" pattern="[a-z0-9]+(-[a-z0-9]+)*" placeholder="product-update"><small>使用小写英文字母、数字和连字符。</small></label>
|
||||
<label>分类<select name="category">
|
||||
<?php foreach (Repository::CATEGORIES as $key => $label): ?>
|
||||
<option value="<?= $e($key) ?>" <?= $article['category'] === $key ? 'selected' : '' ?>><?= $e($label) ?></option>
|
||||
<?php endforeach ?>
|
||||
</select></label>
|
||||
</div>
|
||||
<label>标签<input name="tags" value="<?= $e(implode(',', $article['tags'])) ?>" placeholder="用逗号分隔"></label>
|
||||
<label>摘要<textarea name="summary" rows="2" maxlength="250"><?= $e($article['summary']) ?></textarea><small>用于动态列表和搜索摘要。</small></label>
|
||||
<?= View::fragment('admin-editor', ['format' => 'markdown', 'body' => $article['body']]) ?>
|
||||
<div class="form-submit">
|
||||
<label>发布状态<select name="status">
|
||||
<option value="draft" <?= $article['status'] === 'draft' ? 'selected' : '' ?>>草稿</option>
|
||||
<option value="published" <?= $article['status'] === 'published' ? 'selected' : '' ?>>已发布</option>
|
||||
</select></label>
|
||||
<button class="button button-primary" type="submit">保存文章</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
?>
|
||||
<header class="admin-heading">
|
||||
<h1>文章与动态</h1>
|
||||
<a class="button button-primary" href="/admin/articles/new">新建文章</a>
|
||||
</header>
|
||||
<div class="admin-panel">
|
||||
<?= View::fragment('admin-article-list', ['articles' => $articles]) ?>
|
||||
</div>
|
||||
<?php if ($pageNumber > 1 || $hasNext): ?>
|
||||
<nav class="pagination" aria-label="文章分页">
|
||||
<?php if ($pageNumber > 1): ?><a class="button button-outline" href="/admin/articles?page=<?= $pageNumber - 1 ?>">上一页</a><?php endif ?>
|
||||
<span>第 <?= $pageNumber ?> 页</span>
|
||||
<?php if ($hasNext): ?><a class="button button-outline" href="/admin/articles?page=<?= $pageNumber + 1 ?>">下一页</a><?php endif ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<header class="admin-heading">
|
||||
<div><h1>内容管理</h1><p>管理网站页面、文章、公告和产品动态。</p></div>
|
||||
<a class="button button-primary" href="/admin/articles/new">新建文章</a>
|
||||
</header>
|
||||
<section class="admin-panel" aria-labelledby="pages-title">
|
||||
<h2 id="pages-title">网站页面</h2>
|
||||
<ul class="admin-list">
|
||||
<?php foreach ($pages as $page): ?>
|
||||
<li>
|
||||
<div><strong><?= $e($page['name']) ?></strong><small><?= $e($page['slug'] === 'home' ? '/' : '/' . $page['slug']) ?></small></div>
|
||||
<a class="button button-outline" href="/admin/pages/<?= $e($page['slug']) ?>">编辑页面</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="admin-panel" aria-labelledby="recent-title">
|
||||
<div class="admin-heading compact"><h2 id="recent-title">最近编辑的文章</h2><a href="/admin/articles">管理全部文章</a></div>
|
||||
<?= View::fragment('admin-article-list', ['articles' => $articles]) ?>
|
||||
</section>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<div class="editor" data-editor data-format="<?= $format ?>">
|
||||
<label for="editor-text">正文(<?= $format === 'markdown' ? 'Markdown' : 'HTML' ?>)</label>
|
||||
<div class="editor-toolbar">
|
||||
<div role="group" aria-label="插入格式">
|
||||
<button type="button" data-insert="heading">小标题</button>
|
||||
<button type="button" data-insert="bold">粗体</button>
|
||||
<button type="button" data-insert="list">列表</button>
|
||||
<button type="button" data-insert="link">链接</button>
|
||||
</div>
|
||||
<button data-preview-button type="button" aria-controls="editor-preview" aria-expanded="false">预览正文</button>
|
||||
</div>
|
||||
<textarea id="editor-text" name="body" rows="15" spellcheck="false"><?= $e($body) ?></textarea>
|
||||
<?php if ($format === 'html'): ?>
|
||||
<p class="field-note">支持段落、标题、链接、图片、列表、表格和折叠问答。保存时会清理脚本、内联样式等标签或属性。</p>
|
||||
<?php endif ?>
|
||||
<div class="editor-preview rich prose" id="editor-preview" aria-live="polite" hidden></div>
|
||||
</div>
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1><?= App\Content\View::escape($title) ?></h1>
|
||||
<a class="button button-primary" href="/admin">返回内容管理</a>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php use App\Content\View; ?>
|
||||
<?php if ($error): ?><p class="feedback error" role="alert"><?= View::escape($error) ?></p><?php endif ?>
|
||||
<?php if ($saved && !$error): ?><p class="feedback success" role="status">已保存。</p><?php endif ?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title><?= $e($title) ?> · 来笙 CMS</title>
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="stylesheet" href="/assets/site.css">
|
||||
<link rel="stylesheet" href="/assets/admin.css">
|
||||
<script src="/assets/admin.js" defer></script>
|
||||
</head>
|
||||
<body class="admin-body">
|
||||
<a class="skip-link" href="#admin-content">跳到内容</a>
|
||||
<header class="admin-bar">
|
||||
<div class="admin-wrap admin-bar-inner">
|
||||
<a class="wordmark" href="/admin" aria-label="来笙内容管理首页"><img src="/assets/wordmark.webp" alt="来笙 Laysense" width="130" height="33"></a>
|
||||
<?php if ($user): ?>
|
||||
<nav aria-label="后台导航">
|
||||
<a href="/admin">页面</a>
|
||||
<a href="/admin/articles">文章</a>
|
||||
<a href="/">访问网站</a>
|
||||
<form method="post" action="/admin/logout">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<button class="button button-outline" type="submit">退出</button>
|
||||
</form>
|
||||
</nav>
|
||||
<?php else: ?>
|
||||
<a class="back-link" href="/">返回网站</a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</header>
|
||||
<main class="admin-wrap admin-main" id="admin-content"><?= $content ?></main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<div class="login-box">
|
||||
<h1>登录内容管理</h1>
|
||||
<p>编辑来笙网站的页面、公告和文章。</p>
|
||||
<?php if ($error): ?><p class="feedback error" role="alert"><?= $e($error) ?></p><?php endif ?>
|
||||
<form class="admin-form" method="post" action="/admin/login">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<label>管理员邮箱<input name="email" type="email" value="<?= $e($email) ?>" autocomplete="username" required maxlength="254"></label>
|
||||
<label>密码<input name="password" type="password" autocomplete="current-password" required></label>
|
||||
<button class="button button-primary" type="submit">登录</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$slug = $page['slug'];
|
||||
?>
|
||||
<a class="back-link" href="/admin">返回内容管理</a>
|
||||
<header class="admin-heading">
|
||||
<h1><?= $e($title) ?></h1>
|
||||
<a class="button button-outline" href="<?= $e($slug === 'home' ? '/' : '/' . $slug) ?>">查看公开页面</a>
|
||||
</header>
|
||||
<?= View::fragment('admin-feedback', compact('error', 'saved')) ?>
|
||||
<form class="admin-form admin-panel" method="post" action="/admin/pages/<?= $e($slug) ?>">
|
||||
<h2>首屏与 SEO</h2>
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="version" value="<?= $e($page['version']) ?>">
|
||||
<label>SEO 标题<input name="title" value="<?= $e($page['title']) ?>" required maxlength="160"></label>
|
||||
<label>SEO 描述<textarea name="description" rows="3" required maxlength="300"><?= $e($page['description']) ?></textarea></label>
|
||||
<div class="form-grid">
|
||||
<label>首屏标题<input name="heading" value="<?= $e($page['heading']) ?>" required maxlength="110"></label>
|
||||
<label>标题第二行<input name="accent" value="<?= $e($page['accent']) ?>" maxlength="110"></label>
|
||||
</div>
|
||||
<label>首屏简介<textarea name="lead" rows="3" maxlength="600"><?= $e($page['lead']) ?></textarea></label>
|
||||
<div class="form-grid">
|
||||
<label>首屏图片地址<input name="image" value="<?= $e($page['image']) ?>" maxlength="1000"></label>
|
||||
<label>图片替代文本<input name="alt" value="<?= $e($page['alt']) ?>" maxlength="200"></label>
|
||||
</div>
|
||||
<?php foreach ([1, 2] as $index): ?>
|
||||
<div class="form-grid">
|
||||
<label>按钮 <?= $index ?> 文案<input name="label<?= $index ?>" value="<?= $e($page['actions'][$index - 1][1] ?? '') ?>" maxlength="50"></label>
|
||||
<label>按钮 <?= $index ?> 链接<input name="url<?= $index ?>" value="<?= $e($page['actions'][$index - 1][0] ?? '') ?>" maxlength="1000"></label>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
<div class="form-submit"><button class="button button-primary" type="submit">保存页面</button></div>
|
||||
</form>
|
||||
<section class="admin-panel">
|
||||
<h2>内容区块</h2>
|
||||
<ul class="admin-list">
|
||||
<?php foreach ($page['sections'] as $item): ?>
|
||||
<li>
|
||||
<div><strong><?= $e($item['title']) ?></strong><small>#<?= $e($item['key']) ?></small></div>
|
||||
<a class="button button-outline" href="/admin/pages/<?= $e($slug) ?>/<?= $e($item['key']) ?>">编辑区块</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</section>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$slug = $section['page_slug'];
|
||||
$key = $section['key'];
|
||||
?>
|
||||
<a class="back-link" href="/admin/pages/<?= $e($slug) ?>">返回页面编辑</a>
|
||||
<header class="admin-heading">
|
||||
<div><h1><?= $e($title) ?></h1><p><?= $e($slug) ?> · #<?= $e($key) ?></p></div>
|
||||
<a class="button button-outline" href="<?= $e(($slug === 'home' ? '/' : '/' . $slug) . '#' . $key) ?>">查看公开区块</a>
|
||||
</header>
|
||||
<?= View::fragment('admin-feedback', compact('error', 'saved')) ?>
|
||||
<form class="admin-form admin-panel" method="post" action="/admin/pages/<?= $e($slug) ?>/<?= $e($key) ?>">
|
||||
<input type="hidden" name="csrf" value="<?= $e($token) ?>">
|
||||
<input type="hidden" name="version" value="<?= $e($section['version']) ?>">
|
||||
<label>区块标题<input name="title" value="<?= $e($section['title']) ?>" required maxlength="100"></label>
|
||||
<label>区块简介<textarea name="lead" rows="2" maxlength="500"><?= $e($section['lead']) ?></textarea></label>
|
||||
<?= View::fragment('admin-editor', ['format' => 'html', 'body' => $section['body']]) ?>
|
||||
<div class="form-submit"><button class="button button-primary" type="submit">保存区块</button></div>
|
||||
</form>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<section class="section article-page" aria-labelledby="archive-title" data-enter>
|
||||
<div class="wrap">
|
||||
<div class="section-heading">
|
||||
<?php if ($tag || $category): ?><a class="back-link" href="/articles">全部动态</a><?php endif ?>
|
||||
<h1 id="archive-title"><?= $e($headline) ?></h1>
|
||||
<p>来笙的公告、新闻和产品动态。</p>
|
||||
</div>
|
||||
<nav class="filter-nav" aria-label="动态分类">
|
||||
<a href="/articles" <?= !$category && !$tag ? 'aria-current="page"' : '' ?>>全部</a>
|
||||
<?php foreach (Repository::CATEGORIES as $key => $label): ?>
|
||||
<a href="/articles/category/<?= $e($key) ?>" <?= $category === $key ? 'aria-current="page"' : '' ?>><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
</nav>
|
||||
<?= View::fragment('article-list', ['articles' => $articles]) ?>
|
||||
<?php if ($pageNumber > 1 || $hasNext): ?>
|
||||
<nav class="pagination" aria-label="动态分页">
|
||||
<?php if ($pageNumber > 1): ?><a class="button button-outline" href="<?= $e($archivePath . ($pageNumber > 2 ? '?page=' . ($pageNumber - 1) : '')) ?>" rel="prev">上一页</a><?php endif ?>
|
||||
<span>第 <?= $e($pageNumber) ?> 页</span>
|
||||
<?php if ($hasNext): ?><a class="button button-outline" href="<?= $e($archivePath . '?page=' . ($pageNumber + 1)) ?>" rel="next">下一页</a><?php endif ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<?php if ($articles): ?>
|
||||
<ul class="article-list">
|
||||
<?php foreach ($articles as $item): ?>
|
||||
<li>
|
||||
<a class="article-row" href="/articles/<?= $e($item['slug']) ?>">
|
||||
<span class="article-category"><?= $e(Repository::CATEGORIES[$item['category']]) ?></span>
|
||||
<span class="article-row-title"><?= $e($item['title']) ?>
|
||||
<?php if ($item['summary']): ?><small><?= $e($item['summary']) ?></small><?php endif ?>
|
||||
</span>
|
||||
<time datetime="<?= $e(View::date($item['published_at'], 'Y-m-d')) ?>"><?= $e(View::date($item['published_at'], 'Y.m.d')) ?></time>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p class="empty-state">暂无已发布的动态。</p>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
use App\Content\Repository;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<article class="section article-page" itemscope itemtype="https://schema.org/Article" data-enter>
|
||||
<div class="wrap reading-wrap">
|
||||
<a class="back-link" href="/articles">全部动态</a>
|
||||
<header class="section-heading">
|
||||
<div class="article-meta">
|
||||
<a href="/articles/category/<?= $e($article['category']) ?>" itemprop="articleSection"><?= $e(Repository::CATEGORIES[$article['category']]) ?></a>
|
||||
<time itemprop="datePublished" datetime="<?= $e(View::date($article['published_at'], DATE_ATOM)) ?>"><?= $e(View::date($article['published_at'])) ?></time>
|
||||
<meta itemprop="dateModified" content="<?= $e(View::date($article['updated_at'], DATE_ATOM)) ?>">
|
||||
</div>
|
||||
<h1 itemprop="headline"><?= $e($article['title']) ?></h1>
|
||||
<?php if ($article['summary']): ?><p itemprop="description"><?= $e($article['summary']) ?></p><?php endif ?>
|
||||
<span itemprop="author" itemscope itemtype="https://schema.org/Organization"><meta itemprop="name" content="<?= $e($site['name']) ?>"></span>
|
||||
</header>
|
||||
<div class="rich prose" itemprop="articleBody">
|
||||
<?php if (trim($articleHtml) !== ''): ?>
|
||||
<?= $articleHtml ?>
|
||||
<?php else: ?>
|
||||
<p class="empty-state">此公告的原文暂不可用。</p>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php if ($article['tags']): ?>
|
||||
<nav class="filter-nav" aria-label="文章标签">
|
||||
<?php foreach ($article['tags'] as $tag): ?>
|
||||
<a href="/articles/tag/<?= $e(rawurlencode($tag)) ?>"><?= $e($tag) ?></a>
|
||||
<?php endforeach ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</article>
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$canonical = $path !== null ? View::absolute($path) : null;
|
||||
$imageUrl = !empty($socialImage) ? $socialImage : '/assets/original/home-hero.webp';
|
||||
if (str_starts_with($imageUrl, '/')) {
|
||||
$imageUrl = View::absolute($imageUrl);
|
||||
}
|
||||
$kind = in_array($page['slug'] ?? '', ['sc', 'shnu-sc'], true) ? 'service' : 'software';
|
||||
$siteKind = $kind === 'service' ? 'other' : 'software';
|
||||
$nav = [
|
||||
['/', '首页'], ['/#product', '产品与服务'], ['/articles', '动态'], ['/#about', '关于来笙'],
|
||||
];
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN" data-type="<?= $e($kind) ?>" data-buttons="solid" data-motion="on">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= $e($title) ?></title>
|
||||
<meta name="description" content="<?= $e($description) ?>">
|
||||
<meta name="theme-color" content="#f5f7fb">
|
||||
<meta name="page-type" content="<?= $e($kind) ?>">
|
||||
<meta name="site-kind" content="<?= $e($siteKind) ?>">
|
||||
<?php if ($canonical): ?>
|
||||
<link rel="canonical" href="<?= $e($canonical) ?>">
|
||||
<meta property="og:url" content="<?= $e($canonical) ?>">
|
||||
<?php endif ?>
|
||||
<?php if (!empty($noindex)): ?><meta name="robots" content="noindex"><?php endif ?>
|
||||
<meta property="og:type" content="<?= isset($article) ? 'article' : 'website' ?>">
|
||||
<meta property="og:locale" content="zh_CN">
|
||||
<meta property="og:site_name" content="来笙 Laysense">
|
||||
<meta property="og:title" content="<?= $e($title) ?>">
|
||||
<meta property="og:description" content="<?= $e($description) ?>">
|
||||
<meta property="og:image" content="<?= $e($imageUrl) ?>">
|
||||
<meta property="og:image:alt" content="<?= $e(($socialAlt ?? '') ?: '来笙 Laysense') ?>">
|
||||
<?php if (isset($article)): ?>
|
||||
<meta property="article:published_time" content="<?= $e(View::date($article['published_at'], DATE_ATOM)) ?>">
|
||||
<meta property="article:modified_time" content="<?= $e(View::date($article['updated_at'], DATE_ATOM)) ?>">
|
||||
<?php endif ?>
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="stylesheet" href="/assets/site.css">
|
||||
<script src="/assets/site.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#main-content">跳到内容</a>
|
||||
<header class="masthead">
|
||||
<div class="wrap masthead-inner">
|
||||
<a class="wordmark" href="/" aria-label="来笙 Laysense 首页">
|
||||
<img src="/assets/wordmark.webp" alt="Laysense 来笙" width="130" height="33">
|
||||
</a>
|
||||
<button class="menu-toggle" type="button" aria-expanded="false" aria-controls="primary-navigation" hidden>
|
||||
<span></span><span></span><span class="sr-only">菜单</span>
|
||||
</button>
|
||||
<nav id="primary-navigation" class="primary-nav" aria-label="主导航">
|
||||
<?php foreach ($nav as [$url, $label]): ?>
|
||||
<?php $current = $url === $path || ($url === '/articles' && str_starts_with($path ?? '', '/articles')); ?>
|
||||
<a href="<?= $e($url) ?>" <?= $current ? 'aria-current="page"' : '' ?>><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
<a class="mobile-contact" href="#contact">联系来笙</a>
|
||||
</nav>
|
||||
<a class="button button-outline masthead-action" href="#contact">联系来笙</a>
|
||||
</div>
|
||||
</header>
|
||||
<main id="main-content" tabindex="-1"><?= $content ?></main>
|
||||
<footer class="site-footer" id="contact">
|
||||
<div class="wrap">
|
||||
<div class="footer-grid">
|
||||
<div class="footer-company" itemscope itemtype="https://schema.org/Organization">
|
||||
<a href="/" itemprop="url" aria-label="来笙 Laysense 首页">
|
||||
<img src="/assets/wordmark.webp" alt="来笙 Laysense" width="130" height="33" itemprop="logo" loading="lazy">
|
||||
</a>
|
||||
<p itemprop="name"><?= $e($site['name']) ?></p>
|
||||
<address itemprop="address"><?= $e($site['address']) ?></address>
|
||||
<a itemprop="email" href="mailto:<?= $e($site['email']) ?>"><?= $e($site['email']) ?></a>
|
||||
<div class="payment-methods" aria-label="支持的付款方式">
|
||||
<img src="/assets/original/payment-taobao.png" alt="淘宝" width="26" height="26" loading="lazy">
|
||||
<img src="/assets/original/payment-alipay.png" alt="支付宝" width="26" height="26" loading="lazy">
|
||||
<img src="/assets/original/payment-wechat.png" alt="微信支付" width="26" height="26" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p class="footer-label">产品与服务</p>
|
||||
<a href="/pagepan">PAGEPAN 小飞页</a>
|
||||
<a href="/highspeaker">HighSpeaker DNS</a>
|
||||
<a href="/sc">软著代理服务</a>
|
||||
<a href="/shnu-sc">SHNU 学生软著服务</a>
|
||||
</div>
|
||||
<div>
|
||||
<p class="footer-label">公司</p>
|
||||
<a href="/#about">关于来笙</a>
|
||||
<a href="/articles">来笙动态</a>
|
||||
<a href="https://git.laysense.com">Laysense Git</a>
|
||||
<a href="https://www.layso.de">LaySo</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-meta">
|
||||
<p><?= $e($site['copyright']) ?> 2024–<?= $e(date('Y')) ?></p>
|
||||
<p>全球号码 <a href="tel:+16699004532">+1 (669) 900 4532</a> / <a href="tel:+85257012856">+852 5701 2856</a></p>
|
||||
<a href="https://beian.miit.gov.cn/"><?= $e($site['registration']) ?></a>
|
||||
<p class="footer-terms"><?= $e($site['terms']) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<section class="section article-page">
|
||||
<div class="wrap">
|
||||
<p class="overline">404</p>
|
||||
<h1>页面未找到</h1>
|
||||
<p>请检查网址,或回到首页浏览产品与服务。</p>
|
||||
<a class="button button-primary" href="/">返回首页</a>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$home = $page['slug'] === 'home';
|
||||
$service = in_array($page['slug'], ['sc', 'shnu-sc'], true);
|
||||
?>
|
||||
<section class="hero hero-<?= $e($page['slug']) ?>" id="home" data-enter>
|
||||
<div class="wrap hero-inner">
|
||||
<div class="hero-copy">
|
||||
<?php if (!$home): ?>
|
||||
<nav class="breadcrumbs" aria-label="面包屑" itemscope itemtype="https://schema.org/BreadcrumbList">
|
||||
<span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
|
||||
<a itemprop="item" href="/"><span itemprop="name">首页</span></a>
|
||||
<meta itemprop="position" content="1">
|
||||
</span>
|
||||
<span class="crumb-divider" aria-hidden="true">/</span>
|
||||
<span itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
|
||||
<a itemprop="item" href="/<?= $e($page['slug']) ?>" aria-current="page"><span itemprop="name"><?= $e($page['name']) ?></span></a>
|
||||
<meta itemprop="position" content="2">
|
||||
</span>
|
||||
</nav>
|
||||
<?php else: ?>
|
||||
<p class="overline hero-label">上海来笙信息科技有限公司</p>
|
||||
<?php endif ?>
|
||||
<h1><?= $e($page['heading']) ?><?php if ($page['accent'] !== ''): ?><br><span><?= $e($page['accent']) ?></span><?php endif ?></h1>
|
||||
<p class="hero-lead"><?= $e($page['lead']) ?></p>
|
||||
<div class="actions hero-actions">
|
||||
<?php foreach ($page['actions'] as $index => [$url, $label]): ?>
|
||||
<a class="button <?= $index ? 'button-outline' : 'button-primary' ?>" href="<?= $e($url) ?>"><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($page['image'] !== ''): ?>
|
||||
<div class="hero-visual <?= $home ? 'hero-illustration' : ($service ? 'hero-service-art' : 'app-frame') ?>" data-visual>
|
||||
<img src="<?= $e($page['image']) ?>" alt="<?= $e($page['alt']) ?>" width="1448" height="1086" fetchpriority="high">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php if ($home): ?>
|
||||
<div class="wrap hero-directory">
|
||||
<span class="overline">产品与服务</span>
|
||||
<a href="/pagepan"><span>PAGEPAN</span><small>可视化建站</small></a>
|
||||
<a href="/highspeaker"><span>HighSpeaker DNS</span><small>开源智能解析</small></a>
|
||||
<a href="/sc"><span>软著代理</span><small>登记申请与材料服务</small></a>
|
||||
<a href="/shnu-sc"><span>SHNU 学生</span><small>软著申请方案</small></a>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
<?php if ($page['quicklinks']): ?>
|
||||
<nav class="section-nav" aria-label="本页目录">
|
||||
<div class="wrap section-nav-inner">
|
||||
<?php foreach ($page['quicklinks'] as [$url, $label]): ?>
|
||||
<a href="<?= $e($url) ?>"><?= $e($label) ?></a>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
<?php foreach ($page['sections'] as $section): ?>
|
||||
<?= View::fragment('section', ['section' => $section, 'moment' => $home && $section['key'] === 'about']) ?>
|
||||
<?php endforeach ?>
|
||||
<?php if ($home): ?>
|
||||
<section class="section home-news" id="blog" aria-labelledby="updates-heading">
|
||||
<div class="wrap">
|
||||
<div class="section-heading inline-heading">
|
||||
<h2 id="updates-heading">来笙动态</h2>
|
||||
<a class="button button-outline" href="/articles">查看全部动态</a>
|
||||
</div>
|
||||
<?= View::fragment('article-list', ['articles' => $articles]) ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php if ($page['partners']): ?>
|
||||
<section class="section network" aria-labelledby="network-heading">
|
||||
<div class="wrap">
|
||||
<div class="section-heading"><h2 id="network-heading">支持项目与合作伙伴</h2></div>
|
||||
<?php foreach (['来笙支持项目' => 'supported-projects', '来笙合作伙伴' => 'partners'] as $group => $id): ?>
|
||||
<div class="network-group" id="<?= $e($id) ?>">
|
||||
<h3><?= $e($group) ?></h3>
|
||||
<ul class="network-list">
|
||||
<?php foreach ($page['partners'] as $partner): ?>
|
||||
<?php if ($partner['group'] !== $group) { continue; } ?>
|
||||
<li>
|
||||
<?php if ($partner['url']): ?><a href="<?= $e($partner['url']) ?>"><?php else: ?><div><?php endif ?>
|
||||
<?php if ($partner['image']): ?>
|
||||
<img src="<?= $e($partner['image']) ?>" alt="" loading="lazy" width="76" height="28">
|
||||
<?php endif ?>
|
||||
<span><?= $e($partner['name']) ?></span>
|
||||
<?php if ($partner['url']): ?></a><?php else: ?></div><?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
?>
|
||||
<section class="section section-<?= $e($section['style']) ?>" id="<?= $e($section['key']) ?>" aria-labelledby="heading-<?= $e($section['key']) ?>" <?= $moment ? 'data-moment="iris-opens"' : '' ?>>
|
||||
<div class="wrap">
|
||||
<div class="section-heading">
|
||||
<h2 id="heading-<?= $e($section['key']) ?>"><?= $e($section['title']) ?></h2>
|
||||
<?php if ($section['lead']): ?><p><?= $e($section['lead']) ?></p><?php endif ?>
|
||||
</div>
|
||||
<div class="rich"><?= $section['body'] ?></div>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user