From 1253f94e3ad4d4355aacdd0cc965bea18c6c4091 Mon Sep 17 00:00:00 2001 From: leafee98 Date: Thu, 28 Apr 2022 22:57:20 +0800 Subject: [PATCH] modified: content/posts/use-git-hook-to-build-hugo-site-automatically.md --- .../posts/use-git-hook-to-build-hugo-site-automatically.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/posts/use-git-hook-to-build-hugo-site-automatically.md b/content/posts/use-git-hook-to-build-hugo-site-automatically.md index 25f85f4..a685cef 100644 --- a/content/posts/use-git-hook-to-build-hugo-site-automatically.md +++ b/content/posts/use-git-hook-to-build-hugo-site-automatically.md @@ -3,7 +3,7 @@ title: "使用 git hook 实现自动构建 Hugo 静态网站" date: 2022-04-28T20:39:01+08:00 tags: [] categories: [] -draft: false +draft: true --- Hugo 是一个优秀的静态网站生成器,并且结构对 Git 十分友好,所以一般会将 Hugo 搭配 Git 使用来提供较高的可操作性,很多人还会搭配 GitHub Pages 来实现免服务器建立个人博客。但是在不使用 GitHub Pages 的情况下,使用静态博客就会不可避免地要重复构建网站,每次都要手动构建再上传构建结果未免过于繁琐,这篇文章将介绍已有自建服务器的情况下,通过 Git Hook 实现在推送时自动重新构建网站内容的方式。 @@ -36,7 +36,7 @@ pre-receive, update, post-receive, post-update, push-to-checkout ```bash #!/bin/bash -for hook in "$(find "$(dirname "$0")"/post-receive.d -type f -perm -u=x)"; do +for hook in $(find "$(dirname "$0")"/post-receive.d -type f -perm -u=x); do bash $hook done