Commits

John Mulligan  committed 17c5249

add site variables and add link to blog page titles

  • Participants
  • Parent commits 1b71945

Comments (0)

Files changed (5)

File muyhomepage2/app/build.py

     print 'Building:', pctx.page.title
     tname = pctx.template()
     scope = dict(current=pctx, site=website, config=config,
-            ext=pctx.extension(website, config))
+            ext=pctx.extension(website, config),
+            vars=config.sitevars())
     env = config.templateenv()
     template = env.get_template(tname)
     fp = open(os.path.join(config.destination(), pctx.finalname()), 'w')

File muyhomepage2/app/configuration.py

     def atom_id_base(self):
         return self._get('site', 'id_base', 'tag:my-site')
 
+    def sitevars(self):
+        return dict(self._list('sitevars'))
+

File muyhomepage2/pagehandlers/blog.py

 from muyhomepage2 import util
 
 
+class BlogEntryHandler(standard.StandardHandler):
+    def link_ref(self):
+        link = './%s' % self.finalname()
+        return link
+    
+
 class BlogHandler(handler.PageHandler):
     def content(self):
         return wikirst.format(self.page.body)
         def wrap(pg):
             if not hasattr(pg, 'body'):
                 pg = page.parse(pg.filename)
-            return standard.StandardHandler(pg)
+            return BlogEntryHandler(pg)
         entries, days = [], []
         for entry in website.newest(config.blog_count()):
             day = entry.created().dayfmt()

File skins/default/base.html

 </head>
 <body>
   <div id="page-intro">
-    <h1><a href="http://asynchrono.us">
+    <h1><a href="{{vars.home}}">
       Birch Street Computing - {% block vistitle %}{% endblock %}
     </a></h1>
   </div>

File skins/default/blog.html

     <h4 class="dateline">{{dateline}}</h4>
     {% endif %}
     <div>
-      <h2>{{entry.page.title}}</h2>
+      <h2><a href="{{entry.link_ref()}}" class="topage">{{entry.page.title}}</a></h2>
       {{ components.tagicon(entry, config) }}
       <div></div>
       <div class="written-text">