Commit Graph

2165 Commits (beae7ef9db01ab2af75d3176b016113c9d33f0a9)

Author SHA1 Message Date
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 3adb47ec4f Merge branch 'master' into commentreorg
Conflicts:
	debian/changelog
2010-05-07 12:42:38 -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 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 1193759568 remove unused indexlink function and template variable 2010-05-05 20:42:56 -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 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 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 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 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 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