Commit Graph

2800 Commits (4a6ac6b485c7e6e312e42c3c609df693f5e531ec)

Author SHA1 Message Date
intrigeri 1786b106a9 Merge remote branch 'upstream/master' into prv/po
Conflicts:
	doc/plugins/po.mdwn
2010-06-29 15:53:51 +02:00
intrigeri b225fdc44d po: added a needstranslation() pagespec 2010-06-29 15:45:34 +02:00
intrigeri dcd57dd5c9 Add a fullpage arg to filter.
Set it to true every time IkiWiki::filter is called on a full page's content.

This is a much nicer solution, for the po plugin, than previous whitelisting
using caller().
2010-06-29 15:17:56 +02:00
Joey Hess bb5193fde1 hnb: Fixed broken use of mkstemp that had caused dangling temp files, and prevented actually rendering hnb files. 2010-06-27 13:49:51 -04:00
intrigeri 4f44534d72 po: s/utf-8/UTF-8, to solve part of the double commit bug. 2010-06-26 01:16:56 +02:00
intrigeri 4cf185e781 po_slave_languages can now be a hash, if order matters. 2010-06-26 00:56:06 +02:00
intrigeri a128c256a5 po: added support for html pagetype
... after having audited the po4a Xml and Xhtml modules for security issues.

Signed-off-by: intrigeri <intrigeri@boum.org>
2010-06-25 23:18:57 +02:00
intrigeri 903a71c1b9 TODO++ 2010-06-25 17:45:08 +02:00
intrigeri d4136aea8a po: also filter sidebar translation pages 2010-06-25 17:43:25 +02:00
intrigeri d877b9644b po: fix bug with translated pages including templates
The protection against processing loops (i.e. the alreadyfiltered stuff) was
playing against us: the template plugin triggered a filter hooks run with the
very same ($page, $destpage) arguments pair that we use to identify a already
filtered page. Processing an included template could then mark the whole
translation page as already filtered, which prevented po_to_markup to be called
on the PO content.

This commit only runs the whole PO filter logic when our filter hook is run by
IkiWiki::render, which only happens when the full page needs to be filtered.
2010-06-25 17:14:13 +02:00
intrigeri 9f401d6617 Merge remote branch 'upstream/master' into prv/po
Conflicts:
	IkiWiki/Plugin/po.pm
2010-06-25 14:38:37 +02:00
Joey Hess d8d057c356 chdir to srcdir in rcs_getctime 2010-06-23 21:29:47 -04:00
Joey Hess 38bf2f6388 bugfix 2010-06-23 20:26:09 -04:00
Joey Hess 9a32451986 finializing openid nickname support
Renamed usershort => nickname.

Note that this means existing user login sessions will not have the nickname
recorded, and so it won't be used for those.
2010-06-23 20:16:01 -04:00
Joey Hess a4f381ace8 git: Record the username from openid in the git author email. (This avoids display of ugly google openids.) 2010-06-23 19:44:41 -04:00
Joey Hess b38b9327a8 take username from email address as fallback 2010-06-23 19:36:23 -04:00
Joey Hess d8e4b51a41 rcs_getctime and rcs_getmtime take relative filenames
There was some confusion about whether the filename was
relative to srcdir or not. Some test cases, and the bzr
plugin assumed it was relative to the srcdir. Most everything else
assumed it was absolute.

Changed it to relative, for consistency with the rest
of the rcs_ functions.
2010-06-23 19:32:53 -04:00
Joey Hess ecdfd1b864 rcs_commit and rcs_commit_staged api changes
Using named parameters for these is overdue. Passing the session in a
parameter instead of passing username and IP separately will later allow
storing other session info, like username or part of the email.

Note that these functions are not part of the exported API,
and the prototype change will catch (most) skew, so I am not changing
API versions. Any third-party plugins that call them will need updated
though.
2010-06-23 19:04:36 -04:00
Joey Hess caf7bcdda3 update for new rcs_commit_staged API
In the process, lost the commits from special usernames
when committing changed po files. Instead of trying to dummy up a session
object for the special username, I just don't pass one, and the commit will
appear to be from whatever user ikiwiki runs as.
2010-06-23 16:56:50 -04:00
Joey Hess 4292802ee5 stop using REMOTE_ADDR
Everywhere that REMOTE_ADDR was used, a session object is available, so
instead use its remote_addr method.

In IkiWiki::Receive, stop setting a dummy REMOTE_ADDR.

Note that it's possible for a session cookie to be obtained using one IP
address, and then used from another IP. In this case, the first IP will now
be used. I think that should be ok.
2010-06-23 16:35:51 -04:00
Joey Hess b4a43406f6 API: rcs_commit and rcs_commit_staged are passed a new parameter
that may contain the username component of the email address of
the user making the commit.
2010-06-23 16:05:49 -04:00
Joey Hess c46bcb425a Add new optional field usershort to rcs_recentchanges.
Now the git plugin supports commits with author fields that look like:
Author: http://my.openid/ <me@web>

Then in recentchanges, the short username will be displayed, linking
to the openid.

Particularly useful for the horrible google openids, of course.
2010-06-23 15:54:52 -04:00
Joey Hess 0580cbbf40 whitespace 2010-06-23 15:23:13 -04:00
Joey Hess 82789e39aa bugfix: record email-like links as page links
This way, an email-like link will be a mailto until a matching page
is created, then it will link to the page. And removing the page will
convert it back to a mailto.
2010-06-23 14:05:57 -04:00
Joey Hess 6e67219eff simplify anchor handling
At least two bugfixes in here. First, an old bug;
\[[foo#0]] was displayed as [[foo]], losing the anchor
as the anchor text was false. Secondly, a new bug;
an email like foo#bar@baz should not check bestlink("foo@baz").
2010-06-23 13:57:27 -04:00
Joey Hess 19dcd50c84 avoid needing full email regexp
Fully validating the email address is not necessary,
all that matters is not matching an url like http://foo@bar/
as an email address.
2010-06-23 13:40:10 -04:00
Bernd Zeimetz dd3274ce73 Enhance the link plugin to handle external links.
The following ways to create a link are supported now:
[[url]]
[[text|url]]
url can be one of the following:
- an internal wikilink: will be handled as before
- any other kind of URL, including mailto: proper links will be created:
  <a href="url">url</a>
  <a href="url">text</a>
- an email address:
  <a href="mailto:url">url</a>
  <a href="mailto:url">text</a>
2010-06-19 03:14:16 +02:00
Joey Hess 57e56828f5 store state to avoid needing to rebuild when changing theme 2010-06-18 16:40:47 -04:00
Joey Hess cfcc79ed4c needsbuild hook is passed an array ref 2010-06-18 16:15:57 -04:00
Joey Hess d5199424c5 avoid shelling 2010-06-18 12:50:31 -04:00
Joey Hess 2797a659db mercurial: Fix buggy getctime code.
The file passed to rcs_getctime is already absolute, and it was
trying to stick the srcdir on the front.

Also, eliminated potentially unsafe shelling.
2010-06-18 12:48:05 -04:00
Joey Hess cb4b999297 avoid dying if cannot chdir to an underlaydir 2010-06-17 16:54:03 -04:00
Joey Hess 184f68efa8 Merge branch 'themes' 2010-06-16 19:17:18 -04:00
Joey Hess eff5e233a2 force list context
run_or_die returns a status code in scalar context
2010-06-16 16:07:41 -04:00
Joey Hess 2f3f826b5b force rebuild for theme change
For now, a rebuild is the only way to ensure the changed theme is used.
Ikiwiki normally will not realize style.css has changed, since themes
tend to have the same timestamp for the file.
2010-06-16 15:44:21 -04:00
Joey Hess 062ed44f47 add theme plugin 2010-06-16 15:43:42 -04:00
Joey Hess a748f283ac Encode not used 2010-06-16 15:30:33 -04:00
Joey Hess 69c22fa1ea attachment: Support Windows paths when taking basename of client-supplied file name. 2010-06-16 13:23:32 -04:00
Joey Hess da2be6e85c git: Gix --gettime to properly support utf8 filenames.
In passing, fixed a bug where the srcdir was in a subdir of a repository
named "0".
2010-06-15 23:21:55 -04:00
Joey Hess 5f33532468 Make --gettime be honored after initial setup.
Bugfix in passing: New files not treated as such when no rcs is used.
2010-06-15 22:56:06 -04:00
Joey Hess a298959888 fix other cases of unicode mixing issue
and fix underlaydir override attack guard when srcdir is non-absolute
2010-06-15 17:41:26 -04:00
Joey Hess 86a43aefb4 Fix issues with combining unicode srcdirs and source files.
A short story:

  Once there was a unicode string, let's call him Srcdir.

  Along came a crufy old File::Find, who went through a tree and pasted each
  of the leaves in turn onto Srcdir. But this 90's relic didn't decode the
  leaves -- despite some of them using unicode! Poor Srcdir, with these
  leaves stuck on him, tainted them with his nice unicode-ness. They didn't
  look like leaves at all, but instead garbage.

(In other words, perl's unicode support sucks mightily, and drives
us all to drink and bad storytelling. But we knew that..)

So, srcdir is not normally flagged as unicode, because typically it's pure
ascii. And in that case, things work ok; File::Find finds filenames, which
are not yet decoded to unicode, and appends them to the srcdir, and then
decode_utf8 happily converts the whole thing.

But, if the srcdir does contain utf8 characters, that breaks. Or, if a Yaml
setup file is used, Yaml::Syck's implicitunicode sets the unicode flag of
*all* strings, even those containing only ascii. In either case, srcdir
has the unicode flag set; a non-decoded filename is appended, and the flag
remains set; and decode_utf8 sees the flag and does *nothing*. The result
is that the filename is not decoded, so looks valid and gets skipped.

File::Find only sticks the directory and filenames together in no_chdir
mode .. but we need that mode for security. In order to retain the
security, and avoid the problem, I made it not pass srcdir to File::Find.
Instead, chdir to the srcdir, and pass ".". Since "." is ascii, the problem
is avoided.

Note that chdir srcdir is safe because we check for symlinks in the srcdir
path.

Note that it takes care to chdir back to the starting location. Because
the user may have specified relative paths and so staying in the srcdir
might break. A relative path could even be specifed for an underlay dir, so
it chdirs back after each.
2010-06-15 17:13:46 -04:00
Joey Hess 69383fb6b0 Fix issues with combining unicode srcdirs and source files.
A short story:

  Once there was a unicode string, let's call him Srcdir.

  Along came a crufy old File::Find, who went through a tree and pasted each
  of the leaves in turn onto Srcdir. But this 90's relic didn't decode the
  leaves -- despite some of them using unicode! Poor Srcdir, with these
  leaves stuck on him, tainted them with his nice unicode-ness. They didn't
  look like leaves at all, but instead garbage.

In other words, perl's unicode support sucks mightily, and drives
us all to drink and bad storytelling. But we knew that..

So, srcdir is not normally flagged as unicode, because typically it's pure
ascii. And in that case, things work ok; File::Find finds filenames, which
are not yet decoded to unicode, and appends them to the srcdir, and then
decode_utf8 happily converts the whole thing.

But, if the srcdir does contain utf8 characters, that breaks. Or, if a Yaml
setup file is used, Yaml::Syck's implicitunicode sets the unicode flag of
*all* strings, even those containing only ascii. In either case, srcdir
has the unicode flag set; a non-decoded filename is appended, and
decode_utf8 sees the flag and does *nothing*. The result is that the
filename is not decoded, so looks valid and gets skipped.

File::Find only sticks the directory and filenames together in no_chdir
mode .. but we need that mode for security. In order to retain the
security, and avoid the problem, I made it not pass srcdir to File::Find.
Instead, chdir to the srcdir, and pass ".". Since "." is ascii, the problem
is avoided.

Note that it takes care to chdir back to the starting location. Because
the user may have specified relative paths and so staying in the srcdir
might break. A relative path could even be specifed for an underlay dir, so
it chdirs back after each.
2010-06-15 16:40:37 -04:00
Joey Hess d541cc854a calendar: Tune archive_pagespec to only match pages, not other files. 2010-06-15 13:38:19 -04:00
Joey Hess c0bc2d0839 editpage, comments: Fix broken links in sidebar (due to forcebaseurl). (Thanks, privat) 2010-06-14 14:34:52 -04:00
Joey Hess 9f7a118ffc more symetric enable/disable
Removing a plugin from add_plugins is not always enough to disable it.
It may have been redundantly added there and also pulled in via goodstuff.
Always add didabled plugins to disable_plugins.
2010-06-13 10:25:17 -04:00
Joey Hess 17592a951b websetup: Allow enabling plugins listed in disable_plugins.
The bug here was that disabling a plugin included thru goodstuff, like
htmlscrubber, caused it to be added to disable_plugins, and those plugins
were never loaded, so could not be re-enabled. Fix by allowing them to be
force loaded when appropriate. (Also that allows disabled plugins to still
record their setup options when dumping a setup file.)
2010-06-13 10:21:19 -04:00
Joey Hess c65658eeb5 attachment: When inserting links, insert img directives for images, if that plugin is enabled. 2010-06-12 23:00:30 -04:00
Joey Hess 35a0715b9a avoid ugly warning if size="" is specified 2010-06-12 22:59:46 -04:00
Joey Hess dccd764871 edittemplate: Look for template pages under templates/ like everything else (still looks in old location for backwards compatability). 2010-06-12 22:43:34 -04:00
Joey Hess c225cdad25 edittemplate: Make silent mode not disable display when the template page does not exist, so it can be easily created. 2010-06-12 22:20:22 -04:00
Joey Hess 31fa7714e7 editpage: Rename "comments" field to avoid CSS conflict with the comments div. 2010-06-12 18:10:33 -04:00
Joey Hess d7cfcef54a img: Support hspace and vspace attributes. 2010-06-12 16:43:24 -04:00
Joey Hess 9923f5db65 attachment: Show files from underlay in attachments list.
While those files cannot be removed or renamed, this allows easy
downloading of them, and a new version can after all be uploaded.
2010-06-12 14:29:56 -04:00
Joey Hess d5181a1977 realm is an url pattern 2010-06-11 14:14:20 -04:00
Joey Hess 475b4199e1 openid: Add openid_realm and openid_cgiurl configuration options, useful in a few edge case setups. 2010-06-11 13:53:56 -04:00
Joey Hess 04ff998c51 calendar styling
* calendar: Shorten day names, and improve styling of month calendar.
* style.css: Reduced sidebar width back to 20ex from 30; the month calendar
  will now fit in the smaller width, and 30 was feeling too large.
2010-06-10 15:07:28 -04:00
Joey Hess 1bdf98a4a0 let's allow comments of "0" 2010-06-09 17:47:49 -04:00
Joey Hess 24b59b3a9e editpage: Avoid storing accidental state changes when previewing pages.
This is a slow, safe, stupid approach. Could make deep copies of the data
structures as backups instead of re-loading the index from disk.
2010-06-09 17:44:40 -04:00
Joey Hess b2327cfae4 improve preview mode comments 2010-06-09 17:43:20 -04:00
Joey Hess e93cee3378 Fix display of sidebar when previewing page edit. (Thanks, privat)
On second thought, only display a page's personal sidebar when previewing
it, not when editing normally.
2010-06-09 16:59:17 -04:00
Joey Hess 95b45864de relativedate: Fix problem with localised dates not working. 2010-06-09 16:16:48 -04:00
Joey Hess e96cf38ecc When editing a page, show that page's sidebar. (Thanks, privat) 2010-06-09 16:00:12 -04:00
Joey Hess 0ccf21daaf img: Fill in missing height or width when scaling image. 2010-06-08 21:13:46 -04:00
Joey Hess 3d769f7849 fix uninitalized value warning 2010-05-21 18:03:21 -04:00
Joey Hess 6472302b8d disable warnings when evaling setup files
In particular, perl warns if a qw{} contains a #, but openids can.

If the setup file has 'use warnings', it will turn warning messages back
on, so it seems reasonable to squelch them by default.
2010-05-21 13:39:07 -04:00
Joey Hess 14de1d87ef Fix a typo in the last release. 2010-05-18 14:16:58 -04:00
Joey Hess baaa176b9b simplify example
I've seen user(http://*) confuse someone who didn't know pagespecs to think
that just http://* would moderate all comments to every page, or something
like that.
2010-05-18 13:36:51 -04:00
Joey Hess 7aa209f1ce Fix a bug that prevented matching deleted comments, and so did not update pages that had contained them.
Problem is that by the time rendering calls render_dependent, %pagesources
has had deleted files removed from it. So match_comment's lookup of
files in there to see if they had the _comment extension failed.

I had to introduce a hash that temporarily holds filenames of deleted pages
to fix this.

Note that unlike comment(), internal() had avoided this pitfall by being
defined to match both internal and non-internal pages.
2010-05-18 13:32:28 -04:00
Joey Hess facc77e109 force scalar context 2010-05-17 17:06:13 -04:00
Joey Hess 8e77dc1c9c fix typo 2010-05-15 23:54:00 -04:00
Joey Hess ff67a31db5 Revert "avoid showing comment post stuff on dynamic pages"
This reverts commit 4a6d5330e5.

That was too ugly, the DYNAMIC test on page.tmpl will avoid the problem
anyway -- just needs to be added.
2010-05-15 22:38:59 -04:00
Joey Hess 4a6d5330e5 avoid showing comment post stuff on dynamic pages
If the site is configured to allow comments on *, then the comment post
interface was being added to cgi pages like signin and prefs. This fixes it
w/o requiring more page.tmpl changes. The pagetemplate hook is called by
misctemplate with an empty page name for dynamic pages.
2010-05-15 22:28:07 -04:00
Joey Hess c8b34aa31c allow misctemplate callers to pass params to suppress actions etc
Suppress disiplay of small search for on search results page, and of
Prefrences link on prefs page.
2010-05-14 21:45:54 -04:00
Joey Hess 4c6fa6413f avoid showing redundant search box on search results page 2010-05-14 21:42:48 -04:00
Joey Hess f69c072d8a better misctemplate splitting sequence 2010-05-14 21:40:30 -04:00
Joey Hess 3dd98a3b3f put back recentchangesurl
On second thought, misctemplate can use pagetemplate hooks to provide
it, so it's better to keep back-compat, and allow full customisation
of how it's displayed via the template.
2010-05-14 20:38:08 -04:00
Joey Hess d80a649073 bugfix 2010-05-14 20:29:16 -04:00
Joey Hess bbe971881a refactor template actions 2010-05-14 20:20:41 -04:00
Joey Hess 377e82b16c we want the recentchanges link to be the first floating action 2010-05-14 20:10:18 -04:00
Joey Hess 5a4c95cc35 enable action bar on misctemplates
So RecentChanges shows on the action bar there,
convert recentchanges to use new pageactions hook,
with compatability code to avoid breaking old templates.
2010-05-14 20:04:02 -04:00
Joey Hess 8ff761afa2 remove, rename: Add guards against XSRF attacks. 2010-05-14 14:21:45 -04:00
Joey Hess 031da9c134 po: guard against reimportation
If po is imported twice, bad things happen. Guard against that.

I'm not sure what causes the double import; I saw it when websetup did a
wiki rebuild. Carp failed to show a backtrace for the second call to
import.
2010-05-13 16:28:09 -04:00
Joey Hess bc0aa4d40e Use xhtml friendly pubdate setting. 2010-05-08 19:45:02 -04:00
Joey Hess c3e9215e1f moved non-openid signin form into same page as openid selector; show/hide as buttons are pressed 2010-05-08 15:57:39 -04:00
Joey Hess d0c17a4a46 calendar: Display year name in title of month calendar.
Also, fix relative month calculations.
2010-05-08 13:51:05 -04:00
Joey Hess fd817f9ac3 calendar: nextchange calculation bugfix
If a page had multiple calendars, the last one won and set nextchange.
That's wrong; the calendar that needs to next update soonest should win.
2010-05-08 12:52:19 -04:00
Joey Hess 0f778849c6 calendar: Allow negative month to be specified. -1 is last month, etc. (And also negaitve years.) 2010-05-08 12:45:21 -04:00
Joey Hess 937b24e0cf Merge branch 'master' into commentreorg 2010-05-07 22:30:42 -04:00
Joey Hess b8dcaf91d0 scale display form to match openid size 2010-05-07 21:48:50 -04:00
Joey Hess 8f6cfbfade Removed the openidsignup option. 2010-05-07 21:33:27 -04:00
Joey Hess 1e75389a85 bugfix
Always load IkiWiki::CGI so its cgi_signin is present, so we replace it.
2010-05-07 21:28:59 -04:00
Joey Hess dc0d48459c bugfix 2010-05-07 21:27:02 -04:00
Joey Hess c1e365abdc remove loginlabel, not used 2010-05-07 21:20:21 -04:00
Joey Hess f8c2a67b3c pretty openid login
* openid: Incorporated a fancy openid-selector signin form.
  (http://code.google.com/p/openid-selector/)
* openid: Use "openid_identifier" as the form field, as required
  by OpenID Authentication v2.0 spec.
2010-05-07 20:14:25 -04:00
Joey Hess 378c647768 patch hidden field setting code
Fixes http://code.google.com/p/openid-selector/issues/detail?id=11#c3
2010-05-07 19:10:50 -04:00
Joey Hess 2ee820dedd avoid linking directly to ikiwiki.cgi?do=signin
Instead, add a custom do=commentsignin, that calls cgi_signin.

This allows a plugin to inject a custom cgi_signin, that uses a different
do= parameter, and have it be used consitently. (This was the only
place to hardcode a link to do=signin.)
2010-05-07 17:11:23 -04:00
Joey Hess b50b549cab fix comment matching pagespecs
test isinternal first, because match_glob with internal => 1 also returns
non-internal pages that match. This order should also be faster.

Remove test to see if pagesources is set. isinternal will not succeed if it
is not.
2010-05-07 14:02:30 -04:00
Joey Hess fe8f4a7781 better wording 2010-05-07 13:55:08 -04:00
Joey Hess 2dfdadf10c bugfix 2010-05-07 13:47:29 -04:00
Joey Hess 8d3c89f0c7 bugfixes 2010-05-07 13:44:24 -04:00
Joey Hess be0c2df6db check that pagesources exists before testing 2010-05-07 13:28:14 -04:00
Joey Hess 8cd216d748 fix match_comment 2010-05-07 12:55:34 -04:00
Joey Hess 5e6ed10583 nasty update to ugly hack to allow comment() pagespecs to work 2010-05-07 12:43:51 -04:00
Joey Hess 3adb47ec4f Merge branch 'master' into commentreorg
Conflicts:
	debian/changelog
2010-05-07 12:42:38 -04:00
Joey Hess 915d9281db call delete hook even if only internal pages are deleted 2010-05-07 00:26:59 -04:00
Joey Hess 1678604fe3 avoid redir loop when going to an internal page that has no permalink 2010-05-07 00:22:05 -04:00
Joey Hess 575080d6ef respect permalinks 2010-05-06 23:28:40 -04:00
Joey Hess 14826ad927 Delete hooks are passed deleted internal pages.
Necessary so search can remove its indexes for internal pages.
But also, it seems it was an omission not to pass the deleted
pages before.
2010-05-06 23:25:27 -04:00
Joey Hess ea4967f184 inline: Call indexhtml when inlining internal pages, so their text can be indexed for searching. 2010-05-06 23:20:48 -04:00
Joey Hess 121e2ffc2f Renamed postscan hook to indexhtml, to reflect its changed position.
Probably only the search plugin uses it, so this seemed safe.
2010-05-06 23:14:36 -04:00
Joey Hess 4c320176c0 simplify formbuilder stylesheet specification
Since all forms are wrapped in a template that defines the actual
stylesheets, formbuilder just has to be told to turn on stylesheet mode,
not what file is the style sheet.
2010-05-06 22:27:12 -04:00
Joey Hess d3aaf6e01f fix pagediff to not display as "preview"
I think originally, the page preview header was not displayed,
so diff was hacked in using it.
2010-05-06 22:19:14 -04:00
Joey Hess d9d910f676 moved comments pending moderation
* comments: Comments pending moderation are now stored in the srcdir
  alongside accepted comments, but with a `._comment_pending` extension.
* This allows easier byhand moderation, as the "_pending" need
  only be stripped off and the comment be committed to version control.
* The `comment_pending()` pagespec can be used to match such unmoderated
  comments, which makes it easy to add a feed of them, or a counter
  indicating how many there are.
* Belatedly added a `comment()` pagespec.
2010-05-06 20:05:53 -04:00
Joey Hess cb2025af45 refactor 2010-05-05 22:41:23 -04:00
Joey Hess ee9a4e06fc rename ispage variable 2010-05-05 22:36:50 -04:00
Joey Hess 1193759568 remove unused indexlink function and template variable 2010-05-05 20:42:56 -04:00
Joey Hess 66c787658e remove unused 2010-05-05 18:53:03 -04:00
Joey Hess 8aa5f2d23e add ISPAGE variable to page.tmpl
Plugins will also be able to use this to tell if the template
is being used to generate a wiki page, when misctemplate starts
also using page.tmpl.
2010-05-05 18:17:25 -04:00
Joey Hess d0a5945000 Fixes a bug in skipping of illegal source files introduced in 3.20100427. 2010-05-04 20:26:17 -04:00
Joey Hess 76a5dbe7cb note that tcc workaround is for bug fixed in tcc now 2010-05-04 18:41:55 -04:00
Joey Hess ab575a4b69 graphviz: Fix display of preexisting images in preview mode. 2010-05-04 16:54:58 -04:00
Joey Hess 9699f16b51 websetup: Only display Setup button on admins' preferences page.
Renamed it from "Wiki Setup" to just "Setup" for good measure.
2010-05-03 13:59:43 -04:00
Joey Hess 0fc32c8b2f allow do=setup to log a user in if necessary 2010-05-03 13:46:52 -04:00
Joey Hess 2f22ee85e5 Add ACTIONS variable to page.tmpl, which allows plugins to add arbitrary links to the action bar without modifying the template further.
(COMMENTSLINK and DISCUSSIONLINK could be folded into this, but are kept
separate for now to avoid breaking modified templates.)
2010-05-03 12:46:52 -04:00
Joey Hess adf182669d add a missing space 2010-05-02 22:43:55 -04:00
Joey Hess 154732dc42 adapt comment.tmpl to html5
Note that I put comment-header in a <header> despite it being
below the comment. Using a <footer> would be confusing given
the class name. Also, the content is semantically closer to
a header than a footer.
2010-05-02 16:12:08 -04:00
Joey Hess 932fc0c25f use a div, not a p .. and in html5, a nav 2010-05-02 14:41:20 -04:00
Joey Hess b21df5029b Add placeholder text in search form (in html5 mode only). 2010-05-02 13:49:56 -04:00
Joey Hess 970373548f Add parameter to displaytime to specify that it is a pubdate, and in html5 mode, use time tag. 2010-05-02 13:44:13 -04:00
Joey Hess a547d26858 html5 option
* Ikiwiki can be configured to generate html5 instead of the default xhtml
  1.0. The html5 output mode is experimental, not yet fully standards
  compliant, and will be subject to rapid change.
2010-05-01 20:49:18 -04:00
Joey Hess ccafb10007 enable hidden attribute 2010-05-01 19:59:16 -04:00
Joey Hess 790a339db1 htmlscrubber: Also allow some other html5 tags: canvas, progress, meter, ruby, rt, rp, details, summary. 2010-05-01 19:28:28 -04:00
Joey Hess f1e2d0af12 more html5 attributes 2010-05-01 19:11:03 -04:00
Joey Hess 78cee5140a add rest of html5 form attributes
It's easy to imagine pattern being used to freeze or crash browsers, if
they implement it stupidly. Let's hope not..
2010-05-01 18:44:37 -04:00
Joey Hess 80f9a2a087 add figure and figcaption 2010-05-01 18:31:33 -04:00
Joey Hess 0a139aba82 htmlscrubber: Allow the html5 form attributes: placeholder autofocus, min, max, step. 2010-05-01 18:27:53 -04:00
Joey Hess 442bc59a15 htmlscrubber: Allow the placeholder attribute. 2010-05-01 18:14:50 -04:00
Joey Hess 73c8209484 more html5
* htmlscrubber: Also allow html5 canvas tags.
* htmlscrubber: Round out html5 video support with the preload
  attribute and the source tag.
2010-05-01 17:56:35 -04:00
Joey Hess 80f2042464 htmlscrubber: Allow html5 semantic tags: section nav article aside hgroup header footer time mark 2010-05-01 16:34:47 -04:00
Joey Hess 0e7a3640ae template: Fix typo. 2010-04-27 12:10:58 -04:00
Joey Hess 194824ce29 loop on pagesources, not ctime 2010-04-26 18:32:06 -04:00
Joey Hess 97b0c6e455 Fix removal of rendered files in rebuild mode.
Needed to handle the move of the .js files into ikiwiki/, but also this is
a longstanding bug.

Old pagemtime is not remembered in rebuild mode, and changing that would
need a lot of changes. So instead, loop on pagectime, which is remembered.

Change to remembering old pagesources info in rebuild mode. This seems safe
enough.
2010-04-26 17:14:03 -04:00
Joey Hess 7f3047f67c added match_guid function to meta plugin
(cherry picked from commit 8b6fde73669ddf9204acb3d334c3984566f3c59d)

Conflicts:

	IkiWiki/Plugin/meta.pm
2010-04-26 13:47:01 -04:00
Joey Hess e05c9653ef rebuild on template removal 2010-04-24 21:13:53 -04:00
Joey Hess a1575b0c83 bugfixes 2010-04-24 20:41:35 -04:00
Joey Hess ca9c6cc254 add support for mass dependencies
Registered by passing "" as page name to add_depends.
2010-04-24 20:22:20 -04:00
Joey Hess 4321b30139 Merge branch 'master' into templatemove 2010-04-24 16:46:30 -04:00
Joey Hess cce3042457 po: fix some uninitalized value warnings when used by websetup 2010-04-24 16:44:45 -04:00
Joey Hess c2656f08f3 template() - return params in list context
I forgot CGI::Formbuilder's horrible interface that needs template
parameters instead of a constructed object.
2010-04-24 16:15:47 -04:00
Joey Hess df012e54c7 chomp template values
Before the template reorg, this was done by a template filter.
2010-04-24 01:13:58 -04:00
Joey Hess 998f47ed13 Merge branch 'master' into templatemove 2010-04-24 00:55:09 -04:00
Joey Hess e90d67d3c9 Moved javascript files under the ikiwiki/ directory, to avoid cluttering the top of the web root. This is another things that requires a wiki rebuild on upgrade to this version. 2010-04-24 00:54:59 -04:00
Joey Hess 6486452e4c special case for page.tmpl dependency handling
Rather than wasting resources recording that every page depends on
page.tmpl, add a special case. The special case curretly rebuilds non-page
files too when page.tmpl changes, but that's minor.
2010-04-23 16:41:07 -04:00
Joey Hess 0e68f76a9a update 2010-04-23 15:23:34 -04:00
Joey Hess d1cc7e81c8 use template() rather than rolling it by hand 2010-04-23 15:11:25 -04:00
Joey Hess ee8d237f98 improved error message 2010-04-23 14:50:00 -04:00
Joey Hess 753bfb17a0 switch to using template_depends
It now handles all the details of finding a page template that this used to
need to implement.
2010-04-23 14:45:48 -04:00
Joey Hess d4d7d5ddaf use same error string as template.pm does 2010-04-23 14:45:02 -04:00
Joey Hess 011d88052d fix logic 2010-04-23 14:00:53 -04:00
Joey Hess abd2339312 look for templates in srcdir and underlays, first
This entailed changing template_params; it no longer takes the template
filename as its first parameter.

Add template_depends to api and replace calls to template() with
template_depends() in appropriate places, where a dependency should be
added on the template.

Other plugins don't use template(), so will need further work.

Also, includes are disabled for security. Enabling includes only when using
templates from the templatedir would be nice, but would add a lot of
complexity to the implementation.
2010-04-22 15:55:58 -04:00
Joey Hess 23d62f42bd remove add_templates option
Templates are moving into the srcdir, and will also be searched for in
configured underlays, so this is redundant.
2010-04-22 14:35:00 -04:00
Joey Hess 3ee571390e Merge branch 'autotag' 2010-04-22 00:34:03 -04:00
Joey Hess bc6d602609 add influence info for failed metadata matches
This is needed so that when a negated pagespec like "!author(foo)"
stops matching, due to the page being changed, ikiwiki knows that
the match was influenced by the page content.
2010-04-22 00:10:13 -04:00
Joey Hess d048e9c64a turn on tag_autocreate by default if tagbase is set 2010-04-21 20:39:20 -04:00
Joey Hess 20052f8882 Merge branch 'master' into autotag
Conflicts:
	IkiWiki/Plugin/tag.pm
2010-04-21 20:19:06 -04:00
Joey Hess 129cd00bdb remove broken ./tag support
The commit that added the (working) support for using /tag to override
tagbase also tried to make ./tag work. Problem is, tags are links,
and ./foo is not a valid link (though I think there's a wishlist about it).

So, using ./tag really resulted in tag creation links that led to a
"bad page name" error. And even if the tag were created in the right place,
the link didn't go to it.
2010-04-21 20:15:11 -04:00
Joey Hess 752ccf8b48 fixes 2010-04-21 20:08:23 -04:00
Joey Hess 0e2b5ebe31 clarify 2010-04-21 19:49:11 -04:00
Joey Hess 789e68a8b1 Merge branch 'master' into autotag
Conflicts:
	IkiWiki/Plugin/tag.pm
2010-04-21 19:47:38 -04:00
Joey Hess 77779dc4a0 pass pagespec parameters along from match_tagged 2010-04-21 19:46:27 -04:00
Joey Hess 1a09cddd39 fix false positive in link_types_changed
loadindex does not bother populating oldtypedlinks if there is no link
type. However, the code in link_types_changed assumed that if oldtypedlinks
is not defined, and typedlinks is, they must differ.
2010-04-21 19:42:00 -04:00
Joey Hess 8cde2365e4 add separate template variable for tag page and sanitize displayed tag name 2010-04-21 19:13:03 -04:00
Joey Hess 167964b686 remember autofiles that were tried and failed to be added
This way, if an autofile is registered for a file that already exists,
it is remembered that it was tried, and it doesn't get recreated when
removed.
2010-04-21 16:41:36 -04:00
Joey Hess fd6fb4c507 commit autocreated tag pages 2010-04-21 16:13:37 -04:00
Joey Hess a71b92ed5c remember autofiles always
This fixes the problem that it did not remember if an autofile is deleted,
unless a plugin happened to register the autofile at the same time.

With the new code, we just never recreate an autofile more than once.

Only downside is that the list of autofiles is never pruned either.
And I don't really see a way to prune it.
2010-04-21 15:59:39 -04:00
Joey Hess 2a0e3787a0 bugfixes 2010-04-21 15:54:18 -04:00
Joey Hess 034b4e8266 remove verify_src_file
Splitting out this function bothered me. It is conceptially similar to
file_pruned, and yet also very specific to exactly the security needs of
find_src_files.

I liked that it got rid of duplicate code in the latter function. So
instead, put a helper sub in that, which I think allows refactoring
things more cleanly, and with less boilerplate.

As to the needs of gen_autofile, I'm not convinced this needs to handle
the same set of problems that verify_src_file did. So I sat down and
wrote a custom validator for autofiles, which turned out to seem to just
need three things: Make sure the candidate filename is not something
that would be pruned; untaint the candidate filename; and make sure that
srcdir doesn't already have something with its name. (Plus, of course,
all the other checks that were already in gen_autofile.)

(In passing, also fixed a bunch of bugs I had introduced in this branch.)
2010-04-21 15:05:59 -04:00
Joey Hess 34e8c78c1c Merge branch 'master' into autotag 2010-04-20 18:19:00 -04:00
Joey Hess 64946f9198 Merge branch 'file_pruned_revamp' 2010-04-20 18:18:39 -04:00
Joey Hess 511f7f9cb9 bugfix
So this is the one place that does need to canonpath and compare,
as two argument file_pruned used to.
2010-04-20 18:16:40 -04:00
Joey Hess d578f3ff78 darcs: ensure whole darcs query manifest output is consumed
By a stroke of luck, after a long & full day, I happened to
remember that in the morning, I had seen someone on irc mention
that darcs query manifest doesn't like it if its full output
is not consumed.

So contrary to the usual case where bug reports sent via irc are like
messages written in sand before the new tide, this one was seen and
fixed.

(But use http://ikiwiki.info/bugs/ next time!)
2010-04-20 17:49:00 -04:00
Joey Hess bfca8345ea bugfix
Avoid file_pruned triggering on absolute paths causing the whole
comments_pending directory being pruned.

Simplify code.
2010-04-20 17:42:36 -04:00
Joey Hess 808a4249fc Merge branch 'master' into file_pruned_revamp 2010-04-20 17:26:40 -04:00
Joey Hess 93cf1db7b9 fix uninitialized value warning
$cgi->params('do') may not be defined. The CSRF code may delete all
cgi params. This uninitalized value was introduced when do=register
support was added recently.
2010-04-20 17:21:50 -04:00
Joey Hess 81eae1a531 typo 2010-04-20 14:25:17 -04:00
Joey Hess 59bb1f1db3 fix stat to use unmunged filename 2010-04-20 14:23:48 -04:00
Joey Hess 1f56dead00 oops, fix for no_chdir mode
$_ will be absolute then
2010-04-20 14:21:31 -04:00
Joey Hess 6d063a6698 switch to 1 parameter version of file_pruned
Another bit of code that didn't realize that File::Find sets $_ to the
relative filename.
2010-04-20 14:06:00 -04:00
Joey Hess 230a8b22a4 remove explicit absolute test
file_pruned now tests for that
2010-04-20 13:59:17 -04:00
Joey Hess 5d3f787729 use one parameter form of file_pruned here too
In File::Find, $_ is relative to the current directory, so that is ok.
Also, the directory name doesn't need to be stripped from $_.
2010-04-20 13:54:24 -04:00
Joey Hess 7a92c0aa4a clarify why absolute is tested & stripped here
file_prune also fails on absolute filenames now
2010-04-20 13:49:46 -04:00
Joey Hess ca33969823 Merge branch 'master' into file_pruned_revamp 2010-04-20 13:43:21 -04:00
Joey Hess d1a1f3ad21 fix minor bug if a page's name is "0" 2010-04-20 01:54:42 -04:00
Joey Hess 1239fa55d5 no need to return content from postscan hook 2010-04-20 00:07:41 -04:00
Joey Hess de6167a3b0 change wording
This is more accurate when a file that is not a page is what is removed.
2010-04-19 23:48:24 -04:00
Joey Hess 2111bf0408 move message into if block 2010-04-19 22:14:22 -04:00
Joey Hess a97964688b unfinished file_prune revamp
Many calls to file_prune were incorrectly calling it with 2 parameters.
In cases where the filename being checked is relative to the srcdir,
that is not needed.

Made absolute filenames be pruned. (This won't work for the 2 parameter call
style.)
2010-04-17 19:05:40 -04:00
Joey Hess 831b891abd move File::Find control back into its code blocks
Ok, this is longer, but features less scary action at a distance.
2010-04-17 16:14:15 -04:00
Joey Hess f78e6798aa move decode_utf8 closer to reason for it
Filenames need to be decoded, as File::Find does not provide them in
decoded form, but other callers of verify_src_file will be using utf8.
2010-04-17 16:08:37 -04:00
Joey Hess 2fc342b048 fix autotag behavior for relative tags
A tag like ./foo is searched for relative to the tagging page.
However, if multiple pages use such a tag, the only one sure
to be in common is in the root, so autocreate it there to
avoid scattering redunadant autocreated tags around the tree.

(This is probably not ideal.)

Also renamed the tagpage and taglink functions for clarity.
2010-04-17 16:01:41 -04:00
Joey Hess b00d8771cc call gentag for taglinks too 2010-04-17 15:48:00 -04:00
Joey Hess 3651e6263c fix autofile call 2010-04-17 15:43:58 -04:00
Joey Hess adc196a8b5 tag_autocreate fixups
Fix style of prompt.
Optional to rebuild when it is changed. (Needed to get new all missing tags)
2010-04-17 15:41:45 -04:00
Joey Hess 2f9504a10d bzr: changelog and refactor 2010-04-17 13:55:38 -04:00
Jelmer Vernooij 9ff5174f11 Fix get_ctime implementation in Bazaar plugin, add get_mtime implementation. 2010-04-17 13:52:16 -04:00
Joey Hess b7d50abc0f refactor autofiles
Made add_autofile take a generator function, and just register the
autofile, for later possible creation. The testing is moved into Render,
which allows cleaning up some stuff.
2010-04-17 13:35:15 -04:00
Joey Hess 2269a4c74b whitespace 2010-04-17 13:05:04 -04:00
Joey Hess 54f600af14 Merge remote branch 'davrieb/autotag' into autotag
Conflicts:
	IkiWiki.pm
	IkiWiki/Plugin/tag.pm
2010-04-17 12:50:23 -04:00
Joey Hess c769a33392 autoindex: Switch to using %wikistate instead of abusing $pagestate{index}. 2010-04-17 12:20:50 -04:00
Joey Hess 9265ce85b6 squelch warning 2010-04-16 19:23:11 -04:00
Joey Hess b13bb0c83c implement rcs_getmtime for svn
This is a slow implementation; it runs svn log once per file
still, rather than running svn log once on the whole srcdir.

I did it this way because in my experience, svn log, run on a directory,
does not always list every change to files inside that directory.
I don't know why, and I use svn as little as possible these days.
2010-04-16 18:46:20 -04:00
Joey Hess dee2940c0b automatically run --gettime, and optimise it for git
* Automatically run --gettime the first time ikiwiki is run on
  a given srcdir.
* Optimise --gettime for git, so it's appropriatly screamingly
  fast. (This could be done for other backends too.)
* However, --gettime for git no longer follows renames.
* Use above to fix up timestamps on docwiki, as well as ensure that
  timestamps on basewiki files shipped in the deb are sane.
2010-04-16 18:30:56 -04:00
Joey Hess b14f84c4ac --gettime revamp
* Rename --getctime to --gettime. (The old name still works for
  backwards compatability.)
* --gettime now also looks up last modification time.
* Add rcs_getmtime to plugin API; currently only implemented
  for git.
2010-04-16 17:02:29 -04:00
Joey Hess dd64c2a9c0 sidebar plugin optimisations
The pagetemplate hook may be called multiple times, for example when pages
are inlined into a page. Sidebars were being calculated each time that
happened, only to be thrown away when the final pagetemplate hook was
called. Avoid this unnecessary work.

Remove stored sidebar content on use to save some memory.
2010-04-15 22:18:56 -04:00
Joey Hess 142e025ae4 calendar: Improved display of arrows. 2010-04-15 20:12:03 -04:00
Joey Hess 50d08bc2ae conditional: Fix bug that forced "all" mode off by default.
Commit b7351daacd introduced the bug.
2010-04-15 18:18:48 -04:00
Joey Hess 4c6f5a48bc fix sidebar directive parameter handling 2010-04-15 17:50:43 -04:00
Joey Hess d63e043f0a allow sidebar directive to enable use of sidebar page
This way, the example blog always has a sidebar on the index page,
but not the overhead of sidebars on all the other pages. And if a
user wants to, they can enable global_sidebars to switch to sidebars on
every page.
2010-04-15 17:38:13 -04:00
Joey Hess 1f7175e891 sidebar: Add global_sidebars setting. 2010-04-15 17:31:50 -04:00
Joey Hess 358fa953e1 sidebar: Now a sidebar directive can be used to override the sidebar shown on a page. 2010-04-15 16:51:27 -04:00
Joey Hess 1fbc1b518a disable feeds in raw mode 2010-04-15 15:41:56 -04:00
Joey Hess 691dab0306 typo 2010-04-15 14:45:03 -04:00
Joey Hess fe733e2a42 enhance pagestats and rework example blog front page
* pagestats: Class parameter can be used to override default class for
  custom styling.
* pagestats: Use style=list to get a list of tags, scaled by use like
  in a tag cloud. This is useful to put in a sidebar.
* Rework example blog front page.
2010-04-15 14:29:14 -04:00
Joey Hess 3131433f64 calendar: Add archive_pagespec, which is used by ikiwiki-calendar to specify which pages to include on the calendar archive pages. (The pagespec can still also be specified on the ikiwiki-calendar command line.) 2010-04-15 13:40:53 -04:00
Joey Hess d5eb540149 po: Configuring the same language as master and slave confuses processing; so filter out such a misconfiguration. 2010-04-10 18:28:15 -04:00
Joey Hess 002d9e3cb5 Merge remote branch 'smcv/unescaped-meta'
Conflicts:
	IkiWiki/Plugin/meta.pm
2010-04-10 14:33:51 -04:00
Joey Hess d1a616df2e po: Check that translated underlay directories exist before using them for master language. 2010-04-09 18:43:25 -04:00
Joey Hess 153c0ff13b minor style etc changes 2010-04-06 23:29:18 -04:00
Joey Hess ffb0802c4a don't force a rebuild
Rebuild can be needed sometimes, but not always, so undef.
2010-04-06 23:15:39 -04:00
Joey Hess bab8fec524 Merge remote branch 'smcv/ready/sort-package'
Conflicts:
	debian/NEWS
2010-04-06 23:15:33 -04:00
Joey Hess f6fd7639da Merge remote branch 'smcv/ready/link-types' 2010-04-06 22:50:19 -04:00
Simon McVittie 5408279b5f HTML-encode meta title, description, guid on output, but not in the pagestate
This makes them consistent with the rest of the meta keys. A wiki rebuild
will be needed on upgrade to this version; until the wiki is rebuilt,
double-escaping will occur in the titles of pages that have not changed.
2010-04-06 01:31:38 +01:00
Simon McVittie a2dc8c9373 Only store authorsort in meta pagestate if it differs from author 2010-04-06 00:59:16 +01:00
Simon McVittie be1d97c0bd Only store titlesort in meta pagestate if it differs from title 2010-04-06 00:58:55 +01:00
Simon McVittie cb8b2f80b2 Use $a and $b for SortSpec cmp callbacks 2010-04-05 22:50:51 +01:00
Joey Hess a01028ae81 txt: Add a special case for robots.txt. 2010-04-05 17:02:10 -04:00
Joey Hess 09d4e9d6bb comments: Fix missing entity encoding in title.
The meta title data set by comments needs to be encoded the same way that
meta encodes it. (NB The security implications of the missing encoding
are small.)

Note that meta's encoding of title, description, and guid data, and not
other data, is probably a special case that should be removed. Instead,
these values should be encoded when used. I have avoided doing so here
because that would mean forcing a wiki rebuild on upgrade to have the data
consitently encoded.
2010-04-05 16:34:49 -04:00
Joey Hess b4a162dec2 fix test suite 2010-04-04 17:06:28 -04:00
Joey Hess c9af069b59 more idiomatic perl 2010-04-04 12:23:12 -04:00
Joey Hess 2a15f94159 rename hash and avoid unnecessary hash ref
Variable renamed to be a bit more self-explanatory.
Probably more idiomatic perl to not use a hash ref when a hash can be used.
2010-04-04 12:20:26 -04:00
Joey Hess f206035a3a fix indentation & whitespace 2010-04-04 12:17:03 -04:00
Lars Wirzenius 75afa94c36 Fix bzr plugin to work with bzr 2.0.
The output of "bzr log" seems to have changed a bit, so we change the
parsing accordingly. This has not been tested with earlier versions of
bzr.

Several problems seemed to occur, all in the bzr_log subroutine:

1. The @infos list would contain an empty hash, which would confuse the
   rest of the program.
2. This was because bzr_log would push an empty anonymous hash to the
   list whenever it thought a new record would start.
3. However, a new record marker (now?) also happens at th end of bzr log
   output.
4. Now we collect the record to a hash that gets pushed to the list only
   if it is not empty.
5. Also, sometimes bzr log outputs "revno: 1234 [merge]", so we catch only
   the revision number.
6. Finally, there may be non-headers at the of the output, so we ignore
   those.
2010-04-04 12:15:38 -04:00
Simon McVittie 490f95616a Rename sort parameter to meta title/author to sortas=bar
Joey pointed out that sort=x usually takes a sort order.
2010-04-04 01:43:02 +01:00
Simon McVittie 618bbaee38 meta: generalize meta_title into meta(title); support author, updated, date
I've left meta_title in, undocumented, as a possible replacement for
sort=title in IkiWiki 4.0 or something.
2010-04-04 01:43:02 +01:00
Simon McVittie ef63441440 Remove tagged_is_strict option, and just behave as though it was enabled
Jon was worried about the backwards-compatibility break involved in making
tagged() not match non-tag links, but Joey seems less concerned about it.
2010-04-04 00:43:58 +01:00
Simon McVittie f127857676 Fix some typos that would break Render during changed-link calculation 2010-04-04 00:43:48 +01:00
Simon McVittie c1a42e76bc implement typed links; add tagged_is_strict config option 2010-04-04 00:43:48 +01:00
David Riebenbauer 981400177d Make sure deleted tag pages don't get recreated.
The reason to do this is basically a user interaction design decision.

It is achieved by adding an entry, associated to the creating plugin, to
%pagestate. To find out if files were deleted a new global hash %del_hash is
%introduced.
2010-04-03 22:20:48 +02:00
David Riebenbauer 628a52a6c4 Revert "Revert the effects of find_del_files() for (re)autoadded files."
This reverts commit 31680111f0062f07727d14fcf291c98978ad5a2f.
2010-04-03 22:20:48 +02:00