From: Oleg Broytman Date: Fri, 20 Aug 2010 21:12:49 +0000 (+0000) Subject: Start/first/last links. X-Git-Url: https://git.phdru.name/?p=phdru.name%2Fphdru.name.git;a=commitdiff_plain;h=3cb0903ad684d4dcdd70adb6b3b0f4ea2c2056ee Start/first/last links. git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@108 7bb0bf08-9e0d-0410-b083-99cee3bf18b8 --- diff --git a/dotfiles2html/dotfiles2html.py b/dotfiles2html/dotfiles2html.py index 10ec3c2..3c0e1b1 100755 --- a/dotfiles2html/dotfiles2html.py +++ b/dotfiles2html/dotfiles2html.py @@ -38,10 +38,12 @@ def add_headers(fname, start, prev, next): html_file.write("#attr $Copyright = 2003\n") if start: html_file.write("#attr $Start = \"index.html\"\n") + html_file.write("#attr $First = \"profile.html\"\n") if prev: html_file.write("#attr $Prev = \"%s.html\"\n" % prev) if next: html_file.write("#attr $Next = \"%s.html\"\n" % next) + html_file.write("#attr $Last = \"pdbrc.py.html\"\n") html_file.write('#attr $alternates = (("Plain text version", "text/plain", "%s"),)' % txt_name) html_file.write("\n") html_file.write("#def body_html\n") diff --git a/phd_pp_ru.tmpl b/phd_pp_ru.tmpl index c87bfce..2ede5d4 100644 --- a/phd_pp_ru.tmpl +++ b/phd_pp_ru.tmpl @@ -6,8 +6,10 @@ #attr $Keywords = None #attr $Copyright = None #attr $Start = None +#attr $First = None #attr $Prev = None #attr $Next = None +#attr $Last = None #attr $refresh = None #import time #attr $last_modified_en = time.strftime("%a, %d %b %Y %T GMT", time.gmtime()) @@ -35,25 +37,47 @@ #end if #if $Copyright #set $full_copyright = $copyright($Copyright) +#if $path.startswith("/Russian/") +#set $author_href = $root + "Russian/" +#set $copy_href = $root + "Russian/free.html" +#else +#set $author_href = $root or "./" +#set $copy_href = $root + "free.html" +#end if + - + #end if - + #if $root - - +#if $path.endswith('index.html') + +#else + +#end if #end if #if $Start - + +#elif not $path.endswith('index.html') + +#end if +#if $First + #end if #if $Prev - + #end if #if $Next - + +#end if +#if $Last + +#end if +#if $path != "/search.html" + #end if #if $styles diff --git a/reindex_blog.py b/reindex_blog.py index a57f1d2..5c14d46 100755 --- a/reindex_blog.py +++ b/reindex_blog.py @@ -167,11 +167,6 @@ def write_template(level, year, month, day, titles, tags=None): iday = int(day) imonth = int(month) - new_text.append("""\ -#attr $Next = "%s" -""" % titles[0][3]) - - if len(titles) == 1: new_text.append("""\ #attr $refresh = "0; URL=%s"