Add site landing page
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { nav } from '../lib/docs.js';
|
||||
import '../style.css';
|
||||
|
||||
const { title = 'Decodal', active = '', playground = false } = Astro.props;
|
||||
const { title = 'Decodal', active = '', playground = false, frontpage = false } = Astro.props;
|
||||
|
||||
function renderNav(items, prefix = []) {
|
||||
return `<ul class="nav-tree">${items
|
||||
@@ -25,20 +25,20 @@ function renderNav(items, prefix = []) {
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
<a class="brand" href="/docs/introduction/">Decodal</a>
|
||||
<a class="brand" href="/">Decodal</a>
|
||||
<nav class="topnav">
|
||||
<a href="/docs/introduction/">Docs</a>
|
||||
<a href="/playground/">Playground</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class={playground ? 'layout playground-layout' : 'layout'}>
|
||||
{!playground && (
|
||||
<div class={playground || frontpage ? 'layout playground-layout' : 'layout'}>
|
||||
{!playground && !frontpage && (
|
||||
<aside class="sidebar">
|
||||
<a class="sidebar-title" href="/docs/">Manual</a>
|
||||
<nav set:html={renderNav(nav)} />
|
||||
</aside>
|
||||
)}
|
||||
<main class={playground ? 'playground' : ''}>
|
||||
<main class={playground ? 'playground' : frontpage ? 'frontpage' : ''}>
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user