Commit Graph

2575 Commits (8ad932efd511376c3a9889b40a8fb16e2ba5e9a3)

Author SHA1 Message Date
Simon McVittie ef7c80258d comments: use comments_pagespec for authorization, not just UI 2014-07-04 23:27:43 +01:00
Simon McVittie 0357ad66ea inline: postform=no should take precedence over rootpage existing
If someone has explicitly disabled the postform, it seems reasonable
from a least-astonishment point of view for that to take precedence
over rootpage, even though that makes rootpage useless.

Also add a regression test; so far, this is all it tests.
2014-07-04 23:23:42 +01:00
Simon McVittie 17440ea301 Allow creation of transient index pages for directories outside srcdir
After this change autoindex creates index pages also for empty directories
included in underlays, but only if it isn't going to commit them to the
srcdir ($config{autoindex_commit} = 0).

Inspired by a patch from Tuomas Jormola.

Bug-Debian: http://bugs.debian.org/611068
2014-07-04 09:25:09 +01:00
Simon McVittie 3ba2ef1a54 autoindex: remove unnecessary special case for transient underlay
It's not clear that the transient underlay should be excluded from
indexing; see [[bugs/transient autocreated tagbase is not transient
autoindexed]].

In any case, the code that checks what directories might need indexes
specifically checks for the srcdir anyway, so the only effect this extra
check can have is negative (it could fail to notice files in the
transient underlay and attempt to recreate them unnecessarily).
2014-07-04 09:22:57 +01:00
Louis 2a5e8e72a0 calendar plugin: Autocreate archive pages if needed 2014-06-24 15:17:51 +02:00
chrysn bcc209eb5a add pagenumber parameter
this allows picking a page from a pdf. also, this enhances performance
greatly when rendering pdfs, as only the first page is rasterized.
(otherwise, imagemagick would treat the pdf as a list of images, work
with all of them, until finally only the first page gets saved). the
default parameter of 0 will select the single image contained in typical
image files anyway, so no specialcasing between single- and multifile
containers is needed.
2014-04-07 11:32:25 +02:00
chrysn 6cc43773e7 add pdf support to the img directive
this is trivial as pdf is supported by imagemagick, and just needs an
explicit mention to enable conversion.
2014-04-07 11:19:04 +02:00
chrysn 71b9ad33e0 set the file type parameter after reading the image
imagemagick, when reading an image, sets its magick parameter to
indicate the file type, overriding the explicitly set file type for
output if it is set at creation.

as a result, previously (with graphicsmagick-libmagick-dev-compat
1.3.18-1 providing Image::Magick), svg output files were not png,
neither svg, but mvg (imagemagick vector graphics).
2014-04-07 11:15:51 +02:00
Joey Hess 59cfb9b6d0 only_committed_changes could fail in a git repository merged with git merge -s ours. 2014-04-05 19:09:05 -04: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 24599e3cc9 In all=no conditionals, depend on the influences, not the test pagespec
Previously, if a page like `plugins/trail` contained a conditional like

    [[!if test="backlink(plugins/goodstuff)" all=no]]

(which it gets via `templates/gitbranch`), then the
[[plugins/conditional]] plugin would give `plugins/trail` a dependency on
`(backlink(plugins/goodstuff)) and plugins/trail`. This dependency is
useless: that pagespec can never match any page other than
`plugins/trail`, but if `plugins/trail` has been modified or deleted,
then it's going to be rendered or deleted *anyway*, so there's no point
in spending time evaluating match_backlink for it.

Conversely, the influences from the result were not taken into account,
so `plugins/trail` did not have the
`{ "plugins/goodstuff" => $DEPEND_LINKS }` dependency that it should.

Invert that, depending on the influences but not on the test.

Bug: http://ikiwiki.info/bugs/editing_gitbranch_template_is_really_slow/
2014-03-03 11:30:36 +00:00
Joey Hess ddc9441beb Merge remote-tracking branch 'remotes/smcv/ready/careful-eval' 2014-02-23 14:21:13 -04:00
Joey Hess c1fbd66c03 Merge remote-tracking branch 'remotes/smcv/ready/git-push-origin-master' 2014-02-23 14:19:39 -04:00
Joey Hess 204dcda88b Merge remote-tracking branch 'intrigeri/fix_diffurl_vs._cgit' 2014-02-23 14:13:53 -04:00
Joey Hess 9a99c4c6e2 Merge remote-tracking branch 'mhameed/html_lang_and_dir' 2014-02-23 14:06:40 -04:00
Simon McVittie bb359796b8 protect $@ whenever a block using $@ is non-trivial
As noted in the Try::Tiny man page, eval/$@ can be quite awkward in
corner cases, because $@ has the same properties and problems as C's
errno. While writing a regression test for definetemplate
in which it couldn't find an appropriate template, I received

    <span class="error">Error: failed to process template
    <span class="createlink">deftmpl</span> </span>

instead of the intended

    <span class="error">Error: failed to process template
    <span class="createlink">deftmpl</span> template deftmpl not
    found</span>

which turned out to be because the "catch"-analogous block called
gettext before it used $@, and gettext can call define_gettext,
which uses eval.

This commit alters all current "catch"-like blocks that use $@, except
those that just do trivial things with $@ (string interpolation, string
concatenation) and call a function (die, error, print, etc.)
2014-02-21 17:06:36 +00:00
Simon McVittie be3483fe9b git: explicitly specify the branch to push to origin
git's behaviour when doing "git push origin" is configurable, and the
default is going to change in 2.0. In particular, if you've set
push.default to "nothing", the regression test will warn:

fatal: You didn't specify any refspecs to push, and push.default
is "nothing".
'git push origin' failed:  at .../lib/IkiWiki/Plugin/git.pm line 220.
2014-02-21 16:39:17 +00: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
Joey Hess a8d7a99979 osm: Escape name parameter. Closes: #731797 2014-01-15 15:53:51 -04:00
Joey Hess fe1a69e11a inline: Allow overriding the title of the feed. Closes: #735123 Thanks, Christophe Rhodes 2014-01-13 17:06:29 -04:00
intrigeri d52774dd45 Do not UTF8-escape "/" in Git's diffurl: cgit does not support this. 2013-12-31 01:47:10 +00:00
Joey Hess a2fb23286f aggregrate: Fix several bugs in handling of empty and colliding titles when generating filenames. 2013-12-28 20:02:22 -04:00
Joey Hess bfc13b9070 osm: Remove invalid use of charset on embedded javascript tags. Closes: #731197 2013-12-03 12:42:04 -04:00
Joey Hess 6d95bd7e02 typo 2013-11-18 16:35:51 -04:00
Joey Hess 002a97ffcd search: Added googlesearch option, which makes it search google rather than using the internal xapain database. (googlesearch plugin is too hard to turn on when xapain databases corrupt themselves, which happens all too frequently). 2013-11-17 16:37:18 -04:00
Joey Hess 81aa58e7ca comments: Write pending moderation comments to the transient underlay to avoid conflict with only_committed_changes. 2013-11-17 13:07:00 -04:00
Joey Hess e11a87acfa autoindex and tag use transient underlay when not committing, so do not need to disable only_committed_changes 2013-11-17 12:51:20 -04:00
Joey Hess 7dd110ba51 disable only_committed_changes when uncommitted files are created by plugins 2013-11-17 00:04:05 -04:00
Joey Hess 441002e3e6 deal with the case where oldrev is the same as newrev 2013-11-16 20:48:23 -04:00
Joey Hess 727d39b92a fix eq 2013-11-16 18:56:39 -04: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 2f8bafb709 poll: Fix behavior of poll buttons when inlined. 2013-11-13 22:06:02 -04:00
Mesar Hameed 062b196f51 Add two template variables, expose html language code and language direction. 2013-10-14 12:47:48 +02:00
Joey Hess db6f258745 fix new perl warning 2013-08-30 22:33:11 -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 4c88a4d9d8 Merge remote-tracking branch 'schmonz/fancypodcast' 2013-07-21 13:51:35 -04:00
Joey Hess 7d938559cb calendar: Display the popup mouseover when there is only 1 page for a given day, for better UI consistency. 2013-07-19 18:54:32 -04:00
Amitai Schlair 5c0a18e75a Merge branch 'master' into fancypodcast
Conflicts:
	doc/todo/fancypodcast.mdwn
2013-07-17 16:49:46 -04:00
Amitai Schlair 97d0c09a18 Show author in addition to feedname, if different.
While here, mollify http://validator.w3.org/feed/ and
s/dcterms:creator/dc:creator/g, which happens to make rss2email see
and do nice things with authors.
2013-07-17 16:38:08 -04:00
Joey Hess 946af13ae6 Pass --no-edit when used with git 1.7.8 and newer.
Not sure if this is needed to avoid it trying to run an editor. Probably
there is never a controlling terminal and probably git notices and does
nothing. But I'm just copying what I have in git-annex assistant here.

(Although with a much worse git version comparion, that only really works due
to luck.)
2013-07-10 21:52:49 -04:00
Joey Hess b162563dc1 Deal with git behavior change in 1.7.8 and newer that broke support for commits with an empty commit message. 2013-07-10 21:50:18 -04:00
Joey Hess 87f46582f5 Fix committing attachments when using svn. 2013-07-10 18:23:09 -04:00
Joey Hess c849a9f409 openid: Automatically upgrade openid_realm to https when accessed via https. 2013-06-29 13:31:47 -04:00
Amitai Schlair 844710c0da Merge branch 'master' into fancypodcast 2013-06-27 00:50:17 -04:00
Amitai Schlair b25f7700bd Instead of hacking back to $link, just provide it. 2013-06-27 00:21:20 -04:00
Joey Hess c5f9b01662 osm: Remove trailing slash from KML maps icon. 2013-06-23 14:14:52 -04:00
Joey Hess b8d65da266 calendar: When there are multiple pages for a given day, they're displayed in a popup on mouseover. Thanks, Louis 2013-06-23 14:11:39 -04:00
Joey Hess 5038f36cba Merge branch 'restrict-comment-formats' of git://rtime.felk.cvut.cz/sojka/ikiwiki 2013-06-23 14:04:42 -04:00
Changaco e51169132a fix encoding issue in blogspam plugin
RPC::XML uses ascii as default encoding, we have to tell it to use utf8.

Without this, ikiwiki returns "failed to get response from blogspam server"
every time a non-ascii character is used in a content that needs checking.
2013-06-23 14:01:59 -04:00
Joey Hess 07d39ce5bf bzr: bzr rm no longer has a --force option, remove 2013-05-18 16:33:32 -04:00
Joey Hess 9e4f0efe44 notifyemail: Fix bug that caused duplicate emails to be sent when site was rebuilt. 2013-05-18 16:26:48 -04:00
Joey Hess 67ebaf15d7 theme: Now <TMPL_IF THEME_$NAME> can be used in all templates when a theme is enabled. 2013-05-16 22:20:56 -04:00
Amitai Schlair d33b31f706 Merge branch 'master' into fancypodcast 2013-05-12 19:16:50 -04:00
Joey Hess 6c09c3e646 meta: Fix anchors used to link to the page's license and copyright. Closes: #706437 2013-04-30 13:35:04 -04:00
Amitai Schlair 137ed653ea Merge branch 'master' into fancypodcast
Conflicts:
	doc/todo/fancypodcast.mdwn
2013-03-17 15:01:13 -04:00
Michal Sojka c42fd7d758 Add configuration to restrict the formats allowed for comments
I want to write my blog posts in a convenient format (Emacs org mode)
but do not want commenters to be able to use this format for security
reasons. This patch allows to configure which formats are allowed for
writing comments.

Effectively, it restricts the formats enabled with add_plugin to those
mentioned in comments_allowformats. If this is empty, all formats are
allowed, which is the behavior without this patch.
2013-03-05 11:00:29 +01:00
Joey Hess b1a721942d Merge remote-tracking branch 'smcv/ready/map' 2013-03-04 18:29:58 -04:00
Joey Hess 1d6eb13e2b Add missing plugin section, and deal with missing sections with a warning. 2013-03-04 13:03:34 -04:00
Simon McVittie af8712cfac map: postprocess to collapse useless </ul><ul> sequences
This re-fixes the same bug as 2d5c2f30, but without introducing
malformed HTML in some situations. This is not a very elegant
solution, but it has the advantage of passing more tests.
2013-02-24 13:10:24 +00:00
Simon McVittie 3f27a97336 Optionally add indentation to maps
This makes them easier to debug by showing the structure. Sample output
when $spaces is set to 4 spaces:

<div class='map'>
<ul>
    <li>
    <a href="../alpha" class="mapparent">alpha</a>
        <ul>
        <li>
        <a href="../alpha/1" class="mapitem">1</a>
        </li>
        </ul>
    </li>
    <li>
    <a href="../beta" class="mapitem">beta</a>
    </li>
</ul>
</div>
2013-02-24 13:10:24 +00:00
Simon McVittie ce1c7a3eab Revert "map: don't create useless </ul><ul> sequences"
This reverts commit 2d5c2f301c.
2013-02-24 13:10:24 +00:00
Amitai Schlair 4b6ea05ac8 Catch up rsspage to atompage. Validates. 2013-02-22 12:54:16 -05:00
Amitai Schlair d77ee60b15 Render fancy podcast enclosures.
Simple podcast feeds didn't have content tags and I made sure to
keep it that way. This may be unnecessarily conservative. Changing
the behavior to include empty content tags might be fine, but I
don't want to think about it right now, I just want my tests to
keep passing!

The new fancy-podcast tests are copy-pasted-edited from the
simple-podcast tests. These tests shall be refactored.
2013-02-20 21:16:19 -05:00
Amitai Schlair a629b276b2 Extract genenclosure(). No functional change intended. 2013-02-20 20:53:50 -05:00
Amitai Schlair 3d2be49420 Make enclosures absolute (in feeds they have to be). 2013-02-20 19:14:20 -05:00
Amitai Schlair c3b17740ae Document that last enclosure wins. 2013-02-19 20:22:47 -05:00
Amitai Schlair 0e278c4a84 Make enclosure follow WikiLink LinkingRules. 2013-02-19 20:22:46 -05:00
Amitai Schlair 546da9bac7 Make [[!meta enclosure=foo.mp3]] "work" for HTML. 2013-02-19 20:22:46 -05:00
Joey Hess 480d6f93c1 highlight: Now adds a span with class highlight-<extension> around highlighted content, allowing for language-specific css styling. 2013-02-12 11:27:29 -04:00
Amitai Schlair 91b477c087 Fix diffurl links (cvsweb expects unescaped '/'). 2013-02-02 14:11:15 -05:00
Amitai Schlair 0f3f809a45 Merge branch 'master' into cvs 2013-02-02 13:02:26 -05:00
Joey Hess 82114f4451 Deal with empty diffurl in configuration. 2013-01-29 08:12:56 +11:00
Amitai Schlair b30cacdf8d Fix longstanding bug (chdir to nonexistent dirs).
In test, set up the post-commit hook for more realism (and bugs!).
To make wrappers work in test, set PERL5LIB, and allow the wrappee's
path to be overridden. Meta-test that post-commit is really hooked
up by verifying that content is getting generated in destdir.

About the longstanding bug, which as far as I know was harmless:
CVS can't operate outside a srcdir, so we're always setting $CWD.
"local $CWD" restores the previous value when we go out of scope.
Usually that's correct. But if we're removing the last file from a
directory, the post-commit hook will exec in a working directory
that's about to not exist (CVS will prune it).

The fix: chdir() manually in cvs_runcvs(), so we can selectively
not chdir() back.
2013-01-27 22:09:57 -05:00
Amitai Schlair 64370885cc Merge branch 'master' into cvs 2013-01-25 08:47:17 -05:00
Joey Hess e5d82ef868 trail: Avoid massive slowdown caused by pagetemplate hook when displaying dynamic cgi pages, which cannot use trail anyway.
This seemed to be due to the pagetemplate hook calling prerender. I've
observed this making it take *minutes* for the signin page to be displayed.
ltracing ikiwiki showed it was matching pagespecs a lot.

It may be that this is still a speed pain point when rendering pages, not
just for CGI. So more work may be needed here.
2013-01-24 10:40:35 +11:00
Joey Hess 37cf511f06 poll: Add expandable option to allow users to easily add new choices to a poll. 2013-01-10 12:43:27 -04:00
Joey Hess 7173ef1b13 htmlscrubber: Allow the URI schemes of major VCS's. 2013-01-05 17:25:47 -04:00
Joey Hess 22cb87c684 Merge remote-tracking branch 'smcv/ready/trail' 2013-01-02 15:31:10 -04:00
Simon McVittie 7029f98bc7 trail: remove excess presence-dependencies
Since trail members are explicitly rebuilt if the information used for
their prev/up/next boxes changes, they don't need another dependency
on the trail itself. (If the trail disappears, it will disappear from
the member's member_to_trails entry, causing a rebuild; so the add_depends
is redundant.)

Similarly, since trail members are explicitly rebuilt if their next
or previous item, or its title, changes, the presence dependencies on the
next and previous items are redundant.
2013-01-02 19:19:32 +00:00
Simon McVittie 7b06a65221 If the title of a trail or trail-member changes, rebuild affected pages
If the title of a trail changes, each member of that trail must be
rebuilt, for its prev/up/next box to reflect the new title.

If the title of a member changes, its next and previous items (if any)
must be rebuilt, for their prev/up/next boxes to reflect the new title.
2013-01-02 19:19:32 +00:00
Simon McVittie 1daa68b8b7 trail: call prerender from build_affected
In the unlikely event that the ordered contents of a trail have changed
without the TRAILS or TRAILLOOP template variables being evaluated
(for instance, all trail directives are removed from a former trail
that uses a custom pagetemplate that doesn't contain TRAILS), we might
get here without having already called prerender.
2013-01-02 19:19:32 +00:00
Simon McVittie 6e962a2d74 opendiscussion: don't allow editing discussionpage if discussion is disabled 2013-01-02 18:05:33 +00:00
Joey Hess 86519b047e trail: Converted all dependencies to presence dependencies.
smcv please note this introduces another bug, which I've opened
2012-12-27 22:29:51 -04:00
Joey Hess dc05125b0b aggregate: When run with --aggregate, if an aggregation is already running, don't go on and --refresh.
This way, if a previous aggregation job is running, we don't add additional
load doing work that job will do anyway.
2012-12-27 21:25:59 -04:00
Joey Hess 3d6ee9eccd htmlscrubber: Allow the bitcoin URI scheme. 2012-12-22 16:15:38 -04:00
Shlomi Fish 12c9219d67 Fix some warnigns in recent perls.
All existing tests pass.
2012-12-17 22:44:54 +02:00
Joey Hess c29413ba2a openid: Display openid in Preferences page as a comment, so it can be selected in all browsers. 2012-12-04 13:59:19 -04:00
Joey Hess 286026877d filecheck: Fix bug that prevented File::MimeInfo::Magic from ever being used. 2012-11-04 12:02:26 -04:00
Joey Hess 96bfdbf1be really fix diff display to not show both types of diff
12fa9c031f porported to fix this, but failed
2012-10-16 10:59:00 -04:00
Joey Hess b5b3f56703 typo 2012-10-14 20:49:42 -04:00
Antoine Beaupré 9aa888cadf osm: indent the generated KML file for better readability
(cherry picked from commit 1636da85d82644d923042c870aaedc5a29754aa6)
2012-08-25 10:45:21 -04:00
Antoine Beaupré a12dc95883 osm: optimization: do not create duplicate styles
(cherry picked from commit 9d550817ca546d1dd30a21cebad6093d1f3bacad)
2012-08-25 10:45:16 -04:00
Joey Hess a3c1768e10 comments: Remove ipv6 address specific code. 2012-08-25 10:43:24 -04:00
Joey Hess 93a12752ac merged anarcat/osm_arbitrary_layers 2012-08-25 10:13:22 -04:00
Antoine Beaupré 636e04a13a make layers an array
this simplifies the code, make the configuration more intuitive, at
the cost of making the labels on the layers automatically generated
and therefore less customizable
2012-08-25 08:53:33 -04:00
Antoine Beaupré 081fd38636 make layers completely customizable 2012-08-25 08:20:30 -04:00
Antoine Beaupré acc4d7d7d6 osm: add optional google maps support
for google maps to work, an API key needs to be added to the configuration
2012-08-25 08:20:30 -04:00
Geneviève Bastien 8fb42f42f4 OSM plugin: new config option to specify the url to fetch maps from 2012-08-25 08:20:30 -04:00
Philippe Gauthier d5b2dfd0e4 Add Document tag to OSM plugin KML output
(cherry picked from commit 519d35368e2f1e7fe1fce577fe7d71ef9bd5c07e)
2012-08-24 23:24:47 -04:00