Compare commits
No commits in common. "a0d3a5fca243058fb13ae77be873a7d1cf28eda2" and "1772b80ab30752713ecd8ce749f0c7a261839daf" have entirely different histories.
a0d3a5fca2
...
1772b80ab3
49
README.md
49
README.md
|
@ -1,10 +1,6 @@
|
||||||
# Cute Seal Fanpage
|
# Cute Seal Fanpage
|
||||||
|
|
||||||
> An experiment using [Nix](https://nixos.org/),
|
> An experiment using [Nix](https://nixos.org/), [Hakyll](https://jaspervdj.be/hakyll/), [Haskell](https://www.haskell.org/), and [shell scripts](https://en.wikipedia.org/wiki/Bourne_shell) to automate a simple website deployment pipeline.
|
||||||
> [Hakyll](https://jaspervdj.be/hakyll/),
|
|
||||||
> [Haskell](https://www.haskell.org/),
|
|
||||||
> and [shell scripts](https://en.wikipedia.org/wiki/Bourne_shell)
|
|
||||||
> to automate a simple website deployment pipeline.
|
|
||||||
|
|
||||||
## Why Seals?
|
## Why Seals?
|
||||||
|
|
||||||
|
@ -14,19 +10,30 @@ It's an in-joke.
|
||||||
|
|
||||||
seal-blog/
|
seal-blog/
|
||||||
|
|
||||||
- `flake.nix`
|
- devops/
|
||||||
- The specification for everything is repo can do.
|
- build.sh
|
||||||
- Defines the hakyll site build instructions, as well as sets it as an app to be run with `nix run .#hakyll-site`.
|
- Uses a [nix-shell](https://nixos.wiki/wiki/Development_environment_with_nix-shell) expression to build the Hakyll executable
|
||||||
- Defines the blog generation command as an app to be run with `nix run .#generateSealPosts`.
|
|
||||||
- Creates a shell with the same ghc installed, as well as other haskell tools.
|
- configuration.nix
|
||||||
- For use with `nix develop .` or [direnv](https://direnv.net)
|
- The [configuration file for the NixOS](https://nixos.org/manual/nixos/stable/index.html#ch-configuration) production server. This takes care of installing all the necessary software, setup [Nginx](https://www.nginx.com/), and get [ACME certs](https://en.wikipedia.org/wiki/Automated_Certificate_Management_Environment) for verification.
|
||||||
- `site.hs`
|
|
||||||
- The hakyll blog is defined here.
|
- newSealPost.sh
|
||||||
- Pulls in the rest of the files in this repo and creates a static site at `_site`.
|
- Script to be called daily by a cron job on the server. Generates the post for the day, builds and commits.
|
||||||
- `config.dhall`
|
|
||||||
- The config file for the blog generation, run with `nix run .#generateSealPosts`.
|
- website/
|
||||||
- Uses a pseudo random number generator, change the seed to see different outputs in the `postsOutputPath` (default `./posts/`).
|
- A basic Hakyll site, slightly modified to serve seals. Most of the site is generated from the `site.hs` file. Check the [Hakyll](https://jaspervdj.be/hakyll/) documentation for more info.
|
||||||
- The rest of the code is related to the static hakyll site itself.
|
|
||||||
- I've tried putting it in it's own `src` or `website` folder but
|
## Work to be done
|
||||||
- it feels like needless refactoring
|
|
||||||
- I can't get the flake operations to work :(
|
- The blog post generation and the hosting of the website are currently intertwined when they should be separated
|
||||||
|
- Seal post generator just makes posts
|
||||||
|
- Hakyll blog imports or calls the post generator
|
||||||
|
- The deployed server/nix config file has a cron job for adding a new blog and committing every day
|
||||||
|
- Need to move the blog and post generation inside nixos-apps on my beefier server
|
||||||
|
- The configuration file here is for it's own Linode, the current small one running, but I have a better setup for that now
|
||||||
|
- Pull out the useful parts for my deployed server, remove anything not necessary for a small config file
|
||||||
|
- Also switch to using caddy if not already
|
||||||
|
- Experiment with `*` A records
|
||||||
|
- For the seal blog
|
||||||
|
- Instead of having `www` and `git` and `...` subdomains spelled out in Namecheap
|
||||||
|
- Just have a `*` record and have caddy do the filtering
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
name: website
|
||||||
|
version: 0.1.0.0
|
||||||
|
build-type: Simple
|
||||||
|
cabal-version: >= 1.10
|
||||||
|
|
||||||
|
executable site
|
||||||
|
main-is: site.hs
|
||||||
|
build-depends: base == 4.*
|
||||||
|
, hakyll == 4.13.*
|
||||||
|
ghc-options: -threaded
|
||||||
|
default-language: Haskell2010
|
Loading…
Reference in New Issue