Compare commits

..

1 Commits

Author SHA1 Message Date
mat ess 440b1ab216 Test commit
continuous-integration/drone/pr Build was killed Details
continuous-integration/drone/push Build is passing Details
2022-11-19 13:52:49 -05:00
30 changed files with 184 additions and 315 deletions

View File

@ -1,64 +1,54 @@
local PROD = 'production'; local Volume = { name: 'site', path: '/site' };
local STAGE = 'staging';
local NIX = 'nix --extra-experimental-features nix-command --extra-experimental-features flakes';
local Secrets(secrets) = {
environment: {
[secret]: { from_secret: std.asciiLower(secret) }
for secret in secrets
},
};
local WhenProd(prod) = if prod then { local WhenProd(prod) = if prod then {
event: ['promote'], event: ['promote'],
target: [PROD], target: ['production'],
} else { } else {
target: { exclude: [PROD] }, target: { exclude: ['production'] },
}; };
local Step(env, name, cmds, extras={}) =
local prod = env == PROD;
{
name: name + ' ' + env,
image: 'nixos/nix:latest',
volumes: [
{ name: 'site', path: '/site' },
{ name: 'cache', path: '/nix/store' },
],
commands: cmds,
when: WhenProd(prod),
} + extras;
local NixStep(env) = local NixStep(env) =
local prod = env == PROD; local prod = env == 'production';
local output = if prod then '' else ' .#staging-site'; local output = if prod then '' else ' .#staging-site';
Step(env, 'nix build', [ {
NIX + ' build' + output, name: 'nix build ' + env,
image: 'nixos/nix:latest',
volumes: [Volume],
commands: [
'$NIX build' + output,
'cp -r result/* /site/', 'cp -r result/* /site/',
]); ],
when: WhenProd(prod),
local DeployStep(env) = };
local prod = env == PROD; local NetlifyStep(env) =
local options = if prod then '--prod' else '--alias staging'; local prod = env == 'production';
Step(env, 'netlify deploy', [ {
NIX + ' profile install nixpkgs#netlify-cli', name: 'netlify deploy ' + env,
'netlify deploy -d /site --auth $NETLIFY_TOKEN --site $NETLIFY_SITE_ID --message "$DRONE_COMMIT_MESSAGE" ' + options, image: 'internetmat/drone-netlify:latest',
], Secrets(['NETLIFY_TOKEN', 'NETLIFY_SITE_ID'])); pull: 'always',
volumes: [Volume],
settings: {
token: { from_secret: 'netlify_token' },
site: { from_secret: 'netlify_site_id' },
alias: env,
path: '/site',
prod: prod,
},
when: WhenProd(prod),
};
{ {
kind: 'pipeline', kind: 'pipeline',
type: 'docker', type: 'docker',
name: 'default', name: 'default',
volumes: [ environment: {
{ name: 'site', temp: {} }, NIX: 'nix --extra-experimental-features nix-command --extra-experimental-features flakes',
{ name: 'cache', host: { path: '/data/cache' } }, },
],
volumes: [{ name: 'site', temp: {} }],
steps: [ steps: [
NixStep(STAGE), NixStep('staging'),
NixStep(PROD), NixStep('production'),
DeployStep(STAGE), NetlifyStep('staging'),
DeployStep(PROD), NetlifyStep('production'),
], ],
} }

3
.gitignore vendored
View File

@ -10,6 +10,3 @@ static/style/fonts.css
# Local Netlify folder # Local Netlify folder
.netlify .netlify
# local pre-commit config
.pre-commit-config.yaml

0
.gitkeep Normal file
View File

View File

@ -1,5 +1,6 @@
# mat.services # mat.services
## my personal site ## my personal site
[![Build Status](https://build.mat.services/api/badges/mat/mat.services/status.svg)](https://build.mat.services/mat/mat.services)
[![Netlify Status](https://api.netlify.com/api/v1/badges/3f5578c4-e3f5-4c22-abb5-29fd22f34b42/deploy-status)](https://app.netlify.com/sites/mat-services/deploys) [![Netlify Status](https://api.netlify.com/api/v1/badges/3f5578c4-e3f5-4c22-abb5-29fd22f34b42/deploy-status)](https://app.netlify.com/sites/mat-services/deploys)
built using zola and nix built using zola and nix

View File

@ -1,2 +0,0 @@
[default.extend-words]
referer = "referer"

View File

@ -1,6 +1,6 @@
base_url = "https://www.mat.services" base_url = "https://www.mat.services"
title = "mat.services" title = "mat.services"
description = "the personal website of mat ess" description = "the personal website of matthew ess"
default_language = "en" default_language = "en"
compile_sass = true compile_sass = true
@ -45,6 +45,7 @@ menu = [
] ]
me_links = [ me_links = [
{ name = "stereophonic.space", url = "https://stereophonic.space/mat" },
{ name = "pijul nest", url = "https://nest.pijul.com/mat" }, { name = "pijul nest", url = "https://nest.pijul.com/mat" },
{ name = "lobste.rs", url = "https://lobste.rs/u/mat" }, { name = "lobste.rs", url = "https://lobste.rs/u/mat" },
{ name = "gitlab", url = "https://gitlab.com/matthewess" }, { name = "gitlab", url = "https://gitlab.com/matthewess" },

View File

@ -1,9 +1,9 @@
--- +++
title: "about me" title = "about me"
path: "about" path = "about"
--- +++
## mat ess (they/them) ## matthew ess (they/them)
i'm a 'software engineer'/'code monkey' by trade, currently employed by yelp inc in the engineering effectiveness department. my work is focused on improving the tooling used by other engineers at yelp to develop python services. i'm a 'software engineer'/'code monkey' by trade, currently employed by yelp inc in the engineering effectiveness department. my work is focused on improving the tooling used by other engineers at yelp to develop python services.
[you can look at my resume here](/resume). [you can look at my resume here](/resume).

View File

@ -1,5 +1,5 @@
--- +++
path: "posts" path = "posts"
template: "posts.html" template = "posts.html"
sort_by: "date" sort_by = "date"
--- +++

View File

@ -1,13 +1,13 @@
--- +++
title: "cellular automata toys in löve2d" title = "cellular automata toys in löve2d"
date: "2022-09-15" date = "2022-09-15"
description: "a short announcement post for a few interactive cellular automata toys written in lua" description = "a short announcement post for a few interactive cellular automata toys written in lua"
taxonomies: [taxonomies]
tags: ["cellular-automata", "lua", "löve2d"] tags = ["cellular-automata", "lua", "löve2d"]
extra: [extra]
hero: true hero = true
heroPrompt: "The oracle reading the future from Conway's Game of Life, technomancer aesthetic, digital illustration, 8k uhd" heroPrompt = "The oracle reading the future from Conway's Game of Life, technomancer aesthetic, digital illustration, 8k uhd"
--- +++
after reading [Andrew Healey's blog post about Langton's Ant](https://healeycodes.com/virtual-ants), i found myself inspired to reimplement some of his work. i've read numerous rave reviews of löve2d for writing simple toys, so i decided to give that a shot here as well. Langton's Ant went well enough that i also implemented Life and Wireworld. after reading [Andrew Healey's blog post about Langton's Ant](https://healeycodes.com/virtual-ants), i found myself inspired to reimplement some of his work. i've read numerous rave reviews of löve2d for writing simple toys, so i decided to give that a shot here as well. Langton's Ant went well enough that i also implemented Life and Wireworld.

View File

@ -1,13 +1,13 @@
--- +++
title: "passing command line arguments to nix flakes" title = "passing command line arguments to nix flakes"
date: "2022-10-10" date = "2022-10-10"
description: "a tutorial on 'breaking' the hermeticity of nix flakes by adding convenient command line flags" description = "a tutorial on 'breaking' the hermeticity of nix flakes by adding convenient command line flags"
taxonomies: [taxonomies]
tags: ["nix"] tags = ["nix"]
extra: [extra]
hero: true hero = true
heroPrompt: "A rogue program hacking through the firewall, in the style of Tron Legacy, cyberpunk vibe, digital render, 8k uhd, unreal engine" heroPrompt = "A rogue program hacking through the firewall, in the style of Tron Legacy, cyberpunk vibe, digital render, 8k uhd, unreal engine"
--- +++
[Nix flakes](https://serokell.io/blog/practical-nix-flakes) are very useful, but the feature of a [fully hermetic build](https://bazel.build/basics/hermeticity) also means that they carry with them a certain degree of inflexibility. [Users have asked for a mechanism to parameterize flakes](https://github.com/NixOS/nix/issues/2861#issuecomment-891521971), but there seems to be no interest from the Nix maintainers in adding such a feature. [Nix flakes](https://serokell.io/blog/practical-nix-flakes) are very useful, but the feature of a [fully hermetic build](https://bazel.build/basics/hermeticity) also means that they carry with them a certain degree of inflexibility. [Users have asked for a mechanism to parameterize flakes](https://github.com/NixOS/nix/issues/2861#issuecomment-891521971), but there seems to be no interest from the Nix maintainers in adding such a feature.
@ -126,7 +126,7 @@ If software builds are functions, then Nix flakes are pure functions. Indeed, th
builder.url = "..."; builder.url = "...";
source.url = "..."; source.url = "...";
}; };
outputs = { self, builder, source }: { ouputs = { self, builder, source }: {
software = builder.build source; software = builder.build source;
}; };
} }

View File

@ -1,10 +1,10 @@
--- +++
title: "diy code hosting with gitea and fly.io" title = "diy code hosting with gitea and fly.io"
date: "2022-08-07" date = "2022-08-07"
updated: "2022-09-04" updated = "2022-09-04"
taxonomies: [taxonomies]
tags: ["git", "gitea", "fly.io"] tags = ["git", "gitea", "fly.io"]
--- +++
## Setting the Scene ## Setting the Scene
Inspired by the [Give Up Github campaign](https://sfconservancy.org/GiveUpGitHub/), I recently decided I wanted to spin up my own instance of [Gitea](https://gitea.io/). There are free (as in beer), free (as in freedom), public instances of Gitea and other FOSS-leaning code forges, but self-hosted Gitea struck me as a nice way to take even a bit more ownership over my own code. Inspired by the [Give Up Github campaign](https://sfconservancy.org/GiveUpGitHub/), I recently decided I wanted to spin up my own instance of [Gitea](https://gitea.io/). There are free (as in beer), free (as in freedom), public instances of Gitea and other FOSS-leaning code forges, but self-hosted Gitea struck me as a nice way to take even a bit more ownership over my own code.

View File

@ -1,13 +1,13 @@
--- +++
title: "now on netlify" title = "now on netlify"
date: "2022-10-16" date = "2022-10-16"
description: "a short update regarding me packing up my static site and moving from fly.io to netlify" description = "a short update regarding me packing up my static site and moving from fly.io to netlify"
taxonomies: [taxonomies]
tags: ["static-site", "netlify"] tags = ["static-site", "netlify"]
extra: [extra]
hero: true hero = true
heroPrompt: "A man packing up and leaving home to move to the city, luggage and boxes outside of his house, a moving truck idling in his driveway, gorgeous illustration, high quality art, masterpiece" heroPrompt = "A man packing up and leaving home to move to the city, luggage and boxes outside of his house, a moving truck idling in his driveway, gorgeous illustration, high quality art, masterpiece"
--- +++
a short update today, and one that (unfortunately) obsoletes a lot of the work I put into [my last post on static site hosting](@/posts/static-site-with-nix-and-caddy/index.md): this site is now hosted on netlify! after [my most recent article](@/posts/command-line-flake-arguments/index.md) ran into some accessibility issues for people outside of my fly.io deployment region, I decided to minimize the moving parts involved in keeping the site running. i moved my static content over to [netlify](https://www.netlify.com/), a well-liked PaaS for deploying webapps and static sites (they also offer other things I don't care about, such as "Serverless" and FaaS offerings). [netlify's configuration file](https://docs.netlify.com/configure-builds/file-based-configuration/) supports all the same headers and redirects options that I was using in caddy, so the transition was extremely smooth. a short update today, and one that (unfortunately) obsoletes a lot of the work I put into [my last post on static site hosting](@/posts/static-site-with-nix-and-caddy/index.md): this site is now hosted on netlify! after [my most recent article](@/posts/command-line-flake-arguments/index.md) ran into some accessibility issues for people outside of my fly.io deployment region, I decided to minimize the moving parts involved in keeping the site running. i moved my static content over to [netlify](https://www.netlify.com/), a well-liked PaaS for deploying webapps and static sites (they also offer other things I don't care about, such as "Serverless" and FaaS offerings). [netlify's configuration file](https://docs.netlify.com/configure-builds/file-based-configuration/) supports all the same headers and redirects options that I was using in caddy, so the transition was extremely smooth.

View File

@ -1,10 +1,10 @@
--- +++
title: "hosting a static site on fly.io with nix and caddy" title = "hosting a static site on fly.io with nix and caddy"
date: "2022-09-04" date = "2022-09-04"
updated: "2022-10-17" updated = "2022-10-17"
taxonomies: [taxonomies]
tags: ["static-site", "nix", "caddy", "fly.io"] tags = ["static-site", "nix", "caddy", "fly.io"]
--- +++
**UPDATE** **UPDATE**
most of the information on this page is no longer accurate for my blog, [which has since moved to netlify](@/posts/now-on-netlify/index.md). it should still work, or get you close, but i recommend checking out [`nix-fly-template`](https://github.com/LutrisEng/nix-fly-template). most of the information on this page is no longer accurate for my blog, [which has since moved to netlify](@/posts/now-on-netlify/index.md). it should still work, or get you close, but i recommend checking out [`nix-fly-template`](https://github.com/LutrisEng/nix-fly-template).

View File

@ -1,7 +1,7 @@
--- +++
title: "privacy notice" title = "privacy notice"
path: "privacy" path = "privacy"
--- +++
## summary ## summary
i want to respect your pivacy, while still getting some insight into the readership of my site. no "personally identifiable information" or "sensitive information" is collected, and no data is shared with external parties. i want to respect your pivacy, while still getting some insight into the readership of my site. no "personally identifiable information" or "sensitive information" is collected, and no data is shared with external parties.

View File

@ -1,16 +1,12 @@
--- +++
title: "selected projects" title = "selected projects"
path: "projects" path = "projects"
--- +++
## gemini for rust ## gemini for rust
`gemini` is a rust crate providing a small set of types useful for working with the Gemini protocol `gemini` is a rust crate providing a small set of types useful for working with the Gemini protocol
- [`gemini` on crates.io](https://crates.io/crates/gemini) - [`gemini` on crates.io](https://crates.io/crates/gemini)
- [`gemini` source on the pijul nest](https://nest.pijul.com/mat/gemini-projects:main/5II6T7YETYWUI.BEAAA) - [`gemini` source on the pijul nest](https://nest.pijul.com/mat/gemini-projects:main/5II6T7YETYWUI.BEAAA)
## mat.services
the static sources for this site are publicly available. perhaps the most interesting files for inspection are the nix configurations.
- [`mat.services` on git.mat.services](https://git.mat.services/mat/mat.services)
## other projects ## other projects
i am in the process of moving my active git-managed projects to a ["self"-hosted gitea instance](https://git.mat.services/mat), but currently some of my projects still live on [github](https://github.com/matthewess) or [gitlab](https://gitlab.com/matthewess). i occasionally work on projects using [pijul](https://pijul.org), which can be found on [the pijul nest](https://nest.pijul.com/mat). i am in the process of moving my active git-managed projects to a ["self"-hosted gitea instance](https://git.mat.services/mat), but currently some of my projects still live on [github](https://github.com/matthewess) or [gitlab](https://gitlab.com/matthewess). i occasionally work on projects using [pijul](https://pijul.org), which can be found on [the pijul nest](https://nest.pijul.com/mat).

View File

@ -1,7 +1,7 @@
--- +++
title: "resume" title = "resume"
path: "resume" path = "resume"
--- +++
## skills ## skills
### professional ### professional

View File

@ -16,32 +16,18 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1668681692,
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1668450977, "lastModified": 1664385320,
"narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=", "narHash": "sha256-uSCHb9RUqHRjTpI8OzyaUuHckFnnxwZqlXEuo+yUpYQ=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa", "rev": "45298bd207b26e1bcd030a0bb075aa2da29f8e30",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -50,21 +36,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -87,11 +58,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1670064435, "lastModified": 1665259268,
"narHash": "sha256-+ELoY30UN+Pl3Yn7RWRPabykwebsVK/kYE9JsIsUMxQ=", "narHash": "sha256-ONFhHBLv5nZKhwV/F2GOH16197PbvpyWhoO0AOyktkU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "61a8a98e6d557e6dd7ed0cdb54c3a3e3bbc5e25c", "rev": "c5924154f000e6306030300592f4282949b2db6c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -101,73 +72,12 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1665349835,
"narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1671271954,
"narHash": "sha256-cSvu+bnvN08sOlTBWbBrKaBHQZq8mvk8bgpt0ZJ2Snc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d513b448cc2a6da2c8803e3c197c9fc7e67b19e3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"gitignore": [
"gitignore"
],
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1671452357,
"narHash": "sha256-HqzXiQEegpRQ4VEl9pEPgHSIxhJrNJ27HfN1wOc7w2E=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "200790e9c77064c53eaf95805b013d96615ecc27",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"caddyfile-syntax": "caddyfile-syntax", "caddyfile-syntax": "caddyfile-syntax",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"gitignore": "gitignore", "gitignore": "gitignore",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs"
"pre-commit": "pre-commit"
} }
} }
}, },

View File

@ -4,21 +4,19 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
gitignore.url = "github:hercules-ci/gitignore.nix"; gitignore.url = "github:hercules-ci/gitignore.nix";
gitignore.inputs.nixpkgs.follows = "nixpkgs"; gitignore.inputs.nixpkgs.follows = "nixpkgs";
pre-commit.url = "github:cachix/pre-commit-hooks.nix";
pre-commit.inputs.nixpkgs.follows = "nixpkgs";
pre-commit.inputs.gitignore.follows = "gitignore";
caddyfile-syntax.url = "github:caddyserver/sublimetext"; caddyfile-syntax.url = "github:caddyserver/sublimetext";
caddyfile-syntax.flake = false; caddyfile-syntax.flake = false;
}; };
outputs = { self, flake-parts, gitignore, pre-commit, ... }@inputs: outputs = { self, flake-parts, gitignore, ... }@inputs:
flake-parts.lib.mkFlake { inherit self; } { flake-parts.lib.mkFlake { inherit self; } {
imports = [ pre-commit.flakeModule ]; imports = [ ];
systems = [ "x86_64-linux" "aarch64-darwin" ]; systems = [ "x86_64-linux" "aarch64-darwin" ];
perSystem = { config, pkgs, ... }: perSystem = { config, self', inputs', pkgs, system, ... }:
let let
inherit (gitignore.lib) gitignoreSource; inherit (gitignore.lib) gitignoreSource;
inherit (pkgs.callPackage ./nix { }) fonts optimize-images update-date; inherit (pkgs.callPackage ./nix { }) fonts optimize-images update-date;
@ -26,23 +24,25 @@
caddyfile-syntax = "${inputs.caddyfile-syntax}/Caddyfile.sublime-syntax"; caddyfile-syntax = "${inputs.caddyfile-syntax}/Caddyfile.sublime-syntax";
buildSite = { prod }: buildSite = { prod }:
let let
ifStaging = pkgs.lib.optionalString (!prod); inherit (pkgs.lib) optionalString;
ifStaging = optionalString (!prod);
rev = if (self ? rev) then self.rev else "dirty";
in in
'' ''
optimize-images optimize-images
zola build --drafts ${ifStaging "--base-url https://staging--mat-services.netlify.app"} zola build --drafts ${ifStaging "--base-url https://staging--mat-services.netlify.app"}
# zola's ignored_content setting doesn't work in static/ # zola's ignored_content setting doesn't work in static/
rm -rf public/image/_favicon.svg rm -rf public/image/_favicon.svg
convert public/image/favicon.svg -resize 256x256 public/favicon.ico
''; '';
in in
{ {
packages.default = with pkgs; stdenv.mkDerivation { packages.default = with pkgs; stdenv.mkDerivation {
pname = "personal-site"; pname = "personal-site";
version = "2023-02-01"; version = "2022-10-23";
src = gitignoreSource ./.; src = gitignoreSource ./.;
nativeBuildInputs = [ optimize-images update-date zola ]; nativeBuildInputs = [ imagemagick optimize-images update-date zola ];
configurePhase = '' configurePhase = copyFonts + ''
${copyFonts}
mkdir -p extra/syntax mkdir -p extra/syntax
cp ${caddyfile-syntax} extra/syntax cp ${caddyfile-syntax} extra/syntax
''; '';
@ -54,25 +54,12 @@
packages.staging-site = config.packages.default.overrideAttrs (_: { packages.staging-site = config.packages.default.overrideAttrs (_: {
buildPhase = buildSite { prod = false; }; buildPhase = buildSite { prod = false; };
}); });
pre-commit.settings.hooks = {
# nix hooks
deadnix.enable = true;
nix-linter.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
# general hooks
typos.enable = true;
typos.excludes = [ "webp" "png" "svg" "ico" ];
};
devShells.default = with pkgs; mkShell { devShells.default = with pkgs; mkShell {
packages = [ jsonnet netlify-cli optimize-images update-date zola ]; packages = [ optimize-images update-date zola ];
shellHook = '' shellHook = linkFonts + ''
${config.pre-commit.installationScript}
${linkFonts}
mkdir -p extra/syntax mkdir -p extra/syntax
ln -snf ${caddyfile-syntax} extra/syntax ln -snf ${caddyfile-syntax} extra/syntax
''; '';
inputsFrom = builtins.attrValues self.checks;
}; };
}; };
}; };

View File

@ -42,7 +42,7 @@
img-src 'self' https://stats.mat.services; img-src 'self' https://stats.mat.services;
style-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';
font-src 'self'; font-src 'self';
script-src 'self' https://stats.mat.services; script-src 'sha256-a8rh6u3maZ6JiY6w6zsLlw9OUQf2tFPUX3t1/BV+RKc=' 'strict-dynamic';
form-action 'none'; form-action 'none';
frame-ancestors 'none'; frame-ancestors 'none';
base-uri 'none'; base-uri 'none';

View File

@ -2,6 +2,7 @@
, lib , lib
, stdenv , stdenv
, woff2 , woff2
, writeShellScriptBin
, writeText , writeText
}: }:
let let
@ -44,7 +45,7 @@ rec {
name = "font-${pathName name}"; name = "font-${pathName name}";
src = fetchFromGitHub { src = fetchFromGitHub {
inherit owner repo rev sha256; inherit owner repo rev sha256;
sparseCheckout = [ path ]; sparseCheckout = path;
}; };
nativeBuildInputs = [ woff2 ]; nativeBuildInputs = [ woff2 ];
buildPhase = '' buildPhase = ''
@ -60,7 +61,7 @@ rec {
font = fontDerivation fontSrc; font = fontDerivation fontSrc;
}; };
fonts = map fetchFont fontSrcs; fonts = map fetchFont fontSrcs;
mkFontCss = { name, fileName, cssVar, ... }: mkFontCss = { font, name, fileName, cssVar }:
let path = pathName name; in '' let path = pathName name; in ''
@font-face { @font-face {
font-family: '${name}'; font-family: '${name}';

View File

@ -1,4 +1,4 @@
{ bc, imagemagick, libwebp, scour, writeShellScriptBin }: { bc, libwebp, scour, writeShellScriptBin }:
writeShellScriptBin "optimize-images" '' writeShellScriptBin "optimize-images" ''
shopt -s globstar nullglob shopt -s globstar nullglob
@ -14,5 +14,4 @@ writeShellScriptBin "optimize-images" ''
pct=$(${bc}/bin/bc <<< "scale=1; $newsize * 100 / $oldsize") pct=$(${bc}/bin/bc <<< "scale=1; $newsize * 100 / $oldsize")
echo "size went from "$(($oldsize / 1024))"KB to "$(($newsize / 1024))"KB ("$pct"% as large as original)" echo "size went from "$(($oldsize / 1024))"KB to "$(($newsize / 1024))"KB ("$pct"% as large as original)"
done done
${imagemagick}/bin/convert static/image/favicon.svg -resize 256x256 static/favicon.ico
'' ''

View File

@ -47,9 +47,8 @@ html {
} }
// Logo // Logo
div.brand > * { div.brand>* {
padding-left: 0.25em; padding: 0 0.25em;
padding-right: 0.25em;
} }
div.brand:hover img#logo { div.brand:hover img#logo {
@ -70,21 +69,13 @@ nav a {
} }
// Footer // Footer
html, body {
box-sizing: border-box;
height: 100%;
padding: 0;
margin: 0;
}
.content { .content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
min-height: 100%; min-height: 100vh;
box-sizing: border-box;
} }
main.inner { div.inner {
flex-grow: 1; flex-grow: 1;
} }
@ -98,10 +89,6 @@ footer {
margin: 2em; margin: 2em;
color: var(--text-1); color: var(--text-1);
font-size: 0.75em; font-size: 0.75em;
}
@media (min-width: 500px) {
footer {
display: flex; display: flex;
#site-info { #site-info {
@ -111,7 +98,6 @@ footer {
#copyright { #copyright {
align-items: flex-end; align-items: flex-end;
} }
}
} }
// Post list // Post list

View File

@ -31,7 +31,7 @@ header {
} }
header .main { header .main {
font-size: 1.2rem; font-size: 1.5rem;
/* Otherwise header and menu is too close on small screens*/ /* Otherwise header and menu is too close on small screens*/
margin-bottom: 10px; margin-bottom: 10px;

View File

@ -11,6 +11,12 @@
background-color: var(--primary-color); background-color: var(--primary-color);
} }
::-moz-selection {
background: var(--primary-color);
color: var(--hover-color);
text-shadow: none;
}
::selection { ::selection {
background: var(--primary-color); background: var(--primary-color);
color: var(--hover-color); color: var(--hover-color);
@ -34,27 +40,14 @@ blockquote {
} }
a { a {
border-bottom: 3px solid var(--primary-color);
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
box-shadow: inset 0 -3px 0 var(--primary-color);
padding-bottom: 3px;
transition: all .1s ease-in;
} }
a:hover { a:hover {
background-color: var(--primary-color);
color: var(--hover-color); color: var(--hover-color);
box-shadow: inset 0 -1.45em 0 var(--primary-color);
transition: all .3s ease;
}
@media (prefers-reduced-motion: reduce), (any-hover: none) {
a {
transition: none;
}
a:hover {
transition: none;
}
} }
time { time {

View File

@ -2,6 +2,15 @@
content: "🏷 "; content: "🏷 ";
} }
.tags a {
border-bottom: 3px solid var(--primary-color);
}
.tags a:hover {
color: var(--hover_color);
background-color: var(--primary-color);
}
ul.tags { ul.tags {
margin: 0.5rem; margin: 0.5rem;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

View File

@ -16,7 +16,7 @@
</author> </author>
<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/> <link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
<icon>{{ get_url(path=config.extra.favicon) }}</icon> <icon>{{ get_url(path=config.extra.favicon) }}</icon>
<rights>&#169; 2022-2023 mat ess</rights> <rights>&#169; 2022 mat ess</rights>
<generator uri="https://www.getzola.org/">Zola</generator> <generator uri="https://www.getzola.org/">Zola</generator>
<updated>{{ last_updated | date(format="%+") }}</updated> <updated>{{ last_updated | date(format="%+") }}</updated>
<id>{{ feed_url | safe }}</id> <id>{{ feed_url | safe }}</id>

View File

@ -4,11 +4,11 @@
<span>also on <span>also on
{%- for me in config.extra.me_links -%} {%- for me in config.extra.me_links -%}
{%- if loop.last -%} {%- if loop.last -%}
&#32;and&#32; <span> and </span>
{%- endif %} {%- endif %}
<a href="{{ me.url | safe }}" target="_blank" rel="me noopener noreferrer">{{ me.name }}</a> <a href="{{ me.url | safe }}" target="_blank" rel="me noopener noreferrer">{{ me.name }}</a>
{%- if not loop.last -%},{%- else %} {%- if not loop.last -%},{%- else %}
</span> </span>
{%- endif -%} {%- endif -%}
{% endfor %} {% endfor -%}
{% endblock main_content %} {% endblock main_content %}

View File

@ -3,14 +3,14 @@
<p id="powered-by"> <p id="powered-by">
powered by <a href="https://getzola.org" target="_blank" rel="noopener noreferral">zola</a> + <a href="https://github.com/not-matthias/apollo" target="_blank" rel="noopener noreferral">apollo</a> powered by <a href="https://getzola.org" target="_blank" rel="noopener noreferral">zola</a> + <a href="https://github.com/not-matthias/apollo" target="_blank" rel="noopener noreferral">apollo</a>
and and
<a href="https://nixos.org" target="_blank" rel="noopener noreferral">nix</a> <a href="https://nixos.org" target="_blank" rel="noopener noreferral">nix</a>.
</p> </p>
<p id="privacy-note"> <p id="privacy-note">
<a href="/privacy">privacy notice</a> <a href="/privacy">privacy notice</a>.
</p> </p>
</div> </div>
<p id="copyright"> <p id="copyright">
&copy; 2022-2023 mat ess &copy; 2022 mat ess.
</p> </p>
<script data-goatcounter="https://stats.mat.services/count" async src="//stats.mat.services/count.js" crossorigin integrity="sha256-a8rh6u3maZ6JiY6w6zsLlw9OUQf2tFPUX3t1/BV+RKc="></script> <script data-goatcounter="https://stats.mat.services/count" async src="//stats.mat.services/count.js" crossorigin integrity="sha256-a8rh6u3maZ6JiY6w6zsLlw9OUQf2tFPUX3t1/BV+RKc="></script>
<noscript> <noscript>

View File

@ -10,9 +10,11 @@
<link rel="icon" type="image/{{ favicon_ext }}" href="{{ get_url(path=config.extra.favicon, cachebust=true) }}" /> <link rel="icon" type="image/{{ favicon_ext }}" href="{{ get_url(path=config.extra.favicon, cachebust=true) }}" />
{%- endif -%} {%- endif -%}
{% for font in config.extra.fonts -%} {% for font in config.extra.fonts -%}
{% set font_path = '/font/' ~ font.path ~ '/' ~ font.name ~ '-Regular.woff2' %} {% for style in ["Bold", "BoldItalic", "Italic", "Regular"] -%}
{% set font_path = '/font/' ~ font.path ~ '/' ~ font.name ~ '-' ~ style ~ '.woff2' %}
<link rel="preload" href="{{ get_url(path=font_path, trailing_slash=false) }}" as="font" type="font/woff2" crossorigin> <link rel="preload" href="{{ get_url(path=font_path, trailing_slash=false) }}" as="font" type="font/woff2" crossorigin>
{%- endfor %} {%- endfor %}
{%- endfor %}
<link href="{{ get_url(path='style/fonts.css', cachebust=true) }}" rel="stylesheet preload" as="style" /> <link href="{{ get_url(path='style/fonts.css', cachebust=true) }}" rel="stylesheet preload" as="style" />
{# Atom #} {# Atom #}
{%- block rss -%} {%- block rss -%}
@ -22,7 +24,6 @@
<link rel="stylesheet preload" as="style" type="text/css" href="{{ get_url(path='style/theme/light.css', cachebust=true) }}" /> <link rel="stylesheet preload" as="style" type="text/css" href="{{ get_url(path='style/theme/light.css', cachebust=true) }}" />
<link rel="stylesheet preload" as="style" type="text/css" href="{{ get_url(path='style/theme/dark.css', cachebust=true) }}" media="(prefers-color-scheme: dark)" /> <link rel="stylesheet preload" as="style" type="text/css" href="{{ get_url(path='style/theme/dark.css', cachebust=true) }}" media="(prefers-color-scheme: dark)" />
<link rel="stylesheet preload" as="style" type="text/css" media="screen" href="{{ get_url(path='style/main.css', cachebust=true) }}" /> <link rel="stylesheet preload" as="style" type="text/css" media="screen" href="{{ get_url(path='style/main.css', cachebust=true) }}" />
<meta name="theme-color" content="lightcoral" />
{%- if config.extra.stylesheets -%} {%- if config.extra.stylesheets -%}
{%- for stylesheet in config.extra.stylesheets -%} {%- for stylesheet in config.extra.stylesheets -%}
<link rel="stylesheet" href="{{ get_url(path=stylesheet, cachebust=true) }}"> <link rel="stylesheet" href="{{ get_url(path=stylesheet, cachebust=true) }}">
@ -50,10 +51,10 @@
<meta property="og:image" content="{{ get_url(path=current_path) }}/hero.webp"> <meta property="og:image" content="{{ get_url(path=current_path) }}/hero.webp">
{%- endif -%} {%- endif -%}
{#- Twitter #} {#- Twitter #}
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:title" content="{{ current_title }}"> <meta property="twitter:title" content="{{ current_title }}">
<meta property="twitter:description" content="{{ current_description }}"> <meta property="twitter:description" content="{{ current_description }}">
{%- if hero -%} {%- if hero -%}
<meta property="twitter:image" content="{{ get_url(path=current_path) }}/hero.webp"> <meta property="twitter:image" content="{{ get_url(path=current_path) }}/hero.webp">
<meta property="twitter:card" content="summary_large_image">
{%- endif %} {%- endif %}
</head> </head>