LISPUSER

LISPMEMOQ: How can you tell when you've reached Lisp Enlightenment?
A: The parentheses disappear. -- Anonymous

(top)  (memo)  (rss)

PyBlosxom 設定

RSS で見たときに,エントリの URL の拡張子が .rss20 などになってしまっていました. 正しくは .html であるべきなので,flavour に関係なく .html を使うように.

         else:
             base_url = entry['base_url']
             file_path = entry['file_path']
             flavour = entry['flavour']
-            tuple = {'url':'%s/%s.%s' % (base_url, file_path, flavour),
+            tuple = {'url':'%s/%s.%s' % (base_url, file_path, 'html'),
                      'base_url':base_url,
                      'file_path':file_path,
                      'flavour':flavour}

tags.py

URL から tag を取り出す方法の変更と,改行コード (utf-8-dos) 向けの `\\n` -> `\\r\\n` 調整.

         m = re.compile(r'^%s' % config['tag_url']).match(data['url'])
         if m:
-                tag = re.sub("%s" % config['tag_url'],'',data['url'])
+                #tag = re.sub("%s" % config['tag_url'],'',data['url'])
+                tag = data['url'].split("/")[-1]
                 
                 for root,dirs,files in os.walk(config['datadir']):
                         for x in files:
                                 m = re.compile('.*\.([^.]+)$').match(x)
                                 if m and m.group(1) in tagfileswithext:
                                         entry_location = root + "/" + x 
                                         directory = os.path.dirname(entry_location)
                                         if ( os.path.split(directory)[1] in ignore_directories ):
                                                 continue
                                         
                                         contents = open(entry_location,'r').read()
                                         
-                                        m = re.compile('\n#tags\s+(.*)\n' ).search(contents)
+                                        m = re.compile('\n#tags\s+(.*)\r\n' ).search(contents)

story.html

各ストーリの末尾に分類タグを表示するようにテンプレートを変更.

  <h1 class="storyTitle"><a name="$fn">$title</a></h3>
  $body
  <p>
   posted at: $ti | path: <a href="$base_url/$absolute_path_urlencoded" title="path">/$absolute_path</a>
   | <a href="$base_url/$file_path_urlencoded.$flavour">permanent link to this entry</a>
+  | $tags
  <p>

他のは忘れてしまってますね.やっぱ即メモらないとだめですねぇ….

posted: 2006/03/18 03:21 | permanent link to this entry | Tags: MISC

(top)  (memo)  (rss)