File tree 7 files changed +78
-79
lines changed
7 files changed +78
-79
lines changed Original file line number Diff line number Diff line change 1
1
# BlogWriter
2
2
With this program you can easily post to linuxcodevblog.
3
+ ## 使い方
4
+ 0 もし写真を使う場合:URLの取得
5
+ 写真を使う場合、BlogWriterフォルダの中に「記事のタイトル-01.png(例:○○をする方法-01.png)」という名前で保存してください。
6
+ なお、複数ある場合01を他の数字にしてください。
7
+ 保存したら、
8
+ ./getimgurl.sh 画像の名前
9
+ を実行してください。
10
+ 画像のURL(仮)が出てきます。
11
+ アップロードは./upload.shで行われます。
12
+
13
+ 1 . yyyy-mm-dd-タイトル.mdにhtmlかmdでブログの本文を書く
14
+ (例:2021-08-26-○○をする方法.md)
15
+
16
+ 2 . ./blogwriter.shを実行する
17
+ ./blogwriter.sh 本文のファイル
18
+
19
+ 3 ./convertc.shを実行する
20
+ ./convertc.sh 本文のファイル
21
+
22
+ 4 写真の移動
23
+ 写真を移動させます。
24
+ ./mvimg.sh 画像の名前
25
+
26
+ 4 ./upload.shを実行する
27
+ ./upload.sh 本文のファイル
28
+ <b >もし、 「Which should be the base repository (used for e.g. querying issues) for this directory?」と聞かれたら、「okaitslinblog/okaitslinblog.github.io」と答えてください。<br >
29
+ また、「Where should we push the 'gh-pages' branch?」と聞かれたら、「Create a fork of okaitslinblog/okaitslinblog.github.io」と答えてください。<br ></b >
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ sed -i -e " 1i ---" $1
3
+ sed -i -e " 2i layout: post" $1
4
+ read -p " タイトル> " title
5
+ sed -i -e " 3i title: $title " $1
6
+ read -p " 説明・概要> " description
7
+ sed -i -e " 4i description: $description " $1
8
+ read -p " カテゴリ> " categories
9
+ sed -i -e " 5i categories: $categories " $1
10
+ sed -i -e " 6i highlight: true" $1
11
+ sed -i -e " 7i disqus: true" $1
12
+ read -p " 筆者のDiscordユーザー名&Discordタグ(例:okaits#7534)> " author
13
+ sed -i -e " 8i author: $author " $1
14
+ sed -i -e " 9i ---" $1
15
+ echo " Done."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ sed -i -e ' s/blogwriter.commands.code.start/\<pre class\=\"prettyprint\">\<code class\=\"prettyprint\"\>/g' $1
3
+ sed -i -e ' s/blogwriter.commands.code.end/\<\/code\>\<\/pre\>/g' $1
4
+ sed -i -e ' s/blogwriter.commands.toc.insert/\{\% include toc.html html\=content sanitize\=true \%\}/g' $1
5
+ echo " Done."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ echo " https://okaitslinblog.github.io/img/$1 "
3
+ exit
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ if ls img > /dev/null 2>&1
3
+ then
4
+ mv $1 img/
5
+ else
6
+ mkdir img
7
+ mv $1 img/
8
+ fi
9
+ echo " Done."
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ if ls okaitslinblog.github.io > /dev/null 2>&1
3
+ then
4
+ true
5
+ else
6
+ gh repo clone okaitslinblog/okaitslinblog.github.io
7
+ fi
8
+ if ls img/* > /dev/null 2>&1
9
+ then
10
+ mv img/* okaitslinblog.github.io/img/
11
+ fi
12
+ mv $1 okaitslinblog.github.io/_posts/
13
+ cd okaitslinblog.github.io
14
+ ls
15
+ echo " アップロード処理を開始します。"
16
+ git add .
17
+ git commit -m " [add] Post"
18
+ gh pr create --title " [add] Post" --body " Automaticaly generated by blogwriter"
19
+ echo " Done."
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments