diff --git a/site/_includes/css/prism.css b/site/_includes/css/prism.css index 32fcac8..e2acc3c 100644 --- a/site/_includes/css/prism.css +++ b/site/_includes/css/prism.css @@ -6,7 +6,7 @@ pre[class*="language-"] { word-spacing: normal; word-break: normal; word-wrap: normal; - font-size: 1em; + font-size: 0.8rem; line-height: 1.5em; color: var(--c-text-dim); -moz-tab-size: 4; @@ -30,6 +30,15 @@ pre[class*="language-"] { margin: 0.5em 0; padding: 1.25em 1em; } +p:has(+ pre[class*="language-"]) > code { + margin: 0; + padding: 0.1em 1em; + border-radius: none; + background: none; +} +p:has(>code) + pre[class*="language-"] { + margin-top: 0; +} [class*="language-"] .namespace { opacity: 0.7; } diff --git a/site/_includes/css/site.css b/site/_includes/css/site.css index a824291..f5220cf 100644 --- a/site/_includes/css/site.css +++ b/site/_includes/css/site.css @@ -246,9 +246,9 @@ ul.collection { } p { margin: 0; - + p { - margin-top: 1lh; - } +} +p + p, pre + p { + margin-top: 1lh; } blockquote { position: relative; @@ -485,6 +485,30 @@ h1 { } } +@media screen { + p:has(+ pre[class*="language-"] > code) { + position: relative; + font-size: 0.8em; + } + p:has(+ pre[class*="language-"]) > code::after { + content: ""; + pointer-events: none; + opacity: 0.5; + position: absolute; + z-index: -1; + bottom: 0; + left: -2rem; + height: 4rem; + width: 20rem; + max-width: 100%; + background: radial-gradient( + ellipse farthest-side at 50% 100%, + var(--c-highlight), + transparent + ); + } +} + main { h1, h2, diff --git a/site/posts/2025-06-15-replacing-github-pages.md b/site/posts/2025-06-15-replacing-github-pages.md index 1fc5943..cb7cc47 100644 --- a/site/posts/2025-06-15-replacing-github-pages.md +++ b/site/posts/2025-06-15-replacing-github-pages.md @@ -10,18 +10,20 @@ I recently started self-hosting [Forgejo](https://forgejo.org/), but I wanted so When I push a `gh-pages` branch to any public repository on my Forgejo instance, the name of the repo is used as a domain name (e.g. [marklink.pages.seigler.net](https://marklink.pages.seigler.net/)) and the branch contents are automatically served with SSL. If I push updates to the branch, they are automatically published. If the branch or repo is deleted, the site is taken down. ## How to do it + ### Debian server preparation In case you don't have a basic server setup routine yet, this is a good start: -- Change the default root password -- Create a new user, add it to the sudo group. In my examples below the user is `joshua`. -- Use `ssh-copy-id` to install your ssl pubkey for easier login -- Disable/lock root's password +- Change the default root password. +- Create a new user and add it to the sudo group. In my examples below the user is `joshua`. +- Use `ssh-copy-id` to install your ssl pubkey for easier login. +- Disable/lock root's password. - Disable root login over ssh and change the SSL port number. Pick a new port lower than 1024. - Edit your local `~/.ssh/config` so you don't have to specify the port number every time you connect. - On the server, install and enable `ufw` and `fail2ban`. In addition to allowing your custom SSL port, be sure to enable ports 80 and 443 with `sudo ufw allow "WWW Full"`. + ### Caddy I usually use nginx, but I wanted to give Caddy a shot, and it has been a great experience. I installed Caddy using the [official instructions](https://caddyserver.com/docs/install). -Here is the Caddyfile I made - you will need to change the domains names and the email. Email could be removed, but it is recommended so SSL certificate issues can contact you if there is a problem with your certificates. +Here is the Caddyfile I made---you will need to change the domains names and the email. Email could be removed, but it is recommended so SSL certificate issuers can contact you if there is a problem with your certificates. `/etc/caddy/Caddyfile` ```undefined