forked from laysense/laysense.cn
Add visual CMS, media library and product directory
This commit is contained in:
+18
-46
@@ -1,17 +1,21 @@
|
||||
<?php
|
||||
use App\Content\View;
|
||||
use App\Content\Assets;
|
||||
use App\Content\SiteDesign;
|
||||
|
||||
$e = View::escape(...);
|
||||
$canonical = $path !== null ? View::absolute($path) : null;
|
||||
$imageUrl = !empty($socialImage) ? $socialImage : '/assets/original/home-hero.webp';
|
||||
$imageUrl = Assets::url($imageUrl, $cdn);
|
||||
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', '关于来笙'],
|
||||
];
|
||||
$header = ($site['header'] ?? []) + SiteDesign::DEFAULT_HEADER;
|
||||
$footer = ($site['footer'] ?? []) + SiteDesign::DEFAULT_FOOTER + $site;
|
||||
$nav = $header['links'];
|
||||
$contact = $header['button'];
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN" data-type="<?= $e($kind) ?>" data-buttons="solid" data-motion="on">
|
||||
@@ -45,12 +49,14 @@ $nav = [
|
||||
<script src="/assets/jquery-4.0.0.min.js" defer></script>
|
||||
<script src="/assets/site.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<body<?= $kind === 'service' ? ' class="copyright-service"' : '' ?>>
|
||||
<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">
|
||||
<?php if ($header['logo'] !== ''): ?>
|
||||
<img src="<?= $e($header['logo']) ?>" alt="<?= $e($header['alt']) ?>" width="130" height="33">
|
||||
<?php else: ?>来笙 Laysense<?php endif ?>
|
||||
</a>
|
||||
<button class="menu-toggle" type="button" aria-expanded="false" aria-controls="primary-navigation" hidden>
|
||||
<span></span><span></span><span class="sr-only">菜单</span>
|
||||
@@ -60,50 +66,16 @@ $nav = [
|
||||
<?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>
|
||||
<?php if ($contact): ?>
|
||||
<a class="mobile-contact" href="<?= $e($contact[0]) ?>"><?= $e($contact[1]) ?></a>
|
||||
<?php endif ?>
|
||||
</nav>
|
||||
<a class="button button-outline masthead-action" href="#contact">联系来笙</a>
|
||||
<?php if ($contact): ?>
|
||||
<a class="button button-outline masthead-action" href="<?= $e($contact[0]) ?>"><?= $e($contact[1]) ?></a>
|
||||
<?php endif ?>
|
||||
</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>
|
||||
<?= View::fragment('footer', ['footer' => $footer]) ?>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user