Refactors website to use zine-ssg.io

wch-ch32v003
Felix "xq" Queißner 7 months ago committed by Felix Queißner
parent 9a73dab34d
commit fe9bafc828

@ -0,0 +1,2 @@
# use_nix
use_flake

1
.gitignore vendored

@ -1,3 +1,4 @@
zig-cache/
render/
zig-out/
.direnv/

3
.gitmodules vendored

@ -1,3 +0,0 @@
[submodule "deps/koino"]
path = deps/koino
url = https://github.com/MasterQ32/koino

@ -28,7 +28,6 @@ Things that should be written eventually.
- What device to chose?
- Introduction to HAL 9001
- Articles
- `async`/`await` on embedded platforms
- Creating your own JTAG debugger
- Black Magic Probe
- https://paramaggarwal.medium.com/converting-an-stm32f103-board-to-a-black-magic-probe-c013cf2cc38c

@ -1,33 +1,15 @@
const std = @import("std");
const pkgs = struct {
const koino = std.build.Pkg{
.name = "koino",
.source = .{ .path = "./deps/koino/src/koino.zig" },
.dependencies = &[_]std.build.Pkg{
std.build.Pkg{ .name = "libpcre", .source = .{ .path = "deps/koino/vendor/libpcre/src/main.zig" } },
std.build.Pkg{ .name = "htmlentities", .source = .{ .path = "deps/koino/vendor/htmlentities/src/main.zig" } },
std.build.Pkg{ .name = "clap", .source = .{ .path = "deps/koino/vendor/zig-clap/clap.zig" } },
std.build.Pkg{ .name = "zunicode", .source = .{ .path = "deps/koino/vendor/zunicode/src/zunicode.zig" } },
const zine = @import("zine");
pub fn build(b: *std.Build) !void {
// zine.scriptyReferenceDocs(b, "content/documentation/scripty/index.md");
try zine.addWebsite(b, .{
.layouts_dir_path = "layouts",
.content_dir_path = "content",
.static_dir_path = "static",
.site = .{
.base_url = "https://microzig.tech",
.title = "Zig Embedded Group",
},
};
};
const linkPcre = @import("deps/koino/vendor/libpcre/build.zig").linkPcre;
pub fn build(b: *std.build.Builder) !void {
const target = b.standardTargetOptions(.{});
const mode = b.standardReleaseOptions();
const render_website = b.addExecutable("zeg-website", "src/main.zig");
render_website.setTarget(target);
render_website.setBuildMode(mode);
try linkPcre(render_website);
render_website.addPackage(pkgs.koino);
render_website.install();
const gen_cmd = render_website.run();
const gen_step = b.step("gen", "Generates the website");
gen_step.dependOn(&gen_cmd.step);
});
}

@ -0,0 +1,11 @@
.{
.name = "microzig.tech",
.version = "0.2.0",
.paths = .{"."},
.dependencies = .{
.zine = .{
.url = "https://github.com/kristoff-it/zine/archive/03f80646b83cadb2e693ff5d97445d3e16c8e222.tar.gz",
.hash = "1220e3e4938edf652776349c45b3bb58774d540a050034488ff8dab7dbe410cc2977",
},
},
}

@ -0,0 +1,11 @@
---
{
"title": "Home",
"date": "2020-07-06T00:00:00",
"author": "Felix Queißner",
"draft": false,
"layout": "getting-started.html",
"tags": []
}
---
Dummy, full text is implemented in the HTML file for now.

@ -0,0 +1,11 @@
---
{
"title": "Home",
"date": "2020-07-06T00:00:00",
"author": "Felix Queißner",
"draft": false,
"layout": "index.html",
"tags": []
}
---
Dummy, full text is implemented in the HTML file for now.

@ -1,3 +1,13 @@
---
{
"title": "Embedded Basics",
"date": "2020-07-06T00:00:00",
"author": "Felix Queißner",
"draft": false,
"layout": "tutorial.html",
"tags": []
}
---
# Embedded Basics
In this tutorial, you'll learn the absolute basics of the embedded world. If
@ -21,6 +31,7 @@ Wikipedia does a good job defining embedded systems with this opener:
So at the end of the day, if you are adding any sort of computation to some object who's main purpose is not being a computer, it's an embedded system.
Some examples of Embedded systems:
- cars
- industrial control systems
- mars rovers

@ -1,3 +1,13 @@
---
{
"title": "Embedded Basics",
"date": "2020-07-06T00:00:00",
"author": "Felix Queißner",
"draft": false,
"layout": "tutorial.html",
"tags": []
}
---
# Embedded Programming
In this tutorial, you'll learn the ways of the embedded programmer and how to master your MCU.
@ -39,7 +49,7 @@ And last, but not least: You need a [text editor of your choice](https://en.wiki
So to get an embedded program up and running, we first need to check out the *memory map* in the datasheet. These usually look like this:
![Memory Map of LPC1768](../img/memory-map.png)
![Memory Map of LPC1768](memory-map.png)
Here you can see that the memory contains continuous flash memory (*On-chip [non-volatile memory](https://en.wikipedia.org/wiki/Non-volatile_memory)*), two sections of SRAM (*On-chip [SRAM](https://en.wikipedia.org/wiki/Static_random-access_memory)*), some *Boot ROM*, and peripherials.
@ -127,7 +137,7 @@ extern fn _start() callconv(.Naked) noreturn {
std.mem.copy(u8, dst_ptr[0..length], src_ptr[0..length]);
// call your program enty point here:
//
}
```

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 159 KiB

1
deps/koino vendored

@ -1 +0,0 @@
Subproject commit 5ea268b50116f2f06bfa9b83f24324ec8c211be1

@ -0,0 +1,146 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1708682153,
"narHash": "sha256-5sMDOig3rOe5/2yrhiVjQZnVranorjKHVkzQGmZNNLY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "33a498b7b1e3af01cb9f99bed64c96c1b4acaa70",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1702350026,
"narHash": "sha256-A+GNZFZdfl4JdDphYKBJ5Ef1HOiFsP18vQe9mqjmUis=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9463103069725474698139ab10f17a9d125da859",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"zig": "zig"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"zig": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1708647717,
"narHash": "sha256-iA+MJG6isCog6KIq9uyyTmBMacJCwIuecBbkZol8XiE=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "433ed3117af772faad68a50dcf0199bf273f8721",
"type": "github"
},
"original": {
"owner": "mitchellh",
"repo": "zig-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

@ -0,0 +1,52 @@
{
description = "microzig website environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-23.11";
flake-utils.url = "github:numtide/flake-utils";
# required for latest zig
zig.url = "github:mitchellh/zig-overlay";
# Used for shell.nix
flake-compat = {
url = github:edolstra/flake-compat;
flake = false;
};
};
outputs =
{ self
, nixpkgs
, flake-utils
, ...
} @ inputs:
let
overlays = [
(final: prev: { zigpkgs = inputs.zig.packages.${prev.system}; })
];
# Our supported systems are the same supported systems as the Zig binaries
systems = builtins.attrNames inputs.zig.packages;
in
flake-utils.lib.eachSystem systems (
system:
let
pkgs = import nixpkgs { inherit overlays system; };
in
rec {
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ pkgs.zigpkgs.master ];
buildInputs = [ pkgs.bashInteractive ];
shellHook = ''
export SHELL=${pkgs.bashInteractive}/bin/bash
'';
};
# For compatibility with older versions of the `nix` binary
devShell = self.devShells.${system}.default;
}
);
}

@ -1,4 +1,8 @@
<div id="intro">
<extend template="base.html"/>
<title id="title" var="$page.title"></title>
<div id="content">
<nav id="intro-nav">
<h1><a href="/">zig embedded group</a> -&nbsp;learn</h1>
<img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">

@ -1,4 +1,8 @@
<div id="intro">
<extend template="base.html"/>
<title id="title" var="$page.title"></title>
<div id="content">
<nav id="intro-nav">
<h1>zig embedded group</h1>
<img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">
@ -46,7 +50,7 @@
discord</a></li>
<li><img class="inline" src="img/chat-irc.svg">&nbsp;<a href="irc://irc.libera.chat/microzig">microzig
irc channel</a> (<a target="_blank"
href="https://kiwiirc.com/nextclient/irc.libera.chat/#microzig">webchat</a>)</a>
href="https://kiwiirc.com/nextclient/irc.libera.chat/#microzig">webchat</a>)
</li>
<li><img class="inline" src="img/chat-discord.svg">&nbsp;<a href="https://discord.gg/TyzJXjser6">zig
language

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title id="title"><super/> - Zig Embedded Group</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Zig Embedded Group: Bringing joy to the world of embedded development">
<meta name="twitter:card" content="summary">
<!--
<meta name="twitter:site" content="@croloris">
<meta name="twitter:author" content="@croloris">
-->
<meta name="twitter:description" content="Zig Embedded Group: Bringing joy to the world of embedded development">
<meta name="twitter:title" content="$page.title.suffix(' - Zig Embedded Group')">
<meta property="og:title" content="$page.title">
<meta property="og:type" content="website">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="content"><super/></div>
</body>
</html>

@ -0,0 +1,17 @@
<extend template="base.html"/>
<title id="title" var="$page.title"></title>
<div id="content">
<nav id="intro-nav">
<h1>zig embedded group</h1>
<img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">
</nav>
<div id="page" var="$page.content"></div>
<footer>
<img src="img/ember.svg" alt="vectorized Ember, the awesome zeg mascot!">
</footer>
</div>

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 796 B

After

Width:  |  Height:  |  Size: 796 B

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

@ -113,7 +113,7 @@ strong a {
color: #f7a41d
}
#intro {
#content {
padding: 80px
}
Loading…
Cancel
Save