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:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -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
|
||||
|
||||
|
||||
7
Makefile
7
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)")'
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user