Commit Graph

2165 Commits (beae7ef9db01ab2af75d3176b016113c9d33f0a9)

Author SHA1 Message Date
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 8cde2365e4 add separate template variable for tag page and sanitize displayed tag name 2010-04-21 19:13:03 -04:00
Joey Hess fd6fb4c507 commit autocreated tag pages 2010-04-21 16:13:37 -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 1239fa55d5 no need to return content from postscan hook 2010-04-20 00:07:41 -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 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 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 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 a358d74bef Check for existence off srcfile in add_autofile
add_autofile has to have checks, whether to create the file, anyway, so this
will make things more consistent.

Correcter check for the result of verify_src_file().

Cosmetic rename of a variable $addfile to $autofile.
2010-04-03 22:20:48 +02:00
Simon McVittie 04a59b3c65 Move sort hooks to the IkiWiki::SortSpec namespace
Also rename cmpspec_translate (internal function) to sortspec_translate
for consistency.
2010-04-03 14:28:21 +01:00
Simon McVittie a875ee8be7 Split out sortnaturally into a plugin 2010-04-03 14:28:21 +01:00
Joey Hess f7a2a4b4d4 qualify template_file 2010-04-02 16:55:29 -04:00
Joey Hess 59ba938822 template: Search for templates in the templatedir, if they are not found as pages in the wiki. 2010-04-02 16:54:06 -04:00
Joey Hess 104919ee07 htmlscrubber: Allow colons in url fragments after '?'
Colons are not allowed at the start of urls, because it can be interpreted
as a protocol, and allowing arbitrary protocols can be unsafe
(CVE-2008-0809). However, this check was too restrictive, not allowing
use of eg, "video.ogv?t=0:03:00/0:04:00" to seek to a given place in a
video, or "somecgi?foo=bar:baz" to pass parameters with colons.

It's still not allowed to have a filename with a colon in it (ie
"foo:bar.png") -- to link to such a file, a fully qualified url must be
used.
2010-04-02 16:05:14 -04:00
Joey Hess 243b0dd082 fix the other half of the filecheck filename bug 2010-03-26 00:16:21 -04:00
Simon McVittie b86276ffed Reimplement extensible sorting mechanisms, in the same way as pagespecs 2010-03-25 23:31:53 +00:00
Joey Hess 3d671ea8c1 filecheck: Fix bug that prevented the pagespecs from matching when not called by attachment plugin. 2010-03-25 14:39:09 -04:00
Joey Hess baa07e0b52 remove a few leftover manual folding indicators 2010-03-25 14:23:16 -04:00
Joey Hess a76206d480 fix back-compat with old Net::OpenID
Debian stable's Net::OpenID does not support getting extension fields.
2010-03-24 15:32:35 -04:00
Simon McVittie b0ae19872d Add an optional "sort" argument to meta titles, defaulting to the title
This allows correct sorting of titles, names, etc., with:

    [[!meta title="David Bowie" sort="Bowie, David"]]
    [[!meta title="The Beatles" sort="Beatles, The"]]
2010-03-24 03:18:24 +00:00
Simon McVittie 0618f099da Have the meta plugin add a meta_title sort order 2010-03-24 03:15:50 +00:00
Joey Hess 8a5084bc62 whitespace 2010-03-19 15:09:08 -04:00
Joey Hess cbf269eee2 audited use POSIX
The POSIX perl module exports a huge number of functions by default, so
make sure all imports are qualified. (And remove one that was not
necessary.)
2010-03-19 13:12:28 -04:00
Joey Hess a01e0679f4 openid: Use Openid Simple Registration or OpenID Attribute Exchange to get the user's email address and username.
The info is stored in the session database, not the user database.
There should be no reason to need it when a user is not logged in.

Also, hide the email field in the preferences page for openid users.

Note that the email and username are not yet actually used for anything.
The email will be useful for gravatar, while the username might be used
for a more pretty display of the openid.
2010-03-13 19:08:15 -05:00
Joey Hess e56ec7a96c websetup: Add websetup_unsafe to allow marking other settings as unsafe. 2010-03-13 15:08:00 -05:00
Joey Hess edec9514f4 typo 2010-03-12 15:01:24 -05:00
Joey Hess 2ad3e60ee8 htmlscrubber: Security fix: In data:image/* uris, only allow a few whitelisted image types. No svg. 2010-03-12 14:50:26 -05:00
Joey Hess 45dfdcb257 search: Avoid '$' in the wikiname appearing unescaped on omega's query template, where it might crash omega.
Really, a more general fix, this deals with any $ that might appear on the
misctemplate.
2010-03-11 16:10:04 -05:00
Joey Hess ac3aac560f moderatedcomments: Added moderate_pagespec
* moderatedcomments: Added moderate_pagespec that can be used
  to control which users or comment locations are moderated.
  This can be used, just for example, to moderate http://myopenid.com/*
  if you're getting a lot of spammers from one particular openid
  provider (who should perhaps answer your emails about them),
  while not moderating other users.
* moderatedcomments: The moderate_users setting is deprecated. Instead,
  set moderate_pagespec to "!admin()" or "user(*)" instead.
2010-03-11 15:44:10 -05:00
Joey Hess 6eb71547dd typo 2010-03-09 19:55:50 -05:00
Joey Hess 6d27bbd026 Fix utf8 issues in calls to md5_hex.
This prevented comments containing some utf-8, including euro sign, from
being submitted. Since md5_hex is a C implementation, the string has to be
converted from perl's internal encoding to utf-8 when it is called. Some
utf-8 happened to work before, apparently by accident.

Note that this will change the checksums returned.

unique_comment_location is only used when posting comments, so the checksum
does not need to be stable there.

I only changed page_to_id for completeness; it is passed a comment page
name, and they can currently never contain utf-8.

In teximg, the bug could perhaps be triggered if the tex source contained
utf-8. If that happens, the checksum will change, and some extra work might
be performed on upgrade to rebuild the image.
2010-03-09 19:55:19 -05:00
Joey Hess 068e47aa45 catch failure to open the filetypes file 2010-02-24 20:28:52 -05:00
Joey Hess c21eb47e62 comments: Display number of comments in comment action link.
This was not doable before, but when I added transitive dependency handling
in the big dependency rewrite, it became possible to include a comment
count when inlining.

This also improves the action link when a page has no comments. It will
link direct to the cgi to allow posting the first comment. And if the page
is locked to prevent posting new comments, the link is no longer shown.
2010-02-14 19:11:18 -05:00
Joey Hess 9a0b9bdc88 minor refactor/optimisation 2010-02-14 18:09:28 -05:00
Joey Hess 34fff64e7b setup file ordering 2010-02-12 06:35:52 -05:00
Joey Hess 20ba12802b add section information 2010-02-12 04:22:15 -05:00
Joey Hess 73242f0890 remove unnecessary IkiWiki:: 2010-02-12 04:01:04 -05:00
Joey Hess 9cee2962e0 format plugin categorization 2010-02-12 01:10:36 -05:00
Joey Hess 18394f6ba9 improve websetup fieldset display
to handle sections
2010-02-12 00:21:12 -05:00
Joey Hess 8fdc238c8c fix websetup display of unsafe arrays in expert mode 2010-02-11 22:55:35 -05:00
Joey Hess a63929f6cc Group related plugins into sections in the setup file, and drop unused rcs plugins from the setup file. 2010-02-11 22:24:15 -05:00
Joey Hess 7af18f2a1e reorder canedit checks during page creation to have best_loc first
When creating a page, multiple locations are tested to see if they can be
edited. If all fail, one of the failure subs is called, to log the user in
to allow them to proceed with the edit. So far so good.

But, what if some pages fail for one reason, and some for another? This
occurs when httpauth_pagespec is used in conjunction with signinedit (and
openid or something). When the user is not signed in at all
The former will fail to edit a page because the user was not httpauthed.
The latter will fail to edit a different page, because the user was not
signed in. One of their failure methods gets to run first.

The page creation code always ran the failure method corresponding to the
topmost page location. So, when editing a foo/Discussion page, and with
httpauth_pagespec => "*!/Discussion", it ran the httpauth failure method,
which was exactly the wrong thing to do.

I fixed this by making it instead run the failure method for the *best*
page location. In the above example, that's foo/Discussion, so signinedit
runs, as desired, and we get the signin page.

This seems like it will be the right choice, or at least an acceptable
choice. If a user wants to use httpauth they can always choose it on the
signin page.
2010-02-11 20:13:30 -05:00
Joey Hess 6f1d623618 partially fix httpauth canedit hook
My logic was right before. Cleaned up some code.

(Page creation is still a problem.)

Also, I removed the Edit url munging, because that is not
necessary with the canedit hook, since canedit will handle
redirection through cgiauthurl if necessary.
2010-02-11 19:54:40 -05:00
Joey Hess e6678275a9 fix logic error 2010-02-11 18:32:07 -05:00
Joey Hess e11876b700 httpauth: Add httpauth_pagespec setting that can be used to limit pages to only being edited via users authed with httpauth. 2010-02-11 18:25:10 -05:00
Joey Hess 046095552a httpauth: When cgiauthurl is configured, httpauth can now be used alongside other authentication methods (like openid or anonok). Rather than always redirect to the cgiauthurl for authentication, there is now a button on the login form to use it. 2010-02-11 17:26:09 -05:00
Joey Hess f2d6d4f6b2 patch so far 2010-02-11 16:36:19 -05:00
Joey Hess a4ec579d1a amazon_s3: Fix to support the EU S3 datacenter, which is more picky about attempts to create already existing buckets. 2010-02-09 16:24:14 -05:00
Joey Hess 5a2de27947 Fix color and format plugins to appear in the websetup interface. 2010-02-06 16:25:39 -05:00
Joey Hess b384af237d opendiscussion: This plugin will also now allow posting comments
to otherwise locked-down sites.
2010-02-06 16:19:17 -05:00
Joey Hess e33a65719a ensure opendiscussion hook is always called before lockedit
This was only ordered ok due to luck before.
2010-02-06 16:12:29 -05:00
Joey Hess 1af8db763b revert accidental code change 2010-02-05 23:06:29 -05:00
Joey Hess 5541b06de4 response 2010-02-05 15:22:02 -05:00
Joey Hess 8380a9d000 factor out a userpage function
Not yet exported, as only 4 quite core plugins use it.
2010-02-04 18:24:15 -05:00
Joey Hess a2e78ebcf2 Add link to userpage (or creation link) to top of preferences page. 2010-02-04 15:30:41 -05:00
Joey Hess 68f7be91e5 typo 2010-02-04 15:10:55 -05:00
Joey Hess b547170a96 Improve display of openid in preferences page.
Now that openiduser is in IkiWiki core, it's ok to have passwordauth check
for it, and avoid displaying useless password fields when showing
preferences for an openid.

Also improved the styling of the display of the openid in the preferneces
page.
2010-02-04 15:07:10 -05:00
Joey Hess 345b40c652 Allow jumping directly into account registration process by going to ikiwiki.cgi?do=register 2010-02-04 14:51:56 -05:00
David Riebenbauer 25741100b0 Export add_autofile() for use in Plugins. 2010-02-02 14:04:39 +01:00
David Riebenbauer a8d313aba1 Use add_autofile() in tag.pm
to make the automatically created tagpages render.
2010-02-02 14:04:29 +01:00
David Riebenbauer f35d35abe3 Automatically create tag pages,
if "tag_autocreate=1" is set in the configuration. The pages will be created in
tagbase, if and only if they do not exist in the srcdir yet. Tag pages will be create from
"autotag.tmpl".

At this stage a second refresh is needed for the tag pages to be rendered.

Add autotag.tmpl template.
2010-02-02 14:04:28 +01:00
Joey Hess f91d79f469 img: Fix a bug that could taint @links with undef values. 2010-01-28 21:07:23 -05:00
Joey Hess 73253d6925 template: Preprocess parameters before htmlizing.
Consider a template like:

[[!template type=note text="""
[[!inline pages="*foo*"]]
"""]]

The text parameter is htmlized before being passed into the template (in
case the template wraps it in a <span> that prevents markdown from
htmlizing it later).

But, when markdown sees "*foo*", it turns that into <em>foo</em>.
Later, when preprocessing the inline directive, that leads to suprising
results.

To fix this, I made template parameters be preprocessed (and filtered)
before being htmlized.

Note that I left in the preprocessing (and filtering) of the template
output at the end. That's still relevant when the template itself contains
preprocessor directives.
2010-01-26 22:33:46 -05:00
Joey Hess ee9ae0a314 po: avoid crash when page is empty
Note that there is an associated po4a warning when a page is empty:
  Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/Locale/Po4a/Text.pm line 205.
I've filed a bug with po4a about that, but the important thing is fixing
the crash here.
2010-01-21 15:33:20 -05:00
Joey Hess 8bf2f5a31a handle git-notes breakage
The new git-notes feature in git 1.6.6 changes git log output in a way that
broke ikiwiki's parser if notes are added to commits.

I decided to deal with this by disabling notes when ikiwiki uses git,
by setting GIT_NOTES_REF="". AFAICS, looking up notes when dumping logs
will only waste time, since it does not currently seem to make sense for
ikiwiki to do anything with the notes.
2010-01-19 23:42:04 -05:00
Joey Hess ccf14b185e brace style and layout 2010-01-18 12:34:19 -05:00
Joey Hess 461804a5e4 clarify error 2010-01-18 12:09:54 -05:00
Joey Hess 9dc5685de4 linkmap: Simplify and improve browser compatability by using an img, not object tag.
I noticed that chromium was not hyperlinking the areas in the object-based
linkmap, while img works ok. Dunno why, but img based is nicer anyway since
it is allowed right through the htmlscrubber with no workarounds.
2010-01-09 23:10:26 -05:00
intrigeri 73f4a88358 po: inject custom isselflink to fix selflink detection on translation pages 2010-01-09 22:54:34 +01:00
Joey Hess 1f51af907e websetup: Fix bug in array change detection. 2010-01-09 16:27:08 -05:00
Joey Hess 59d929d6b1 websetup: Fix utf-8 problems. 2010-01-09 16:20:09 -05:00
Joey Hess eb30cfb310 only use css alignment stuff for table
This way users can use all the other alignment values when not including a
caption. Also, it will work without the standard style, and I don't have to
worry about regressions this way.
2010-01-07 16:09:34 -05:00
Joey Hess e31cb975a7 img: remove special case handling of link=yes
Only exists as an undocumented backwards compatability hack.
2010-01-07 15:41:16 -05:00
Joey Hess 253b1a41c1 refactor 2010-01-07 15:36:49 -05:00
Joey Hess e68cce6d1d brace style 2010-01-07 15:12:17 -05:00
Giuseppe Bilotta 4bda18a50a Support align attribute for img with caption
This is achieved by preparing CSS definitions that emulates the behavior
of the align attribute, and passing it to the outermost IMG wrapper
(A or TABLE) instead of passing the align value to IMG directly.
2010-01-06 21:02:09 +01:00
Joey Hess d78e8ee452 comments: Fix permalinks for comments using new conflict-free filenames. 2010-01-04 20:51:40 -05:00
Joey Hess 264f469894 lockedit can make sense with no auth plugins
On second though, you might want a wide-open wiki with some locked
pages that cannot be edited online.

So, the right thing for lockedit to do when there are no auth plugins is
to just say the page cannot be edited.
2010-01-04 19:40:33 -05:00
Joey Hess ae493178cf lockedit: Detect if no authentication plugins are enabled, and die with an error message as this configuration does not make sense. 2010-01-04 15:01:25 -05:00
Joey Hess f8bd25bfc7 signinedit: Auto-disable the plugin when all authentication methods are disabled. 2010-01-04 14:56:17 -05:00
Joey Hess aed16b4833 inline: Avoid showing edit links if page editing is disabled. (Sjoerd) 2010-01-04 12:54:18 -05:00
Joey Hess 7dd074e2e7 Fix several places that did not properly handle capitalization of the discussionpage setting.
Specifically, fixes discussion actions on discussion pages, and unbreaks the opendiscussion plugin.
2010-01-02 15:52:38 -05:00
Joey Hess 9747c47670 Merge remote branch 'tove/master' 2010-01-02 15:11:51 -05:00
Torsten Veller 59277c9b6b Terminate the arrow entities with ";" 2010-01-02 19:22:25 +01:00
Joey Hess 63cc5384bb inline: Fix bug that limited displayed pages when feedshow was specified w/o show. 2010-01-01 15:09:15 -05:00
Joey Hess 2ae1d9d928 linkmap: Add option to omit disconnected pages from the map. 2010-01-01 03:37:59 -05:00
Joey Hess 6af6c89df3 comments: Add a checksum to the name of comment pages, to avoid merge conflicts when comments are posted to two branches of a site. 2009-12-30 15:41:17 -05:00
Joey Hess ffc9f25e73 toc: Add startlevel parameter. (kerravonsen) 2009-12-25 15:28:18 -05:00
Joey Hess 3a1c8c2b46 pagestats: Add show parameter. Closes: #562129 2009-12-25 14:31:51 -05:00
Joey Hess 2bceb10b5f 404/goto: Fix 404 display of utf-8 pages.
Problem here was that no charset http header was being sent.

I fixed this globally by making cgi_custom_failure send the header.
Required changing its parameters.
2009-12-14 18:16:47 -05:00
Joey Hess 40078b1781 404: fix utf-8 encoding of REDIRECT_URL 2009-12-14 18:07:24 -05:00
Joey Hess 4ee754536d remove: Fix problem removing pages with utf-8 in the name. 2009-12-14 17:26:48 -05:00
Joey Hess cdbdf19c36 attachment: Fix reversion in attachment sorting by age.
Reversion was introduced by over-eager removal of mtime_raw in
2b569f99d9
2009-12-14 17:19:31 -05:00
Joey Hess bb1ce7207d attachment: Fix several utf-8 problems.
Similar to those in the rename plugin, although here we can't use
the form object.
2009-12-14 17:16:40 -05:00
Joey Hess b4bc7d1708 rename: Fix some utf-8 problems.
The crux of the problem is that the cgi object has raw values not converted
to utf-8, and rename was using its fields. Also fixed a missed place where
the form object did not get its fields utf-8 encoded.
2009-12-14 17:15:50 -05:00
Joey Hess f843033749 monotone: Deal with format change in version 0.45. (Thanks, Richard Levitte) 2009-12-13 13:00:42 -05:00
Joey Hess b8ed5e7228 more idomatic perl 2009-12-04 13:13:41 -05:00
Joey Hess f02f806cf7 calendar: Fix month wraparound error that broke in December. 2009-12-02 12:58:45 -05:00
Joey Hess c5b554b9b2 inline: Avoid using %links to test for page existence
%links is populated even for just-deleted pages, so %pagesources
should be used for such tests instead.
2009-11-30 18:15:33 -05:00
Joey Hess 2255a6a0bb calendar: Add title attributes for all links in the calendars. 2009-11-26 14:58:35 -05:00
Joey Hess 09dbbaf245 fix hook names 2009-11-25 06:49:26 -05:00
Joey Hess df75c5b93a date: New plugin that allows inserting date directives that expand to pretty-printed dates, using the same formatting as used for page modification date display, etc. 2009-11-25 01:18:43 -05:00
Joey Hess da92e91769 inline: Use caching of inlined pages to speed up builds of inlines that include feeds.
Speedup of about 25% for small inlines; could be much larger for inlines of
many, or complex pages.

Not bloating memory with excessive memoization data was the key to this.
The method chosen does not squeeze out every erg of speed possible when
inlines are nested, but that's rare. It uses less memory than other
optimisation hacks (I'm looking at you,
f937c1fb80 !) already used in inline.pm.
2009-11-17 01:29:28 -05:00
Joey Hess 43a1640345 meta: Allow use of DESCRIPTION in templates to get at the meta description value. (Thanks, NicolasLimare) 2009-11-16 15:54:11 -05:00
Joey Hess 4fa17df57d meta: Generate meta description tags even when the html scrubber is enabled.
Unlike generic meta foo tags, meta description is known to be safe, so can
be special cased to be allowed despite the html scrubber. This makes meta
description much more useful, since it is otherwise limited to being used
by other plugins like map.
2009-11-16 15:51:00 -05:00
Joey Hess 20cdadba32 avoid fallthrough to default meta header addition for title
With the htmlscrubber disabled, it was adding a <meta name=title>
tag for the title, which is pointless.
2009-11-16 15:44:03 -05:00
Joey Hess d8cfd8d431 inline: Fix display of all pages when archive=yes or show=0 are used. 2009-11-13 20:50:27 -05:00
Joey Hess ad303e878e inline: Allow direct inclusion of non-page files in raw mode. 2009-11-13 15:10:58 -05:00
Joey Hess 5ccf68f113 inline: Do not generated feeds for nested inlines.
My experience is that when inlines are nested, the old behavior of
generating feeds for the nested inlines was never really desired. Since the
feeds were numbered sequentially, the numbers could easily change, and it did
not make sense to subscribe to or use those feeds. And generating those nested
feeds often meant a lot of unnecessary calculation, and data being written.
So, I dropped them.

Looking back, nested feeds originally were a free side effect of properly
handing multiple feeds on one page. Of course, that is still supported.
2009-11-13 14:56:24 -05:00
Joey Hess 8ec53967c1 typo 2009-11-10 00:53:34 -05:00
Joey Hess 92a6f2e5e8 httpauth: Add cgiauthurl setting that can be used to do http basic auth only when ikiwiki needs authentication, rather than for any access to the cgi/wiki. 2009-11-10 00:50:59 -05:00
Joey Hess 9f0931ce21 localstyle: New plugin, allows overrding the toplevel local.css with one that is closer to a page.
I chose not to have it override style.css, because style.css is not really
intended to be edited; the one from the underlay is intended to be used as
a base that local.css overrides.

I chose to use a plugin rather than changing the default behavior, both
because I didn't want to have to worry about possibly breaking backwards
compatability (though this seems unlikely), and because it seemed cleaner
to not include style template parameters in the main page template code.

I suppose someone might want a way to not override the toplevel
local.css, but instead include it as well as foo/local.css. Probably the
best way to do that would be to have foo/local.css @import ../local.css
(modulo browser compatability issues). Alternatively, edit page.tmpl
to always include the toplevel local.css, or swap out this plugin for
another one.
2009-11-09 13:39:05 -05:00
Joey Hess 910cbae922 underlay: Avoid crashing if lists of underlays (or template directories) are not configured. 2009-11-07 12:36:13 -05:00
Joey Hess 70ee70e276 underlay: Fix example values put in setup file to be array references. 2009-11-06 12:06:46 -05:00
Joey Hess c29957e017 google: Pass the whole wiki url to google, not just the domain, so that search works correctly for wikis that are located in subdirectories of domains. 2009-10-29 18:05:58 -04:00
Joey Hess 8dfd5289a9 moderatedcomments: New plugin to allow comment moderation w/o relying on blogspam.net. 2009-10-26 13:24:27 -04:00
Joey Hess a2979b2b52 mdwn: Avoid trying to use multimarkdown if it is not installed. 2009-10-26 11:56:42 -04:00
Joey Hess f756d7e6de po: Fix breakage caused by changes to render code. 2009-10-26 11:53:55 -04:00
Joey Hess 789e0bfd6b inline: Fix raw mode. Closes: #552114 2009-10-23 12:38:30 -04:00
Joey Hess b907108271 meta: Gather permalink info on scan pass so it is available to inline when using a template that does not include page content. 2009-10-21 16:42:25 -04:00
Joey Hess 2d60ea7fa8 edittemplate: Work around bug #551499 in CGI::FormBuilder. 2009-10-18 13:56:35 -04:00
Joey Hess d1a88c892e edittemplate: Allow template page name to be specified using anything legal for a wikilink (including eg, leading slashes).
Before, the htmllink would display the link to the template as if it were a
wikilink, but what was stored was not, which could lead to confusing
situations.
2009-10-18 13:47:30 -04:00
Joey Hess 6a955e86bb fix logic error
This sometimes caused infinite recursion when rebuilding a wiki
with po files.
2009-10-17 20:45:03 -04:00
Joey Hess fc1bad2e7b slight optimisation 2009-10-15 20:01:47 -04:00
Joey Hess d0213917ad inline: Optimize generation of archives, etc
Don't generate inlined page content if the template does not use it.
2009-10-15 16:25:43 -04:00
Joey Hess 2fced917a5 sparkline: show error if php does not run 2009-10-14 16:59:21 -04:00
Joey Hess 28c4caea59 year calendar: Avoid highlighting the current month in a different year 2009-10-12 14:24:28 -04:00
Joey Hess 5c78192435 year calendar: only link to months that have posts
This does mean the year calendars depend on existence of all posts made in
the year and have to be updated.
2009-10-12 14:19:04 -04:00
Joey Hess 22737e53f1 remove whitespace from within arrow links 2009-10-12 14:05:56 -04:00
Joey Hess 227540fd87 calendar: Add creation time limits to user's pagespec
This avoids all calendars rebuilding when a new page is added
that will only show in one of them.
2009-10-12 12:30:10 -04:00
Joey Hess 11e6d650ea calendar: Fix CSS for year calendar to match the plugin documentation.
The names in the documentation were completly different, but
also seemed better chosen than the names in the code.
2009-10-12 12:19:42 -04:00
Joey Hess e82b43bf95 skip merges
git log --follow seems to sometimes show merges from before the file was
ever created. So, skip them, a file shouldn't be first created during a
merge anyway.
2009-10-12 00:50:48 -04:00
Joey Hess bf577d34c7 can't use --reverse with git log --follow
Meh, git.
2009-10-11 23:36:06 -04:00
Joey Hess 85af97c9a2 Merge branch 'master' into dependency-types
Conflicts:
	debian/changelog
2009-10-11 22:39:31 -04:00
Joey Hess 33f42db2ea git: --getctime will now follow renames back to the original creation of a file.
This will be a bit more expensive, but --getctime does not need to be fast.
And getting the real creation time a very useful when untangling blog
histories that involve renames.
2009-10-11 22:38:42 -04:00
Joey Hess e4c765c64f calendar: avoid inline images in links 2009-10-11 22:11:11 -04:00
Joey Hess cf74cf7a37 calendar: use left and right arrows for next/prev months
This is consistent with the year display, and I think it is less
visually confusing than using the full month names.
2009-10-11 21:55:06 -04:00
Joey Hess 23a21850fa fix next/prev month padding bug 2009-10-11 21:52:50 -04:00
Joey Hess 8a37be35ac fix day links
I broke this recently.
2009-10-11 21:43:16 -04:00
Joey Hess f3342773d3 calendar: Fix bug in next/previous year/month links, which sometimes linked to an archive page from the wrong year. 2009-10-11 21:42:59 -04:00
Joey Hess dd80be66ee calendar: Fix midnight rebuild trigger of calendars with explicit month/year.
It was just broken for calendars with an explicit month or year, not
triggering at all.

Now it will update those at appropriate times.
2009-10-11 21:26:43 -04:00
Joey Hess 71e266b939 avoid temporary variables
and fix a bug in pagespec variable name
2009-10-11 20:15:54 -04:00
Joey Hess 74409f940d add_depends: optimise influence calculation
I made match_* functions whose influences can vary depending on the page
matched set a special "" influence to indicate this.

Then add_depends can try just one page, and if static influences are found,
stop there.
2009-10-09 17:15:40 -04:00
Joey Hess c5e237c013 img: use presence dependency when linking to a page 2009-10-09 13:37:06 -04:00
Joey Hess 1b6b1ee2d8 brokenlinks: use pagespec_match_list 2009-10-09 13:35:11 -04:00
Joey Hess 6f2cc5ac8c pagespec_match_list: change limit to filter 2009-10-09 13:20:41 -04:00
Joey Hess f9f7a6e9f3 conditional: use pagespec_match_list 2009-10-09 13:07:50 -04:00
Joey Hess c7da991158 indentation 2009-10-09 13:02:03 -04:00
Joey Hess b7351daacd conditional: use yesno 2009-10-09 12:54:35 -04:00
Joey Hess 96682e3084 progress: switch to new pagespec_match_list 2009-10-09 12:48:16 -04:00
Joey Hess c791f84fb5 linkmap: Use new pagespec_match_list 2009-10-09 12:35:41 -04:00
Joey Hess 5e7b2dea84 rename use_pagespec to pagespec_match_list
To avoid breaking plugins, also support the old pagespec_match_list
calling convention, with a deprecation warning.
2009-10-08 23:51:06 -04:00
Joey Hess 332821144b calendar: rework so it can use use_pagespec
This was tricky because of the caching, and because use_pagespec always
adds a dependency. That would have made year calendars depend on the whole
pagespec, which is overly broad. So I removed the caching, format_month,
and in format_year just look at %pagesources to see if month pages are
available.

In format_month, I make it always call use_pagespec, so each month calendar
gets the right dependency and any influcences added. This means a bit more
work, but the added work is fairly minimal, and presence dependencies
remove a *lot* of work it used to do.

(100% untested!)
2009-10-08 23:30:34 -04:00
Joey Hess 80ab1dbc12 postsparkline: switch to use_pagespec
Also, fixed up the dependency type for time=mtime. That has
to remain a content dependency, sadly.
2009-10-08 22:56:36 -04:00
Joey Hess 3be7a02e7d orphans: switch to use_pagespec 2009-10-08 22:56:12 -04:00
Joey Hess 57d04ed892 fix feedpages dependency
This dependency was missing before switching to use_pagespec.
It is correct to add it, but it needs to be combined with the regular
"pages" dependency to ensure that it does not match extra pages.

(Also fixed its dependency type.)
2009-10-08 20:55:12 -04:00
Joey Hess bc4ef28f3e pagestate: switch to use_pagespec 2009-10-08 20:29:51 -04:00
Joey Hess 1abbc6a404 pagecount: switched to use_pagespec 2009-10-08 18:47:25 -04:00
Joey Hess 32cd5f0b79 inline: switch to use_pagespec
Taking advantage of every single one of its features, of course.
Even had to add one more..
2009-10-08 18:30:50 -04:00
Joey Hess de24c0df87 map: switch to use_pagespec 2009-10-08 17:53:45 -04:00
Joey Hess c57908b9d0 change how dependency types are specified to add_depends
Also, this fixes 2 bugs in dependency info.
2009-10-08 16:49:03 -04:00
Joey Hess f2b3d13414 fix handling of influences of pagespecs that fail to match
If a pagespec fails to match, I had been throwing the influences away, but
that is not right. Consider `backlink(foo)`, where foo does not exist.
It still needs to be added as an influence, because if it is created, it
will influence the pagespec to match.

But with that fix, `link(bar)` had as influences all pages, whether they
link to bar or not. Which is not necessary, because modifiying a page to
add a link to bar will directly cause the pagespec to match.

So, in match_link (and all the match_* functions for page metadata),
only return an influence if the match succeeds.

match_backlink had been implemented as the inverse of match_link, but that
is no longer completly true. While match_link does not return an influence
on failure, match_backlink does.

match_created_before/after also return the influence on failure, this way
if created_after(foo) currently fails because foo does not exist, it will
still update the page with the pagespec if foo is created.
2009-10-08 13:38:46 -04:00
Joey Hess 957ded9d64 remove explicit addition of dependencies for displayed pages
that hack is not needed, thanks to pagespec influences calculation
2009-10-07 21:57:31 -04:00
Joey Hess 5f9860e65c add type info to influence information 2009-10-07 21:52:37 -04:00
Joey Hess 4002d7c1a4 add influence info to match_*
Also update docs, test suite.
2009-10-07 20:31:13 -04:00
Joey Hess 77598dfa9f linkmap, pagestats: avoid using %links to get a list of pages
When a page is deleted, it is removed from %pagesources, but
not from %links. So use the former.
2009-10-06 19:29:28 -04:00
Joey Hess a5d825f286 linkmap: does need presence deps
Otherwise, removal of a page with no links will not be noticed,
since no links will change.
2009-10-06 19:28:52 -04:00
Joey Hess 15fd89d64d presence dependencies not needed
Using just a link dependency is sufficient, since
2009-10-06 18:41:09 -04:00
Joey Hess af85f62d6f linkmap: Use a combination of presence and link dependencies.
This makes the map be regenerated much less frequently, so larger maps are
more practical to use now.
2009-10-06 17:47:10 -04:00
Joey Hess 031d1bf504 use among limit for correctness 2009-10-05 17:03:16 -04:00
Joey Hess c21f9e7093 pagestats: Use a combination of precense and link dependencies.
This makes it more efficient.

It also fixes the same bug that I fixed in orphans recently,
that only changes to the set of displayed pages were considered (or amoung),
which missed changes to links on other pages to those.

Probably this bug was never noticed because pagestats is most often put
on a blog type page, which gets updated anyway when posts change,
and thus the tag cloud was updated.
2009-10-05 15:44:26 -04:00
Joey Hess 7123178732 oprhans: Use a combination of precense and link dependencies.
This makes it more efficient.

It also fixes a longstanding bug, where if only a small set of pages were
considered by orphans, changes to links on other pages failed to cause an
update.
2009-10-05 15:14:18 -04:00
Joey Hess f41caf57ea use links dependency 2009-10-05 15:09:09 -04:00
Joey Hess e96992bbc8 fix add_depends to new api 2009-10-05 14:33:42 -04:00
Joey Hess be032a7b87 rework dependency types code
Simplify, change default content depends number to 1,
change interface to make more sense.
2009-10-04 20:30:21 -04:00
Joey Hess 7982c3c177 postsparkline and progress: also contentless dependencies 2009-10-04 16:16:50 -04:00
Joey Hess 66852de775 meta redir dependency is contentless 2009-10-04 16:12:05 -04:00
Joey Hess 2af988b86f listdirectives: contentless dependency
Another one that probably doesn't matter, but for completness.
2009-10-04 16:11:10 -04:00
Joey Hess de6eba6ddd not a contentless dependency
needs link info
2009-10-04 16:10:34 -04:00
Joey Hess ce78b69927 edittemplate: contentless dependency
This one is unlikely to matter much, but yeah, it's contentless.
2009-10-04 16:07:02 -04:00
Joey Hess a6689f9c7a calendar: all dependencies are contentless 2009-10-04 16:05:41 -04:00
Joey Hess e529c561f5 inline: Use a contentless dependency in quick mode. 2009-10-04 16:03:01 -04:00
Joey Hess 2fbfcd16e6 map: Use a contentless dependency unless show= is specified.
This makes simple maps efficient enough that they can be used on sidebars!
2009-10-04 15:46:23 -04:00
Joey Hess 6eaf9e4015 orphans and brokenlinks cannot use contentless dependency
Tried a contentless dep and it does not work; changes to links in pages
are not noticed. Drat.
2009-10-03 15:59:30 -04:00
Joey Hess dc4e44adf1 pagecount: Use contentless dependency
This will avoid lots of unnecessary updates of pages using the pagecount
directive. Yay!
2009-10-03 15:36:23 -04:00
Joey Hess 0c6648f02c mirrorlist: Display nothing if list is empty. 2009-10-02 12:37:53 -04:00
Joey Hess ac8ecdcf68 Support RPC::XML 0.69's incompatable object instantiation method. 2009-09-29 13:35:30 -04:00
Joey Hess 1f929e7f64 typo 2009-09-29 13:33:23 -04:00
Joey Hess 3525a6b7f2 toggle, relativedate: Support templates that add attributes to the body tag. 2009-09-28 16:21:03 -04:00
Joey Hess 7cb620d0e8 img: Fix dependency code for full size images.
I had assumed that an image shown full size did not need add_depends, since
a change would not need a change to the displaying page.

But this is not true if the image is modified and its size changes. Then
the page needs to update its img tag to reflect the current size.
2009-09-27 20:57:27 -04:00
Joey Hess f42215cb65 img: Correct bug in image size calculation code.
If an image was resized smaller, with width and height specified to values
that did not fit its aspect ratio, the image tag with/height were not
adjusted to the actual size imagemagick chooses.

This was broken by 03449610d6.

To fix it right, it unfortunatly needs to always read the src image now,
in order to determine if the image is being displayed larger, or resized
smaller. When resized smaller, it then always uses the size of the
thumbnail, while for larger it calculates the size.

(Only way to get rid of this sometimes extra image read would be to change
it to not allow displaying images larger.)
2009-09-27 20:53:02 -04:00
Joey Hess 2acaa15830 parentlinks: Add has_parentlinks template parameter to allow styling the toplevel index differently etc. 2009-09-27 18:29:16 -04:00
Joey Hess 34991b7d35 otl: Avoid globally filtering non-otl pages
Through a complex chain of circumstances, that filtering was causing
dumpsetup to trigger undefined warning messages from the po plugin. But
anyway, munging the otl in htmlize is less error-prone and less expensive,
a win all around.
2009-09-23 15:11:51 -04:00
Joey Hess af26398c14 avoid tempfile warning
Allow tempfile to open the file, so it doesn't warn about possible
insecurity. This probably fixes a real, but unlikely security hole too.
2009-09-13 20:20:21 -04:00
Joey Hess f1999df705 remove cgi exclusion
Note that a typical use of this plugin is for a static site, w/o cgi
support enabled.
2009-09-12 00:24:57 -04:00
Joey Hess a7545978c7 got rid of the postrefresh hook after all
Instead, use the change and delete hooks, and launch rsync if either hook
is called.
2009-09-11 18:29:56 -04:00
Joey Hess 5b818c9f2a doc update, add --exclude ikiwiki.cgi to examples 2009-09-11 18:28:35 -04:00
Joey Hess 3c80557054 localize user-visible warnings and tack on missing newlines 2009-09-11 18:22:06 -04:00
Joey Hess c6ac7409bd Merge commit 'schmonz/master'
Conflicts:
	IkiWiki/Plugin/rsync.pm
2009-09-11 18:20:23 -04:00
Joey Hess 2d9e97c283 chdir to the destdir before running rsync
Avoids needing to specify the path in the rsync command, can just use "."
2009-09-11 18:19:21 -04:00
Joey Hess dcc177440e remove unixauth; I am only adding render at the moment
yeah, you need branches :P
2009-09-11 18:15:19 -04:00
Amitai Schlair 604037b0f2 Don't error out, either warn or say nothing, depending. 2009-09-11 17:42:51 -04:00
Amitai Schlair a69d628b2c Whoops, copyright 2009. /usr/bin/perl for the interpreter like other plugins. 2009-09-11 14:13:47 -04:00
Amitai Schlair b2bd2e93f0 Revivify unixauth and rsync plugins (and hook needed by rsync) lost in
the last merge. I should really put each feature on its own git branch.
2009-09-10 17:34:52 -04:00
Joey Hess 9ef4b5e677 Merge commit 'schmonz/master' 2009-09-10 17:04:20 -04:00
Amitai Schlair fb6c6895c6 Add NetBSD-style 2-clause BSD license. 2009-09-10 17:03:06 -04:00
Joey Hess 60111384a9 formatting 2009-09-10 16:21:03 -04:00
Joey Hess 73224daf2c minor simplification 2009-09-10 16:20:21 -04:00
Joey Hess 1365ebf12f Merge commit 'schmonz/master' into cvs 2009-09-10 16:18:27 -04:00
Joey Hess 93cd30bc0a Merge branch 'master' into cvs 2009-09-10 16:18:23 -04:00
Joey Hess 26dae8f049 clean up use of IkiWiki::Receive
Loading and use of IkiWiki::Receive can all be pushed into the git plugin,
rather than scattered around.

I had at first wanted to make a receive plugin and move it there,
but a plugin was not a good fit; you don't want users to have to manually
load it, and making the git plugin load the receive plugin at the right
times would need more, and ugly code.
2009-09-10 16:15:48 -04:00
Amitai Schlair 8063bc3402 Catch up to the new genwrapper hook. 2009-09-10 15:12:45 -04:00
Amitai Schlair 460b1a0deb Merge branch 'master' of git://github.com/joeyh/ikiwiki 2009-09-10 15:03:18 -04:00
Joey Hess 3ebd4e0b45 Add genwrapper hook, that can be used to add code into the C wrapper. 2009-09-10 14:04:46 -04:00
Joey Hess c22b938631 Merge commit 'schmonz/master' into cvs 2009-09-10 13:44:31 -04:00
Joey Hess 81a9b5feff Merge branch 'master' into cvs 2009-09-10 13:44:27 -04:00
Amitai Schlair 98553d1537 CVS operations generally need to be within CVS checkouts, so these chdir()
calls are warranted. They shouldn't modify the caller's working directory,
though. Use File::chdir to keep the scope of the changes subroutine-local.
The tests now pass without resetting the working directory.
2009-09-10 00:51:34 -04:00
Amitai Schlair aafd267ee0 Abstract out CVS's involvement in the wrapper:
* In Wrapper.pm, add a new hook "wrapperargcheck" to examine argc/argv
  and return success or failure. In the failure case, the wrapper
  terminates.

* In cvs.pm, implement the new hook to return failure if a directory is
  being cvs added.
2009-09-09 21:58:42 -04:00
Amitai Schlair 5f44dd8e77 Merge branch 'master' of git://github.com/joeyh/ikiwiki 2009-09-09 14:44:52 -04:00
Joey Hess 2a99ebf276 underlay: Also allow configuring additional directories to search for template files in. 2009-09-08 17:27:37 -04:00
Joey Hess 8c55424b11 Merge commit 'schmonz/master' into cvs
Conflicts:
	IkiWiki/Plugin/cvs.pm
2009-09-04 17:16:28 -04:00
Amitai Schlair d79cf3728d It's STDOUT we have to shut up for cvs, and $savedout has to be
restored just so.
2009-09-04 14:56:55 -05:00
Amitai Schlair 9de742bb00 Stop using IPC::Cmd and String::ShellQuote, since quoting (and
having to quote, and the possible use of the shell) sucks. Stop
passing args to cvs_runcvs() as an arrayref, since that also sucks
(and was a sop to IPC::Cmd). Instead, use Joey's construction for
temporarily redirecting stderr to /dev/null. Much much simpler and
better. Works on my laptop with bozohttpd, now to test on the NetBSD
wiki.
2009-09-04 12:40:04 -05:00
Joey Hess de7c3aa16b minor formatting 2009-09-02 16:08:18 -04:00
Joey Hess 9f5cc7c9a2 remove two plugins that are unrelated to cvs 2009-09-02 15:36:56 -04:00
Amitai Schlair 85844b8494 whitespace 2009-08-30 21:03:18 -04:00
Amitai Schlair fe350e8b89 Merge branch 'master' of git://github.com/joeyh/ikiwiki 2009-08-30 16:34:32 -04:00
Amitai Schlair 1af7d7d842 On some systems the commit message gets quoted properly already. Don't
requote in such cases, do quote in all others.
2009-08-30 16:13:17 -04:00
Joey Hess d678147410 Revert "po: do not inject custom bestlink function when po_link_to eq default"
This reverts commit cdc3576c8d.

Conflicts:

	IkiWiki/Plugin/po.pm

This change broke the test suite and is not strictly necessary.
2009-08-30 14:50:43 -04:00
Amitai Schlair e972cadf78 Fix uninitialized value when editing a page being vivified from the
basewiki. Makes the filetype-testing logic more explicit anyway.
2009-08-30 13:49:38 -04:00
Amitai Schlair c36d2fa896 Merge branch 'master' of git://github.com/joeyh/ikiwiki 2009-08-30 03:02:15 -04:00
Amitai Schlair 968c6c93b4 Remove debug statement. 2009-08-30 01:45:09 -04:00
Amitai Schlair 2d1ff30e13 Knock off another to-do item: "Don't slurp the entire cvsps output
into memory (!)."
2009-08-30 01:14:22 -04:00
Amitai Schlair b493f9b6d8 Knock off a to-do item: "If the argument to cvs add smells like a
binary file, cvs add -kb it (for attachment support)."
2009-08-30 00:17:42 -04:00
Amitai Schlair 6191f3fbb9 Remove getopt() hook (it's a dead end, unsafe to pass wrapper args to
ikiwiki). Crunch on-demand module loads into one-liners. Comment why
cvsps output is getting read in its entirety and reversed.
2009-08-29 21:35:54 -04:00
Josh Triplett 9f75d3b1f3 teximg: Make TeX handle preventing unsafe things; remove insufficient blacklist
TeX has configuration options that prevent unsafe things like shell
escapes and insecure file reads/writes.  Turn all of them on.

teximg's regex-based blacklist does not suffice.  For instance:

[[!teximg code="""
\catcode`\%=0
%input{/etc/passwd}
"""]]

Remove the blacklist, since the TeX configuration options seal off the
underlying mechanisms more safely, and the blacklist blocks other TeX
commands that can prove useful.
2009-08-28 23:18:07 -07:00
Joey Hess 03449610d6 img: Don't generate new verison of image if it is scaled to be larger in either dimension.
Although imagemagick handles even really large sizes sanely, using a page
file, doing so would just waste time and disk space, since the browser
can be told to resize it larger.
2009-08-28 23:31:53 -04:00
Joey Hess 3811c5f559 Merge commit 'intrigeri/po' 2009-08-28 19:48:32 -04:00
Joey Hess ec26a96193 avoid clobbering origsub if checkconfig runs more than once
checkconfig can run more than once in a single ikiwiki run if setup is
building wrappers. That clobbered the origsub value for bestlink, leading
to infinite recursion
2009-08-28 19:15:25 -04:00
intrigeri 646c9a4c95 po: fix link() pagespec when used on translation pages
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 16:34:58 +02:00
Simon McVittie d92f767fb7 inline: if using pagenames, don't add a dependency on "page1 or page2 or..."
This is unnecessary and just slows us down (by a factor of 2, in the
pessimal case where every page has an inline with pagenames); it's also
not possible to optimize it into add_depends_exact calls.
2009-08-28 15:34:35 +01:00
intrigeri e671e72053 po: better rootpage logic for inline's post form
Set rootpage to the non-l10n'd rootpage parameter if it is set,
else to the masterpage of the linking page.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 15:00:16 +02:00
intrigeri 53dc18ec2b Revert "po: keep masterpage as the rootpage for inline's post form"
This reverts commit cf43ae5a1f, which actually
only works when a rootpage parameter is set. A more complete fix will be
written soon.
2009-08-28 14:47:11 +02:00
intrigeri cf43ae5a1f po: keep masterpage as the rootpage for inline's post form
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 14:22:36 +02:00
intrigeri 72ac9821e5 inline: moved rootpage logic to a function
The po plugin's injected bestlink must do something special when called by this
exact part of inline's code.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 14:22:23 +02:00
intrigeri 5136c22eed po: favor the type of linking page's masterpage on page creation
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 07:33:53 -04:00
intrigeri 18ddf727d1 po: fix interdiction to create pages of type po
... which was broken by the new page_types code.

Signed-off-by: intrigeri <intrigeri@boum.org>
(cherry picked from commit 1914ae2fd2)
2009-08-28 07:32:41 -04:00
intrigeri c9301d2c29 po: favor the type of linking page's masterpage on page creation
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 13:12:58 +02:00
intrigeri 1914ae2fd2 po: fix interdiction to create pages of type po
... which was broken by the new page_types code.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 12:38:07 +02:00
Joey Hess 0c1a71896d htmltidy: Return an error message if tidy fails. Closes: #543722
On second^Wthird^Wfourth thought, putting the message into the page seems
better than using stderr.
2009-08-27 16:27:57 -04:00
intrigeri cdc3576c8d po: do not inject custom bestlink function when po_link_to eq default
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-27 20:31:44 +02:00
intrigeri 6c0f9c691c po: override the title template variable for coherent homepage titling
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-27 20:19:17 +02:00
intrigeri 3c2bffe21b po(scan): removed scary comment about only wanting to change the first link
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-27 19:59:15 +02:00
intrigeri 0c032b0ccb Merge commit 'upstream/master' into prv/po 2009-08-27 19:56:37 +02:00
intrigeri 5eec60d4c6 po: do not beautify urls on the recentchanges page
... else, the recentchanges page shows a link such as "sandbox.es". But,
clicking on it goes to the English (or negotiated language) version of the page.

It is better in this one case if the link goes direct to the translated version
of the page.
(cherry picked from commit 496e8523c6)
2009-08-27 12:56:49 -04:00
Joey Hess 4e70f2f0d2 htmltidy: Print a warning message if tidy fails. Closes: #543722 2009-08-26 13:24:51 -04:00
intrigeri 496e8523c6 po: do not beautify urls on the recentchanges page
... else, the recentchanges page shows a link such as "sandbox.es". But,
clicking on it goes to the English (or negotiated language) version of the page.

It is better in this one case if the link goes direct to the translated version
of the page.
2009-08-26 07:56:33 +02:00
intrigeri 0113c69d4f po: (hopefully) fixed WikiLink to self with po_link_to=default 2009-08-26 07:02:29 +02:00
Joey Hess 5bcdc39999 Revert "Allow add_depends to take an arrayref"
This reverts commit e4cd168ebe.

There was no benefit to this change.
2009-08-25 17:11:29 -04:00
Simon McVittie e4cd168ebe Allow add_depends to take an arrayref 2009-08-25 00:31:24 +01:00
Simon McVittie b6fcb1cb0e calendar, inline, map: don't pre-join dependencies
The new dependency handling works better (eliminates more duplicates) if
dependencies are split up. On the same wiki mentioned in the previous
commit, this saves about a second (i.e. 4%) on the same test.
2009-08-24 23:18:16 +01:00
Amitai Schlair 607534cecc Explain that command must run unattended, and lose the debug statement. 2009-08-23 15:43:18 -04:00
Amitai Schlair 844169c9b0 I'm not redefining any subs after all, don't prevent those warnings. 2009-08-23 15:21:39 -04:00
Amitai Schlair 3d6bc6e1b7 Add rsync plugin, though the only rsync-specific thing about it is the
assumption that uploading an entire site is efficient.
2009-08-23 15:18:41 -04:00
Amitai Schlair 5bdcd4d57b Oops, use the more recent (and less brittle) directory test. 2009-08-22 02:22:36 -04:00
Amitai Schlair 524de4db26 Pass along wrapper args to ikiwiki, then handle the "cvs add dir"
case with a getopt hook directly in my plugin. If the wrapper change
is safe, we won't need a wrapper wrapper.
2009-08-22 01:25:41 -04:00
Amitai Schlair 5c0e56d149 Put old unixauth plugin under git control. Needs some serious attention. 2009-08-21 22:51:12 -04:00
Joey Hess 9b799ccc85 po: Fixed to run rcs_add ralative to srcdir. 2009-08-19 14:05:59 -04:00
Joey Hess 8b99e68743 use pagespec_match_list for feedpages
This is both faster, and propigates any error in processing the feedpages
pagespec out to display on the page. Which may have been why I didn't use
it before, but currently seems like a good thing to do, since it explains
why your feeds are empty..
2009-08-16 13:45:10 -04:00
Joey Hess 4ff3e2a540 po: Better fix for missing underlay translation problem.
If a page is taken from the underlay, and one of the specified languages
does not have po files in the underlay, it would create a broken link
to the translated version of the page for that language.

With this change, there's no broken link.
2009-08-15 22:18:05 -04:00
Joey Hess 1be07eae46 replace N/A with 0
I think the N/A was not intended to be visible, but it can show up as the
percent translated to a language. This happens if the page is located in an
underlay, and not translated to the language in any other underlay.
2009-08-15 21:08:17 -04:00
Joey Hess e031551727 update for consistency 2009-08-15 16:42:29 -04:00
Joey Hess 6a2f3ef4bd indentation 2009-08-15 13:58:04 -04:00
Simon McVittie 97e9d99358 meta: depend on absolute page name, not relative
Previously, [[!meta redir="foo"]] on bar, where bar/foo exists, would
depend on "foo" (which matches nothing, probably) rather than "bar/foo".
(cherry picked from commit f27ec09b72f886415e63fe394e18d9c3cb3913bf)
2009-08-15 13:50:55 -04:00
Simon McVittie e0bb9675ce img: depend on absolute page name, not relative
Previously, [[!img bar.jpg]] on foo, where foo/bar.jpg exists, would
get a dependency equivalent to "glob(bar.jpg)" (which might not match
anything), rather than the correct "glob(foo/bar.jpg)".
(cherry picked from commit 85b2ec49ecd12dd23e5c432933457a72744ce7cb)
2009-08-15 13:50:34 -04:00
Joey Hess 82bb3af579 optimise brokenlinks by gathering the data when calculating backlinks
During backlink calulation, all links are examined and broken links can
be detected for free, so store a list of broken links and have brokenlinks
use it.

Exposing the %brokenlinks structure is a bit ugly, but the speedup seems
worth it: Around 1 second for wikis the size of the doc wiki that use
brokenlinks.
2009-08-14 01:11:53 -04:00
Joey Hess f486271009 orphans: Reuse backlinks info
This plugin was building essentially the same data that is built to handle
backlinks, so reuse that as an optimisation.
2009-08-14 00:51:52 -04:00
Joey Hess 949eb252e9 po: use discussionpage config setting
This was tricky. $links{$page/discussion} must be checked; with it in
lowercase.
2009-08-13 21:44:40 -04:00
Joey Hess 830c9e59b2 Add discussionpage configuration setting
By adding this setting, we get both more configurability, and a minor
optimisation too, since gettext does not need to be called continually
to get the Discussion value.
2009-08-13 21:41:33 -04:00
Joey Hess 159c0c043c optimise gettext calls 2009-08-13 21:04:19 -04:00
Amitai Schlair 2b7a003794 Add my CVS plugin and related patches. 2009-08-13 16:56:26 -04:00
Joey Hess 4971f873a0 more idiomatic use of foreach 2009-08-12 12:49:40 -04:00
Joey Hess 906c8f6e58 use a more idiomatic foreach my 2009-08-12 12:43:57 -04:00