From f20790f5d47053044fb54c5f8ca8b7a1f090bd39 Mon Sep 17 00:00:00 2001
From: garhve
太麻烦了,我就写了个简单的脚本来简化一下流程,反正是自用的,所以也不用考虑 怎么处理不同的位置,并且原先由于发布比较繁琐,草稿就都存在本地了,现在 我也可以直接将草稿发布出来,看得见,我才有动力写~
-######################################################################
-# @author : garhve (dev@garhve.com)
-# @file : blog
-# @created : Friday Dec 09, 2022 16:09:42 CST
-#
-# @description : simplify blog publishing.
-######################################################################
+######################################################################
+# @author : garhve (dev@garhve.com)
+# @file : blog
+# @created : Friday Dec 09, 2022 16:09:42 CST
+#
+# @description : simplify blog publishing.
+######################################################################
-p="$(pwd)"
+p="$(pwd)"
-cd "$HOME/Storage/data/blog"
+cd "$HOME/Storage/data/blog"
-echo "Enter the blog name"
+echo "Enter the blog name"
read -r name
-hugo new posts/"$name"
+hugo new posts/"$name"
-echo "1. en"
-echo "2. cn"
-echo "all option would be default to 1 except 2[1 or 2]: "
+echo "1. en"
+echo "2. cn"
+echo "all option would be default to 1 except 2[1 or 2]: "
read l
-if [ $l -eq 1 ]; then
- lang="en"
-elif [ $l -eq 2 ]; then
- lang="cn"
-else
- lang="en"
-fi
-[ $lang == "cn" ] && mv "content/en/posts/$name" "content/cn/posts/$name"
-vim "content/$lang/posts/$name"
+if [ $l -eq 1 ]; then
+ lang="en"
+elif [ $l -eq 2 ]; then
+ lang="cn"
+else
+ lang="en"
+fi
+[ $lang == "cn" ] && mv "content/en/posts/$name" "content/cn/posts/$name"
+vim "content/$lang/posts/$name"
hugo
cd public
git add .
-read -r -p "commit message: " com
-git commit -m "$com"
+read -r -p "commit message: " com
+git commit -m "$com"
-cd "$p"
+cd "$p"
这片文章的出现,也只是我想确认一下能不能正确处理好中文内容。这样一说,突然想起来编辑也挺麻烦的。。
也许可以将代码优化下以后就省心了,哈哈。
diff --git a/cn/posts/index.html b/cn/posts/index.html
index 6625a7a..417623a 100644
--- a/cn/posts/index.html
+++ b/cn/posts/index.html
@@ -45,7 +45,7 @@
-
+
diff --git a/index.html b/index.html
index fb6f0e2..a3d1433 100644
--- a/index.html
+++ b/index.html
@@ -45,7 +45,7 @@
-
+
diff --git a/posts/1/index.html b/posts/1/index.html
index 569ad5e..4c80065 100644
--- a/posts/1/index.html
+++ b/posts/1/index.html
@@ -49,7 +49,7 @@ Due to personal interest, I didn’t choose frame to base my website. I
-
+
diff --git a/posts/2/index.html b/posts/2/index.html
index fec5e9f..f038c4a 100644
--- a/posts/2/index.html
+++ b/posts/2/index.html
@@ -49,7 +49,7 @@ abroad provider because they don’t have to register.. the the budget&a
-
+
diff --git a/posts/3/index.html b/posts/3/index.html
index cdabc2e..1b005f7 100644
--- a/posts/3/index.html
+++ b/posts/3/index.html
@@ -51,7 +51,7 @@ delete file foo every minute * * * * * rm foo delete file foo every 15 minutes 1
-
+
diff --git a/posts/4/index.html b/posts/4/index.html
index 079b175..74ab8ae 100644
--- a/posts/4/index.html
+++ b/posts/4/index.html
@@ -74,7 +74,7 @@ document.addEventListener("DOMContentLoaded", function() {
-
+
diff --git a/posts/5/index.html b/posts/5/index.html
index 22902a3..6992e50 100644
--- a/posts/5/index.html
+++ b/posts/5/index.html
@@ -53,7 +53,7 @@ Arguments are delimeted by semi colon (;)." />
-
+
diff --git a/posts/6/index.html b/posts/6/index.html
index 2b26582..c953036 100644
--- a/posts/6/index.html
+++ b/posts/6/index.html
@@ -53,7 +53,7 @@ Redirection File Redirection 0 is standard input, 1 is standard output, 2 is sta
-
+
diff --git a/posts/7/index.html b/posts/7/index.html
index f3365c9..ce39300 100644
--- a/posts/7/index.html
+++ b/posts/7/index.html
@@ -47,7 +47,7 @@ First is in the movie Midnight in Paris, directed by Woody Allen, which I just f
-
+
diff --git a/posts/8/index.html b/posts/8/index.html
index 63c4320..b297f95 100644
--- a/posts/8/index.html
+++ b/posts/8/index.html
@@ -51,7 +51,7 @@ Here’s a brief description: all configuration files I want to put in .
-
+
diff --git a/posts/index.html b/posts/index.html
index 4ba4da8..c869bba 100644
--- a/posts/index.html
+++ b/posts/index.html
@@ -45,7 +45,7 @@
-
+
--
cgit v1.2.3-70-g09d2