3.2 KiB
Marcus Allison — Portfolio (Static site)
Quick deploy instructions for an nginx host (Debian/Ubuntu):
-
Copy files to the web root on the server:
sudo mkdir -p /var/www/html sudo cp -r . /var/www/html/ sudo chown -R www-data:www-data /var/www/html
-
Configure nginx with your own server block and enable it:
sudo cp /path/to/your/site.conf /etc/nginx/sites-available/website-but-better sudo ln -sf /etc/nginx/sites-available/website-but-better /etc/nginx/sites-enabled/
-
Test nginx config and reload:
sudo nginx -t sudo systemctl reload nginx
-
(Optional) Provision HTTPS with Certbot (Let's Encrypt):
sudo apt update && sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d yourdomain.example.com -d www.yourdomain.example.com
-
Docker alternative (serve static site with nginx container):
docker run --rm -p 80:80 -v "$(pwd):/usr/share/nginx/html:ro" nginx:stable
Customize:
- Replace
yourdomain.example.comwith your real domain. - Update contact email in
index.html. - The homepage uses
the server.jpgas a small lab snapshot; formal photography should live inimages/.
Photography gallery:
- To regenerate
images/manifest.jsonafter adding or removing photos, run:
py -3 scripts/generate_manifest.py
- Alternatively, enable Nginx directory listing for
/images/so the site can probe the directory. Example server block fragment for/images/only:
location /images/ {
alias /var/www/html/images/;
autoindex on;
}
Blog support:
- Add plain text files to the
blog/directory. Supported extensions are.txtand.text. - Each file should start with a date/time line, then a title line, then the body.
- To attach a file, place it in
blog/files/and reference it in the post with[[file: filename.ext]]or[[attachment: filename.ext]]. - Run
py -3 scripts/generate_blog_manifest.pyfrom the project root to refreshblog/manifest.jsonafter adding or removing posts.
Git sync:
- Run the sync script from anywhere by invoking the repo script path, for example
./scripts/sync_site.shfrom the repo root or/path/to/website-but-better/scripts/sync_site.shfrom another directory. - The script uses its own location to find the repo root, so it does not need to be started from the web root.
- The default remote is
https://git.organic-server.org/organic-CPU/website-but-better.gitand the default branch ismain. - By default it deploys to
/var/www/html. - Override with
GIT_REPO_URL,GIT_BRANCH, orDEPLOY_DIRif needed.
Automatic sync every 12 hours:
- Copy
scripts/sync_site.serviceandscripts/sync_site.timerto/etc/systemd/system/. - Update
sync_site.serviceto point at the actual repository path on your server. - Then enable and start the timer:
sudo systemctl daemon-reload
sudo systemctl enable --now sync_site.timer
This makes the website sync twice per day and deploy the latest files to the nginx root.
Editing the Git link:
- Update the header Git link in
index.htmlat the element with idgit-linkto your repository URL.
If you want, I can also:
- Add a Docker Compose service for a static site + automatic certs.
- Produce a small resume/JSON-LD metadata file for SEO.