]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
* inline: Add timeformat parameter to control how the ctime of
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 13 Nov 2007 21:14:48 +0000 (16:14 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 13 Nov 2007 21:14:48 +0000 (16:14 -0500)
  inlined pages is displayed. Closes: #451019

IkiWiki.pm
IkiWiki/Plugin/inline.pm
debian/changelog
doc/blog.mdwn
doc/plugins/write.mdwn
po/ikiwiki.pot

index 5ae360ad0ee32d3068a64a5e97cc742176dada4e..ad4d26741af22a5a0f087917ebc8334e819f7398 100644 (file)
@@ -498,13 +498,16 @@ sub abs2rel ($$) { #{{{
        return $ret;
 } #}}}
 
        return $ret;
 } #}}}
 
-sub displaytime ($) { #{{{
+sub displaytime ($;$) { #{{{
        my $time=shift;
        my $time=shift;
+       my $format=shift;
+       if (! defined $format) {
+               $format=$config{timeformat};
+       }
 
        # strftime doesn't know about encodings, so make sure
        # its output is properly treated as utf8
 
        # strftime doesn't know about encodings, so make sure
        # its output is properly treated as utf8
-       return decode_utf8(POSIX::strftime(
-                       $config{timeformat}, localtime($time)));
+       return decode_utf8(POSIX::strftime($format, localtime($time)));
 } #}}}
 
 sub beautify_url ($) { #{{{
 } #}}}
 
 sub beautify_url ($) { #{{{
index bb160ac4de949058cc62be656686058d717bb71b..ebeb231783fbe950fce33f04cac59e01ed655456 100644 (file)
@@ -221,7 +221,7 @@ sub preprocess_inline (@) { #{{{
                                }
                                $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
                                $template->param(title => pagetitle(basename($page)));
                                }
                                $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
                                $template->param(title => pagetitle(basename($page)));
-                               $template->param(ctime => displaytime($pagectime{$page}));
+                               $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat}));
        
                                if ($actions) {
                                        my $file = $pagesources{$page};
        
                                if ($actions) {
                                        my $file = $pagesources{$page};
index 3f809a7e047928a3703becd73211eeef9a5ef819..749db67e0f31839456dfe6881aaf6ea41c4b9ed5 100644 (file)
@@ -3,8 +3,10 @@ ikiwiki (2.13) UNRELEASED; urgency=low
   * Add liblwpx-paranoidagent-perl to recommends of Debian package,
     this is needed to do OpenID really securely.
   * ikiwiki.setup is licensed same as the basewiki, not GPLed.
   * Add liblwpx-paranoidagent-perl to recommends of Debian package,
     this is needed to do OpenID really securely.
   * ikiwiki.setup is licensed same as the basewiki, not GPLed.
+  * inline: Add timeformat parameter to control how the ctime of
+    inlined pages is displayed. Closes: #451019
 
 
- -- Joey Hess <joeyh@debian.org>  Tue, 13 Nov 2007 16:03:46 -0500
+ -- Joey Hess <joeyh@debian.org>  Tue, 13 Nov 2007 16:11:54 -0500
 
 ikiwiki (2.12) unstable; urgency=low
 
 
 ikiwiki (2.12) unstable; urgency=low
 
index fe839775cd5a5305a5030fa99a452ebc7e71c0e1..6e5eec4aada473f6b10c94d2bdffec6d1e56fb75 100644 (file)
@@ -93,3 +93,5 @@ directive:
   the rss/atom feeds. The default is the same as the `show` value above.
 * `feedonly` - Only generate the feed, do not display the pages inline on
   the page.
   the rss/atom feeds. The default is the same as the `show` value above.
 * `feedonly` - Only generate the feed, do not display the pages inline on
   the page.
+* `timeformat` - Use this to specify how to display the time or date for pages
+  in the blog. The format string is passed to the strftime(3) function.
index 0e1839c6ca31157ddf0b5edcfd4d78529fbb2327..64b353a41759deb76d086a2825ff2c48085b3da5 100644 (file)
@@ -477,10 +477,13 @@ search for files.
 If the directory name is not absolute, ikiwiki will assume it is in
 the parent directory of the configured underlaydir.
 
 If the directory name is not absolute, ikiwiki will assume it is in
 the parent directory of the configured underlaydir.
 
-#### `displaytime($)`
+#### `displaytime($;$)`
 
 Given a time, formats it for display.
 
 
 Given a time, formats it for display.
 
+The optional second parameter is a strftime format to use to format the
+time.
+
 #### `gettext`
 
 This is the standard gettext function, although slightly optimised.
 #### `gettext`
 
 This is the standard gettext function, although slightly optimised.
index 2a3fef4c546f988839bd62bb6264689979609ca7..3448cda199c5e67eafdbb16920ecceefbb046bcf 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-11-12 14:36-0500\n"
+"POT-Creation-Date: 2007-11-13 16:14-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -614,7 +614,7 @@ msgstr ""
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:708
+#: ../IkiWiki.pm:711
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr ""
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr ""