nycki.net/content/blog/draft-1-blog-setup.md
Nicholas Lamicela 29f9af39b5
All checks were successful
/ build (push) Successful in 29s
css tweaks and blog about it
2024-12-28 13:32:16 -08:00

2.3 KiB

date title description tags draft
2024-12-23 draft - blog setup How to make a website with 11ty and edit it with Decap CMS
programming
my-blog
how-to
true

or, how to make a website with 11ty and edit it with Decap CMS.

I'm just gonna start documenting all the config files I write here in case I forget how I did this. I can always update this later or something.

get a server

I'm using a VPS (Virtual Private Server) from DigitalOcean. The cheapest option costs $4/mo and comes with 10 GB of storage. I picked one with Debian 12 pre-installed.

I also changed my login shell to fish:

$ sudo apt install fish
$ chsh -s /usr/bin/fish

And created an account for my friend:

$ sudo useradd -s /usr/bin/fish -m friend
  • -s /usr/bin/fish: set fish as the new user's default shell
  • -m: create a new folder in /home.

install apache web server

$ sudo apt install apache2

I like to put my own stuff in /data so I don't get confused by stuff added by an installer.

I'll be using a neat trick taught to me by Kooda: Default HTTPS but only for recent browsers. This way your website will work on old gizmos like the Nintendo 3DS.

$ sudo a2enmod headers

Contents of /data/example.net/site.conf

<VirtualHost *:80 *:443>
  ServerName example.net
#  SSLEngine on
#  Include /etc/letsencrypt/options-ssl-apache.conf
#  SSLCertificateFile    /etc/letsencrypt/live/example.net/fullchain.pem
#  SSLCertificateKeyFile /etc/letsencrypt/live/example.net/privkey.pem

  Header always add Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload;"
  <If "%{HTTPS} == 'off'">
    <If "%{HTTP:Upgrade-Insecure-Requests} == 1">
      Header always add Vary: Upgrade-Insecure-Requests
      Redirect / https://example.net
    </If>
  </If>

  DocumentRoot /data/example.net/site
  <Directory />
    ErrorDocument 404 404.html
    Options FollowSymLinks MultiViews
    Require all granted
  </Directory>

</VirtualHost>

you can uncomment those SSL lines later when you get a certificate

asdfasdf come back to this later

todo:

  • set up 11ty
  • install forgejo
  • git hooks to auto-build?
  • decap CMS for editing