Getting Started
Install sukr and build your first site
This guide walks you through installing sukr and creating your first static site.
Installation¶
From source (recommended)¶
git clone https://github.com/nrdxp/sukr
cd sukr
cargo install --path .
With Nix¶
nix build github:nrdxp/sukr
./result/bin/sukr --help
Create Your First Site¶
1. Create directory structure¶
mkdir my-site && cd my-site
mkdir -p content templates static
2. Create configuration¶
Create site.toml:
title = "My Site"
author = "Your Name"
base_url = "https://example.com"
3. Create homepage¶
Create content/_index.md:
---
title: Welcome
description: My awesome site
---
# Hello, World!
This is my site built with sukr.
4. Create templates¶
Create templates/base.html:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ title }} | {{ config.title }}</title>
<link rel="stylesheet" href="{{ prefix }}/style.css" />
</head>
<body>
<main>{% block content %}{% endblock content %}</main>
</body>
</html>
Create templates/page.html:
{% extends "base.html" %} {% block content %}
<article>
<h1>{{ page.title }}</h1>
{{ content | safe }}
</article>
{% endblock content %}
Create templates/content/default.html:
{% extends "base.html" %} {% block content %}
<article>
<h1>{{ page.title }}</h1>
{{ content | safe }}
</article>
{% endblock content %}
Your templates directory should look like this:
templates/
├── base.html
├── page.html
└── content/
└── default.html
5. Build¶
sukr
6. View your site¶
Open public/index.html in your browser. You should see your "Hello, World!" page rendered with the template you created.
Next Steps¶
- Deployment — put your site on the web
- Configuration — customize
site.tomloptions (paths, navigation, base URL) - Content Organization — learn how directories map to site sections
- Features — syntax highlighting, math, diagrams, and more