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) <noreply@anthropic.com>
This commit is contained in:
Andrew Stryker
2026-03-24 21:36:00 -07:00
parent 403da45ff1
commit 80ea5b1c2c
2 changed files with 9 additions and 1 deletions

3
.gitignore vendored
View File

@@ -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

View File

@@ -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)")'
#-----------------------------------------------------------------------------#
#