feat(gws.fyi): Build from org + integrate with readTree

Build from org via emacs --batch, and update all the top-level
definitions to make things work nicely with readTree.

Change-Id: If0ac49c1d264856392e29b9e7b155641d865525b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/400
Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
Griffin Smith 2020-06-15 22:24:13 -04:00 committed by glittershark
parent b570e4c7cf
commit e77b2b8f12
6 changed files with 75 additions and 34 deletions

View file

@ -1,7 +1,7 @@
.PHONY: deploy
deploy:
@`nix-build --no-out-link`
@$(shell nix-build `git rev-parse --show-toplevel` -A 'users.glittershark."gws.fyi"' --no-out-link)
renew:
@echo Renewing...

View file

@ -1,12 +1,15 @@
with import <nixpkgs> {};
args@{ pkgs, ... }:
with pkgs;
let
site = import ./site.nix args;
bucket = "s3://gws.fyi";
distributionID = "E2ST43JNBH8C64";
website =
runCommand "gws.fyi" { } ''
mkdir -p $out
cp ${./index.html} $out/index.html
cp ${site.index} $out/index.html
'';
in writeShellScript "deploy.sh" ''
${awscli}/bin/aws s3 sync ${website}/ ${bucket}
${awscli}/bin/aws cloudfront create-invalidation \

View file

@ -1,31 +0,0 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Griffin has a website now">
<title>griffin smith</title>
</head>
<body>
my name is griffin ward smith (aka grfn, glittershark, gws) and i'm a software
engineer and musician
<ul>
<li><a href="https://github.com/glittershark/">github</a></li>
<li><a href="https://sacrosanct.bandcamp.com/">music</a></li>
</ul>
contact
<ul>
<li><a href="mailto:root@gws.fyi">root@gws.fyi</a></li>
<li><a href="https://twitter.com/glittershark1">twitter</a></li>
<li><a href="https://keybase.io/glittershark">keybase</a></li>
<li>
<a href="http://keys.gnupg.net/pks/lookup?op=get&search=0x44EF5B5E861C09A7">
gpg key: 0F11A989879E8BBBFDC1E23644EF5B5E861C09A7
</a>
<br>
verify with keybase, if you don't trust this site's lack of SSL
</li>
</ul>
</body>

View file

@ -0,0 +1,15 @@
my name is griffin ward smith (aka grfn, glittershark, gws) and i'm a software
engineer and musician
- [[https://github.com/glittershark/][github]]
- music
- https://sacrosanct.bandcamp.com/, a post-rock project with a [[https://bandcamp.com/h34rken][friend of mine]]
- [[https://soundcloud.com/missingggg][my current soundcloud]], releasing instrumental hip-hop under the name missing
contact
- [[mailto:web@gws.fyi][web@gws.fyi]]
- [[https://twitter.com/glittershark1][twitter]]
- https://keybase.io/glittershark
- glittershark on freenode
- [[http://keys.gnupg.net/pks/lookup?op=get&search=0x44EF5B5E861C09A7][gpg key: 0F11A989879E8BBBFDC1E23644EF5B5E861C09A7]]

View file

@ -0,0 +1,45 @@
{ pkgs, ... }:
with pkgs;
with lib;
let
emacs-nixpkgs =
(import <nixpkgs> {
overlays = [(import (builtins.fetchTarball {
url = "https://github.com/nix-community/emacs-overlay/archive/54afb061bdd12c61bbfcc13bad98b7a3aab7d8d3.tar.gz";
sha256 = "0hrbg65d5h0cb0nky7a46md7vlvhajq1hf0328l2f7ln9hznqz6j";
}))];
});
emacs = (emacs-nixpkgs.emacsPackagesFor emacs-nixpkgs.emacsUnstable)
.emacsWithPackages (p: with p; [
org
]);
in
src:
let
outName =
let bn = builtins.baseNameOf src;
filename = elemAt (splitString "." bn) 0;
in filename + ".html";
in
runCommand outName {} ''
cp ${src} file.org
echo "${emacs}/bin/emacs --batch"
${emacs}/bin/emacs --batch \
--load ${./config.el} \
--visit file.org \
--eval "(progn
(require 'org)
(org-html-export-to-html))" \
--kill
cp file.html $out
''

View file

@ -0,0 +1,9 @@
args@{ pkgs, depot, ... }:
let
orgExportHTML = import ./orgExportHTML.nix args;
in
{
index = orgExportHTML ./index.org;
}