Silent Blog
htmx and go based personal blog boilerplate. For motivation and more information, see this blog post.
Features
Write a post in markdown, and place it to the prod/posts directory. Describe the post in the prod/posts.json file. The post will be rendered in the blog.
Development
- Install go, make, templ and tailwindcss
Test the blog locally with
make run
This will start the server on localhost:3049
Deployment
The most basic approach is to build the binary for the target architecture and deploy it to the server.
Reverse Proxy
One approach is that server has a reverse proxy like nginx installed and configured to serve our service. For example, if the binary runs with default config on localhost:3049, and nginx is configured to serve the binary with your domain. Then the steps for installing and configuring the server are as follows:
make build
- copy the prod directory to the server
scp -r /prod ubuntu@YOUR_DOMAIN_NAME:/home/ubuntu/
- run binary with default config
cd prod
./app
Standalone
Another approach is to build the binary for the target architecture and run it on the server.
In this case you should run it with the following config parameters in the config.yaml file if you want to use https.
localonly: False
tls: True
domain: "your-domain.dev"
# port: 443
Docker
VSCode with TailwindCSS
settings.json
"tailwindCSS.includeLanguages": {
"templ": "html"
}
TODO
- containerize
- automate deployment