Skip to content

Commit

Permalink
Add tangled file names.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmedrano committed Jun 4, 2024
1 parent ddc4f58 commit e00d1d4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
15 changes: 15 additions & 0 deletions build.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
;;; ~emacs -Q --script build.el~
;;; Code:
(require 'ox-publish)
(require 'cl-lib)

(defun add-tangled-name (backend)
(let ((src-blocks (org-element-map (org-element-parse-buffer) 'src-block #'identity)))
(setq src-blocks (nreverse src-blocks))
(cl-loop for src in src-blocks
do
(goto-char (org-element-property :begin src))
(let* ((properties (nth 2 (org-babel-get-src-block-info)))
(tangle (alist-get :tangle properties))
(file (alist-get :file properties)))
(when (string= tangle "yes")
(insert (format "File ~%s~:\n" file)))
))))

(defun build-wmedrano-dev-site ()
"Build wmedrano.dev website.
Expand All @@ -16,6 +30,7 @@ The static site is output into the site directory."
</div>
")
(org-html-link-up "../") ;; Unused. Required for home/up to render.
(org-export-before-processing-functions '(add-tangled-name))
(org-publish-project-alist
`(("wmedrano-site" :components ("wmedrano-home" "wmedrano-posts"))
("wmedrano-home"
Expand Down
2 changes: 2 additions & 0 deletions src/posts/github-gitlab.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#+TITLE: GitHub or GitLab for Hobby Projects
#+AUTHOR: Will Medrano
#+DATE: [2024-05-13 Mon]
#+DESCRIPTION: Compare GitHub and GitLab for hobby or personal projects. Compares speed, community engagement, CI capabilities, security, features, and user experience.


* Introduction
:PROPERTIES:
Expand Down
3 changes: 2 additions & 1 deletion src/posts/server-setup.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#+TITLE: Server Setup for wmedrano.dev
#+AUTHOR: Will S. Medrano
#+DATE: [2024-06-04 Tue]
#+DESCRIPTION: Discover the efficient server setup for wmedrano.dev. Learn how the 'oddtaxi' Raspberry Pi 4 machine, Caddy, Prometheus, and Grafana work together to serve static files, collect metrics, and provide a seamless user experience. Explore the detailed configurations and monitoring setup for optimal website performance.

* Overview
:PROPERTIES:
Expand Down Expand Up @@ -98,7 +99,7 @@ automatically installed with ~Prometheus~.

Caddy is install through ~sudo apt install caddy~. After installation,
Caddy should automatically be started as a daemon that reads the
config from /etc/caddy/Caddyfile. The logs and status of the daemon
config from ~/etc/caddy/Caddyfile~. The logs and status of the daemon
can be inspected with ~systemctl status caddy~.

** Static Files
Expand Down

0 comments on commit e00d1d4

Please sign in to comment.