Migrate the Laysense production snapshot to LaySite 1.3
This commit is contained in:
+11
-3
@@ -1,10 +1,12 @@
|
||||
<?php
|
||||
use App\Content\Buttons;
|
||||
use App\Content\CanvasStyle;
|
||||
use App\Content\PageTemplates;
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$home = $page['slug'] === 'home';
|
||||
$service = in_array($page['slug'], ['sc', 'shnu-sc'], true);
|
||||
$shared = !empty($page['layout_kind']);
|
||||
$system = ($page['page_type'] ?? 'page') !== 'page';
|
||||
$showHero = $page['visibility']['hero'] ?? true;
|
||||
@@ -38,7 +40,7 @@ $field = static fn (string $name): string => $canvas ? ' data-studio-field="' .
|
||||
<?php else: ?>
|
||||
<p class="overline hero-label"><?= $e($site['name']) ?></p>
|
||||
<?php endif ?>
|
||||
<h1<?= isset($alignments['heading']) ? ' class="' . trim(View::alignmentClass($alignments['heading'])) . '"' : '' ?><?= $alignField('heading') ?>><span class="hero-heading-primary<?= $style('heading') ?>"<?= $field('heading') ?><?= $styleField('heading') ?>><?= $text('heading', $page['heading']) ?></span><?php if ($canvas): ?><span class="studio-accent<?= $style('accent') ?>"<?= $field('accent') ?><?= $styleField('accent') ?>><?= $text('accent', $page['accent']) ?></span><?php elseif ($page['accent'] !== ''): ?><br><span class="<?= trim($style('accent')) ?>"><?= $text('accent', $page['accent']) ?></span><?php endif ?></h1>
|
||||
<h1<?= isset($alignments['heading']) ? ' class="' . trim(View::alignmentClass($alignments['heading'])) . '"' : '' ?><?= $alignField('heading') ?>><span class="hero-heading-primary<?= $style('heading') ?>"<?= $field('heading') ?><?= $styleField('heading') ?>><?= $text('heading', $page['heading']) ?></span><?php if ($canvas): ?><span class="studio-accent<?= $style('accent') ?>"<?= $field('accent') ?><?= $styleField('accent') ?>><?= $text('accent', $page['accent']) ?></span><?php elseif ($page['accent'] !== ''): ?><br><span class="<?= trim($style('accent')) ?>"><?= $text('accent', $page['accent']) ?></span><?php endif ?><?php if ($home && !$canvas): ?><span class="home-cursor" aria-hidden="true">_</span><?php endif ?></h1>
|
||||
<p class="hero-lead<?= View::alignmentClass($alignments['lead'] ?? null) ?><?= $style('lead') ?>"<?= $field('lead') ?><?= $alignField('lead') ?><?= $styleField('lead') ?>><?= $text('lead', $page['lead']) ?></p>
|
||||
<div class="actions hero-actions<?= View::alignmentClass($alignments['actions'] ?? null) ?><?= $style('actions') ?>"<?= $alignField('actions') ?><?= $styleField('actions') ?>>
|
||||
<?php foreach (Buttons::validate($page['actions']) as $index => [$url, $label, $buttonStyle, $blank]): ?>
|
||||
@@ -48,8 +50,9 @@ $field = static fn (string $name): string => $canvas ? ' data-studio-field="' .
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($canvas || $page['image'] !== ''): ?>
|
||||
<div class="hero-visual app-frame<?= $page['image_scale'] ? ' studio-media-' . $e($page['image_scale']) : '' ?><?= View::alignmentClass($alignments['image'] ?? null) ?><?= $style('image') ?>" data-visual<?= $alignField('image') ?><?= $styleField('image') ?><?= $page['image'] === '' ? ' hidden' : '' ?>>
|
||||
<div class="hero-visual <?= $home ? 'hero-illustration' : ($service ? 'app-frame hero-service-art' : 'app-frame') ?><?= $page['image_scale'] ? ' studio-media-' . $e($page['image_scale']) : '' ?><?= View::alignmentClass($alignments['image'] ?? null) ?><?= $style('image') ?>" data-visual<?= $alignField('image') ?><?= $styleField('image') ?><?= $page['image'] === '' ? ' hidden' : '' ?>>
|
||||
<img<?= $page['image'] === '' ? '' : ' src="' . $e($page['image']) . '"' ?> alt="<?= $e($page['alt']) ?>" width="1448" height="1086" fetchpriority="high"<?= $canvas ? ' data-studio-hero-image' : '' ?>>
|
||||
<?php if ($home && !$canvas && $page['image'] === '/assets/original/home-hero.webp'): ?><?= View::fragment('laysense-home-motion') ?><?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
@@ -71,9 +74,14 @@ $field = static fn (string $name): string => $canvas ? ' data-studio-field="' .
|
||||
<?php endif ?>
|
||||
<?php foreach ($page['sections'] as $section): ?>
|
||||
<?php if ($section['style'] !== 'hero-links'): ?>
|
||||
<?= View::fragment('section', ['section' => $section, 'moment' => false, 'canvas' => $canvas, 'pageSlug' => $page['slug']]) ?>
|
||||
<?= View::fragment('section', ['section' => $section, 'moment' => $home && $section['key'] === 'about', 'canvas' => $canvas, 'pageSlug' => $page['slug']]) ?>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
<?php if ($showHero && ($credit = PageTemplates::photoCredit($page['image']))): ?>
|
||||
<p class="wrap page-photo-credit">摄影 <a href="<?= $e($credit[2]) ?>"><?= $e($credit[0]) ?></a> ·
|
||||
<?php if ($credit[3]): ?><a href="<?= $e($credit[3]) ?>"><?= $e($credit[1]) ?></a><?php else: ?><?= $e($credit[1]) ?><?php endif ?>
|
||||
</p>
|
||||
<?php endif ?>
|
||||
<?php if ($canvas): ?>
|
||||
<?php if ($shared): ?>
|
||||
<p class="wrap studio-layout-empty" data-studio-empty-layout hidden>从「组件」添加版式,或在页面设置中显示首屏。</p>
|
||||
|
||||
Reference in New Issue
Block a user