OSDN Git Service

Revert "[remove] : Removed blog"
authorhayao <hayao@fascode.net>
Sat, 9 Oct 2021 14:07:33 +0000 (23:07 +0900)
committerhayao <hayao@fascode.net>
Sat, 9 Oct 2021 14:48:52 +0000 (23:48 +0900)
This reverts commit 75529aa3debc2ec4620b5084a814ab14b5857ba5.

blog/.gitignore [new file with mode: 0644]
blog/config.toml [new file with mode: 0644]
blog/src/archetypes/default.md [new file with mode: 0644]
blog/src/content/posts/20211009/index.md [new file with mode: 0644]
blog/src/themes/smigle [new submodule]
blog/update-theme.sh [new file with mode: 0755]

diff --git a/blog/.gitignore b/blog/.gitignore
new file mode 100644 (file)
index 0000000..8890487
--- /dev/null
@@ -0,0 +1,6 @@
+*
+
+!src
+!.gitignore
+!config.*
+!*.sh
diff --git a/blog/config.toml b/blog/config.toml
new file mode 100644 (file)
index 0000000..4033acd
--- /dev/null
@@ -0,0 +1,13 @@
+baseURL = "./blog/"
+languageCode = 'ja-JP'
+title = 'ハヤオのブログ'
+theme = "smigle"
+
+archetypeDir = "src/archetypes"
+assetDir = "src/assets"
+contentDir = "src/content"
+dataDir = "src/data"
+layoutDir = "src/layouts"
+staticDir = "src/static"
+themesDir = "src/themes"
+publishDir = "./"
diff --git a/blog/src/archetypes/default.md b/blog/src/archetypes/default.md
new file mode 100644 (file)
index 0000000..00e77bd
--- /dev/null
@@ -0,0 +1,6 @@
+---
+title: "{{ replace .Name "-" " " | title }}"
+date: {{ .Date }}
+draft: true
+---
+
diff --git a/blog/src/content/posts/20211009/index.md b/blog/src/content/posts/20211009/index.md
new file mode 100644 (file)
index 0000000..55b2c9d
--- /dev/null
@@ -0,0 +1,11 @@
+---
+title: "最初の投稿"
+date: 2021-10-09T21:10:53+09:00
+draft: true
+---
+
+ハヤオのブログをHugoを使って作ってみた。
+
+マークダウンだけでこうやってかけるのシンプルでいいですね。
+
+Fascodeのブログに載せられないものでもこれからちょこちょこ書いていこうかしら()
diff --git a/blog/src/themes/smigle b/blog/src/themes/smigle
new file mode 160000 (submodule)
index 0000000..13c241e
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 13c241e8ab83a0162d7c3e3eaefaadb0843bf38d
diff --git a/blog/update-theme.sh b/blog/update-theme.sh
new file mode 100755 (executable)
index 0000000..dcb9aba
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+set -eu
+
+script_path="$( cd -P "$( dirname "$(readlink -f "${0}")" )" && pwd )"
+theme_dir="${script_path}/src/themes/"
+
+cd "${theme_dir}"
+for _theme in "${theme_dir}/"*; do
+    cd "${_theme}"
+    current_commit_id="$(git rev-parse --short HEAD)"
+    default_branch="$(git remote show origin | grep 'HEAD branch' | awk '{print $NF}')"
+    git checkout "${default_branch}"
+    git pull
+    new_commit_id="$(git rev-parse --short HEAD)"
+    cd "${script_path}"
+
+
+    if [[ ! "${current_commit_id}" = "${new_commit_id}" ]]; then
+        git add "${_theme}"
+        git commit -S -m "Updated hugo theme (${new_commit_id})"
+    fi
+
+    git push
+done