|
Der Python Community Server kann jetzt Trackback Pings annehmen. Hier folgt eine Beschreibung wie man diese Funktionen im Python Desktop Server nutzen kann. Seit der Version 0.4.21 ist das nicht mehr notwendig, die Templates wie hier beschrieben zu ändern, aber als Dokumentation habe ich das mal einfach online gelassen. Ab 0.4.21 ist das ganze jedenfalls fest in PyDS integriert. Zuerst müssen die folgenden beiden Textbausteine angelegt werden:
Diese beiden Textbausteine müssen in das WeblogRendering.tmpl eingebaut werden. Hier ist mein Template: #if $upstream.get('prefs','cancomment')
$macros.commentsScript()
#end if
#if $upstream.get('prefs','cantrackback')
$macros.trackbackScript()
#end if
<table border=0 width="100%">
#set lastdate = ''
#if $year and $month and $day
#set list = $current.getRecentPosts(year=$year, month=$month, day=$day, onhome=$onhome, category=$category)
#elif $year and $month
#set list = $current.getRecentPosts(year=$year, month=$month, onhome=$onhome, category=$category)
#else
#set list = $current.getRecentPosts(onhome=$onhome, category=$category)
#end if
#for $post in $list
#if $post.pubdate != $lastdate
#if $lastdate
</table>
</td></tr>
<tr><td> </td></tr>
#end if
<tr><td class="whitebox" colspan=2>
<table width="100%">
<tr><td><a href="$current.getCloudUrlForDay($post.pubtime,category=$category)">$post.pubdate</a></td></tr>
#set $lastdate = $post.pubdate
#else
<tr><td> </td></tr>
#end if
#if $post.title
<tr>
#if $post.link
<td><h3><a name="$post.id"></a><a href="$post.link">$post.title</a></h3></td>
#else
<td><h3><a name="$post.id"></a>$post.title</h3></td>
#end if
</tr>
#end if
<tr>
<td>
#if not($post.title)
<a name="$post.id"></a>
#end if
#if $post.rendered
$post.rendered</td>
#else
$post.text</td>
#end if
</tr>
#if $post.source
<tr><td colspan=2 align="right" class="smallfont">$_('Source:')
#if $post.sourceurl
<a target="_new" href="$post.sourceurl">$post.source</a>
#else
$post.source
#end if
</td></tr>
#end if
<tr><td align="left">
<span class="smallfont">
$_('posted at') $macros.Time($post.pubtime)
$macros.weblogPermaLink($post.id, $post.pubtime, $category)
#if $upstream.get('prefs','cancomment')
$macros.weblogCommentsLink($post.id, $post.pubtime, $category)
#end if
#if $upstream.get('prefs','cantrackback')
$macros.weblogTrackbackLink($post.id, $post.pubtime, $category)
#end if
</span>
</td></tr>
#end for
#if $lastdate
</table>
</td></tr>
#end if
</table>
Hier für den Download der Datei klicken Wenn die Trackbacklinks auch im RSS-Feed eingebaut werden sollen, sollte das RSSFeedRendering.tmpl wie folgt aussehen (das RSSFeedRendering.tmpl kann man nicht über die Oberfläche editieren, es ist nur in ~/.PyDS/template zu finden): <?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<channel>
<title>$current.getRSSTitle(category=$category)</title>
<link>$current.getStaticUrl(category=$category)</link>
<description>$current.getRSSDescription(category=$category)</description>
<language>$_PyDS.language</language>
<copyright>$_('Copyright') $request.year $prefs.getXML('private', 'name')</copyright>
<lastBuildDate>$current.getRSSNewestDate(category=$category)</lastBuildDate>
<generator>$tools.version</generator>
<managingEditor>$prefs.getXML('private','email')</managingEditor>
<webMaster>$prefs.getXML('private','email')</webMaster>
<category domain="http://www.weblogs.com/rssUpdates/changes.xml">rssUpdates</category>
#set $skipHours = $current.getRSSSkipHours(category=$category)
#if $skipHours
<skipHours>
#for $hour in $skipHours
<hour>$hour</hour>
#end for
</skipHours>
#end if
#for $item in $current.getRSSItems(category=$category)
<item>
#if $item.title
<title>$item.title</title>
#end if
#if $item.link
<link>$item.link</link>
#end if
<description>$item.description</description>
<guid>$item.guid</guid>
#if $upstream.get('prefs','cancomment')
<comments>$item.comments</comments>
#end if
#if $upstream.get('prefs','cantrackback')
<trackback:ping rdf:resource="$item.trackback"/>
#end if
<pubDate>$item.pubdate</pubDate>
#if $item.source and $item.sourceurl
<source url="$item.sourceurl">$item.source</source>
#end if
</item>
#end for
</channel>
</rss>
letzte Änderung 2003-05-05 23:01:52 |
Hier wird beschrieben, wie man die Trackbacklinks in den Output einbaut. Das macht natürlich nur sinn, wenn der eigene Community-Server auch ein Python Community Server ist.
Wichtige Links zu PyDS:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
© 2003, Georg Bauer