Commit Graph

589 Commits (7ee8aa477e6c854533dc04ea90f97a7d4edaa17f)

Author SHA1 Message Date
Simon McVittie 7f5c2cfa5a Merge branch 'ready/templatebody' 2014-09-15 21:52:03 +01:00
Simon McVittie 70bc1a2113 add more wording based on what chrysn suggested 2014-09-15 21:22:42 +01:00
Simon McVittie 7dcf18dba5 Merge branch 'ready/document-success-reason' 2014-09-15 21:15:31 +01:00
Simon McVittie 2eea320b67 Merge branch 'ready/trail-sort' 2014-09-12 21:38:06 +01:00
Joey Hess 40d6ccbadb Make --no-gettime work in initial build. Closes: #755075 2014-08-28 19:08:09 -07:00
Simon McVittie 3f4a935740 trail: don't generate a costly dependency when forcing sort order
pagespec_match_list() makes the current page depend on the pagespec
being matched, so if you use [[!trailoptions sort="..."]] to force
a sort order, the trail ends up depending on internal(*) and is
rebuilt whenever anything changes. Add a new sort_pages() and use that
instead.
2014-07-11 22:08:08 +01:00
Simon McVittie a9fc30b19c Track whether we're in the scan or render phase
In the scan phase, it's too early to match pagespecs or sort pages;
in the render phase, both of those are OK.

It would be possible to add phases later, renumbering them if necessary
to maintain numerical order.
2014-03-05 10:42:19 +00:00
Simon McVittie 7672014582 Add templatebody plugin and directive, and enable it by default
Also add a regression test for templatebody.
2014-03-05 10:42:19 +00:00
Simon McVittie cbb3218db7 add readtemplate hook 2014-03-05 10:42:19 +00:00
Simon McVittie 8c6da231d6 SuccessReason: add some explanatory comments
Whenever I look at dependency calculation, it takes me a while to get my
head round the concept of influences. If what I've written here is
accurate, maybe the next person to look at this (or my future self)
will need less of a run-up.
2014-03-03 11:50:15 +00:00
Joey Hess e0d1c264d9 Allow up to 8 levels of nested directives, rather than previous 3 in directive infinite loop guard. 2014-02-23 14:11:54 -04:00
Joey Hess c5d63c549d Merge remote-tracking branch 'anarcat/dev/syslog_utf8' 2014-02-23 14:09:51 -04:00
Tuomas Jormola dc53ca18f2 Bug#737121: ikiwiki: [PATCH] Implement configuration option to set the user agent string for outbound HTTP requests
Package: ikiwiki
Version: 3.20140125
Severity: wishlist

By default, LWP::UserAgent used by IkiWiki to perform outbound HTTP
requests sends the string "libwww-perl/<version number>" as User-Agent
header in HTTP requests. Some blogging platforms have blacklisted the
user agent and won't serve any content for clients using this user agent
string. With IkiWiki configuration option "useragent" it's now possible
to define a custom string that is used for the value of the User-Agent
header.
2014-02-01 16:53:33 -04:00
Antoine Beaupré 2a143bfd0b don't edit config setting, but a temporary variable, complete and unbreak tests 2013-11-29 01:09:04 -05:00
Antoine Beaupré 2869b65bcb recover gracefully from syslog failures 2013-11-29 01:09:03 -05:00
Joey Hess 654530fa8b Added only_committed_changes config setting, which speeds up wiki refresh by querying git to find the files that were changed, rather than looking at the work tree. Not enabled by default as it can break some setups where not all files get committed to git. 2013-11-16 17:26:20 -04:00
Joey Hess 3aaa33064c Optmised loadindex by caching the page name in the index.
I have benchmarked the pagename() call this avoids taking up to 2 seconds
for a loadindex in a large wiki. The total loadindex for that wiki was
6.46s, so this is a significant improvment.
Even on a smaller site, this reduces the refresh time from 1.69 to 1.52
seconds.

The only breakage risk here is that pagename() can change the page name
it calculates due to setup changes. But in the case of a setup change, the
whole site is rebuilt. So the cached page name is not used in that
case.
2013-11-16 12:48:11 -04:00
Joey Hess 992d4f52ff Fixed unncessary tight loop hash copy in saveindex where a pointer can be used instead. Can speed up refreshes by nearly 50% in some circumstances.
I *think* this is ok, at least it results in close to the same index being
saved as before. The difference is that plugins that have a pagestate of {}
have that recorded this way, while with the tight loop, the key for the
plugin in not copied in that case. I cannot see how this could matter.
2013-11-16 12:28:01 -04:00
Joey Hess df09eba2fd Fix cookiejar default setting. 2013-09-04 10:15:35 -04:00
Amitai Schlair d844a3487e cookiejar is now a core config setting. 2013-08-03 09:55:54 -04:00
Amitai Schlair 462d8f8015 Honor proxy env vars and reliably honor cookiejar. 2013-07-27 08:12:01 -04:00
Joey Hess 533793ee46 The ip() pagespec can now contain glob characters to match eg, a subnet full of spammers. 2013-07-08 11:49:38 -04:00
Giuseppe Bilotta 186a76ec20 Allow dots in parameter key names
This allows e.g. the meta command to be used to introduce DublinCore
metadata.
2013-02-15 17:24:33 -04:00
Joey Hess b1cd1c067f add cgi_overload_message 2012-10-11 11:22:03 -04:00
Joey Hess 6bd8c6732e add cgi_overload_delay tunable
Try to avoid a situation in which so many ikiwiki cgi wrapper programs are
running, all waiting on some long-running thing like a site rebuild, that
it prevents the web server from doing anything else. The current approach
only avoids this problem for GET requests; if multiple cgi's run GETs on a
site at the same time, one will display a "please wait" page for a
configurable number of seconds, which then redirects to retry. To enable
this protection, set cgi_overload_delay to the number of seconds to wait.
This is not enabled by default.
2012-10-09 17:12:04 -04:00
Joey Hess f9e96b0c32 passwordauth: Fix url in password recovery email to be absolute.
This got broken when cgiurl began often returning a relative url.
Added a cgiurl_abs for the things that need a guaranteed absolute cgiurl.
2012-04-02 12:24:14 -04:00
Joey Hess 3200515b3d fix typo in LC_TIME locale lookup 2012-02-01 22:49:35 -04:00
Joey Hess a78126c55e calendar, prettydate: Fix strftime encoding bug
strftime is a C function, it does not return decoded utf8.
Several places in ikiwiki manually decoded it, but at least two
forgot to.

Also, strftime might not return even encoded utf8, if LC_TIME is set
to a non-utf8 value. Went ahead and supported decoding whatever encoding
it uses.

The remaining direct calls to strftime() are all ones that first set
LC_TIME=C, in order to get times that are not for human display.
2012-01-30 15:09:37 -04:00
Giuseppe Bilotta 17fb0cf9f9 backlink(.) should behave like backlink(<current page>)
Since commit c4d4cad3be, the single dot in
a pagespec can be used to mean the current page. While this worked
correctly in link() it didn't work in backlink(). Fix this by explicitly
checking the testpage in backlink against . and replacing it with the
current location if necessary.
2012-01-13 13:42:38 -04:00
Simon McVittie 5333c113d6 Add path and path_natural sort orders
(cherry picked from commit 272e0b2f17)
2011-12-06 14:26:27 -04:00
Simon McVittie 3df7d14346 Support private, group, public as values for umask
These are equivalent to octal 077, 027 and 022, but easier to get from
YAML.

Signed-off-by: Simon McVittie <smcv@debian.org>
2011-11-27 14:14:47 +00:00
Joey Hess d2cf716876 Avoid using named capture groups in heredoc code for oldperl compatability.
Also reordered heredoc part of regexp for consistency.
2011-07-30 20:12:33 +02:00
Joey Hess 25b01f9404 Preserve mixed case in page creation links, and when creating a page whose title is mixed case, allow selecting between the mixed case and all lower-case names. 2011-06-29 16:38:32 -04:00
Joey Hess c90bc78d44 Support svg as a inlinable image type
svg images can be included on a page by simply linking to them, or by using
the img directive. Note that sanitizing svg files is still not addressed.
2011-06-29 14:17:47 -04:00
Joey Hess 46064d6d63 html5 is not experimental anymore. But not the default either, quite yet. 2011-06-23 09:41:21 -04:00
Timo Paulssen 1c58634068 added support for here-docs and ''' in parameters. 2011-05-13 11:24:15 -04:00
Joey Hess 9df8971e57 Yaml formatted setup files are now produced by default
This has been a while coming. It turns out that non-excutable setup files
have a number of benefits. Also, I find YAML setup files easier to edit
myself, and I suspect many users will prefer not needing to deal with
perl syntax.
2011-03-24 21:30:18 -04:00
Joey Hess 78c750f2d2 Add timezone setting in setup file. This alows time zone to be configured via the web. 2011-03-24 13:36:16 -04:00
Joey Hess 2a2ae88c84 avoid uninitlized value when urlto is called with 1 parameter and no url is configured
This brings back the old behavior before urlto changes for this case.
It will generate a path like "/foo", which is not right, but is
the same as is generated by urlto($page, "", 1) -- which is what
the code that now uses 1-parameter urlto used to use.
2011-02-27 18:32:44 -04:00
Simon McVittie dff44e4a6d Add add_literal_underlay and use it for the transient underlay
This means we don't need to import Cwd and use abs_path.
2011-01-07 20:04:45 +00:00
Joey Hess d991ccf134 use cgitemplate, remove misctemplate 2011-01-05 17:15:38 -04:00
Joey Hess 885bff7239 make urlabs a noop if base url is not provided
This allows urlabs($foo, $config{url}) to be used safely, even if
no url is configured.
2011-01-05 16:23:05 -04:00
Joey Hess c91b39fdb5 factored out an urlabs from aggregate and cgi 2011-01-05 16:18:25 -04:00
Joey Hess c11b1226ca oops 2011-01-05 15:43:03 -04:00
Joey Hess 6b5b0a3282 Temporarily revert one part of the multiple url support in the last release. Non-edit pages are now back to having `<base>` set to the site's main url. 2011-01-05 15:01:31 -04:00
Joey Hess 4fb26f4e60 Add a second parameter to the rcs_diff hook, and avoid bloating memory reading in enormous commits. 2010-12-29 19:58:49 -04:00
Simon McVittie d4704d8bbb urlto: simplify the to='' special case to allow it to be made absolute 2010-12-25 22:54:54 +00:00
Simon McVittie eb58b51bb0 checkconfig: don't warn if $config{url} is undef
The warning was "Use of uninitialized value $IkiWiki::config{"url"} in
length" when running a modified t/tag.t.
2010-12-25 21:35:06 +00:00
intrigeri b2a2246bac Enable HTML::Template's parent_global_vars option.
Else setting parameters that do not appear in the template (such as
title_overridden) fails horribly.
2010-12-22 19:21:41 +01:00
Joey Hess 53d466a07f second parameter of urlto is optional 2010-11-29 14:59:48 -04:00