compile
This commit is contained in:
1 parent
3cea644f7d
commit
d809dc41a9
2 files changed
+71
No files matched your search
@@ -3,9 +3,27 @@
|
||||
# 默认目标:执行所有操作
|
||||
all: render update git
|
||||
|
||||
# 渲染 .qmd 的命令:优先用 quarto CLI,其次用 R 的 quarto 包;
|
||||
# 两者都没有时跳过(忽略 .qmd,直接用已提交的 .md)。
|
||||
QUARTO ?= $(shell command -v quarto 2>/dev/null)
|
||||
ifeq ($(QUARTO),)
|
||||
QUARTO_R := $(shell Rscript -e 'if (requireNamespace("quarto", quietly = TRUE)) cat("yes")' 2>/dev/null)
|
||||
endif
|
||||
|
||||
HUGO_CACHEDIR ?= $(TMPDIR)hugo-cache
|
||||
export HUGO_CACHEDIR
|
||||
|
||||
# 目标:渲染 Quarto 文件
|
||||
render:
|
||||
ifeq ($(QUARTO),)
|
||||
ifeq ($(QUARTO_R),yes)
|
||||
Rscript -e "quarto::quarto_render()"
|
||||
else
|
||||
@echo "warn: quarto 与 R 的 quarto 包均未安装,跳过 .qmd 渲染,直接使用已生成的 .md"
|
||||
endif
|
||||
else
|
||||
$(QUARTO) render
|
||||
endif
|
||||
hugo -d blackwolf
|
||||
|
||||
# 目标:更新网站内容
|
||||
|
||||
Reference in new issue
Block a user