<?php
defined('ABSPATH') || exit;
?>
<main class="kb-docs-wrap">
    <nav class="kb-breadcrumbs">
        <a href="<?php echo esc_url($url_builder::docsIndex()); ?>"><?php esc_html_e('Docs', 'kb-markdown-importer'); ?></a><span>/</span>
        <a href="<?php echo esc_url($url_builder::product($product->slug)); ?>"><?php echo esc_html($product->name); ?></a><span>/</span>
        <?php echo esc_html($version->name); ?>
    </nav>
    <h1><?php echo esc_html($product->name . ' ' . $version->name); ?></h1>
    <ul class="kb-page-list">
        <?php foreach ((array) $pages as $page) : ?>
            <?php $slug = (string) get_post_meta($page->ID, '_kb_page_slug', true); ?>
            <li><a href="<?php echo esc_url($url_builder::page($product->slug, $version->slug, $slug)); ?>"><?php echo esc_html(get_the_title($page)); ?></a></li>
        <?php endforeach; ?>
    </ul>
</main>
