diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index d5b2a76..40c0fa7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ +# zig .zig-cache zig-out zig-pkg + +# dev +.direnv/ *.tar diff --git a/.luaurc b/.luaurc new file mode 100644 index 0000000..1ad69be --- /dev/null +++ b/.luaurc @@ -0,0 +1,6 @@ +{ + "aliases": { + "maivi": "./lua/maivi", + "lune": "~/.lune/.typedefs/0.10.4/" + } +} diff --git a/.nvim.lua b/.nvim.lua new file mode 100644 index 0000000..4e25dab --- /dev/null +++ b/.nvim.lua @@ -0,0 +1,3 @@ +vim.lsp.enable("lua_ls", false) +-- vim.lsp.enable("emmylua_ls") +vim.lsp.enable("luau_lsp") diff --git a/build.zig b/build.zig index 8c8d9dc..f51b55d 100644 --- a/build.zig +++ b/build.zig @@ -6,7 +6,7 @@ const std = @import("std"); // for defining build steps and express dependencies between them, allowing the // build runner to parallelize the build automatically (and the cache system to // know when a step doesn't need to be re-run). -pub fn build(b: *std.Build) void { +pub fn build(b: *std.Build) !void { // Standard target options allow the person running `zig build` to choose // what target to build for. Here we do not override the defaults, which // means any target is allowed, and the default is native. Other options @@ -41,6 +41,30 @@ pub fn build(b: *std.Build) void { .target = target, }); + const exe_options = b.addOptions(); + mod.addOptions("opts", exe_options); + + const opt_version_string = b.option([]const u8, "version-string", "Override version string. Default is to find out with git."); + const version_slice = if (opt_version_string) |version| version else v: { + if (!std.process.can_spawn) { + std.debug.print("error: version info cannot be retrieved from git. version must be provided using -Dversion-string\n", .{}); + std.process.exit(1); + } + + var code: u8 = undefined; + const git_rev_untrimmed = try b.runAllowFail(&[_][]const u8{ + "git", + "-C", b.build_root.path orelse ".", // affects the --git-dir argument + "--git-dir", ".git", // affected by the -C argument + "rev-parse", "HEAD", + }, &code, .ignore); + const git_rev = std.mem.trim(u8, git_rev_untrimmed, " \n\r"); + + break :v git_rev; + }; + const version = try b.allocator.dupeZ(u8, version_slice); + exe_options.addOption([:0]const u8, "version", version); + // Here we define an executable. An executable needs to have a root module // which needs to expose a `main` function. While we could add a main function // to the module defined above, it's sometimes preferable to split business @@ -83,6 +107,15 @@ pub fn build(b: *std.Build) void { }), }); + const zlua = b.dependency("zlua", .{ + .target = target, + .optimize = optimize, + .lang = .luau, + }); + + mod.addImport("zlua", zlua.module("zlua")); + exe.root_module.addImport("zlua", zlua.module("zlua")); + const logz = b.dependency("logz", .{ .target = target, .optimize = optimize, diff --git a/build.zig.zon b/build.zig.zon index 4c55a3b..87da51a 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -35,6 +35,10 @@ .url = "git+https://github.com/karlseguin/log.zig?ref=master#7fa8de39ad4d4adc54fce4d9bb0b6bc6c0076592", .hash = "logz-0.0.0-O9YWXsllAgBq-S0z6q8AInWjei8h7polkVVRzJIGE-jW", }, + .zlua = .{ + .url = "git+https://github.com/natecraddock/ziglua?ref=main#b23143c54b2fc5207825336fb7e61220756dc0a6", + .hash = "zlua-0.1.0-hGRpC4t-BQDQJLgY32R_bGhGNHNNULWAh5ltxho4_pQw", + }, }, .paths = .{ "build.zig", diff --git a/data/_index.md b/data/_index.md new file mode 100644 index 0000000..a0e79c8 --- /dev/null +++ b/data/_index.md @@ -0,0 +1,21 @@ +## 🪴 garden + +welcome to my internet garden, a cozy corner of the internet for storing my ideas and sharing what i'm working on. + +```bash +curl -L robinwobin.dev +``` + +in my garden you can find my [blog posts](/blog) and more frequently some small [notes](/notes). + +this is where i keep the tools i've built - small creations designed to make +development smoother, workflows simpler, and ideas easier to bring to life. + +- evergarden - a soft, nature-inspired colorscheme +- ivy - a nix-based neovim setup +- lynn.nvim - a lightweight neovim plugin manager _(you can read more about it [here](/blog/neovim-native-configuration))_ +- artio.nvim - a minimal, nature-infused file picker for neovim using the new extui window + +more tools are always growing here - check back later! 🌿 + +you can find links to some cool people on the [badges](/badges) page. diff --git a/data/about.md b/data/about.md new file mode 100644 index 0000000..d0df260 --- /dev/null +++ b/data/about.md @@ -0,0 +1,31 @@ ++++ +title = "about me :)" ++++ + +###### ✨ i'm passionate about: + + + +###### 🌱 in my projects, i blend these passions together: + + + +> _"Among the roses, beneath the twilight."_ 🌙🌿 + +## how this site was build + +this site is build using the following tools: + +- zola, for static site generation +- nix, for reproducible builds everywhere + +you can read more about it [here](@/blog/building-this-site.md). diff --git a/data/badges.md b/data/badges.md new file mode 100644 index 0000000..9e891da --- /dev/null +++ b/data/badges.md @@ -0,0 +1,74 @@ ++++ +title = "badges" +description = "collection of cool badges" ++++ + +{{ badge( + name="robin", + url="https://robinwobin.dev", + img="/badges/me.gif") }} + +```html +robin's 88x31 +``` + +## frends :) + +some awesome people with pretty sites + +{{ badge( + name="june", + url="https://koi.rip", + img="/badges/mimi-the-car.gif") }} +{{ badge( + name="april", + url="https://aprl.pet", + img="/badges/april.gif") }} +{{ badge( + name="kaya", + url="https://tired.moe", + img="/badges/tired.moe.gif") }} +{{ badge( + name="diza", + url="https://dbw.neocities.org", + img="/badges/dbw.png") }} +{{ badge( + name="tasky", + url="https://uwu.network/~tasky", + img="/badges/tasky.webp") }} +{{ badge( + name="elissa", + url="https://elissa.moe", + img="/badges/elissa.png") }} +{{ badge( + name="chloe", + url="https://sapphic.moe", + img="/badges/sapphic.png") }} + +## coil sites + +{{ badge( + name="dinpixels", + url="https://dinpixels.neocities.org", + img="https://dinpixels.neocities.org/src/img/buttons/dinbtn0.gif") }} +{{ badge( + name="oyaswmi", + url="https://oyaswmi.net", + img="https://oyaswmi.net/legacy/stamps/OyaButton.gif" ) }} +{{ badge( + name="appledust", + url="https://www.lejlart.com", + img="https://www.lejlart.com/flist/ad_skullsprinkles.gif" ) }} +{{ badge( + name="lilithdev", + url="https://lilithdev.neocities.org", + img="https://lilithdev.neocities.org/buttons/lilithdevbtn.gif" ) }} +{{ badge( + name="espy", + url="https://espy.world", + img="https://espy.world/img/button.gif" ) }} diff --git a/data/blog/_index.md b/data/blog/_index.md new file mode 100644 index 0000000..cc04f9f --- /dev/null +++ b/data/blog/_index.md @@ -0,0 +1,9 @@ ++++ +title = "blog" +description = "questionable ideas put to paper" +sort_by = "date" +template = "pages/blog.html" +page_template = "pages/post.html" +insert_anchor_links = "left" ++++ + diff --git a/data/blog/building-this-site.md b/data/blog/building-this-site.md new file mode 100644 index 0000000..7d2c6e7 --- /dev/null +++ b/data/blog/building-this-site.md @@ -0,0 +1,104 @@ ++++ +title = "building this site" +date = 2025-01-22 +updated = 2026-01-07 +description = "my tiny adventure in static site generation" +[taxonomies] +tags = ["site"] ++++ + +## static site generation + +while looking for a static site generator for my site i tried a few interesting +tools, like hugo and astro. i even tried building my own ssg (which failed +miserably). in the end i discovered zola, simple static site generator +written in rust. zola uses tera templates to build sites with minimal effort. + +zola separates content from templates. where markdown files can specify which +templates to use. + +### templates + +here is my blog page. it specifies a template to use for the section. in this +template i can use zola's section variables to create a dynamic posts page +(which i'll get into in a bit). + +```markdown ++++ +title = "blog" +description = "questionable ideas put to paper" +sort_by = "date" +template = "pages/blog.html" +page_template = "pages/post.html" ++++ +``` + +the blog page also specifies a `page_template`. this is the template that will +be used for all child pages (my blogposts). + +in my `pages/blog.html` template i can use zola's section variables to iterate +over all my blogposts and generate a list at build time. + +```tera +{% block content %} + {{ section.content | safe }} + +{% endblock content %} +``` + +## build and deploy + +to ease building and deploying the site i use nix to setup my tools and build. +because the site is static i simply can use github pages to deploy. + +the nix builder simply takes zola as a buildinput and runs the build. i then +copy the static content to the `$out` directory. + +```nix +stdenvNoCC.mkDerivation { + src = ./.; + + nativeBuildInputs = [ + zola + ]; + + buildPhase = '' + runHook preBuild + zola build + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -r public/* $out + + runHook postInstall + ''; +} +``` + +deployment is done using a single github +action you can find +[here](https://codeberg.org/comfysage/site/src/commit/0b94d7338c1d7c50c09635b4d20fbeab552d58fd/.github/workflows/deploy.yml). + +{% callout(class="note", title="update: codeberg ci") %} +deployment is now done with codeberg ci +using woodpecker using the config you can +find +[here](https://codeberg.org/comfysage/site/src/commit/0b94d7338c1d7c50c09635b4d20fbeab552d58fd/.woodpecker/deploy.yaml) +{% end %} + +## resources + +