Skip to content

Commit

Permalink
Added "title" variables to all generated pages
Browse files Browse the repository at this point in the history
I changed the top of my head.mako file to look like:

    <title>
    %if post and post.title:
    ${post.title} -
    %elif title:
    ${title} -
    %endif
    ${bf.config.blog.name}
    </title>

so that values of ${title} are incorporated into each page's <title> tag.
  • Loading branch information
kstrauser committed Nov 18, 2011
1 parent 542c0ca commit 9a9fb3b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions _controllers/photo_gallery.py
Expand Up @@ -107,7 +107,8 @@ def generatealbumindex(pathelements):
'caption': getcaptionfromfile(os.path.join(dirname, 'index.markdown')),
'indexurl': makeurl(pathelements, ''),
'slug': makepathslug(pathelements),
'subdirs': subdirs})
'subdirs': subdirs,
'title': '%s gallery' % pathelements[-1]})


def getcaptionfromfile(filename):
Expand Down Expand Up @@ -217,7 +218,8 @@ def processsubdirectories(pathelements):
photoinfo.update({
'breadcrumbs': makebreadcrumbs(pathelements + [subdir, photoinfo['original']]),
'caption': getcaptionfromfile(photofilename + '.markdown'),
'photourl': makeurl(subdirelements, photoinfo['original'])})
'photourl': makeurl(subdirelements, photoinfo['original']),
'title': photoinfo['original']})
photos.append(photoinfo)

# If this subdirectory doesn't have photos in it, create an album index and move on.
Expand All @@ -239,4 +241,5 @@ def processsubdirectories(pathelements):
'caption': getcaptionfromfile(os.path.join(fullsubdir, 'index.markdown')),
'indexurl': makeurl(subdirelements, ''),
'photos': photos,
'slug': makepathslug(subdirelements)})
'slug': makepathslug(subdirelements),
'title': '%s gallery' % subdir})

0 comments on commit 9a9fb3b

Please sign in to comment.