1
0
Fork 0
mirror of https://git.ludikovsky.name/git/fugitive.git synced 2024-05-18 22:45:31 +02:00

reorganised includes in default templates

This commit is contained in:
p4bl0 2010-07-25 18:11:03 +02:00
parent 3396369461
commit dbae9472bd
5 changed files with 69 additions and 56 deletions

View file

@ -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 ?>

View file

@ -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 ?>

16
default-files/bottom.html Normal file
View file

@ -0,0 +1,16 @@
<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 ?>
at <time><?fugitive commit_datetime ?></time>,<br />
subject was <q><?fugitive commit_subject ?></q>
</p>
</footer>
</div>
</body>
</html>

47
default-files/top.html Normal file
View file

@ -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>

View file

@ -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."