]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Fixed a bug with previews of subpages having broken links to top-level
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 21 Aug 2006 22:27:02 +0000 (22:27 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 21 Aug 2006 22:27:02 +0000 (22:27 +0000)
  pages.
* Change how the stylesheet url is determined in the templates: Remove
  STYLEURL and add BASEURL to all templates (some already had it). This
  new more general variable can be used to link to other things (eg, images)
  from the template, as well as stylesheets.

IkiWiki.pm
IkiWiki/CGI.pm
IkiWiki/Render.pm
debian/changelog
doc/index/discussion.mdwn
templates/editpage.tmpl
templates/misc.tmpl
templates/page.tmpl
templates/recentchanges.tmpl

index 4e30119182c81d3e376027cfac05031c384d9729..9556d6ef7732bba49e180f14323ddc14141bbe48 100644 (file)
@@ -304,14 +304,14 @@ sub cgiurl (@) { #{{{
        return $config{cgiurl}."?".join("&amp;", map "$_=$params{$_}", keys %params);
 } #}}}
 
-sub styleurl (;$) { #{{{
+sub baseurl (;$) { #{{{
        my $page=shift;
 
-       return "$config{url}/style.css" if ! defined $page;
+       return "$config{url}/" if ! defined $page;
        
        $page=~s/[^\/]+$//;
        $page=~s/[^\/]+\//..\//g;
-       return $page."style.css";
+       return $page;
 } #}}}
 
 sub abs2rel ($$) { #{{{
@@ -476,8 +476,7 @@ sub misctemplate ($$) { #{{{
                indexlink => indexlink(),
                wikiname => $config{wikiname},
                pagebody => $pagebody,
-               styleurl => styleurl(),
-               baseurl => "$config{url}/",
+               baseurl => baseurl(),
        );
        return $template->output;
 }#}}}
index 4c15be0aeecb09221d27863ceb580d55f759d66e..7d4ba146fc9de3eb2e8ca08fb7b4d100a29c6bda 100644 (file)
@@ -70,8 +70,7 @@ sub cgi_recentchanges ($) { #{{{
                indexlink => indexlink(),
                wikiname => $config{wikiname},
                changelog => [rcs_recentchanges(100)],
-               styleurl => styleurl(),
-               baseurl => "$config{url}/",
+               baseurl => baseurl(),
        );
        print $q->header(-charset=>'utf-8'), $template->output;
 } #}}}
@@ -100,7 +99,7 @@ sub cgi_signin ($$) { #{{{
                header => 0,
                template => (-e "$config{templatedir}/signin.tmpl" ?
                             {template_params("signin.tmpl")} : ""),
-               stylesheet => styleurl(),
+               stylesheet => baseurl()."style.css",
        );
                
        decode_form_utf8($form);
@@ -267,7 +266,7 @@ sub cgi_prefs ($$) { #{{{
                action => $config{cgiurl},
                template => (-e "$config{templatedir}/prefs.tmpl" ?
                             {template_params("prefs.tmpl")} : ""),
-               stylesheet => styleurl(),
+               stylesheet => baseurl()."style.css",
        );
        my @buttons=("Save Preferences", "Logout", "Cancel");
        
@@ -394,8 +393,7 @@ sub cgi_editpage ($$) { #{{{
        $form->tmpl_param("indexlink", indexlink());
        $form->tmpl_param("helponformattinglink",
                htmllink("", "", "HelpOnFormatting", 1));
-       $form->tmpl_param("styleurl", styleurl());
-       $form->tmpl_param("baseurl", "$config{url}/");
+       $form->tmpl_param("baseurl", baseurl());
        if (! $form->submitted) {
                $form->field(name => "rcsinfo", value => rcs_prepedit($file),
                        force => 1);
@@ -414,7 +412,7 @@ sub cgi_editpage ($$) { #{{{
                $form->field(name => "comments",
                                value => $comments, force => 1);
                $form->tmpl_param("page_preview",
-                       htmlize($type, linkify($page, $page, filter($page, $content))));
+                       htmlize($type, linkify($page, "", filter($page, $content))));
        }
        else {
                $form->tmpl_param("page_preview", "");
index b4b95e8d4897562b695fe7d5bac5029e1e311fc3..ddd14692230a749b0cee57b6396279e4f236e9bd 100644 (file)
@@ -180,7 +180,7 @@ sub genpage ($$$) { #{{{
                content => $content,
                backlinks => [backlinks($page)],
                mtime => displaytime($mtime),
-               styleurl => styleurl($page),
+               baseurl => baseurl($page),
        );
 
        run_hooks(pagetemplate => sub {
index 3d6d50cb17ddea964bdc595c7cc0289527adcfda..323dcf6b27f41bd1ba4d4ae5ffec069795a95c0f 100644 (file)
@@ -1,3 +1,14 @@
+ikiwiki (1.22) UNRELEASED; urgency=low
+
+  * Fixed a bug with previews of subpages having broken links to top-level
+    pages.
+  * Change how the stylesheet url is determined in the templates: Remove
+    STYLEURL and add BASEURL to all templates (some already had it). This
+    new more general variable can be used to link to other things (eg, images)
+    from the template, as well as stylesheets.
+
+ -- Joey Hess <joeyh@debian.org>  Mon, 21 Aug 2006 18:16:09 -0400
+
 ikiwiki (1.21) unstable; urgency=low
 
   * Add a tail fin^W^Wsidebar plugin by Tuomo Valkonen.
index c8b082a822cafa3bf69f58b1ef348603f3af9db4..b4f38ee51fe5fbd97adf0a9b0fc5a1a6bf7435c6 100644 (file)
@@ -1,20 +1,12 @@
-Seems like there should be a page for you to post your thoughts about ikiwiki, both pro and con, anything that didn't work, ideas, or whatever. Do so here..
+Seems like there should be a page for you to post your thoughts about
+ikiwiki, both pro and con, anything that didn't work, ideas, or whatever.
+Do so here..
 
-Note that for more formal bug reports or todo items, you can also edit the [[bugs]] and  [[todo]] pages.
+Note that for more formal bug reports or todo items, you can also edit the
+[[bugs]] and  [[todo]] pages.
 
-----
-How about adding ACL? So that you can control which users are allowed to read, write certain pages. The moinmoin wiki has that, and it is something, that I think is very valuable. 
-
-----
-It would be interesting to have a `<TMPL_VAR BASEURL>` that would act exactly like the current `STYLEURL`, but without adding 'style.css' (`STYLEURL` could be defined in terms of `BASEURL`). This way it would be possible to have more flexible templates allowing multiple stylesheets, shortcut icons (and other images), etc.
-
-       sub baseurl (;$) { #{{{
-               my $page=shift;
-
-               return "$config{url}/" if ! defined $page;
-               
-               $page=~s/[^\/]+$//;
-               $page=~s/[^\/]+\//..\//g;
-               return $page;
-       } #}}}
+---- 
 
+How about adding ACL? So that you can control which users are allowed
+to read, write certain pages. The moinmoin wiki has that, and it is
+something, that I think is very valuable. 
index 1ee4c49479c16017e7f93ff8654290983cb8fc44..27155f5cf7e1b47c9ef17b8f718b74cd38d5159f 100644 (file)
@@ -2,12 +2,10 @@
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html>
 <head>
-<TMPL_IF NAME="BASEURL">
 <base href="<TMPL_VAR BASEURL>" />
-</TMPL_IF>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title><TMPL_VAR FORM-TITLE></title>
-<link rel="stylesheet" href="<TMPL_VAR STYLEURL>" type="text/css" />
+<link rel="stylesheet" href="<TMPL_VAR BASEURL>style.css" type="text/css" />
 </head>
 <body>
 <TMPL_IF NAME="PAGE_CONFLICT">
index d50fba4235f826c1c84657df9a3ac8a8cfd93f50..0376a19f9eca1b87c80282688d3b1f6bf2d30eb7 100644 (file)
@@ -2,12 +2,10 @@
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html>
 <head>
-<TMPL_IF NAME="BASEURL">
 <base href="<TMPL_VAR BASEURL>" />
-</TMPL_IF>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title><TMPL_VAR TITLE></title>
-<link rel="stylesheet" href="<TMPL_VAR STYLEURL>" type="text/css" />
+<link rel="stylesheet" href="<TMPL_VAR BASEURL>style.css" type="text/css" />
 </head>
 <body>
 
index 47bbfcda3ff7785bd8f00dded08c1181562df4b6..438fbc25d04bbcb63c12f13c59885912ebe5acf0 100644 (file)
@@ -4,7 +4,7 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title><TMPL_VAR TITLE></title>
-<link rel="stylesheet" href="<TMPL_VAR STYLEURL>" type="text/css" />
+<link rel="stylesheet" href="<TMPL_VAR BASEURL>style.css" type="text/css" />
 <TMPL_IF NAME="META">
 <TMPL_VAR META>
 </TMPL_IF>
index 250e5de51c450aad8724fcdf0a04db7650360b74..792fff00cb0cd9c7051580965eebec38393ceead 100644 (file)
@@ -2,12 +2,10 @@
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html>
 <head>
-<TMPL_IF NAME="BASEURL">
 <base href="<TMPL_VAR BASEURL>" />
-</TMPL_IF>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title><TMPL_VAR TITLE></title>
-<link rel="stylesheet" href="<TMPL_VAR STYLEURL>" type="text/css" />
+<link rel="stylesheet" href="<TMPL_VAR BASEURL>style.css" type="text/css" />
 </head>
 <body>