- assets/vendor 全量迁移: fontawesome5→assets/fontawesome5, css→assets/css, js→assets/js/runtime(避开 14 个同名自有文件), img 合并去重→assets/img, fonts→assets/fonts; 删除 assets/vendor - libs 五个与 widgets/third-party 字节相同的库不重复入库, loader paths 改指向 - 运行时切换: _win.uri=assets 根, loader baseUrl=/js/runtime, enlighter 注入 路径同步; PHP 7 个引用文件切换并改名 $zibll_*→$runtime_* - 去品牌: Qinver 头注释/品牌 console.log/演示链接清除, 默认文案中性化 - 功能标识符改名: zib__→aksrt__, zib_ajax→aksrt_ajax, window.zib→ window.aksrtLegacy, zibllblock/*→aksrtblock/*, .zib-widget→.aksrt-panel, .zib-slider→.aksrt-slider, zib_menu_options meta 键等 - 自有 CSS 改名: legacy-utilities/compat-vars/footer shell - admin SPA 重建; 契约测试同步(路径/断言/文件更名) - 例外保留: tests/visual 对照环境与 fixtures 前缀(外部 Zibll 产品引用) 验证: php -l 133 个改动文件通过; runtime 86 个 JS node --check 通过; 契约测试 68/70(2 个失败经 stash 对照确认为存量问题)
98 lines
3.3 KiB
PHP
98 lines
3.3 KiB
PHP
<?php
|
|
/**
|
|
* Single post template — legacy-style shell.
|
|
*
|
|
* Composition lives in inc/helpers/aksrt-single.php.
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
wp_reset_postdata();
|
|
|
|
while (have_posts()) :
|
|
the_post();
|
|
|
|
$post_id = (int) get_the_ID();
|
|
$ctx = function_exists('aksrt_single_build_context')
|
|
? aksrt_single_build_context($post_id)
|
|
: ['show_aside' => false, 'settings' => []];
|
|
|
|
if (function_exists('aksrt_single_is_docs_page') && aksrt_single_is_docs_page($post_id)) {
|
|
get_header();
|
|
get_template_part('templates/pages/page-documentnav');
|
|
get_footer();
|
|
return;
|
|
}
|
|
|
|
$settings = is_array($ctx['settings'] ?? null) ? $ctx['settings'] : [];
|
|
$show_aside = !empty($ctx['show_aside']); // body site-layout-* is authoritative
|
|
|
|
get_header();
|
|
?>
|
|
|
|
<?php if (!empty($settings['reading_progress'])) : ?>
|
|
<div id="reading-progress-global" class="reading-progress-bar" role="progressbar" aria-label="<?php esc_attr_e('阅读进度', 'aksrt'); ?>" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"></div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (is_active_sidebar('single_top_fluid')) : ?>
|
|
<div class="fluid-widget-wrap">
|
|
<?php dynamic_sidebar('single_top_fluid'); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<main role="main" class="container<?php echo $show_aside ? '' : ' container--no-sidebar'; ?>">
|
|
<div class="content-wrap">
|
|
<div class="content-layout">
|
|
<?php if (is_active_sidebar('single_top_content')) : ?>
|
|
<?php dynamic_sidebar('single_top_content'); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if (function_exists('aksrt_single')) {
|
|
aksrt_single($ctx);
|
|
}
|
|
?>
|
|
|
|
<?php if (comments_open() || get_comments_number()) : ?>
|
|
<?php comments_template(); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php if (is_active_sidebar('single_bottom_content')) : ?>
|
|
<?php dynamic_sidebar('single_bottom_content'); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
if (function_exists('aksrt_single_render_aside')) {
|
|
aksrt_single_render_aside($ctx);
|
|
}
|
|
?>
|
|
</main>
|
|
|
|
<?php if (!empty($ctx['show_toc'])) : ?>
|
|
<button type="button" class="toc-float-btn" aria-label="<?php esc_attr_e('打开目录', 'aksrt'); ?>"><i class="fa fas fa-list-ul" aria-hidden="true"></i></button>
|
|
<div class="toc-drawer-overlay"></div>
|
|
<aside class="toc-drawer posts-nav-box" data-title="<?php echo esc_attr((string) ($ctx['toc_title'] ?? __('文章目录', 'aksrt'))); ?>" aria-label="<?php echo esc_attr((string) ($ctx['toc_title'] ?? __('文章目录', 'aksrt'))); ?>">
|
|
<div class="toc-drawer__head">
|
|
<h3><?php echo esc_html((string) ($ctx['toc_title'] ?? __('文章目录', 'aksrt'))); ?></h3>
|
|
<button type="button" class="toc-drawer__close" aria-label="<?php esc_attr_e('关闭目录', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
|
</div>
|
|
<ol class="toc-list"></ol>
|
|
</aside>
|
|
<?php endif; ?>
|
|
|
|
<?php if (!empty($settings['lightbox'])) : ?>
|
|
<div class="lightbox-overlay" id="lightbox-overlay" role="dialog" aria-modal="true" aria-label="<?php esc_attr_e('图片预览', 'aksrt'); ?>" aria-hidden="true">
|
|
<button type="button" class="lightbox-close" aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
|
|
<img src="" alt="" class="lightbox-img">
|
|
<div class="lightbox-caption" aria-live="polite"></div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php endwhile; ?>
|
|
|
|
<?php get_footer(); ?>
|