<?php
define('SITE_LOADED', true);
require_once __DIR__ . '/config.php';

// 前端只读静态缓存文件，不读数据库；缓存不存在时回退到内置文章
$cached = is_file(__DIR__ . '/includes/articles_cache.php') ? require __DIR__ . '/includes/articles_cache.php' : [];

$pageTitle = '规划观点';
$pageKeywords = '国土空间规划,控制性详细规划,城市设计,乡村振兴规划,村庄规划,城市更新,产业园区规划,规划设计院';
$pageDescription = '旭日规划观点：国土空间规划编制、控规修规、城市设计、城市更新、乡村振兴与村庄规划、产业园区与文旅规划等一线实操经验与行业思考。';
include __DIR__ . '/includes/header.php';
?>

<section class="page-banner">
    <div class="container">
        <h1>规划观点</h1>
        <p>首页 / 规划观点</p>
    </div>
</section>

<section class="section">
    <div class="container">
        <div class="news-list">
            <?php if ($cached): foreach ($cached as $a): ?>
            <a class="news-item" href="<?php echo e($a['file']); ?>">
                <div class="news-item-date">
                    <strong><?php echo e(substr($a['date'], 8, 2)); ?></strong>
                    <span><?php echo e(substr($a['date'], 0, 7)); ?></span>
                </div>
                <div class="news-item-body">
                    <h2><?php echo e($a['title']); ?></h2>
                    <p><?php echo e($a['summary']); ?></p>
                    <span class="news-more">阅读全文 →</span>
                </div>
            </a>
            <?php endforeach; else: foreach ($articles as $a): ?>
            <a class="news-item" href="/article.php?id=<?php echo e($a['id']); ?>">
                <div class="news-item-date">
                    <strong><?php echo e(substr($a['date'], 8, 2)); ?></strong>
                    <span><?php echo e(substr($a['date'], 0, 7)); ?></span>
                </div>
                <div class="news-item-body">
                    <h2><?php echo e($a['title']); ?></h2>
                    <p><?php echo e($a['summary']); ?></p>
                    <span class="news-more">阅读全文 →</span>
                </div>
            </a>
            <?php endforeach; endif; ?>
        </div>
    </div>
</section>

<?php include __DIR__ . '/includes/footer.php'; ?>
