Reorganization of included and template files, made more consistent and logical. inc/ is now called lib/, and all non-staic files in pub/ have moved to lib/.

In site dirs _config and _default.tpl have moved to _werc/ in preparation for things like comments.
This commit is contained in:
Uriel 2008-09-24 20:21:32 +02:00
parent de1d5b1e54
commit 83a10c526a
6 changed files with 45 additions and 18 deletions

7
lib/404.tpl Normal file
View file

@ -0,0 +1,7 @@
<!-- To have a custom 404 page copy this template to your site's (or masterSite) _inc director and edit it as you like -->
<h1>The page requested for <i>
% echo ''''$"title''''
</i> doesn't exist</h1>
% # TODO: Use http://www.google.com/support/webmasters/bin/answer.py?answer=100044&hl=en by default?

35
lib/feeds/rss20.tpl Normal file
View file

@ -0,0 +1,35 @@
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="%('http://'$site^$REQUEST_URI%)" rel="self" type="application/rss+xml" />
<title>%($siteTitle%)</title>
<link>%($uri%)</link>
<description>%($blogDesc%)</description>
<language>en-us</language>
<generator>Tom Duff's rc, and Kris Maglione's clever hackery</generator>
<webMaster>uriel99+rss@gmail.com (Uriel)</webMaster>
%{
for(f in `{sortedBlogPostList $blogDirs}) {
statpost $f
# Hack to aproximate the last build date
#(use the mdate from last posted item)
# Commented out for now because maybe a wrong value is worse than no value
#if(~ $#last_build_date 0) {
#last_build_date='<lastBuildDate>'^$"mdate'</lastBuildDate>'
#echo $last_build_date
#}
%}
<item>
<title>%($title%)</title>
<author>%($by%)@noreply.cat-v.org (%($by%))</author>
<link>%($uri%)</link>
<guid isPermaLink="true">%($uri%)</guid>
<pubDate>%($date%)</pubDate>
<description><![CDATA[<pre>%($summary%)</pre>]]></description>
</item>
% }
</channel>
</rss>

36
lib/headers.tpl Normal file
View file

@ -0,0 +1,36 @@
Content-Type: text/html
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta name="verify-v1" content="6zEoK0WMlnLmIS/w7Pnh6+srZECHsvnMGN0kQmowSGk=" />
<title>%($pageTitle%)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="k" />
% if (! ~ $#meta_description 0)
% echo ' <meta name="description" content="'$"meta_description'" />'
% if (! ~ $#meta_keywords 0)
% echo ' <meta name="keywords" content="'$"meta_keywords'" />'
<link rel="stylesheet" href="/pub/style/style.css" type="text/css" media="screen, handheld" title="default" />
<link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon" />
%# <link rel="stylesheet alternative" type="text/css" href="/pub/style/style_old.css" media="screen" title="Old Style" />
% if (test -f $sitedir/_style.css) {
<link rel="stylesheet" href="/_style.css" type="text/css" media="screen" title="default" />
% }
% h = `{ get_lib_file headers.inc}
% if(! ~ $#h 0)
% cat $h
%($extraHeaders%)
</head>
<body>

52
lib/sitemap.tpl Normal file
View file

@ -0,0 +1,52 @@
<h1>Site map</h1>
%{
saveddf = $dirfilter
fn getMdDesc {
sed 's/^(.......................................................................................................[^ ]*).*$/\1/g; 1q' < $1
}
fn listDir {
d=$1
dirfilter = $saveddf
blogDirs = ()
if (test -f $d/_config)
. $d/_config
echo '<ul>'
if (! ~ $#blogDirs 0 || ~ $1 blog Blog )
echo ''
if not {
for ( i in `{ ls -d $d/*/ $d/*.md $d/*.html $d/*.txt >[2]/dev/null |sed $dirfilter^'/index$/d;' } ) {
desc = ''
if (test -f $i.md) {
desc = `{ getMdDesc $i.md }
}
if (test -f $i/index.md) {
desc = `{ getMdDesc $i/index.md }
}
if (test -f $i.html) {
# H1 is not reliable because htmlroff doesn't use it :(
#desc = `{ cat $i.html |sed 32q | grep '<[Hh]1>' |sed 's/<[Hh]1>(.*)(<\/[Hh]1>|$)/\1/;s/<[^>]*>//g;1q' }
# Pick the first line of body instead
desc = `{ /bin/sed -e '0,/<[Bb][Oo][Dd][Yy]/d;s/<[^>]*>//g;/^$/d' < $i.html >[2]/dev/null | sed 1q }
}
if (! ~ $desc '')
desc = ' - '$"desc
tit = `{basename $i|sed 's/_/ /g'}
echo '<li><a style="text-transform: capitalize" href="'$i'">'^$"tit^'</a>' $desc '</li>'
if (test -d $i)
@{ listDir $i }
}
}
echo '</ul>'
}
cd $sitedir
listDir .
%}