X-Git-Url: https://git.danieliu.xyz/?p=pb.git;a=blobdiff_plain;f=pb;fp=pb;h=5f85f3cb2e31af714815d95a6631dbeca60b66be;hp=6b9a6b49e7df50aecf29ef8abff5ef0d87266679;hb=050f3a6d81615e7879053fc595545fa784c1290c;hpb=2e03339e7b72dc244ef6b944b79bf092b23289ab diff --git a/pb b/pb index 6b9a6b4..5f85f3c 100755 --- a/pb +++ b/pb @@ -2,7 +2,7 @@ # pinosaur's blog script data_dir="blog" -website_url="https://www.youtube.com/watch?v=oHg5SJYRHA0/" +website_url="https://www.youtube.com/watch?v=oHg5SJYRHA0/" # no ending slash blog_index_file="blogindex.html" rolling_file="rolling.html" rss_file="rss.xml" @@ -18,7 +18,7 @@ init() { [ "$ask" != "y" ] && echo "Cancelled init" && exit 0 mkdir -p "$data_dir/drafts" "$data_dir/published" "$data_dir/html" "$data_dir/templates" "$data_dir/backups" - echo '

{{TITLE}}

' >> "$data_dir/templates/$index_template" + echo '{{TITLE}}' >> "$data_dir/templates/$index_template" echo -e '
\n

{{TITLE}}

\n

{{DATE}}

\n

{{BODY}}

\n
' >> "$data_dir/templates/$rolling_template" echo -e '\n{{TITLE}}\n\n<\description>\n<\item>' \ >> "$data_dir/templates/$rss_template" @@ -53,8 +53,8 @@ sub() { sed "\$a " |\ sed "s|{{TITLE}}|$1|g; s|{{DATE}}|`date +'%a, %b %d %H:%M'`|g; - s|{{URL}}|$website_url/$1|g" |\ - sed "/{{BODY}}/r $data_dir/drafts/$1" |\ + s|{{URL}}|$website_url/blog/html/$1.html|g" |\ + sed "/{{BODY}}/r $data_dir/drafts/$1.draft.html" |\ sed "/{{BODY}}/d" } @@ -105,7 +105,7 @@ delete() { } # check to see if all required files are present -[ -f $blog_index_file ] && [ -f $rolling_file ] && [ -f $blog_template ] && [ -f $rss_file ] || { echo "You are missing a file, please check that you have $blog_index_file, $template_file, $rolling_file and $rss_file in your home directory" && exit 1; } +[ -f $blog_index_file ] && [ -f $rolling_file ] && [ -f $blog_template ] && [ -f $rss_file ] || { echo "You are missing a file, please check that you have $blog_index_file, $blog_template, $rolling_file and $rss_file in your home directory" && exit 1; } # check if blog dir exists [ ! -d $data_dir ] && init && exit 0