style code block filenames
This commit is contained in:
parent
510a49ec0e
commit
2f85867a05
3 changed files with 44 additions and 9 deletions
|
@ -6,7 +6,7 @@ pre[class*="language-"] {
|
||||||
word-spacing: normal;
|
word-spacing: normal;
|
||||||
word-break: normal;
|
word-break: normal;
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
font-size: 1em;
|
font-size: 0.8rem;
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
color: var(--c-text-dim);
|
color: var(--c-text-dim);
|
||||||
-moz-tab-size: 4;
|
-moz-tab-size: 4;
|
||||||
|
@ -30,6 +30,15 @@ pre[class*="language-"] {
|
||||||
margin: 0.5em 0;
|
margin: 0.5em 0;
|
||||||
padding: 1.25em 1em;
|
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 {
|
[class*="language-"] .namespace {
|
||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,9 +246,9 @@ ul.collection {
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
+ p {
|
}
|
||||||
margin-top: 1lh;
|
p + p, pre + p {
|
||||||
}
|
margin-top: 1lh;
|
||||||
}
|
}
|
||||||
blockquote {
|
blockquote {
|
||||||
position: relative;
|
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 {
|
main {
|
||||||
h1,
|
h1,
|
||||||
h2,
|
h2,
|
||||||
|
|
|
@ -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.
|
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
|
## How to do it
|
||||||
|
|
||||||
### Debian server preparation
|
### Debian server preparation
|
||||||
In case you don't have a basic server setup routine yet, this is a good start:
|
In case you don't have a basic server setup routine yet, this is a good start:
|
||||||
- Change the default root password
|
- Change the default root password.
|
||||||
- Create a new user, add it to the sudo group. In my examples below the user is `joshua`.
|
- 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
|
- Use `ssh-copy-id` to install your ssl pubkey for easier login.
|
||||||
- Disable/lock root's password
|
- Disable/lock root's password.
|
||||||
- Disable root login over ssh and change the SSL port number. Pick a new port lower than 1024.
|
- 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.
|
- 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"`.
|
- 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
|
### 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).
|
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`
|
`/etc/caddy/Caddyfile`
|
||||||
```undefined
|
```undefined
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue