Files
laysense.cn/app/view/layout.php
T

109 lines
5.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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>