From f59b2bd1d4f8ff3548af12e9ca9367562e60373c Mon Sep 17 00:00:00 2001 From: p4bl0 Date: Fri, 23 Jul 2010 03:02:23 +0200 Subject: in fact a Makefile makes no sens here, what I'll need is juste un build script. Thus src dir has no more any reason to be --- Makefile | 1 - archives.html | 46 ++++++++++ article.html | 58 +++++++++++++ exclude | 0 fugitive.css | 235 ++++++++++++++++++++++++++++++++++++++++++++++++++++ install.sh | 70 ++++++++++++++++ post-commit.sh | 115 +++++++++++++++++++++++++ post-receive.sh | 0 src/archives.html | 46 ---------- src/article.html | 58 ------------- src/exclude | 0 src/fugitive.css | 235 ---------------------------------------------------- src/install.sh | 70 ---------------- src/post-commit.sh | 115 ------------------------- src/post-receive.sh | 0 15 files changed, 524 insertions(+), 525 deletions(-) delete mode 100644 Makefile create mode 100644 archives.html create mode 100644 article.html create mode 100644 exclude create mode 100644 fugitive.css create mode 100644 install.sh create mode 100644 post-commit.sh create mode 100644 post-receive.sh delete mode 100644 src/archives.html delete mode 100644 src/article.html delete mode 100644 src/exclude delete mode 100644 src/fugitive.css delete mode 100644 src/install.sh delete mode 100644 src/post-commit.sh delete mode 100644 src/post-receive.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index f4ebe19..0000000 --- a/Makefile +++ /dev/null @@ -1 +0,0 @@ -# should generate the fugitive shell script from hooks files and template diff --git a/archives.html b/archives.html new file mode 100644 index 0000000..9d47769 --- /dev/null +++ b/archives.html @@ -0,0 +1,46 @@ + + + + + <?fugitive-install name ?>'s blog: <?fugitive article_title ?> + + + + + + +
+ +
+

's blog

+ Weeks of coding can save you hours of planning. +
+
+
+

Archives

+
+
+ +
+
+ +
+ + diff --git a/article.html b/article.html new file mode 100644 index 0000000..90cbe3c --- /dev/null +++ b/article.html @@ -0,0 +1,58 @@ + + + + + <?fugitive-install name ?>'s blog: <?fugitive article_title ?> + + + + + + +
+ +
+

's blog

+ Weeks of coding can save you hours of planning. +
+
+
+

+
+
+ by , on +
+ + last update by , on + + +
+
+ +
+
+ +
+ + diff --git a/exclude b/exclude new file mode 100644 index 0000000..e69de29 diff --git a/fugitive.css b/fugitive.css new file mode 100644 index 0000000..12840e0 --- /dev/null +++ b/fugitive.css @@ -0,0 +1,235 @@ +* { margin: 0; padding: 0; } +html, body { + background-color: #fff; + margin: 0; + padding: 0; + font-family: monospace; + font-size: 1em; + text-align: center; + color: #333; +} +#container { + padding: 0 1em; + margin: 0 auto; + width: 51%; + min-width: 480px; +} +nav { + display: block; + margin: 0; + padding: 0.3em 1em; + border: 1px solid #ccc; + border-top: 0; + background: #f2f2f2; + color: #aaa; + font-size: 1.3em; + text-align: left; +} +nav ul { padding: 0; margin: 0; } +nav ul li { display: inline; } +nav ul li:before { content: " — "; } +nav ul li:first-child:before { content: ""; } +nav ul li a { + color: #aaa; + text-decoration: none; +} +nav ul li a:hover { color: #888; } +header { + display: block; + margin: 1em 0; + padding: 1em; + border: 4px double #ccc; +} +header h1 { + margin: 0 0 0.3em 0; + madding: 0; + color: + font-size: 2em; + font-weight: normal; +} +header q { + font-size: 1.2em; + font-style: italic; +} +article { + display: block; + text-align: left; + counter-reset: code; + counter-reset: figure; +} +article header { + display: block; + margin: 2em 0 0 0; + padding: 0; + border-style: none; + border-bottom: 1px dashed #ccc; +} +article header h2 { + margin: 0; + padding: 0 0 0.2em 0; + font-size: 1.5em; + font-weight: bold; +} +article footer { + display: block; + margin: 0.3em 0 2em 0; + padding: 0; + border-style: none; + color: #888; + font-size: 1em; + text-align: right; +} +article > div { + margin: 0; + padding: 0; + line-height: 1.5em; + font-size: 1.1em; +} +article > div p:first-child:first-letter { + font-size: 1.5em; + font-weight: bold; +} +article > div p { + margin: 1em 0; + text-indent: 2em; +} +article > div ul { + margin: 1em 0; + padding: 0 0 0 3em; +} +article > div ul li { + margin: 0 0 0.2em 0; + padding: 0 0 0 0.5em; + list-style-position: outside; + list-style-type: circle; +} +article > div dl { + margin: 1em 0; + padding: 0; +} +article > div dl dt { + margin: 0; + padding: 0; + font-weight: bold; +} +article > div dl dd { + margin: 0 0 0.3em 0; + padding: 0 0 0 2em; +} +article > div blockquote { + margin: 1em 0; + padding: 0.5em; + padding-left: 2em; + background: #f2f2f2; + border-left: 0.1em solid #ccc; +} +article > div blockquote p { + margin: 0.5em 0; +} +article > div a:hover { text-decoration: underline; } +article > div a:visited { color: #048; } +article > div code { + color: #ccc; + background-color: #333; + padding: 0 0.2em; +} +article > div pre:before { + display: block; + padding: 0 0.5em; + font-size: 0.8em; + line-height: 1em; + background-color: #444; + content: "code " counter(code) ":"; + counter-increment: code; +} +article > div pre { + margin: 1em 0; + padding: 0.5em; + overflow: auto; + color: #ccc; + background-color: #333; + max-height: 420px; +} +article > div pre .comment { + color: #888; +} +article > div pre .comment-delimiter { + color: #888; +} +article > div pre .constant { + color: #d0d; +} +article > div pre .function-name { + color: #27d; +} +article > div pre .keyword { + color: #dd0; +} +article > div pre .preprocessor { + color: #9c3; +} +article > div pre .string { + color: #3af; +} +article > div pre .type { + color: #fa0; +} +article > div pre .variable-name { + color: #0b0; +} +article > div a { + color: #08f; + text-decoration: none; +} +article > div figure { + display: block; + margin: 1em 0; + padding: 0; + text-align: center; +} +article > div figure figcaption { + display: block; +} +article > div figure figcaption:before { + display: inline; + content: "figure " counter(figure) ":"; + counter-increment: figure; +} +article > div .left { + float: left; + margin: 0 1em 0.5em 0; +} +article > div .right { + float: right; + margin: 0 0 0.5em 1em; +} +article > div .center { + text-align: center; +} +article > div hr { + margin: 1.5em auto; + padding: 0; + height: 1px; + width: 80%; + border: none; + background-color: #aaa; +} +footer { + display: block; + margin: 3em 0 0 0; + padding: 1em; + border-top: 1px dotted #aaa; + color: #888; + font-size: 0.9em; + clear: both; +} +footer p { + margin: 0; + padding: 0; + line-height: 1.5em; +} +footer p a { + color: #666; + text-decoration: none; +} + diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..a14c8c8 --- /dev/null +++ b/install.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +replace_var_by_string() { + sed "s//$2/" +} + +fugitive_write_template() { + name=`git config --get user.name` + base64 -d | gunzip | replace_var_by_string name "$name" | \ + replace_var_by_string year "`date +%Y`" +} + +fugitive_install() { + DIR="." + if [ "$1" != "" ]; then DIR="$1"; fi + if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi + cd "$DIR" + echo -n "Creating new git repository... " + git init >/dev/null + echo "done." + echo -n "Creating default directory tree... " + mkdir -p fugitive/{drafts,articles,templates} + echo "done." + echo -n "Adding default directory paths to git config... " + git config --add --path fugitive.templates-dir "fugitive/templates" + git config --add --path fugitive.articles-dir "fugitive/articles" + git config --add --path fugitive.public-dir "." + echo "done." + echo -n "Writing default template files... " + fugitive_write_template > fugitive/templates/article.html < fugitive/templates/archives.html < fugitice.css < .git/hooks/post-commit < .git/hooks/post-receive </dev/null + git commit -m "fugitive inital import" >/dev/null + echo "done." + echo -n "Preventing git to track generated html files... " + (base64 -d | gunzip) > .git/info/exclude <&2;; + "--install") fugitive_install "$2";; + "--install-hooks") fugitive_install_hooks "$2";; + *) fugitive_usage >&2;; +esac diff --git a/post-commit.sh b/post-commit.sh new file mode 100644 index 0000000..c028f85 --- /dev/null +++ b/post-commit.sh @@ -0,0 +1,115 @@ +#!/bin/sh + +public_dir=`git config --get fugitive.public-dir` +if [ ! -d "$public_dir" ]; then mkdir -p "$public_dir"; fi +templates_dir=`git config --get fugitive.templates-dir` +articles_dir=`git config --get fugitive.articles-dir` + +added_files=`git log -1 --name-status --pretty="format:" | grep -E '^A' | \ + cut -f2` +modified_files=`git log -1 --name-status --pretty="format:" | grep -E '^M' | \ + cut -f2` +deleted_files=`git log -1 --name-status --pretty="format:" | grep -E '^D' | \ + cut -f2` + +last_published_article=`git log --name-status --pretty="format:" | \ + grep -E '^A' | cut -f2 | grep -E '^$articles_dir' | head -1` + +sanit_mail() { + sed "s/@/[at]/;s/\./(dot)/" +} + +commit_Hash=`git log -1 --format="%H"` +commit_hash=`git log -1 --format="%h"` +commit_author=`git log -1 --format="%an"` +commit_author_email=`git log -1 --format="%ae" | sanit_mail` +commit_datetime=`git log -1 --format="%ai"` +commit_date=`git log -1 --format="%ad" --date="short"` +commit_time=`git log -1 --format="%ai" | cut -d' ' -f2` +commit_timestamp=`git log -1 --format="%at"` +commit_subject=`git log -1 --format="%s"` +commit_slug=`git log -1 --format="%f"` +commit_body() { + tmp=`tempfile -p "fugitive"` + git log -1 --format="%b" > "$tmp" + (sleep 5 && rm -f "$tmp") & # this message will self-destruct in 5s + echo "$tmp" +} + +article_info() { + git log --format="$1" -- "$2" +} +article_title() { + head -1 "$1" +} +article_content() { + tmp=`tempfile -p "fugitive"` + tail -n+2 "$1" > "$tmp" + (sleep 5 && rm -f "$tmp") & # this message will self-destruct in 5s + echo "$tmp" +} + +replace_var_by_string() { + sed "s//$2/" +} +replace_var_by_file() { + sed "// { + r $2 + d }" +} +replace_commit_info() { + replace_var_by_string "commit_Hash" "$commit_Hash" | \ + replace_var_by_string "commit_hash" "$commit_hash" | \ + replace_var_by_string "commit_author" "$commit_author" | \ + replace_var_by_string "commit_author_email" "$commit_author_email" | \ + replace_var_by_string "commit_datetime" "$commit_datetime" | \ + replace_var_by_string "commit_date" "$commit_date" | \ + replace_var_by_string "commit_time" "$commit_time" | \ + replace_var_by_string "commit_timestamp" "$commit_timestamp" | \ + replace_var_by_string "commit_subject" "$commit_subject" | \ + replace_var_by_string "commit_slug" "$commit_slug" | \ + replace_var_by_file "commit_body" "`commit_body`" +} +replace_article_info() { + cdt=`article_info "%ai" "$1" | tail -1` + mdt=`article_info "%ai" "$1" | head -1` + replace_var_by_file "article_content" "`article_content \"$1\"`" | \ + replace_var_by_string "article_title" "`article_title \"$1\"`" | \ + replace_var_by_string "article_cdatetime" "$cdt" | \ + replace_var_by_string "article_cdate" "`echo $cdt | cut -d' ' -f1`" | \ + replace_var_by_string "article_ctime" "`echo $cdt | cut -d' ' -f2`" | \ + replace_var_by_string "article_ctimestamp" \ + "`article_info \"%at\" \"$1\" | tail -1`" | \ + replace_var_by_string "article_mdatetime" "$mdt" | \ + replace_var_by_string "article_mdate" "`echo $mdt | cut -d' ' -f1`" | \ + replace_var_by_string "article_mtime" "`echo $mdt | cut -d' ' -f2`" | \ + replace_var_by_string "article_mtimestamp" \ + "`article_info \"%at\" \"$1\" | head -1`" | \ + replace_var_by_string "article_cauthor" \ + "`article_info \"%an\" \"$1\" | tail -1`" | \ + replace_var_by_string "article_cauthor_email" \ + "`article_info \"%ae\" \"$1\" | tail -1 | sanit_mail`" | \ + replace_var_by_string "article_mauthor" \ + "`article_info \"%an\" \"$1\" | head -1`" | \ + replace_var_by_string "article_mauthor_email" \ + "`article_info \"%ae\" \"$1\" | head -1 | sanit_mail`" +} + +for f in $deleted_files; do + if [ "$f" != "${f#$articles_dir}" ]; then + echo -n "Deleting $public_dir/${f#$articles_dir/}.html... " + rm $public_dir/${f#$articles_dir/}.html + echo "done." + fi +done + +for f in $added_files $modified_files; do + if [ "$f" != "${f#$articles_dir}" ]; then + echo -n "Generating $public_dir/${f#$articles_dir/}.html from $f... " + cat $templates_dir/article.html | \ + replace_commit_info | \ + replace_article_info "$f" | \ + cat > $public_dir/${f#$articles_dir/}.html + echo "done." + fi +done diff --git a/post-receive.sh b/post-receive.sh new file mode 100644 index 0000000..e69de29 diff --git a/src/archives.html b/src/archives.html deleted file mode 100644 index 9d47769..0000000 --- a/src/archives.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - <?fugitive-install name ?>'s blog: <?fugitive article_title ?> - - - - - - -
- -
-

's blog

- Weeks of coding can save you hours of planning. -
-
-
-

Archives

-
-
- -
-
- -
- - diff --git a/src/article.html b/src/article.html deleted file mode 100644 index 90cbe3c..0000000 --- a/src/article.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - <?fugitive-install name ?>'s blog: <?fugitive article_title ?> - - - - - - -
- -
-

's blog

- Weeks of coding can save you hours of planning. -
-
-
-

-
-
- by , on -
- - last update by , on - - -
-
- -
-
- -
- - diff --git a/src/exclude b/src/exclude deleted file mode 100644 index e69de29..0000000 diff --git a/src/fugitive.css b/src/fugitive.css deleted file mode 100644 index 12840e0..0000000 --- a/src/fugitive.css +++ /dev/null @@ -1,235 +0,0 @@ -* { margin: 0; padding: 0; } -html, body { - background-color: #fff; - margin: 0; - padding: 0; - font-family: monospace; - font-size: 1em; - text-align: center; - color: #333; -} -#container { - padding: 0 1em; - margin: 0 auto; - width: 51%; - min-width: 480px; -} -nav { - display: block; - margin: 0; - padding: 0.3em 1em; - border: 1px solid #ccc; - border-top: 0; - background: #f2f2f2; - color: #aaa; - font-size: 1.3em; - text-align: left; -} -nav ul { padding: 0; margin: 0; } -nav ul li { display: inline; } -nav ul li:before { content: " — "; } -nav ul li:first-child:before { content: ""; } -nav ul li a { - color: #aaa; - text-decoration: none; -} -nav ul li a:hover { color: #888; } -header { - display: block; - margin: 1em 0; - padding: 1em; - border: 4px double #ccc; -} -header h1 { - margin: 0 0 0.3em 0; - madding: 0; - color: - font-size: 2em; - font-weight: normal; -} -header q { - font-size: 1.2em; - font-style: italic; -} -article { - display: block; - text-align: left; - counter-reset: code; - counter-reset: figure; -} -article header { - display: block; - margin: 2em 0 0 0; - padding: 0; - border-style: none; - border-bottom: 1px dashed #ccc; -} -article header h2 { - margin: 0; - padding: 0 0 0.2em 0; - font-size: 1.5em; - font-weight: bold; -} -article footer { - display: block; - margin: 0.3em 0 2em 0; - padding: 0; - border-style: none; - color: #888; - font-size: 1em; - text-align: right; -} -article > div { - margin: 0; - padding: 0; - line-height: 1.5em; - font-size: 1.1em; -} -article > div p:first-child:first-letter { - font-size: 1.5em; - font-weight: bold; -} -article > div p { - margin: 1em 0; - text-indent: 2em; -} -article > div ul { - margin: 1em 0; - padding: 0 0 0 3em; -} -article > div ul li { - margin: 0 0 0.2em 0; - padding: 0 0 0 0.5em; - list-style-position: outside; - list-style-type: circle; -} -article > div dl { - margin: 1em 0; - padding: 0; -} -article > div dl dt { - margin: 0; - padding: 0; - font-weight: bold; -} -article > div dl dd { - margin: 0 0 0.3em 0; - padding: 0 0 0 2em; -} -article > div blockquote { - margin: 1em 0; - padding: 0.5em; - padding-left: 2em; - background: #f2f2f2; - border-left: 0.1em solid #ccc; -} -article > div blockquote p { - margin: 0.5em 0; -} -article > div a:hover { text-decoration: underline; } -article > div a:visited { color: #048; } -article > div code { - color: #ccc; - background-color: #333; - padding: 0 0.2em; -} -article > div pre:before { - display: block; - padding: 0 0.5em; - font-size: 0.8em; - line-height: 1em; - background-color: #444; - content: "code " counter(code) ":"; - counter-increment: code; -} -article > div pre { - margin: 1em 0; - padding: 0.5em; - overflow: auto; - color: #ccc; - background-color: #333; - max-height: 420px; -} -article > div pre .comment { - color: #888; -} -article > div pre .comment-delimiter { - color: #888; -} -article > div pre .constant { - color: #d0d; -} -article > div pre .function-name { - color: #27d; -} -article > div pre .keyword { - color: #dd0; -} -article > div pre .preprocessor { - color: #9c3; -} -article > div pre .string { - color: #3af; -} -article > div pre .type { - color: #fa0; -} -article > div pre .variable-name { - color: #0b0; -} -article > div a { - color: #08f; - text-decoration: none; -} -article > div figure { - display: block; - margin: 1em 0; - padding: 0; - text-align: center; -} -article > div figure figcaption { - display: block; -} -article > div figure figcaption:before { - display: inline; - content: "figure " counter(figure) ":"; - counter-increment: figure; -} -article > div .left { - float: left; - margin: 0 1em 0.5em 0; -} -article > div .right { - float: right; - margin: 0 0 0.5em 1em; -} -article > div .center { - text-align: center; -} -article > div hr { - margin: 1.5em auto; - padding: 0; - height: 1px; - width: 80%; - border: none; - background-color: #aaa; -} -footer { - display: block; - margin: 3em 0 0 0; - padding: 1em; - border-top: 1px dotted #aaa; - color: #888; - font-size: 0.9em; - clear: both; -} -footer p { - margin: 0; - padding: 0; - line-height: 1.5em; -} -footer p a { - color: #666; - text-decoration: none; -} - diff --git a/src/install.sh b/src/install.sh deleted file mode 100644 index a14c8c8..0000000 --- a/src/install.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh - -replace_var_by_string() { - sed "s//$2/" -} - -fugitive_write_template() { - name=`git config --get user.name` - base64 -d | gunzip | replace_var_by_string name "$name" | \ - replace_var_by_string year "`date +%Y`" -} - -fugitive_install() { - DIR="." - if [ "$1" != "" ]; then DIR="$1"; fi - if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi - cd "$DIR" - echo -n "Creating new git repository... " - git init >/dev/null - echo "done." - echo -n "Creating default directory tree... " - mkdir -p fugitive/{drafts,articles,templates} - echo "done." - echo -n "Adding default directory paths to git config... " - git config --add --path fugitive.templates-dir "fugitive/templates" - git config --add --path fugitive.articles-dir "fugitive/articles" - git config --add --path fugitive.public-dir "." - echo "done." - echo -n "Writing default template files... " - fugitive_write_template > fugitive/templates/article.html < fugitive/templates/archives.html < fugitice.css < .git/hooks/post-commit < .git/hooks/post-receive </dev/null - git commit -m "fugitive inital import" >/dev/null - echo "done." - echo -n "Preventing git to track generated html files... " - (base64 -d | gunzip) > .git/info/exclude <&2;; - "--install") fugitive_install "$2";; - "--install-hooks") fugitive_install_hooks "$2";; - *) fugitive_usage >&2;; -esac diff --git a/src/post-commit.sh b/src/post-commit.sh deleted file mode 100644 index c028f85..0000000 --- a/src/post-commit.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/sh - -public_dir=`git config --get fugitive.public-dir` -if [ ! -d "$public_dir" ]; then mkdir -p "$public_dir"; fi -templates_dir=`git config --get fugitive.templates-dir` -articles_dir=`git config --get fugitive.articles-dir` - -added_files=`git log -1 --name-status --pretty="format:" | grep -E '^A' | \ - cut -f2` -modified_files=`git log -1 --name-status --pretty="format:" | grep -E '^M' | \ - cut -f2` -deleted_files=`git log -1 --name-status --pretty="format:" | grep -E '^D' | \ - cut -f2` - -last_published_article=`git log --name-status --pretty="format:" | \ - grep -E '^A' | cut -f2 | grep -E '^$articles_dir' | head -1` - -sanit_mail() { - sed "s/@/[at]/;s/\./(dot)/" -} - -commit_Hash=`git log -1 --format="%H"` -commit_hash=`git log -1 --format="%h"` -commit_author=`git log -1 --format="%an"` -commit_author_email=`git log -1 --format="%ae" | sanit_mail` -commit_datetime=`git log -1 --format="%ai"` -commit_date=`git log -1 --format="%ad" --date="short"` -commit_time=`git log -1 --format="%ai" | cut -d' ' -f2` -commit_timestamp=`git log -1 --format="%at"` -commit_subject=`git log -1 --format="%s"` -commit_slug=`git log -1 --format="%f"` -commit_body() { - tmp=`tempfile -p "fugitive"` - git log -1 --format="%b" > "$tmp" - (sleep 5 && rm -f "$tmp") & # this message will self-destruct in 5s - echo "$tmp" -} - -article_info() { - git log --format="$1" -- "$2" -} -article_title() { - head -1 "$1" -} -article_content() { - tmp=`tempfile -p "fugitive"` - tail -n+2 "$1" > "$tmp" - (sleep 5 && rm -f "$tmp") & # this message will self-destruct in 5s - echo "$tmp" -} - -replace_var_by_string() { - sed "s//$2/" -} -replace_var_by_file() { - sed "// { - r $2 - d }" -} -replace_commit_info() { - replace_var_by_string "commit_Hash" "$commit_Hash" | \ - replace_var_by_string "commit_hash" "$commit_hash" | \ - replace_var_by_string "commit_author" "$commit_author" | \ - replace_var_by_string "commit_author_email" "$commit_author_email" | \ - replace_var_by_string "commit_datetime" "$commit_datetime" | \ - replace_var_by_string "commit_date" "$commit_date" | \ - replace_var_by_string "commit_time" "$commit_time" | \ - replace_var_by_string "commit_timestamp" "$commit_timestamp" | \ - replace_var_by_string "commit_subject" "$commit_subject" | \ - replace_var_by_string "commit_slug" "$commit_slug" | \ - replace_var_by_file "commit_body" "`commit_body`" -} -replace_article_info() { - cdt=`article_info "%ai" "$1" | tail -1` - mdt=`article_info "%ai" "$1" | head -1` - replace_var_by_file "article_content" "`article_content \"$1\"`" | \ - replace_var_by_string "article_title" "`article_title \"$1\"`" | \ - replace_var_by_string "article_cdatetime" "$cdt" | \ - replace_var_by_string "article_cdate" "`echo $cdt | cut -d' ' -f1`" | \ - replace_var_by_string "article_ctime" "`echo $cdt | cut -d' ' -f2`" | \ - replace_var_by_string "article_ctimestamp" \ - "`article_info \"%at\" \"$1\" | tail -1`" | \ - replace_var_by_string "article_mdatetime" "$mdt" | \ - replace_var_by_string "article_mdate" "`echo $mdt | cut -d' ' -f1`" | \ - replace_var_by_string "article_mtime" "`echo $mdt | cut -d' ' -f2`" | \ - replace_var_by_string "article_mtimestamp" \ - "`article_info \"%at\" \"$1\" | head -1`" | \ - replace_var_by_string "article_cauthor" \ - "`article_info \"%an\" \"$1\" | tail -1`" | \ - replace_var_by_string "article_cauthor_email" \ - "`article_info \"%ae\" \"$1\" | tail -1 | sanit_mail`" | \ - replace_var_by_string "article_mauthor" \ - "`article_info \"%an\" \"$1\" | head -1`" | \ - replace_var_by_string "article_mauthor_email" \ - "`article_info \"%ae\" \"$1\" | head -1 | sanit_mail`" -} - -for f in $deleted_files; do - if [ "$f" != "${f#$articles_dir}" ]; then - echo -n "Deleting $public_dir/${f#$articles_dir/}.html... " - rm $public_dir/${f#$articles_dir/}.html - echo "done." - fi -done - -for f in $added_files $modified_files; do - if [ "$f" != "${f#$articles_dir}" ]; then - echo -n "Generating $public_dir/${f#$articles_dir/}.html from $f... " - cat $templates_dir/article.html | \ - replace_commit_info | \ - replace_article_info "$f" | \ - cat > $public_dir/${f#$articles_dir/}.html - echo "done." - fi -done diff --git a/src/post-receive.sh b/src/post-receive.sh deleted file mode 100644 index e69de29..0000000 -- cgit v1.2.3