diff --git a/tpl/blogroll.tpl b/tpl/blogroll.tpl
deleted file mode 100755
index 4a37147..0000000
--- a/tpl/blogroll.tpl
+++ /dev/null
@@ -1,69 +0,0 @@
-
Site map
-
-%{
-tmpfile=/tmp/werc_sitemap_$pid.txt
-tmpfilex=/tmp/werc_sitemapx_$pid.txt
-saveddf=$dirfilter
-
-MON2NUM='s/Jan/01/; s/Feb/02/; s/Mar/03/; s/Apr/04/; s/May/05/; s/Jun/06/; s/Jul/07/; s/Aug/08/; s/Sep/09/; s/Oct/10/; s/Nov/11/; s/Dec/12/;'
-
-fn get_mdate {
- t=`{mtime $1}
- t=`{date $t(1) | sed -e $MON2NUM -e 's/ ([0-9]) / 0\1 /g'} # Make sure day of the month is two digits.
- echo $t(6)^'-'^$t(2)^'-'^$t(3)
-}
-
-fn listDir {
- d=$1
- dirfilter=$saveddf
- if(test -f $d/_werc/config)
- . $d/_werc/config
-
- if(~ $#perm_redir_to 0) {
- echo ''
-
- for(i in `{ls -dF $d^*/ $d^*.md $d^*.html $d^*.txt >[2]/dev/null | sed $dirfilter}) {
- desc=`{get_file_title $i}
- u=`{echo $i|sed 's!'$sitedir'!!; '$dirclean's!/index$!/!; '}
- if(! ~ $#desc 0 && ! ~ $desc '')
- timestamp=`{echo $i | sed 's|sites/nunosempere.com/blog/||;' | sed 's|\(\d\)/.*/|$1|'}
- echo $timestamp
- // desc=' - '$"desc
- echo '' $"desc ''
- n=`{echo /$u|sed 's/[\-_]/ /g; s,.*/([^/]+)/?$,\1,'}
- echo $base_url^$u >> $tmpfile
- echo ''$base_url^$u''^`{get_mdate $i}^'' >> $tmpfilex
- if(test -d $i)
- @{ listDir $i }
- }
- echo '
'
- }
-}
-
-
-fltr_cache listDir $sitedir/
-
-if(test -s $tmpfile) {
- mv $tmpfile $sitedir/sitemap.txt &
-}
-if not if(test -f $tmpfile)
- rm $tmpfile
-
-if(test -s $tmpfilex) {
- {
- echo '
-'
-
- cat $tmpfilex
- rm $tmpfilex &
- echo ''
- # TODO Enable automaic search engine update notification.
- #hget 'http://google.com/ping?sitemap='^`{url_encode $base_url'/sitemap.gz'} > /dev/null
-
- } | gzip > $sitedir/sitemap.gz &
- #} > $sitedir/sitemap.xml &
-}
-if not if(test -f $tmpfilex)
- rm $tmpfilex
-
-%}
diff --git a/tpl/sitemap.tpl b/tpl/sitemap.tpl
index 9505b6d..8570169 100644
--- a/tpl/sitemap.tpl
+++ b/tpl/sitemap.tpl
@@ -2,8 +2,9 @@
%{
tmpfile=/tmp/werc_sitemap_$pid.txt
-tmpfilex=/tmp/werc_sitemapx_$pid.txt
+tmpfilex=/tmp/werc_sitemap_$pid.txt
saveddf=$dirfilter
+filtereddirs=( images )
MON2NUM='s/Jan/01/; s/Feb/02/; s/Mar/03/; s/Apr/04/; s/May/05/; s/Jun/06/; s/Jul/07/; s/Aug/08/; s/Sep/09/; s/Oct/10/; s/Nov/11/; s/Dec/12/;'
@@ -23,14 +24,19 @@ fn listDir {
echo ''
for(i in `{ls -dF $d^*/ $d^*.md $d^*.html $d^*.txt >[2]/dev/null | sed $dirfilter}) {
- desc=`{get_file_title $i}
- u=`{echo $i|sed 's!'$sitedir'!!; '$dirclean's!/index$!/!; '}
- if(! ~ $#desc 0 && ! ~ $desc '')
- desc=' - '$"desc
- n=`{echo /$u|sed 's/[\-_]/ /g; s,.*/([^/]+)/?$,\1,'}
- echo '- '^$"n^'' $"desc '
'
- echo $base_url^$u >> $tmpfile
- echo ''$base_url^$u''^`{get_mdate $i}^'' >> $tmpfilex
+ filename=`{get_file_title $i}
+ url=`{echo $i|sed 's!'$sitedir'!!; '$dirclean's!/index$!/!; '}
+ dirname=`{echo /$url|sed 's/[\-_]/ /g; s,.*/([^/]+)/?$,\1,'}
+ if(! ~ $#filename 0 && ! ~ $filename '') {
+ # filename=' — '$"filename
+ echo '- '^$"filename^'
'
+ }
+ if not {
+ if(! ~ $"dirname $filtereddirs)
+ echo '- '^$"dirname^'
'
+ }
+ echo $base_url^$url >> $tmpfile
+ echo ''$base_url^$url''^`{get_mdate $i}^'' >> $tmpfilex
if(test -d $i)
@{ listDir $i }
}
diff --git a/tpl/sitemap2.tpl b/tpl/sitemap2.tpl
deleted file mode 100644
index 559551c..0000000
--- a/tpl/sitemap2.tpl
+++ /dev/null
@@ -1,73 +0,0 @@
-Site map
-
-%{
-tmpfile=/tmp/werc_sitemap2_$pid.txt
-tmpfilex=/tmp/werc_sitemap2_$pid.txt
-saveddf=$dirfilter
-filtereddirs=( images )
-
-MON2NUM='s/Jan/01/; s/Feb/02/; s/Mar/03/; s/Apr/04/; s/May/05/; s/Jun/06/; s/Jul/07/; s/Aug/08/; s/Sep/09/; s/Oct/10/; s/Nov/11/; s/Dec/12/;'
-
-fn get_mdate {
- t=`{mtime $1}
- t=`{date $t(1) | sed -e $MON2NUM -e 's/ ([0-9]) / 0\1 /g'} # Make sure day of the month is two digits.
- echo $t(6)^'-'^$t(2)^'-'^$t(3)
-}
-
-fn listDir {
- d=$1
- dirfilter=$saveddf
- if(test -f $d/_werc/config)
- . $d/_werc/config
-
- if(~ $#perm_redir_to 0) {
- echo ''
-
- for(i in `{ls -dF $d^*/ $d^*.md $d^*.html $d^*.txt >[2]/dev/null | sed $dirfilter}) {
- filename=`{get_file_title $i}
- url=`{echo $i|sed 's!'$sitedir'!!; '$dirclean's!/index$!/!; '}
- dirname=`{echo /$url|sed 's/[\-_]/ /g; s,.*/([^/]+)/?$,\1,'}
- if(! ~ $#filename 0 && ! ~ $filename '') {
- # filename=' — '$"filename
- echo '- '^$"filename^'
'
- }
- if not {
- if(! ~ $"dirname $filtereddirs)
- echo '- '^$"dirname^'
'
- }
- echo $base_url^$url >> $tmpfile
- echo ''$base_url^$url''^`{get_mdate $i}^'' >> $tmpfilex
- if(test -d $i)
- @{ listDir $i }
- }
- echo '
'
- }
-}
-
-
-fltr_cache listDir $sitedir/
-
-if(test -s $tmpfile) {
- mv $tmpfile $sitedir/sitemap.txt &
-}
-if not if(test -f $tmpfile)
- rm $tmpfile
-
-if(test -s $tmpfilex) {
- {
- echo '
-'
-
- cat $tmpfilex
- rm $tmpfilex &
- echo ''
- # TODO Enable automaic search engine update notification.
- #hget 'http://google.com/ping?sitemap='^`{url_encode $base_url'/sitemap.gz'} > /dev/null
-
- } | gzip > $sitedir/sitemap.gz &
- #} > $sitedir/sitemap.xml &
-}
-if not if(test -f $tmpfilex)
- rm $tmpfilex
-
-%}