Skip to content

Commit faf597b

Browse files
authored
Merge pull request #18 from jottenlips/feature/sitemap
sitemap
2 parents 2e7c665 + bda86e4 commit faf597b

12 files changed

Lines changed: 611 additions & 45 deletions

File tree

agave-generator.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
opam-version: "2.0"
22
name: "agave-generator"
3-
version: "0.2.1"
3+
version: "0.2.2"
44
synopsis: "Minimal markdown to HTML static site generator"
55
description: """
66
Minimal markdown to HTML for static sites with pretty URLs.

docs/about/index.html

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>About Agave</title>
7+
<link rel="stylesheet" href="/styles.css">
8+
9+
<meta property="og:title" content="About Agave" />
10+
<meta name="twitter:title" content="About Agave" />
11+
<meta name="description" content="Agave is a simple static site generator written in ReasonML" />
12+
<meta property="og:description" content="Agave is a simple static site generator written in ReasonML" />
13+
<meta name="twitter:description" content="Agave is a simple static site generator written in ReasonML" />
14+
<meta name="twitter:card" content="summary" />
15+
</head>
16+
<body>
17+
<nav>
18+
<a href="/">Home</a>
19+
<a href="/about/">About</a>
20+
<a href="/blog/">Blog</a>
21+
<a href="/sitemap/">Sitemap</a>
22+
</nav>
23+
<main>
24+
<h1 id="about-agave">About Agave</h1>
25+
<p>Agave is a lightweight static site generator that turns markdown files into a website.</p>
26+
<h2 id="features">Features</h2>
27+
<ul>
28+
<li>Markdown to HTML conversion
29+
</li>
30+
<li>Custom templates with <code>base.html</code>
31+
</li>
32+
<li>Per-page meta tags via shorthand notation
33+
</li>
34+
<li>Built-in themes (desert, randomphoto)
35+
</li>
36+
<li>Client-side searchable sitemap
37+
</li>
38+
<li>Local dev server
39+
</li>
40+
</ul>
41+
<h2 id="how-it-works">How It Works</h2>
42+
<p>Drop your <code>.md</code> files into a directory, add a <code>base.html</code> template, and run <code>agave</code>. That's it.</p>
43+
44+
</main>
45+
<footer>
46+
<p>Built with Agave</p>
47+
</footer>
48+
</body>
49+
</html>

docs/blog/deploying/index.html

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Deploying Your Agave Site</title>
7+
<link rel="stylesheet" href="/styles.css">
8+
9+
<meta property="og:title" content="Deploying Your Agave Site" />
10+
<meta name="twitter:title" content="Deploying Your Agave Site" />
11+
<meta name="description" content="How to deploy your static site to GitHub Pages, Netlify, or any host" />
12+
<meta property="og:description" content="How to deploy your static site to GitHub Pages, Netlify, or any host" />
13+
<meta name="twitter:description" content="How to deploy your static site to GitHub Pages, Netlify, or any host" />
14+
<meta name="twitter:card" content="summary" />
15+
</head>
16+
<body>
17+
<nav>
18+
<a href="/">Home</a>
19+
<a href="/about/">About</a>
20+
<a href="/blog/">Blog</a>
21+
<a href="/sitemap/">Sitemap</a>
22+
</nav>
23+
<main>
24+
<h1 id="deploying-your-agave-site">Deploying Your Agave Site</h1>
25+
<p>Once you've built your site, deploying is straightforward since it's just static files.</p>
26+
<h2 id="github-pages">GitHub Pages</h2>
27+
<ol>
28+
<li>Push your <code>public</code> directory to a <code>gh-pages</code> branch
29+
</li>
30+
<li>Enable GitHub Pages in your repo settings
31+
</li>
32+
<li>Your site is live!
33+
</li>
34+
</ol>
35+
<h2 id="netlify">Netlify</h2>
36+
<ol>
37+
<li>Connect your repository
38+
</li>
39+
<li>Set build command: <code>dune exec bin/Agave.exe -- -m markdown -p public</code>
40+
</li>
41+
<li>Set publish directory: <code>public</code>
42+
</li>
43+
</ol>
44+
<h2 id="any-static-host">Any Static Host</h2>
45+
<p>The <code>public</code> directory contains plain HTML, CSS, and nothing else. Upload it anywhere that serves static files — S3, Cloudflare Pages, Vercel, or even a simple nginx server.</p>
46+
47+
</main>
48+
<footer>
49+
<p>Built with Agave</p>
50+
</footer>
51+
</body>
52+
</html>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Getting Started with Agave</title>
7+
<link rel="stylesheet" href="/styles.css">
8+
9+
<meta property="og:title" content="Getting Started with Agave" />
10+
<meta name="twitter:title" content="Getting Started with Agave" />
11+
<meta name="description" content="A beginner's guide to building your first static site with Agave" />
12+
<meta property="og:description" content="A beginner's guide to building your first static site with Agave" />
13+
<meta name="twitter:description" content="A beginner's guide to building your first static site with Agave" />
14+
<meta name="twitter:card" content="summary" />
15+
</head>
16+
<body>
17+
<nav>
18+
<a href="/">Home</a>
19+
<a href="/about/">About</a>
20+
<a href="/blog/">Blog</a>
21+
<a href="/sitemap/">Sitemap</a>
22+
</nav>
23+
<main>
24+
<h1 id="getting-started-with-agave">Getting Started with Agave</h1>
25+
<p>Setting up your first Agave site takes just a few minutes.</p>
26+
<h2 id="installation">Installation</h2>
27+
<p>Install via opam or build from source:</p>
28+
<pre><code>dune build
29+
dune install
30+
</code></pre>
31+
<h2 id="create-your-first-site">Create Your First Site</h2>
32+
<ol>
33+
<li>Create a <code>markdown</code> directory
34+
</li>
35+
<li>Add a <code>base.html</code> template with <code>&lt;!-- MARKDOWN --&gt;</code> placeholder
36+
</li>
37+
<li>Write some <code>.md</code> files
38+
</li>
39+
<li>Run <code>agave -m markdown -p public</code>
40+
</li>
41+
</ol>
42+
<h2 id="adding-meta-tags">Adding Meta Tags</h2>
43+
<p>Use shorthand notation at the top of your markdown files:</p>
44+
<pre><code>@title My Page Title
45+
@description A brief description of this page
46+
@image /images/hero.jpg
47+
</code></pre>
48+
<p>These get injected as Open Graph and Twitter Card meta tags automatically.</p>
49+
50+
</main>
51+
<footer>
52+
<p>Built with Agave</p>
53+
</footer>
54+
</body>
55+
</html>

docs/blog/index.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Blog</title>
7+
<link rel="stylesheet" href="/styles.css">
8+
9+
<meta property="og:title" content="Blog" />
10+
<meta name="twitter:title" content="Blog" />
11+
<meta name="description" content="Latest posts from the Agave blog" />
12+
<meta property="og:description" content="Latest posts from the Agave blog" />
13+
<meta name="twitter:description" content="Latest posts from the Agave blog" />
14+
<meta name="twitter:card" content="summary" />
15+
</head>
16+
<body>
17+
<nav>
18+
<a href="/">Home</a>
19+
<a href="/about/">About</a>
20+
<a href="/blog/">Blog</a>
21+
<a href="/sitemap/">Sitemap</a>
22+
</nav>
23+
<main>
24+
<h1 id="blog">Blog</h1>
25+
<p>Recent articles:</p>
26+
<ul>
27+
<li><a href="/blog/getting-started/">Getting Started with Agave</a>
28+
</li>
29+
<li><a href="/blog/markdown-tips/">Markdown Tips and Tricks</a>
30+
</li>
31+
<li><a href="/blog/deploying/">Deploying Your Site</a>
32+
</li>
33+
</ul>
34+
35+
</main>
36+
<footer>
37+
<p>Built with Agave</p>
38+
</footer>
39+
</body>
40+
</html>

docs/blog/markdown-tips/index.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Markdown Tips and Tricks</title>
7+
<link rel="stylesheet" href="/styles.css">
8+
9+
<meta property="og:title" content="Markdown Tips and Tricks" />
10+
<meta name="twitter:title" content="Markdown Tips and Tricks" />
11+
<meta name="description" content="Power user tips for writing great content in Agave" />
12+
<meta property="og:description" content="Power user tips for writing great content in Agave" />
13+
<meta name="twitter:description" content="Power user tips for writing great content in Agave" />
14+
<meta name="twitter:card" content="summary" />
15+
</head>
16+
<body>
17+
<nav>
18+
<a href="/">Home</a>
19+
<a href="/about/">About</a>
20+
<a href="/blog/">Blog</a>
21+
<a href="/sitemap/">Sitemap</a>
22+
</nav>
23+
<main>
24+
<h1 id="markdown-tips-and-tricks">Markdown Tips and Tricks</h1>
25+
<p>Get the most out of your Agave markdown files.</p>
26+
<h2 id="headings-structure">Headings Structure</h2>
27+
<p>Use <code>#</code> for the page title, <code>##</code> for sections, and <code>###</code> for subsections. Agave will automatically extract the first heading for meta tags if you don't specify <code>@title</code>.</p>
28+
<h2 id="code-blocks">Code Blocks</h2>
29+
<p>Wrap code in triple backticks for syntax highlighting:</p>
30+
<pre><code class="language-javascript">const greeting = &quot;Hello from Agave!&quot;;
31+
console.log(greeting);
32+
</code></pre>
33+
<h2 id="lists">Lists</h2>
34+
<p>Both ordered and unordered lists work great:</p>
35+
<ul>
36+
<li>Bullet points with <code>-</code>
37+
</li>
38+
<li>Nested items supported
39+
<ul>
40+
<li>Like this one
41+
</li>
42+
</ul>
43+
</li>
44+
</ul>
45+
<ol>
46+
<li>Numbered lists
47+
</li>
48+
<li>Auto-increment
49+
</li>
50+
<li>Easy to maintain
51+
</li>
52+
</ol>
53+
<h2 id="links-and-images">Links and Images</h2>
54+
<p>Standard markdown links and images are fully supported. Use relative paths for internal links to keep your site portable.</p>
55+
56+
</main>
57+
<footer>
58+
<p>Built with Agave</p>
59+
</footer>
60+
</body>
61+
</html>

docs/contact/index.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Contact Us</title>
7+
<link rel="stylesheet" href="/styles.css">
8+
9+
<meta property="og:title" content="Contact Us" />
10+
<meta name="twitter:title" content="Contact Us" />
11+
<meta name="description" content="Get in touch with the Agave team" />
12+
<meta property="og:description" content="Get in touch with the Agave team" />
13+
<meta name="twitter:description" content="Get in touch with the Agave team" />
14+
<meta name="twitter:card" content="summary" />
15+
</head>
16+
<body>
17+
<nav>
18+
<a href="/">Home</a>
19+
<a href="/about/">About</a>
20+
<a href="/blog/">Blog</a>
21+
<a href="/sitemap/">Sitemap</a>
22+
</nav>
23+
<main>
24+
<h1 id="contact">Contact</h1>
25+
<p>Have questions or feedback? Reach out!</p>
26+
<ul>
27+
<li>GitHub: <a href="https://github.com/jottenlips/agave">github.com/jottenlips/agave</a>
28+
</li>
29+
<li>Issues: Open a ticket on the repo
30+
</li>
31+
</ul>
32+
<p>We'd love to hear how you're using Agave.</p>
33+
34+
</main>
35+
<footer>
36+
<p>Built with Agave</p>
37+
</footer>
38+
</body>
39+
</html>

docs/index.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Agave Test Site</title>
7+
<link rel="stylesheet" href="/styles.css">
8+
9+
<meta property="og:title" content="Agave Test Site" />
10+
<meta name="twitter:title" content="Agave Test Site" />
11+
<meta name="description" content="A demo site built with Agave static site generator" />
12+
<meta property="og:description" content="A demo site built with Agave static site generator" />
13+
<meta name="twitter:description" content="A demo site built with Agave static site generator" />
14+
<meta name="twitter:card" content="summary" />
15+
</head>
16+
<body>
17+
<nav>
18+
<a href="/">Home</a>
19+
<a href="/about/">About</a>
20+
<a href="/blog/">Blog</a>
21+
<a href="/sitemap/">Sitemap</a>
22+
</nav>
23+
<main>
24+
<h1 id="welcome-to-the-agave-test-site">Welcome to the Agave Test Site</h1>
25+
<p>This is a demo site to test the sitemap and search features.</p>
26+
<h2 id="pages">Pages</h2>
27+
<ul>
28+
<li><a href="/about/">About</a> — Learn about this project
29+
</li>
30+
<li><a href="/blog/">Blog</a> — Read the latest posts
31+
</li>
32+
<li><a href="/sitemap/">Sitemap</a> — Search all pages
33+
</li>
34+
</ul>
35+
36+
</main>
37+
<footer>
38+
<p>Built with Agave</p>
39+
</footer>
40+
</body>
41+
</html>

docs/sitemap/index.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Sitemap</title>
7+
<link rel="stylesheet" href="/styles.css">
8+
9+
<meta property="og:title" content="Sitemap" />
10+
<meta name="twitter:title" content="Sitemap" />
11+
<meta name="description" content="Index of all pages" />
12+
<meta property="og:description" content="Index of all pages" />
13+
<meta name="twitter:description" content="Index of all pages" />
14+
<meta name="twitter:card" content="summary" />
15+
</head>
16+
<body>
17+
<nav>
18+
<a href="/">Home</a>
19+
<a href="/about/">About</a>
20+
<a href="/blog/">Blog</a>
21+
<a href="/sitemap/">Sitemap</a>
22+
</nav>
23+
<main>
24+
<div id="sitemap-container"><input type="text" id="sitemap-search" placeholder="Search pages..." style="width:100%;padding:8px;margin-bottom:16px;box-sizing:border-box;font-size:16px;" /><ul id="sitemap-results" style="list-style:none;padding:0;"></ul></div><script>var pages = [{"url":"/markdown-tips/","title":"Markdown Tips and Tricks","description":"Power user tips for writing great content in Agave","filename":"markdown-tips"},{"url":"/deploying/","title":"Deploying Your Agave Site","description":"How to deploy your static site to GitHub Pages, Netlify, or any host","filename":"deploying"},{"url":"/getting-started/","title":"Getting Started with Agave","description":"A beginner's guide to building your first static site with Agave","filename":"getting-started"},{"url":"//","title":"Blog","description":"Latest posts from the Agave blog","filename":"index"},{"url":"/contact/","title":"Contact Us","description":"Get in touch with the Agave team","filename":"contact"},{"url":"//","title":"Agave Test Site","description":"A demo site built with Agave static site generator","filename":"index"},{"url":"/about/","title":"About Agave","description":"Agave is a simple static site generator written in ReasonML","filename":"about"}];var input = document.getElementById('sitemap-search');var results = document.getElementById('sitemap-results');function render(filter) { var q = filter.toLowerCase(); results.innerHTML = ''; pages.forEach(function(p) { if (!q || p.title.toLowerCase().indexOf(q) !== -1 || p.description.toLowerCase().indexOf(q) !== -1 || p.filename.toLowerCase().indexOf(q) !== -1) { var li = document.createElement('li'); li.style.marginBottom = '12px'; li.innerHTML = '<a href="' + p.url + '">' + p.title + '</a>' + (p.description ? '<br/><small>' + p.description + '</small>' : ''); results.appendChild(li); } });}input.addEventListener('input', function() { render(this.value); });render('');</script>
25+
</main>
26+
<footer>
27+
<p>Built with Agave</p>
28+
</footer>
29+
</body>
30+
</html>

0 commit comments

Comments
 (0)