From 050f3a6d81615e7879053fc595545fa784c1290c Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 5 Jan 2021 20:20:43 -0500 Subject: [PATCH] hopefully stable --- .gitignore | 4 +++- blog/templates/index_entry.html | 1 + blog/templates/rolling_entry.html | 5 +++++ blog/templates/rss_entry.html | 6 ++++++ blogindex.html | 3 +++ pb | 10 +++++----- rolling.html | 7 +++++++ rss.xml | 7 +++++++ 8 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 blog/templates/index_entry.html create mode 100644 blog/templates/rolling_entry.html create mode 100644 blog/templates/rss_entry.html diff --git a/.gitignore b/.gitignore index 4ddfdc4..7ad64e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -blog/ +blog/backups/ +blog/drafts/ +blog/published/ diff --git a/blog/templates/index_entry.html b/blog/templates/index_entry.html new file mode 100644 index 0000000..6c8811d --- /dev/null +++ b/blog/templates/index_entry.html @@ -0,0 +1 @@ +
  • {{DATE}} - {{TITLE}}
  • diff --git a/blog/templates/rolling_entry.html b/blog/templates/rolling_entry.html new file mode 100644 index 0000000..a4dd991 --- /dev/null +++ b/blog/templates/rolling_entry.html @@ -0,0 +1,5 @@ +
    +

    {{TITLE}}

    +

    {{DATE}}

    +

    {{BODY}}

    +
    diff --git a/blog/templates/rss_entry.html b/blog/templates/rss_entry.html new file mode 100644 index 0000000..ef5ae1a --- /dev/null +++ b/blog/templates/rss_entry.html @@ -0,0 +1,6 @@ + +{{TITLE}} +{{URL}} + +{{BODY}} + diff --git a/blogindex.html b/blogindex.html index de1cfe2..e9ebf04 100644 --- a/blogindex.html +++ b/blogindex.html @@ -9,6 +9,9 @@

    Blog index page

    + +lol + 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 diff --git a/rolling.html b/rolling.html index 63a39d5..de68198 100644 --- a/rolling.html +++ b/rolling.html @@ -9,6 +9,13 @@

    Rolling index page

    + +
    +

    lol

    +

    Wed, Nov 25 23:57

    +

    sdkjsaldk

    +
    + diff --git a/rss.xml b/rss.xml index cec4b85..b94e613 100644 --- a/rss.xml +++ b/rss.xml @@ -7,6 +7,13 @@ Description + + +lol + +<\description> +<\item> + -- 2.20.1