Pages
A page source is a .jsx, .md, or .tmpl file. Each format produces an HTML body, which is then wrapped by layouts.
| Format | Best for | Page data from |
|---|---|---|
JSX (.jsx) |
Index pages, listings, anything with logic | A leading data({...}) call |
Markdown (.md) |
Writing: articles, docs, notes | YAML frontmatter |
Go template (.tmpl) |
Simple templated pages and layouts | YAML frontmatter |
A JSX page:
data({ title: "Articles" });
<section>
<h1>{page.title}</h1>
<ul>
{pages("articles/**").reverse().map(a =>
<li><a href={a.path}>{a.title}</a> <small>{a.date}</small></li>
)}
</ul>
</section>
A Markdown page:
---
title: Building your own Ngrok in 130 lines
date: 2021-03-14
tags: [go, networking]
---
Ngrok is a tunnel...