Compare commits

..

43 Commits

Author SHA1 Message Date
mat ess 9fe1e568f3 Animations: add test for hover 2023-02-01 18:55:30 -05:00
mat ess e4f9c6754b More highlight, 'brand' tweaks 2023-01-28 20:42:58 -05:00
mat ess 6f748da235 Use box shadow for link highlight 2023-01-28 15:08:52 -05:00
mat ess 01f97682a1 Stack footer on mobile 2023-01-28 14:09:53 -05:00
mat ess 662f4032a4 matthew -> mat 2023-01-28 14:08:59 -05:00
mat ess d37694a1dc Fix sticky footer 2023-01-28 13:22:25 -05:00
mat ess 95603a0e0a Add theme-color 2023-01-28 10:44:57 -05:00
mat ess 96e9c2cc37 Remove unnecessary highlight on tags 2023-01-27 22:29:08 -05:00
mat ess 5f7beb1de6 Add animated link highlight 2023-01-27 22:03:35 -05:00
mat ess 3bf137fa3b Drop stereophonic link, update years 2023-01-27 13:39:08 -05:00
mat ess 3a6842d053 Remove Drone badge 2022-12-22 01:35:26 -05:00
mat ess 0ab4763af2 Drop drone 2022-12-22 01:32:35 -05:00
mat ess d1c1c0693b Try sandboxing
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build was killed Details
2022-12-22 01:25:43 -05:00
mat ess 44a65b4f90 Try mounting nix/store directly again
continuous-integration/drone/push Build is passing Details
2022-12-22 01:22:34 -05:00
mat ess f2634b2645 Rephrase caching
continuous-integration/drone/push Build is failing Details
continuous-integration/drone Build is failing Details
2022-12-22 01:17:07 -05:00
mat ess d77a5ec61c Reword again
continuous-integration/drone/push Build is failing Details
2022-12-22 01:10:31 -05:00
mat ess 70e1572294 Reword eval-store
continuous-integration/drone/push Build is failing Details
2022-12-22 01:07:37 -05:00
mat ess 6fa52e8860 Add eval-store local
continuous-integration/drone/push Build is failing Details
2022-12-22 01:06:22 -05:00
mat ess 8339d2bdbb Add message
continuous-integration/drone/push Build is failing Details
2022-12-22 01:01:43 -05:00
mat ess b0390a0f02 Add bootstrap step
continuous-integration/drone/push Build is failing Details
2022-12-22 01:00:02 -05:00
mat ess 1f6e1dfb72 Try passing --store path
continuous-integration/drone/push Build is failing Details
2022-12-22 00:48:52 -05:00
mat ess 2ffb142634 Dump nix store contents
continuous-integration/drone/push Build was killed Details
2022-12-22 00:41:16 -05:00
mat ess d24ed003f9 Try caching again
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-12-22 00:26:49 -05:00
mat ess 2c48bb009d Add bootstrap test
continuous-integration/drone/push Build is passing Details
2022-12-22 00:25:47 -05:00
mat ess 9778b56610 Test if anything runs with cache
continuous-integration/drone/push Build encountered an error Details
2022-12-22 00:22:31 -05:00
mat ess 4d0be4e6f7 Try building without nix/store mount
continuous-integration/drone/push Build was killed Details
2022-12-22 00:19:43 -05:00
mat ess a77b87a344 Rework cache
continuous-integration/drone/push Build encountered an error Details
2022-12-22 00:11:43 -05:00
mat ess 013246d114 Add nix store cache
continuous-integration/drone/push Build encountered an error Details
continuous-integration/drone Build encountered an error Details
2022-12-21 23:59:24 -05:00
mat ess 23894ff2b1 Add secrets
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-12-21 23:45:31 -05:00
mat ess 4ef1b26206 Add Netlify auth
continuous-integration/drone/push Build was killed Details
2022-12-21 23:34:16 -05:00
mat ess 64a8c0f4e6 Add site ID specifier
continuous-integration/drone/push Build was killed Details
2022-12-21 23:14:48 -05:00
mat ess 4b8e9a0614 Fix typo
continuous-integration/drone/push Build is failing Details
2022-12-21 22:27:35 -05:00
mat ess 0ac4175f21 Add flake reference
continuous-integration/drone/push Build is failing Details
2022-12-21 22:26:20 -05:00
mat ess 168297aa8f Rework drone config
continuous-integration/drone/push Build is failing Details
2022-12-21 22:09:21 -05:00
mat ess 130efc7383 Add pre-commit 2022-12-21 22:08:18 -05:00
mat ess a512e2a078 Small wording tweak
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-12-04 20:11:19 -05:00
mat ess f66f7bfa4c Add site to projects
continuous-integration/drone/push Build is failing Details
2022-12-04 19:57:24 -05:00
mat ess 3d71e6ab08 Use yaml frontmatter
continuous-integration/drone/push Build is passing Details
2022-11-30 22:20:58 -05:00
mat ess d9964492f3 Drop strict-dynamic
continuous-integration/drone/push Build is passing Details
2022-11-25 18:24:54 -05:00
mat ess 3ecafc95e2 Update date
continuous-integration/drone/push Build is passing Details
2022-11-25 18:15:22 -05:00
mat ess 4515264adf Try reordering script-src CSP rule
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details
2022-11-25 18:11:29 -05:00
mat ess 490f46fde9 Preload fewer fonts, tweak markup
continuous-integration/drone/push Build is passing Details
2022-11-25 17:58:48 -05:00
mat f1bd94338c Merge pull request 'Remove meta links from atom template' (#1) from test-no-meta-atom into main
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build was killed Details
Reviewed-on: mat/mat.services#1
2022-11-19 18:57:28 +00:00
29 changed files with 313 additions and 182 deletions

View File

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

3
.gitignore vendored
View File

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

View File

@ -1,6 +1,5 @@
# mat.services
## 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)
built using zola and nix

2
_typos.toml Normal file
View File

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

View File

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

View File

@ -1,9 +1,9 @@
+++
title = "about me"
path = "about"
+++
---
title: "about me"
path: "about"
---
## matthew ess (they/them)
## mat 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.
[you can look at my resume here](/resume).

View File

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

View File

@ -1,13 +1,13 @@
+++
title = "cellular automata toys in löve2d"
date = "2022-09-15"
description = "a short announcement post for a few interactive cellular automata toys written in lua"
[taxonomies]
tags = ["cellular-automata", "lua", "löve2d"]
[extra]
hero = true
heroPrompt = "The oracle reading the future from Conway's Game of Life, technomancer aesthetic, digital illustration, 8k uhd"
+++
---
title: "cellular automata toys in löve2d"
date: "2022-09-15"
description: "a short announcement post for a few interactive cellular automata toys written in lua"
taxonomies:
tags: ["cellular-automata", "lua", "löve2d"]
extra:
hero: true
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.

View File

@ -1,13 +1,13 @@
+++
title = "passing command line arguments to nix flakes"
date = "2022-10-10"
description = "a tutorial on 'breaking' the hermeticity of nix flakes by adding convenient command line flags"
[taxonomies]
tags = ["nix"]
[extra]
hero = true
heroPrompt = "A rogue program hacking through the firewall, in the style of Tron Legacy, cyberpunk vibe, digital render, 8k uhd, unreal engine"
+++
---
title: "passing command line arguments to nix flakes"
date: "2022-10-10"
description: "a tutorial on 'breaking' the hermeticity of nix flakes by adding convenient command line flags"
taxonomies:
tags: ["nix"]
extra:
hero: true
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.
@ -126,7 +126,7 @@ If software builds are functions, then Nix flakes are pure functions. Indeed, th
builder.url = "...";
source.url = "...";
};
ouputs = { self, builder, source }: {
outputs = { self, builder, source }: {
software = builder.build source;
};
}

View File

@ -1,10 +1,10 @@
+++
title = "diy code hosting with gitea and fly.io"
date = "2022-08-07"
updated = "2022-09-04"
[taxonomies]
tags = ["git", "gitea", "fly.io"]
+++
---
title: "diy code hosting with gitea and fly.io"
date: "2022-08-07"
updated: "2022-09-04"
taxonomies:
tags: ["git", "gitea", "fly.io"]
---
## 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.
@ -50,14 +50,14 @@ mkdir gitea; cd gitea
Next up, we create our app configuration and register it with Fly.io. `flyctl` takes care of this for us in a single command, `flyctl launch`. The command will prompt you interactively for some input, but here we'll just pass some flags directly:
```bash
flyctl launch \
# use the official Gitea docker image \
--image gitea/gitea:latest \
# give our instance a unique name, this will be used to generate a development hostname like gitea-mat-services.fly.dev \
--name gitea-mat-services \
# region where the app runs, don't supply this option if you want to interactively choose a region \
--region ewr \
# don't immediately deploy, we need to edit our fly.toml first \
--no-deploy
# use the official Gitea docker image \
--image gitea/gitea:latest \
# give our instance a unique name, this will be used to generate a development hostname like gitea-mat-services.fly.dev \
--name gitea-mat-services \
# region where the app runs, don't supply this option if you want to interactively choose a region \
--region ewr \
# don't immediately deploy, we need to edit our fly.toml first \
--no-deploy
# don't forget to commit!
git add fly.toml

View File

@ -1,13 +1,13 @@
+++
title = "now on netlify"
date = "2022-10-16"
description = "a short update regarding me packing up my static site and moving from fly.io to netlify"
[taxonomies]
tags = ["static-site", "netlify"]
[extra]
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"
+++
---
title: "now on netlify"
date: "2022-10-16"
description: "a short update regarding me packing up my static site and moving from fly.io to netlify"
taxonomies:
tags: ["static-site", "netlify"]
extra:
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"
---
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"
date = "2022-09-04"
updated = "2022-10-17"
[taxonomies]
tags = ["static-site", "nix", "caddy", "fly.io"]
+++
---
title: "hosting a static site on fly.io with nix and caddy"
date: "2022-09-04"
updated: "2022-10-17"
taxonomies:
tags: ["static-site", "nix", "caddy", "fly.io"]
---
**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).

View File

@ -1,7 +1,7 @@
+++
title = "privacy notice"
path = "privacy"
+++
---
title: "privacy notice"
path: "privacy"
---
## 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.

View File

@ -1,12 +1,16 @@
+++
title = "selected projects"
path = "projects"
+++
---
title: "selected projects"
path: "projects"
---
## gemini for rust
`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` 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
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"
path = "resume"
+++
---
title: "resume"
path: "resume"
---
## skills
### professional

View File

@ -16,18 +16,32 @@
"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": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1664385320,
"narHash": "sha256-uSCHb9RUqHRjTpI8OzyaUuHckFnnxwZqlXEuo+yUpYQ=",
"lastModified": 1668450977,
"narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "45298bd207b26e1bcd030a0bb075aa2da29f8e30",
"rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa",
"type": "github"
},
"original": {
@ -36,6 +50,21 @@
"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": {
"inputs": {
"nixpkgs": [
@ -58,11 +87,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1665259268,
"narHash": "sha256-ONFhHBLv5nZKhwV/F2GOH16197PbvpyWhoO0AOyktkU=",
"lastModified": 1670064435,
"narHash": "sha256-+ELoY30UN+Pl3Yn7RWRPabykwebsVK/kYE9JsIsUMxQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c5924154f000e6306030300592f4282949b2db6c",
"rev": "61a8a98e6d557e6dd7ed0cdb54c3a3e3bbc5e25c",
"type": "github"
},
"original": {
@ -72,12 +101,73 @@
"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": {
"inputs": {
"caddyfile-syntax": "caddyfile-syntax",
"flake-parts": "flake-parts",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"pre-commit": "pre-commit"
}
}
},

View File

@ -4,19 +4,21 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
gitignore.url = "github:hercules-ci/gitignore.nix";
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.flake = false;
};
outputs = { self, flake-parts, gitignore, ... }@inputs:
outputs = { self, flake-parts, gitignore, pre-commit, ... }@inputs:
flake-parts.lib.mkFlake { inherit self; } {
imports = [ ];
imports = [ pre-commit.flakeModule ];
systems = [ "x86_64-linux" "aarch64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }:
perSystem = { config, pkgs, ... }:
let
inherit (gitignore.lib) gitignoreSource;
inherit (pkgs.callPackage ./nix { }) fonts optimize-images update-date;
@ -24,25 +26,23 @@
caddyfile-syntax = "${inputs.caddyfile-syntax}/Caddyfile.sublime-syntax";
buildSite = { prod }:
let
inherit (pkgs.lib) optionalString;
ifStaging = optionalString (!prod);
rev = if (self ? rev) then self.rev else "dirty";
ifStaging = pkgs.lib.optionalString (!prod);
in
''
optimize-images
zola build --drafts ${ifStaging "--base-url https://staging--mat-services.netlify.app"}
# zola's ignored_content setting doesn't work in static/
rm -rf public/image/_favicon.svg
convert public/image/favicon.svg -resize 256x256 public/favicon.ico
'';
in
{
packages.default = with pkgs; stdenv.mkDerivation {
pname = "personal-site";
version = "2022-10-23";
version = "2023-02-01";
src = gitignoreSource ./.;
nativeBuildInputs = [ imagemagick optimize-images update-date zola ];
configurePhase = copyFonts + ''
nativeBuildInputs = [ optimize-images update-date zola ];
configurePhase = ''
${copyFonts}
mkdir -p extra/syntax
cp ${caddyfile-syntax} extra/syntax
'';
@ -54,12 +54,25 @@
packages.staging-site = config.packages.default.overrideAttrs (_: {
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 {
packages = [ optimize-images update-date zola ];
shellHook = linkFonts + ''
packages = [ jsonnet netlify-cli optimize-images update-date zola ];
shellHook = ''
${config.pre-commit.installationScript}
${linkFonts}
mkdir -p 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;
style-src 'self' 'unsafe-inline';
font-src 'self';
script-src 'sha256-a8rh6u3maZ6JiY6w6zsLlw9OUQf2tFPUX3t1/BV+RKc=' 'strict-dynamic';
script-src 'self' https://stats.mat.services;
form-action 'none';
frame-ancestors 'none';
base-uri 'none';

View File

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

View File

@ -1,4 +1,4 @@
{ bc, libwebp, scour, writeShellScriptBin }:
{ bc, imagemagick, libwebp, scour, writeShellScriptBin }:
writeShellScriptBin "optimize-images" ''
shopt -s globstar nullglob
@ -14,4 +14,5 @@ writeShellScriptBin "optimize-images" ''
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)"
done
${imagemagick}/bin/convert static/image/favicon.svg -resize 256x256 static/favicon.ico
''

View File

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

View File

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

View File

@ -11,12 +11,6 @@
background-color: var(--primary-color);
}
::-moz-selection {
background: var(--primary-color);
color: var(--hover-color);
text-shadow: none;
}
::selection {
background: var(--primary-color);
color: var(--hover-color);
@ -40,14 +34,27 @@ blockquote {
}
a {
border-bottom: 3px solid var(--primary-color);
color: inherit;
text-decoration: none;
box-shadow: inset 0 -3px 0 var(--primary-color);
padding-bottom: 3px;
transition: all .1s ease-in;
}
a:hover {
background-color: var(--primary-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 {

View File

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

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

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

View File

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

View File

@ -3,14 +3,14 @@
<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>
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 id="privacy-note">
<a href="/privacy">privacy notice</a>.
<a href="/privacy">privacy notice</a>
</p>
</div>
<p id="copyright">
&copy; 2022 mat ess.
&copy; 2022-2023 mat ess
</p>
<script data-goatcounter="https://stats.mat.services/count" async src="//stats.mat.services/count.js" crossorigin integrity="sha256-a8rh6u3maZ6JiY6w6zsLlw9OUQf2tFPUX3t1/BV+RKc="></script>
<noscript>

View File

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