Add site landing page

This commit is contained in:
2026-07-09 02:55:50 +09:00
parent 6d80c66144
commit 871d342e15
3 changed files with 166 additions and 7 deletions
@@ -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>