diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66632218228c0295aab3a8fd57e464fd1bd196f5..bbca3f52bfed550688d8bf72d8892dd0a3c0987b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,12 +17,15 @@ file_creation: stage: creation script: - if [[ $CI_COMMIT_REF_NAME =~ ^draft_.*$ ]]; then - - 'if [ -n "$FILENAME" ]; then' - - hugo new post/$FILENAME.md + - if [ -n "$FILENAME" ]; then + - if [ -z "$DIRNAME" ]; then + - DIRNAME="post" + - fi + - hugo new $DIRNAME/$FILENAME.md - git config --global user.email $GITLAB_USER_EMAIL - git config --global user.name $GITLAB_USER_NAME - - git add content/post/$FILENAME.md - - 'git commit -m "new content file creation: post/$FILENAME.md"' + - git add content/$DIRNAME/$FILENAME.md + - 'git commit -m "new content file creation: $DIRNAME/$FILENAME.md"' - git -c core.sshCommand="ssh -oStrictHostKeyChecking=no" push gitlab@www-intra.cns.s.u-tokyo.ac.jp:cns-netadmin/cns-hp.git HEAD:${CI_COMMIT_REF_NAME} - fi - fi @@ -71,4 +74,4 @@ production: paths: - public only: - - master \ No newline at end of file + - master diff --git a/themes/cns_hp_theme/archetypes/default.md b/themes/cns_hp_theme/archetypes/default.md index ac36e0622776b9ea3aff3dd3e2b43b1cdf833eed..dcf34e3030df7db1308e0d4f0431c4da18673a72 100644 --- a/themes/cns_hp_theme/archetypes/default.md +++ b/themes/cns_hp_theme/archetypes/default.md @@ -1,2 +1,7 @@ +++ +draft = true +title = "{{ replace .Name "-" " " | title }}" +date = {{ .Date }} +mkbanner = false +bannerimg = "" +++