From: Bernie Innocenti Date: Sun, 10 Aug 2008 05:02:53 +0000 (+0545) Subject: Use generic head links instead of ad-hoc mechanisms X-Git-Tag: v3.0~10 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=5dfc20c244619a80dc091fc3966a997ea0a04fb8;p=geekigeeki.git Use generic head links instead of ad-hoc mechanisms --- diff --git a/geekigeeki.conf.py b/geekigeeki.conf.py index 1080e49..59b8530 100644 --- a/geekigeeki.conf.py +++ b/geekigeeki.conf.py @@ -8,8 +8,13 @@ privileged_url = 'https://www.develer.com/~bernie/wiki' data_dir = '/home/bernie/public_html/wiki/data' # default page links -icon_url = 'hacker-favicon.ico' -css_url = ['../wikidata/geekigeeki.css'] +link_urls = [ + # rel href type + [ 'icon', 'hacker-favicon.ico' ], + [ 'stylesheet', '../wikidata/geekigeeki.css' ], + [ 'openid.server', 'http://www.codewiz.org/openid' ], + [ 'openid.delegate', 'http://www.codewiz.org/openid' ], +] history_url = '../wikigit/wiki.git' diff --git a/geekigeeki.py b/geekigeeki.py index 341bbad..5abd90f 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -125,18 +125,18 @@ def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=Fal print ' ' if not name: print ' ' - for css in css_url: - print ' ' % relative_url(css) - if icon_url: - print ' ' % relative_url(icon_url) + + for link in link_urls: + rel, href = link + print ' ' % (rel, relative_url(href)) if name and writable and privileged_url is not None: - print ' ' \ + print ' ' \ % (privileged_path() + '?edit=' + name) if history_url is not None: print ' ' \ - % (history_url + '?a=rss') + % relative_url(history_url + '?a=rss') print '' @@ -158,9 +158,9 @@ def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=Fal print ' | ' + link_tag('FrontPage', 'Home', 'navlink') print ' | ' + link_tag('FindPage', 'Find Page', 'navlink') if 'history_url' in globals(): - print ' | Recent Changes' + print ' | Recent Changes' if name: - print ' | Page History' + print ' | Page History' if name: print ' | ' + link_tag('?raw=' + name, 'Raw Text', 'navlink') @@ -657,9 +657,11 @@ class Page: send_guru("Read access denied by ACLs", "notice") def format(self): - #css foo.css bar.css - global css_url - css_url = self.get_attr("css", "").split() + css_url + #css foo.css + value = self.get_attr("css", None) + if value: + global link_urls + link_urls += { "stylesheet": value } send_title(self.page_name, self.split_title(), msg_text=self.msg_text, msg_type=self.msg_type, writable=self.can_write())