File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# BlogWriter
22With 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."
Original file line number Diff line number Diff line change 11#! /bin/bash
22echo " Blog Writer Started."
33echo ' By okaits#7534'
4- echo " linuxcodevblog(皆の意見交流所公式ブログ)に投稿します 。"
4+ echo " okaitslinblogに投稿します 。"
55read -p " 日付(yyyy-mm-dd, 例: 2021-08-23(2021年8月23日)> " date
66fn=$date
77read -p " タイトル> " title
@@ -62,19 +62,19 @@ while true
6262 echo $b >> $fn
6363 done
6464echo " アップロードします。"
65- if ls linuxcodevblog > /dev/null 2>&1
65+ if ls okaitslinblog > /dev/null 2>&1
6666 then
67- echo " linuxcodevblogを発見しました 。cloneをキャンセルします。"
67+ echo " okaitslinblogを発見しました 。cloneをキャンセルします。"
6868 else
69- echo " linuxcodevblogがありません 。cloneします。"
70- git clone https://github.com/linuxcodevserver/linuxcodevblog
69+ echo " okaitslinblogがありません 。cloneします。"
70+ git clone https://github.com/okaitslinblog/okaitslinblog.github.io
7171 echo " cloneが終わりました。"
7272fi
73- cd linuxcodevblog
73+ cd okaitslinblog
7474git checkout gh-pages
7575mv ../${fn} ./_posts/
7676echo " アップロード処理を開始します。"
77- echo " 選択肢がでたら、絶対にlinuxcodevserver/linuxcodevblogを選んでください 。"
77+ echo " もし選択肢がでたら、絶対にokaitslinblog/okaitslinblog.github.ioを選んでください 。"
7878gh pr create --title " [add] Post" --body " Automaticaly created by blogwriter"
7979echo " アップロード処理が完了しました。"
8080exit
You can’t perform that action at this time.
0 commit comments