From 80ea5b1c2cbdb6357f097f6567aa8674d0db0d24 Mon Sep 17 00:00:00 2001 From: Andrew Stryker Date: Tue, 24 Mar 2026 21:36:00 -0700 Subject: [PATCH] Add shared libs directory to gitignore and Makefile Configure statdown to write CSS/JS dependencies to static/libs/ so they are shared across posts, and ignore that directory in git. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 3 +++ Makefile | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 72c6a78..6601889 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,9 @@ hugo.linux # Temporary lock file while building /.hugo_build.lock +# Shared CSS/JS dependencies generated by statdown/depkit +/static/libs/ + # Created by https://www.toptal.com/developers/gitignore/api/R # Edit at https://www.toptal.com/developers/gitignore?templates=R diff --git a/Makefile b/Makefile index 4cd872e..f141c5f 100644 --- a/Makefile +++ b/Makefile @@ -83,11 +83,16 @@ help: #> Generate this help message RMD_SOURCES := $(wildcard content/posts/*/index.Rmd) MD_TARGETS := $(RMD_SOURCES:.Rmd=.md) +# Shared asset location for CSS/JS dependencies (via depkit) +LIBS_DIR := static/libs +LIBS_URL := /libs + # Pattern rule: render index.md from index.Rmd using statdown # Re-render when renv.lock changes (package version update) +# Assets are written to static/libs/ so they are shared across posts %/index.md: %/index.Rmd renv.lock @echo "🔄 Rendering $<" - cd $* && Rscript -e 'renv::restore(prompt = FALSE); statdown::statdown_render("index.Rmd")' + cd $* && Rscript -e 'renv::restore(prompt = FALSE); statdown::statdown_render("index.Rmd", output_root = "$(CURDIR)/$(LIBS_DIR)", url_root = "$(LIBS_URL)")' #-----------------------------------------------------------------------------# #