Skip to content

Commit 77f9f80

Browse files
author
[ビルドしてる人の名前/ニックネーム]
committed
[update] 色々と変更
1 parent 4c17ddb commit 77f9f80

File tree

7 files changed

+78
-79
lines changed

7 files changed

+78
-79
lines changed

Diff for: README.md

+27
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
11
# BlogWriter
22
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>

Diff for: blogwriter.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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."

Diff for: convertc.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
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."

Diff for: getimgurl.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
echo "https://okaitslinblog.github.io/img/$1"
3+
exit

Diff for: mvimg.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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."

Diff for: upload.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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."

Diff for: write.sh

-79
This file was deleted.

0 commit comments

Comments
 (0)