summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/archives.html46
-rw-r--r--src/article.html58
-rw-r--r--src/exclude0
-rw-r--r--src/fugitive.css235
-rw-r--r--src/install.sh70
-rw-r--r--src/post-commit.sh115
-rw-r--r--src/post-receive.sh0
7 files changed, 0 insertions, 524 deletions
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 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html>
-<html dir="ltr" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><?fugitive-install name ?>'s blog: <?fugitive article_title ?></title>
- <meta http-equiv="Content-type" content="application/xhtml+xml; charset=utf-8" />
- <meta name="author" content="<?fugitive-install name ?>" />
- <meta name="description" content="<?fugitive-install name ?>'s blog" />
- <link rel="stylesheet" href="fugitive.css" type="text/css" media="screen" charset="utf-8" />
- </head>
- <body>
- <div id="container">
- <nav>
- <ul>
- <li><a href="index.html">home</a></li>
- <li>archives</li>
- </ul>
- </nav>
- <header>
- <h1><?fugitive-install name ?>'s blog</h1>
- <q>Weeks of coding can save you hours of planning.</q>
- </header>
- <article>
- <header>
- <h2>Archives</h2>
- </header>
- <section>
- <?fugitive archives ?>
- </section>
- </article>
- <footer>
- <p>
- <a href="http://www.gnu.org/copyleft/copyleft.html">copyleft</a>
- <?fugitive-install name ?> <?fugitive-install year ?>
- &mdash;
- powered by <a href="http://gitorious.org/fugitive">fugitive</a>
- </p>
- <p>
- last build was <?fugitive commit_hash ?>,
- <time><?fugitive commit_datetime ?></time>,
- <q><?fugitive commit_subject ?></q>
- </p>
- </footer>
- </div>
- </body>
-</html>
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 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html>
-<html dir="ltr" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><?fugitive-install name ?>'s blog: <?fugitive article_title ?></title>
- <meta http-equiv="Content-type" content="application/xhtml+xml; charset=utf-8" />
- <meta name="author" content="<?fugitive-install name ?>" />
- <meta name="description" content="<?fugitive-install name ?>'s blog" />
- <link rel="stylesheet" href="fugitive.css" type="text/css" media="screen" charset="utf-8" />
- </head>
- <body>
- <div id="container">
- <nav>
- <ul>
- <li><a href="index.html">home</a></li>
- <li><a href="archives.html">archives</a></li>
- </ul>
- </nav>
- <header>
- <h1><?fugitive-install name ?>'s blog</h1>
- <q>Weeks of coding can save you hours of planning.</q>
- </header>
- <article>
- <header>
- <h2><?fugitive article_title ?></h2>
- </header>
- <footer>
- by <?fugitive article_cauthor ?>, on
- <time datetime="<?fugitive article_cdatetime ?>">
- <?fugitive article_cdate ?> at <?fugitive article_ctime ?>
- </time><br />
- <small>
- last update by <?fugitive article_mauthor ?>, on
- <time datetime="<?fugitive article_mdatetime ?>">
- <?fugitive article_mdate ?> at <?fugitive article_mtime ?>
- </time>
- </small>
- </footer>
- <div>
- <?fugitive article_content ?>
- </div>
- </article>
- <footer>
- <p>
- <a href="http://www.gnu.org/copyleft/copyleft.html">copyleft</a>
- <?fugitive-install name ?> <?fugitive-install year ?>
- &mdash;
- powered by <a href="http://gitorious.org/fugitive">fugitive</a>
- </p>
- <p>
- last build was <?fugitive commit_hash ?>,
- <time><?fugitive commit_datetime ?></time>,
- <q><?fugitive commit_subject ?></q>
- </p>
- </footer>
- </div>
- </body>
-</html>
diff --git a/src/exclude b/src/exclude
deleted file mode 100644
index e69de29..0000000
--- a/src/exclude
+++ /dev/null
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/<?fugitive-install\s\+$1\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 <<EOF
-#INCLUDE:article.html#
-EOF
- fugitive_write_template > fugitive/templates/archives.html <<EOF
-#INCLUDE:archives.html#
-EOF
- echo "done."
- echo -n "Writing default css file... "
- (base64 -d | gunzip) > fugitice.css <<EOF
-#INCLUDE:fugitive.css#
-EOF
- echo "done."
- echo -n "Installing fugitive hooks scripts... "
- (base64 -d | gunzip) > .git/hooks/post-commit <<EOF
-#INCLUDE:post-commit.sh#
-EOF
- chmod +x .git/hooks/post-receive
- (base64 -d | gunzip) > .git/hooks/post-receive <<EOF
-#INCLUDE:post-receive.sh#
-EOF
- chmod +x .git/hooks/post-receive
- echo "done."
- echo -n "Importing files into git repository... "
- git add fugitive/templates/* fugitive.css >/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 <<EOF
-#INCLUDE:exclude#
-EOF
- echo "done."
- cd -
- echo "Installation complete, please see the README file for an howto."
-}
-
-case "$1" in
- "--help") fugitive_help >&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/<?fugitive\s\+$1\s*?>/$2/"
-}
-replace_var_by_file() {
- sed "/<?fugitive\s\+$1\s*?>/ {
- 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
--- a/src/post-receive.sh
+++ /dev/null