From: Oleg Broytman Date: Wed, 22 Mar 2006 16:47:52 +0000 (+0000) Subject: Add alternates links to news/blog feeds. X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=664d99721302de12a736dc480a340b209b5720e8;p=phdru.name%2Fphdru.name.git Add alternates links to news/blog feeds. git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@41 7bb0bf08-9e0d-0410-b083-99cee3bf18b8 --- diff --git a/news.tmpl-en b/news.tmpl-en index bd1b90f..cd83f8e 100644 --- a/news.tmpl-en +++ b/news.tmpl-en @@ -3,6 +3,9 @@ #attr $Title = "Oleg BroytMann's Personal Page - News" #attr $Description = "BroytMann News Page Index Document" #attr $Copyright = 2004 +#attr $alternates = (("application/atom+xml", "News [Atom 1.0]", "atom_10.xml"), + ("application/rss+xml", "News [RSS 2.0]", "rss_20.xml") +) ## #def body_html

Most recently changed files

diff --git a/news.tmpl-ru b/news.tmpl-ru index e98f72e..a70762d 100644 --- a/news.tmpl-ru +++ b/news.tmpl-ru @@ -4,6 +4,9 @@ #attr $Description = "BroytMann News Page Index Document" #attr $Copyright = 2004 #attr $Prev = "index.html" +#attr $alternates = (("application/atom+xml", "News [Atom 1.0]", "atom_10.xml"), + ("application/rss+xml", "News [RSS 2.0]", "rss_20.xml") +) ## #def body_html

ðÏÓÌÅÄÎÉÅ ÉÚÍÅΣÎÎÙÅ ÆÁÊÌÙ

diff --git a/phd_pp_ru.py b/phd_pp_ru.py deleted file mode 100644 index d569873..0000000 --- a/phd_pp_ru.py +++ /dev/null @@ -1,260 +0,0 @@ -#!/usr/bin/env python -# -*- coding: koi8-r -*- - -""" -Autogenerated by CHEETAH: The Python-Powered Template Engine - CHEETAH VERSION: 1.0 - Generation time: Mon Jan 2 23:48:51 2006 - Source file: phd_pp_ru.tmpl - Source file last modified: Mon Jan 2 23:48:44 2006 -""" - -__CHEETAH_genTime__ = 'Mon Jan 2 23:48:51 2006' -__CHEETAH_src__ = 'phd_pp_ru.tmpl' -__CHEETAH_version__ = '1.0' - -################################################## -## DEPENDENCIES - -import sys -import os -import os.path -from os.path import getmtime, exists -import time -import types -import __builtin__ -from Cheetah.Template import Template -from Cheetah.DummyTransaction import DummyTransaction -from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList -from Cheetah.CacheRegion import CacheRegion -import Cheetah.Filters as Filters -import Cheetah.ErrorCatchers as ErrorCatchers -from phd_pp import phd_pp -import time - -################################################## -## MODULE CONSTANTS - -try: - True, False -except NameError: - True, False = (1==1), (1==0) -VFFSL=valueFromFrameOrSearchList -VFSL=valueFromSearchList -VFN=valueForName -currentTime=time.time - -################################################## -## CLASSES - -class phd_pp_ru(phd_pp): - """ - - Autogenerated by CHEETAH: The Python-Powered Template Engine - """ - - ################################################## - ## GENERATED METHODS - - - def __init__(self, *args, **KWs): - """ - - """ - - phd_pp.__init__(self, *args, **KWs) - - def respond(self, - trans=None, - VFFSL=valueFromFrameOrSearchList, - VFN=valueForName): - - - """ - This is the main method generated by Cheetah - """ - - if not trans: trans = self.transaction # is None unless self.awake() was called - if not trans: - trans = DummyTransaction() - dummyTrans = True - else: dummyTrans = False - write = trans.response().write - SL = self._searchList - globalSetVars = self._globalSetVars - filter = self._currentFilter - - ######################################## - ## START - generated method body - - write(''' - - - - -\n\n') - __v = VFFSL(SL,"Title",True) - if __v is not None: write(filter(__v, rawExpr='$Title')) # from line 23, col 8. - write('\n') - if VFFSL(SL,"refresh",True): - write('\n') - if VFFSL(SL,"Description",True): - write('\n') - if VFFSL(SL,"Keywords",True): - write('\n') - if VFFSL(SL,"Copyright",True): - full_copyright = VFFSL(SL,"copyright",False)(VFFSL(SL,"Copyright",True)) - write('\n\n\n') - write('\n\n') - if VFFSL(SL,"root",True): - write('\n\n') - if VFFSL(SL,"Prev",True): - write('\n') - if VFFSL(SL,"Next",True): - write('\n') - write('\n') - if VFFSL(SL,"styles",True): - for media, style in VFFSL(SL,"styles",True): - write('\n') - write(''' - - -''') - __v = VFFSL(SL,"body",True) - if __v is not None: write(filter(__v, rawExpr='$body')) # from line 64, col 1. - write('\n') - if VFN(VFFSL(SL,"path",True),"endswith",False)("index.html"): - path = VFFSL(SL,"path",True)[:-len("index.html")] - write('
\n') - if VFN(VFFSL(SL,"path",True),"startswith",False)("/Russian/"): - write('

\xfc\xd4\xc1 \xd3\xd4\xd2\xc1\xce\xc9\xc3\xc1 http://phd.pp.ru') - __v = VFFSL(SL,"path",True) - if __v is not None: write(filter(__v, rawExpr='$path')) # from line 70, col 101. - write('\n\xc2\xd9\xcc\xc1 \xd3\xc7\xc5\xce\xc5\xd2\xc9\xd2\xcf\xd7\xc1\xce\xc1 ') - __v = VFFSL(SL,"last_modified_ru",True) - if __v is not None: write(filter(__v, rawExpr='$last_modified_ru')) # from line 71, col 20. - write(' \xc9\xda \xdb\xc1\xc2\xcc\xcf\xce\xc1 CheetahTemplate ') - __v = VFFSL(SL,"_fileBaseName",True) - if __v is not None: write(filter(__v, rawExpr='$_fileBaseName')) # from line 71, col 90. - write(';\n\xf7\xd9 \xcd\xcf\xd6\xc5\xd4\xc5 \xd5\xda\xce\xc1\xd4\xd8 \xcf \xd4\xc5\xc8\xce\xc9\xde\xc5\xd3\xcb\xc9\xc8 \xc1\xd3\xd0\xc5\xcb\xd4\xc1\xc8 \xdc\xd4\xcf\xc7\xcf \xd3\xc1\xca\xd4\xc1.\n

\n') - else: - write('

This is the page http://phd.pp.ru') - __v = VFFSL(SL,"path",True) - if __v is not None: write(filter(__v, rawExpr='$path')) # from line 75, col 105. - write('.\nIt was generated on ') - __v = VFFSL(SL,"last_modified_en",True) - if __v is not None: write(filter(__v, rawExpr='$last_modified_en')) # from line 76, col 21. - write(' from CheetahTemplate ') - __v = VFFSL(SL,"_fileBaseName",True) - if __v is not None: write(filter(__v, rawExpr='$_fileBaseName')) # from line 76, col 85. - write(';\nread more about technical aspects of the site.\n

\n') - write('\n') - - ######################################## - ## END - generated method body - - return dummyTrans and trans.response().getvalue() or "" - - ################################################## - ## GENERATED ATTRIBUTES - - - Title = '' - - Description = None - - Keywords = None - - Copyright = None - - Prev = None - - Next = None - - refresh = None - - last_modified_en = time.strftime("%a, %d %b %Y %T GMT", time.gmtime()) - - last_modified_ru = time.strftime("%d.%m.%Y × %T", time.localtime()) - - styles = None - - __str__ = respond - - _mainCheetahMethod_for_phd_pp_ru= 'respond' - - -# CHEETAH was developed by Tavis Rudd, Mike Orr, Ian Bicking and Chuck Esterbrook; -# with code, advice and input from many other volunteers. -# For more information visit http://www.CheetahTemplate.org - -################################################## -## if run from command line: -if __name__ == '__main__': - phd_pp_ru().runAsMainProgram() - diff --git a/phd_pp_ru.tmpl b/phd_pp_ru.tmpl index a488704..10da99f 100644 --- a/phd_pp_ru.tmpl +++ b/phd_pp_ru.tmpl @@ -12,6 +12,7 @@ #attr $last_modified_en = time.strftime("%a, %d %b %Y %T GMT", time.gmtime()) #attr $last_modified_ru = time.strftime("%d.%m.%Y × %T", time.localtime()) #attr $styles = None +#attr $alternates = None @@ -57,6 +58,11 @@ $style --> #end for #end if +#if $alternates +#for $type, $title, $href in $alternates + +#end for +#end if öÕÒÎÁÌ