summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Turner <jturner.usa@gmail.com>2025-08-27 02:40:36 -0400
committerJohn Turner <jturner.usa@gmail.com>2025-08-27 02:40:36 -0400
commit96db3f4893fb5220234b41f8b4cbc30221905151 (patch)
treeff8475f340eb7d15cbe18ac1545621d3cfb858b3
parentb5e49151e2d5b0d5bf1d977581dbcc6cb2650b15 (diff)
downloadwebsite-96db3f4893fb5220234b41f8b4cbc30221905151.tar.gz
replace makefile with meson
-rw-r--r--.dir-locals.el6
-rw-r--r--blog/meson.build14
-rw-r--r--makefile30
-rw-r--r--meson.build30
4 files changed, 49 insertions, 31 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
index 8bd8ac1..042b2ea 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -3,4 +3,8 @@
(eval . (flycheck-add-next-checker 'python-mypy (cons t 'python-flake8)))
(eval . (add-hook 'before-save-hook 'fmt-current-buffer nil t))
(eval . (setq-local fmt-executable "black"
- fmt-args '("-"))))))
+ fmt-args '("-")))))
+ (meson-mode
+ . ((fmt-executable . "meson")
+ (fmt-args . ("format" "-"))
+ (eval . (add-hook 'before-save-hook 'fmt-current-buffer nil t)))))
diff --git a/blog/meson.build b/blog/meson.build
new file mode 100644
index 0000000..fa74600
--- /dev/null
+++ b/blog/meson.build
@@ -0,0 +1,14 @@
+posts = files('access-control.org', 'gentoo-on-gcloud.org', 'index.org')
+
+foreach post : posts
+ html = fs.replace_suffix(post, '.html')
+
+ custom_target(
+ output: fs.name(html),
+ input: post,
+ command: build_command,
+ install: true,
+ install_dir: '/var/www' / site / 'blog',
+ capture: true,
+ )
+endforeach
diff --git a/makefile b/makefile
deleted file mode 100644
index a3a1eff..0000000
--- a/makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-SITE ?= jturnerusa.dev
-
-PREFIX ?= /
-DESTDIR ?= /var/www
-
-EMACS ?= emacs
-ARGS = -batch -e "org-html-export-to-html"
-
-all: index.html blog/index.html blog/gentoo-on-gcloud.html blog/access-control.html
-
-index.html: index.org
- $(EMACS) $< $(ARGS)
-
-blog/index.html: blog/index.org
- $(EMACS) $< $(ARGS)
-
-blog/gentoo-on-gcloud.html: blog/gentoo-on-gcloud.org
- $(EMACS) $< $(ARGS)
-
-blog/access-control.html: blog/access-control.org
- $(EMACS) $< $(ARGS)
-
-install: all
- install --mode 644 -D robots.txt --target-directory $(PREFIX)/$(DESTDIR)/$(SITE)/
- install --mode 644 -D sitemap.txt --target-directory $(PREFIX)/$(DESTDIR)/$(SITE)/
- install --mode 644 -D *.html --target-directory $(PREFIX)/$(DESTDIR)/$(SITE)/
- install --mode 644 -D blog/*.html --target-directory $(PREFIX)/$(DESTDIR)/$(SITE)/blog/
-
-clean:
- rm *.html blog/*.html
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..5b99de7
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,30 @@
+project('website')
+
+fs = import('fs')
+
+emacs = find_program('emacs')
+
+site = 'jturnerusa.dev'
+
+build_command = [
+ emacs,
+ '@INPUT@',
+ '-batch',
+ '-eval',
+ '(org-export-to-file \'html "/dev/stdout")',
+]
+
+posts = files('index.org')
+
+foreach post : posts
+ custom_target(
+ output: fs.replace_suffix(post, '.html'),
+ input: post,
+ command: build_command,
+ install: true,
+ install_dir: '/var/www' / site,
+ capture: true,
+ )
+endforeach
+
+subdir('blog')