Initial site setup with Zola and zolanight theme
- Zola static site with zolanight theme - Blog section with sample posts - Projects section for listing external projects - Custom index template showing latest post and recent posts list
This commit is contained in:
commit
f57d3d945d
14 changed files with 231 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
public/
|
||||||
30
CLAUDE.md
Normal file
30
CLAUDE.md
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## Project
|
||||||
|
|
||||||
|
Static website for W5ISP (amateur radio callsign) built with [Zola](https://www.getzola.org/), a Rust-based static site generator.
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
- `zola serve` - Local dev server with live reload (default: http://127.0.0.1:1111)
|
||||||
|
- `zola build` - Build site to `public/` directory
|
||||||
|
- `zola check` - Validate links and templates
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
This is a standard Zola project:
|
||||||
|
|
||||||
|
- **`content/`** - Markdown pages and blog posts. Zola uses `_index.md` for section pages and regular `.md` files for individual pages.
|
||||||
|
- **`templates/`** - Tera templates (Jinja2-like syntax). Key templates: `base.html` (layout), `index.html` (homepage), `page.html` (single page), `section.html` (section listing).
|
||||||
|
- **`sass/`** - SCSS stylesheets, auto-compiled by Zola (enabled in config).
|
||||||
|
- **`static/`** - Static assets served as-is (images, fonts, etc.).
|
||||||
|
- **`themes/`** - Zola themes (if using one).
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
- Sass compilation: enabled
|
||||||
|
- Search index: disabled
|
||||||
|
- Syntax highlighting theme: Catppuccin Mocha
|
||||||
|
- Custom variables go in `[extra]` section of `zola.toml`
|
||||||
3
content/_index.md
Normal file
3
content/_index.md
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
+++
|
||||||
|
title = "W5ISP"
|
||||||
|
+++
|
||||||
5
content/blog/_index.md
Normal file
5
content/blog/_index.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
+++
|
||||||
|
title = "Blog"
|
||||||
|
sort_by = "date"
|
||||||
|
paginate_by = 5
|
||||||
|
+++
|
||||||
6
content/blog/first.md
Normal file
6
content/blog/first.md
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
+++
|
||||||
|
title = "My first post"
|
||||||
|
date = 2019-11-27
|
||||||
|
+++
|
||||||
|
|
||||||
|
This is my first blog post.
|
||||||
6
content/blog/second.md
Normal file
6
content/blog/second.md
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
+++
|
||||||
|
title = "My second post"
|
||||||
|
date = 2019-11-28
|
||||||
|
+++
|
||||||
|
|
||||||
|
This is my second blog post.
|
||||||
5
content/projects/_index.md
Normal file
5
content/projects/_index.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
+++
|
||||||
|
title = "Projects"
|
||||||
|
template = "projects.html"
|
||||||
|
sort_by = "title"
|
||||||
|
+++
|
||||||
7
content/projects/gridmap.md
Normal file
7
content/projects/gridmap.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
+++
|
||||||
|
title = "GridMap"
|
||||||
|
description = "GridMap"
|
||||||
|
|
||||||
|
[extra]
|
||||||
|
url = "https://gridmap.org"
|
||||||
|
+++
|
||||||
7
content/projects/towerops.md
Normal file
7
content/projects/towerops.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
+++
|
||||||
|
title = "TowerOps"
|
||||||
|
description = "TowerOps"
|
||||||
|
|
||||||
|
[extra]
|
||||||
|
url = "https://towerops.net"
|
||||||
|
+++
|
||||||
74
templates/base.html
Normal file
74
templates/base.html
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>{% block title %}{{ config.title }}{% endblock title %}</title>
|
||||||
|
{% if page %}
|
||||||
|
{% if page.description %}
|
||||||
|
<meta name="description" content="{{ page.description }}">
|
||||||
|
{% endif %}
|
||||||
|
{% if page.taxonomies.tags %}
|
||||||
|
<meta name="keywords" content="{% for tag in page.taxonomies.tags %}{{ tag }}{% if not loop.last %}, {% endif %}{% endfor %}">
|
||||||
|
{% endif %}
|
||||||
|
{% elif section %}
|
||||||
|
{% if section.description %}
|
||||||
|
<meta name="description" content="{{ section.description }}">
|
||||||
|
{% endif %}
|
||||||
|
{% if section.taxonomies.tags %}
|
||||||
|
<meta name="keywords" content="{% for tag in section.taxonomies.tags %}{{ tag }}{% if not loop.last %}, {% endif %}{% endfor %}">
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if page %}<link rel="canonical" href="{{ page.permalink }}" />
|
||||||
|
{% elif section %}<link rel="canonical" href="{{ section.permalink }}" />
|
||||||
|
{% else %}<link rel="canonical" href="{{ config.base_url }}" />
|
||||||
|
{% endif %}
|
||||||
|
<link rel="stylesheet" href="{{ get_url(path="style.css") }}">
|
||||||
|
{% if config.extra.zolanight.google_analytics_id %}
|
||||||
|
<!-- Delayed Google Analytics loading -->
|
||||||
|
<script>
|
||||||
|
const loadGtag = () => {
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
gtag('config', '{{ config.extra.zolanight.google_analytics_id }}');
|
||||||
|
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.src = "https://www.googletagmanager.com/gtag/js?id={{ config.extra.zolanight.google_analytics_id }}";
|
||||||
|
script.defer = true;
|
||||||
|
document.head.appendChild(script);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('scroll', loadGtag, { once: true });
|
||||||
|
window.addEventListener('mousemove', loadGtag, { once: true });
|
||||||
|
window.addEventListener('touchstart', loadGtag, { once: true });
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
</head>
|
||||||
|
<body class="theme-{{ config.extra.zolanight.theme | default(value="tokyonight") }}">
|
||||||
|
{% set root_section = get_section(path="_index.md") %}
|
||||||
|
<header>
|
||||||
|
<nav>
|
||||||
|
<a href="/">/home/</a>
|
||||||
|
|
||||||
|
{# Render subsections #}
|
||||||
|
{% for subsection_path in root_section.subsections %}
|
||||||
|
{% set subsection = get_section(path=subsection_path) %}
|
||||||
|
<a href="{{ subsection.permalink }}">{{ subsection.permalink | replace(from=config.base_url, to="") }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{# Render pages at the root #}
|
||||||
|
{% for page in root_section.pages %}
|
||||||
|
<a href="{{ page.permalink }}">{{ page.permalink | replace(from=config.base_url, to="") }}</a>
|
||||||
|
{% endfor %}
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
<hr>
|
||||||
|
<main>
|
||||||
|
{% block content %}{% endblock content %}
|
||||||
|
</main>
|
||||||
|
<hr>
|
||||||
|
<footer>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
42
templates/index.html
Normal file
42
templates/index.html
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}{{ section.title }} - {{ config.title }}{% endblock title %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<section>
|
||||||
|
{% if section.title %}
|
||||||
|
<h1>{{ section.title }}</h1>
|
||||||
|
{% endif %}
|
||||||
|
<div>
|
||||||
|
{{ section.content | safe }}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{% set blog_section = get_section(path="blog/_index.md") %}
|
||||||
|
{% if blog_section.pages | length > 0 %}
|
||||||
|
{% set latest = blog_section.pages | first %}
|
||||||
|
<article>
|
||||||
|
<h2><a href="{{ latest.permalink }}">{{ latest.title }}</a></h2>
|
||||||
|
{% if latest.date %}
|
||||||
|
<p><time datetime="{{ latest.date | date(format="%Y-%m-%d") }}">{{ latest.date | date(format="%Y-%m-%d") }}</time></p>
|
||||||
|
{% endif %}
|
||||||
|
{{ latest.content | safe }}
|
||||||
|
</article>
|
||||||
|
|
||||||
|
{% if blog_section.pages | length > 1 %}
|
||||||
|
<h2>Recent Posts</h2>
|
||||||
|
<ul>
|
||||||
|
{% for page in blog_section.pages | slice(start=1, end=6) %}
|
||||||
|
<li>
|
||||||
|
{% if page.date %}
|
||||||
|
<time datetime="{{ page.date | date(format="%Y-%m-%d") }}">{{ page.date | date(format="%Y-%m-%d") }}</time>
|
||||||
|
{% endif %}
|
||||||
|
<a href="{{ page.permalink }}">{{ page.title }}</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<p><a href="{{ get_url(path='@/blog/_index.md') }}">All posts →</a></p>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock content %}
|
||||||
25
templates/projects.html
Normal file
25
templates/projects.html
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}{{ section.title }} - {{ config.title }}{% endblock title %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{{ section.title }}</h1>
|
||||||
|
<div>
|
||||||
|
{{ section.content | safe }}
|
||||||
|
</div>
|
||||||
|
<ul class="projects">
|
||||||
|
{% for page in section.pages %}
|
||||||
|
<li>
|
||||||
|
<article>
|
||||||
|
<h2><a href="{{ page.permalink }}">{{ page.title }}</a></h2>
|
||||||
|
{% if page.description %}
|
||||||
|
<p>{{ page.description }}</p>
|
||||||
|
{% endif %}
|
||||||
|
{% if page.extra.url %}
|
||||||
|
<p><a href="{{ page.extra.url }}">{{ page.extra.url }}</a></p>
|
||||||
|
{% endif %}
|
||||||
|
</article>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endblock content %}
|
||||||
1
themes/zolanight
Submodule
1
themes/zolanight
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 98576b4ffbb1188e6571063bc6b868101ea5bbde
|
||||||
19
zola.toml
Normal file
19
zola.toml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# The URL the site will be built for
|
||||||
|
base_url = "https://w5isp.com"
|
||||||
|
|
||||||
|
# Theme
|
||||||
|
theme = "zolanight"
|
||||||
|
|
||||||
|
# Whether to automatically compile all Sass files in the sass directory
|
||||||
|
compile_sass = true
|
||||||
|
|
||||||
|
# Whether to build a search index to be used later on by a JavaScript library
|
||||||
|
build_search_index = false
|
||||||
|
|
||||||
|
[markdown]
|
||||||
|
|
||||||
|
[markdown.highlighting]
|
||||||
|
theme = "catppuccin-mocha"
|
||||||
|
|
||||||
|
[extra]
|
||||||
|
# Put all your custom variables here
|
||||||
Loading…
Add table
Reference in a new issue