From a4de1eb7869caba6d9020e3f9cc7a817dfc74241 Mon Sep 17 00:00:00 2001 From: p4bl0 Date: Sun, 25 Jul 2010 00:57:27 +0200 Subject: using new include feature in default templates. Reorganised files accordingly --- archives.html | 77 ------------- article.html | 82 ------------- build.sh | 9 +- default-files/archives.html | 56 +++++++++ default-files/article.html | 49 ++++++++ default-files/footer.html | 13 +++ default-files/fugitive.css | 260 ++++++++++++++++++++++++++++++++++++++++++ default-files/nav-header.html | 24 ++++ default-files/print.css | 11 ++ fugitive.css | 260 ------------------------------------------ install.sh | 20 ++-- print.css | 11 -- 12 files changed, 430 insertions(+), 442 deletions(-) delete mode 100644 archives.html delete mode 100644 article.html create mode 100644 default-files/archives.html create mode 100644 default-files/article.html create mode 100644 default-files/footer.html create mode 100644 default-files/fugitive.css create mode 100644 default-files/nav-header.html create mode 100644 default-files/print.css delete mode 100644 fugitive.css delete mode 100644 print.css diff --git a/archives.html b/archives.html deleted file mode 100644 index 0cef075..0000000 --- a/archives.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - <?fugitive-install name ?>'s blog: archives - - - - - - - - - - - - - - - - - -
- -
-

's blog

- fugitive: a blog engine for hackers. -
-
-
-

Archives

-
-
-
- -
- -
-
- - - - -
last update on - - - -
- -
-
-
-
-

- copyleft - - — - powered by fugitive -

-

- last build was - at ,
- subject was -

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

's blog

- fugitive: a blog engine for hackers. -
-
-
-

-
-
- by , on - - -
last update by , on - - - -
-
- -
-
-
-

- copyleft - - — - powered by fugitive -

-

- last build was - at ,
- subject was -

-
-
- - diff --git a/build.sh b/build.sh index 1f3e40d..4bbd162 100755 --- a/build.sh +++ b/build.sh @@ -1,9 +1,10 @@ #!/bin/bash include_file() { + f=`echo -n $2 | sed 's/\//\\\\\//g'` tmp=`tempfile -p "figitive"` cat "$2" | gzip | base64 > "$tmp" - cat "$1" | sed "/#INCLUDE:$2#/ { + cat "$1" | sed "/#INCLUDE:$f#/ { r $tmp d }" rm "$tmp" @@ -11,11 +12,9 @@ include_file() { cp install.sh tmp1 i=1 -for f in archives.html article.html \ - fugitive.css print.css README \ - post-commit.sh post-receive.sh; do +for f in README post-commit.sh post-receive.sh default-files/*; do j=$((1 - i)) - include_file tmp$i $f > tmp$j + include_file tmp$i "$f" > tmp$j i=$j done cp tmp$j fugitive diff --git a/default-files/archives.html b/default-files/archives.html new file mode 100644 index 0000000..5cb8981 --- /dev/null +++ b/default-files/archives.html @@ -0,0 +1,56 @@ + + + + + <?fugitive-install name ?>'s blog: archives + + + + + + + + + + + + + + + + + +
+ +
+
+

Archives

+
+
+
+ +
+ +
+
+ + + + +
last update on + + + +
+ +
+
+
+ +
+ + diff --git a/default-files/article.html b/default-files/article.html new file mode 100644 index 0000000..40066c5 --- /dev/null +++ b/default-files/article.html @@ -0,0 +1,49 @@ + + + + + <?fugitive-install name ?>'s blog: <?fugitive article_title ?> + + + + + + + + + + + + + + + + + +
+ +
+
+

+
+
+ by , on + + +
last update by , on + + + +
+
+ +
+
+ +
+ + diff --git a/default-files/footer.html b/default-files/footer.html new file mode 100644 index 0000000..6040184 --- /dev/null +++ b/default-files/footer.html @@ -0,0 +1,13 @@ + diff --git a/default-files/fugitive.css b/default-files/fugitive.css new file mode 100644 index 0000000..1c4eaba --- /dev/null +++ b/default-files/fugitive.css @@ -0,0 +1,260 @@ +* { 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.nav { float: right; } +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; + 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; + counter-reset: section; + counter-reset: subsection; +} +article header { + display: block; + margin: 2em 0 0 0; + padding: 0; + border-style: none; + border-bottom: 1px dashed #ccc; +} +article header h1 { + margin: 0; + padding: 0 0 0.1em 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 a { + color: #08f; + text-decoration: none; +} +article > div a:hover { text-decoration: underline; } +article > div a:visited { color: #048; } +article > div h2 { + margin: 1em 0 0.5em 0; + padding: 0; + font-size: 1.4em; + font-weight: normal; + counter-increment: section; + counter-reset: subsection; +} +article > div h2:before { + display: inline; + content: counter(section) ". "; +} +article > div h3 { + margin: 1em 0 0.5em 0; + padding: 0; + font-size: 1.2em; + font-weight: bold; +} +article > div h3:before { + display: inline; + content: counter(section) "." counter(subsection) ". "; + counter-increment: subsection; +} +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 code { + color: #eee; + background-color: #666; + 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 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/default-files/nav-header.html b/default-files/nav-header.html new file mode 100644 index 0000000..300592d --- /dev/null +++ b/default-files/nav-header.html @@ -0,0 +1,24 @@ + +
+

's blog

+ fugitive: a blog engine for hackers. +
diff --git a/default-files/print.css b/default-files/print.css new file mode 100644 index 0000000..c386764 --- /dev/null +++ b/default-files/print.css @@ -0,0 +1,11 @@ +#container { + width: auto; + padding: 1em; + margin: 0; +} +nav, header, footer { + display: none; +} +article header, article footer { + display: block; +} diff --git a/fugitive.css b/fugitive.css deleted file mode 100644 index 1c4eaba..0000000 --- a/fugitive.css +++ /dev/null @@ -1,260 +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.nav { float: right; } -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; - 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; - counter-reset: section; - counter-reset: subsection; -} -article header { - display: block; - margin: 2em 0 0 0; - padding: 0; - border-style: none; - border-bottom: 1px dashed #ccc; -} -article header h1 { - margin: 0; - padding: 0 0 0.1em 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 a { - color: #08f; - text-decoration: none; -} -article > div a:hover { text-decoration: underline; } -article > div a:visited { color: #048; } -article > div h2 { - margin: 1em 0 0.5em 0; - padding: 0; - font-size: 1.4em; - font-weight: normal; - counter-increment: section; - counter-reset: subsection; -} -article > div h2:before { - display: inline; - content: counter(section) ". "; -} -article > div h3 { - margin: 1em 0 0.5em 0; - padding: 0; - font-size: 1.2em; - font-weight: bold; -} -article > div h3:before { - display: inline; - content: counter(section) "." counter(subsection) ". "; - counter-increment: subsection; -} -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 code { - color: #eee; - background-color: #666; - 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 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 index 7cd45a2..640a4d8 100644 --- a/install.sh +++ b/install.sh @@ -1,13 +1,13 @@ #!/bin/sh -replace_var_by_string() { +replace_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`" + base64 -d | gunzip | replace_string "name" "$name" | \ + replace_string "year" "`date +%Y`" } fugitive_install_hooks() { @@ -46,10 +46,16 @@ fugitive_install() { echo "done." echo -n "Writing default template files... " fugitive_write_template > _templates/article.html < _templates/archives.html < _templates/nav-header.html < _templates/footer.html < fugitive.css < print.css <