Commit 39a2e1ef by Carsten Brandt

adjusted guide renderer to new guide structure

parent bfaa5f31
......@@ -83,9 +83,6 @@ class GuideController extends BaseController
*/
protected function findFiles($path, $except = [])
{
if (empty($except)) {
$except = ['README.md'];
}
$path = FileHelper::normalizePath($path);
$options = [
'only' => ['*.md'],
......
......@@ -14,11 +14,16 @@ $this->beginContent('@yii/apidoc/templates/bootstrap/layouts/main.php'); ?>
<?php
asort($headlines);
$nav = [];
$nav[] = [
'label' => 'Index',
'url' => $this->context->generateGuideUrl('index.md'),
'active' => isset($currentFile) && (basename($currentFile) == 'index.md'),
];
foreach ($headlines as $file => $headline) {
if (basename($file) == 'README.md') {
$nav[] = [
'label' => $headline,
'url' => $this->context->generateGuideUrl($file),
'active' => isset($currentFile) && ($file == $currentFile),
];
unset($headlines[$file]);
}
}
foreach ($headlines as $file => $headline) {
$nav[] = [
'label' => $headline,
......
......@@ -64,7 +64,7 @@ $this->beginPage();
}
if ($this->context->guideUrl !== null) {
$nav[] = ['label' => 'Guide', 'url' => rtrim($this->context->guideUrl, '/') . '/' . BaseRenderer::GUIDE_PREFIX . 'index.html'];
$nav[] = ['label' => 'Guide', 'url' => rtrim($this->context->guideUrl, '/') . '/' . BaseRenderer::GUIDE_PREFIX . 'README.html'];
}
echo Nav::widget([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment