diff options
author | p4bl0 <pablo@rauzy.name> | 2010-07-25 18:11:03 +0200 |
---|---|---|
committer | p4bl0 <pablo@rauzy.name> | 2010-07-25 18:11:03 +0200 |
commit | dbae9472bd08b9e5edd5bbdc5dcd8a0781010511 (patch) | |
tree | 911bdfe9c2342035c6836db0a773b2e5c20c3626 | |
parent | 339636946103a1607b26d3b5a809c0f6afb87135 (diff) |
reorganised includes in default templates
-rw-r--r-- | default-files/archives.html | 30 | ||||
-rw-r--r-- | default-files/article.html | 30 | ||||
-rw-r--r-- | default-files/bottom.html | 16 | ||||
-rw-r--r-- | default-files/top.html | 47 | ||||
-rw-r--r-- | post-commit.sh | 2 |
5 files changed, 69 insertions, 56 deletions
diff --git a/default-files/archives.html b/default-files/archives.html index 5cb8981..87c3bea 100644 --- a/default-files/archives.html +++ b/default-files/archives.html @@ -1,27 +1,4 @@ -<?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: archives</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" /> - <link rel="stylesheet" href="print.css" type="text/css" media="print" charset="utf-8" /> - <link rel="contents" href="archives.html" /> - <?fugitive ifset:article_file ?> - <link rel="canonical" href="<?fugitive article_file ?>.html" /> - <?fugitive endifset:article_file ?> - <?fugitive ifset:article_previous_file ?> - <link rel="prev" href="<?fugitive article_previous_file ?>.html" /> - <?fugitive endifset:article_previous_file ?> - <?fugitive ifset:article_next_file ?> - <link rel="next" href="<?fugitive article_next_file ?>.html" /> - <?fugitive endifset:article_next_file ?> - </head> - <body> - <div id="container"> - <?fugitive include:nav-header.html ?> + <?fugitive include:top.html ?> <article> <header> <h1>Archives</h1> @@ -50,7 +27,4 @@ </dl> </div> </article> - <?fugitive include:footer.html ?> - </div> - </body> -</html> + <?fugitive include:bottom.html ?> diff --git a/default-files/article.html b/default-files/article.html index 40066c5..5b59e06 100644 --- a/default-files/article.html +++ b/default-files/article.html @@ -1,27 +1,4 @@ -<?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" /> - <link rel="stylesheet" href="print.css" type="text/css" media="print" charset="utf-8" /> - <link rel="contents" href="archives.html" /> - <?fugitive ifset:article_file ?> - <link rel="canonical" href="<?fugitive article_file ?>.html" /> - <?fugitive endifset:article_file ?> - <?fugitive ifset:article_previous_file ?> - <link rel="prev" href="<?fugitive article_previous_file ?>.html" /> - <?fugitive endifset:article_previous_file ?> - <?fugitive ifset:article_next_file ?> - <link rel="next" href="<?fugitive article_next_file ?>.html" /> - <?fugitive endifset:article_next_file ?> - </head> - <body> - <div id="container"> - <?fugitive include:nav-header.html ?> + <?fugitive include:top.html ?> <article> <header> <h1><?fugitive article_title ?></h1> @@ -43,7 +20,4 @@ <?fugitive article_content ?> </div> </article> - <?fugitive include:footer.html ?> - </div> - </body> -</html> + <?fugitive include:bottom.html ?> diff --git a/default-files/bottom.html b/default-files/bottom.html new file mode 100644 index 0000000..b1a6625 --- /dev/null +++ b/default-files/bottom.html @@ -0,0 +1,16 @@ + <footer> + <p> + <a href="http://www.gnu.org/copyleft/copyleft.html">copyleft</a> + <?fugitive-install name ?> <?fugitive-install year ?> + — + powered by <a href="http://gitorious.org/fugitive">fugitive</a> + </p> + <p> + last build was <?fugitive commit_hash ?> + at <time><?fugitive commit_datetime ?></time>,<br /> + subject was <q><?fugitive commit_subject ?></q> + </p> + </footer> + </div> + </body> +</html> diff --git a/default-files/top.html b/default-files/top.html new file mode 100644 index 0000000..4e2d8dc --- /dev/null +++ b/default-files/top.html @@ -0,0 +1,47 @@ +<?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 page_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" /> + <link rel="stylesheet" href="print.css" type="text/css" media="print" /> + <link rel="contents" href="archives.html" /> + <?fugitive ifset:article_file ?> + <link rel="canonical" href="<?fugitive article_file ?>.html" /> + <?fugitive endifset:article_file ?> + <?fugitive ifset:article_previous_file ?> + <link rel="prev" href="<?fugitive article_previous_file ?>.html" /> + <?fugitive endifset:article_previous_file ?> + <?fugitive ifset:article_next_file ?> + <link rel="next" href="<?fugitive article_next_file ?>.html" /> + <?fugitive endifset:article_next_file ?> + </head> + <body> + <div id="container"> + <nav> + <?fugitive ifset:article_file ?> + <ul class="nav"> + <?fugitive ifset:article_previous_file ?> + <li> + <a href="<?fugitive article_previous_file ?>.html">« previous</a> + </li> + <?fugitive endifset:article_previous_file ?> + <?fugitive ifset:article_next_file ?> + <li> + <a href="<?fugitive article_next_file ?>.html">next »</a> + </li> + <?fugitive endifset:article_next_file ?> + </ul> + <?fugitive endifset:article_file ?> + <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>fugitive: a blog engine for hackers.</q> + </header> diff --git a/post-commit.sh b/post-commit.sh index d4894d8..4d9cd25 100644 --- a/post-commit.sh +++ b/post-commit.sh @@ -266,6 +266,7 @@ generate_article() { cat "$templates_dir/article.html" | \ replace_file "article_content" "`get_article_content \"$art\"`" | \ replace_includes | \ + replace_str "page_title" "`get_article_title \"$art\"`" | \ replace_commit_info "-1" | \ replace_article_info "$art" | \ sed "/^\s*$/d" > "$public_dir/$art.html" @@ -339,6 +340,7 @@ if [ $modification -gt 0 ]; then replace_foreach "article" "$articles_sorted" | \ replace_foreach "commit" "$commits" | \ replace_empty_article_info | \ + replace_str "page_title" "archives" | \ replace_commit_info "-1" | \ sed "/^\s*$/d" > "$public_dir/archives.html" echo "done." |