docs: fix tutorial path with inline templates
Replace stale `cargo install sukr` with install-from-source. Replace Step 4 dead-end with inline base.html, page.html, and content/default.html templates. Add "View your site" completion step. Improve Next Steps with reading-order context.
This commit is contained in:
@@ -21,7 +21,9 @@ Most static site generators punt rich content to the browser. sukr doesn't.
|
||||
|
||||
```bash
|
||||
# Install
|
||||
cargo install sukr
|
||||
git clone https://github.com/nrdxp/sukr
|
||||
cd sukr
|
||||
cargo install --path .
|
||||
|
||||
# Create site structure
|
||||
mkdir -p content templates static
|
||||
|
||||
@@ -59,7 +59,54 @@ This is my site built with sukr.
|
||||
|
||||
### 4. Create templates
|
||||
|
||||
Copy the default templates from the sukr repository, or create your own Tera templates.
|
||||
Create `templates/base.html`:
|
||||
|
||||
```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`:
|
||||
|
||||
```html
|
||||
{% extends "base.html" %} {% block content %}
|
||||
<article>
|
||||
<h1>{{ page.title }}</h1>
|
||||
{{ content | safe }}
|
||||
</article>
|
||||
{% endblock content %}
|
||||
```
|
||||
|
||||
Create `templates/content/default.html`:
|
||||
|
||||
```html
|
||||
{% extends "base.html" %} {% block content %}
|
||||
<article>
|
||||
<h1>{{ page.title }}</h1>
|
||||
{{ content | safe }}
|
||||
</article>
|
||||
{% endblock content %}
|
||||
```
|
||||
|
||||
Your templates directory should look like this:
|
||||
|
||||
```text
|
||||
templates/
|
||||
├── base.html
|
||||
├── page.html
|
||||
└── content/
|
||||
└── default.html
|
||||
```
|
||||
|
||||
### 5. Build
|
||||
|
||||
@@ -67,9 +114,12 @@ Copy the default templates from the sukr repository, or create your own Tera tem
|
||||
sukr
|
||||
```
|
||||
|
||||
Your site is now in `public/`.
|
||||
### 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
|
||||
|
||||
- Learn about [Configuration](configuration.html)
|
||||
- Explore [Features](features/index.html)
|
||||
- [Configuration](configuration.html) — customize `site.toml` options (paths, navigation, base URL)
|
||||
- [Content Organization](content-organization.html) — learn how directories map to site sections
|
||||
- [Features](features/index.html) — syntax highlighting, math, diagrams, and more
|
||||
|
||||
@@ -61,13 +61,13 @@ None. All CHALLENGE questions resolved.
|
||||
## Phases
|
||||
|
||||
1. **Phase 1: Fix Stale Content** — every factual claim matches reality
|
||||
- [ ] S1: Replace `cargo install sukr` in `_index.md` with `cargo install --path .` after clone
|
||||
- [ ] S4: Replace Step 4 dead-end in `getting-started.md` with inline minimal templates (base.html, page.html, content/default.html)
|
||||
- [x] S1: Replace `cargo install sukr` in `_index.md` with `cargo install --path .` after clone
|
||||
- [x] S4: Replace Step 4 dead-end in `getting-started.md` with inline minimal templates (base.html, page.html, content/default.html)
|
||||
- [ ] S5: Normalize "Sukr" → "sukr" in `architecture.md`
|
||||
- [ ] S6: Normalize `title` in `docs/site.toml`
|
||||
- [ ] S7: Fix template override path in `templates.md` (`page/special.html` → `content/special.html`)
|
||||
- [ ] S9: Update copyright in `docs/templates/base.html` (2024 → 2026, or remove if unnecessary for OSS)
|
||||
- [ ] Add "view your site" final step to `getting-started.md` with expected output
|
||||
- [x] Add "view your site" final step to `getting-started.md` with expected output
|
||||
|
||||
2. **Phase 2: Structural Rework** — every page declares one quadrant, serves one audience
|
||||
- [ ] Rewrite `_index.md` as explanation quadrant (what sukr is, why it exists, link to tutorial)
|
||||
|
||||
Reference in New Issue
Block a user