Commit Graph

2870 Commits (a8e3040d0aa6c717bec072bff9cd80223e399a0c)

Author SHA1 Message Date
Simon McVittie 059259ecd1 Allow autoindex files to be written into the transient underlay
As with the tag plugin, for the moment keep the old behaviour in the test.
2011-01-22 22:36:41 +00:00
Simon McVittie 594a919456 Merge branch 'ready/autoindex-autofile' into HEAD 2011-01-22 22:35:37 +00:00
Simon McVittie 8ee9eabb1c autoindex: stop tracking deletions, use generic autofile tracking instead
- Migrate the set of deletions to the {autofile} set, since it has
  more or less the same effect. This affects the "deleted" case in the
  test.
- If a page has just been deleted, add it as an autofile anyway: by
  the time gen_autofile is called, it'll be in the list of deleted files,
  so it'll just be added to {autofile}. This affects the "gone" case
  in the test.
- Behaviour change: we don't forget that a page with no reason to be
  re-created was deleted. This affects the 'expunged' and 'reinstated'
  cases in the test.
2011-01-22 22:28:50 +00:00
Simon McVittie dca6679a54 autoindex: use add_autofile
This does cause a minor regression: index pages are now committed
individually rather than being a single commit per rebuild.

This also means the autoindex regression test needs to trigger the
autofile generation pass.
2011-01-22 22:25:48 +00:00
Joey Hess b5d7469830 rename: Fix crash when renaming a page that is linked to by a page in an underlay.
Skip fixing links in such pages. The user will get a list of pages that
still link to the old page.
2011-01-22 10:20:38 -04:00
Joey Hess dcfeaaad5b comments: Fix XSS security hole due to missing validation of page name.
Values have to be checked against wiki_file_regexp, not just file_pruned.
Audited the rest of the code base for similar problems, found none.
2011-01-22 10:15:33 -04:00
Joey Hess 5d3998555f fix uninitilized value warning on bad page name 2011-01-22 10:07:37 -04:00
Simon McVittie d851ae76f6 Put newly aggregated pages in the transient underlay 2011-01-07 20:19:58 +00:00
Simon McVittie 512d860c16 Only unlink excess recentchanges from srcdir if not in transientdir 2011-01-07 20:13:01 +00:00
Simon McVittie 44abf016b3 Put recent changes in the transient underlay 2011-01-07 20:13:01 +00:00
Simon McVittie 40f85e5c91 tag: default to tag_autocreate_commit=1 as intended 2011-01-07 20:11:38 +00:00
Simon McVittie 2a60cda172 tag: optionally write autocreated tags to the transient underlay
For the moment, have the tag test keep the old behaviour.
2011-01-07 20:09:52 +00:00
Simon McVittie dff44e4a6d Add add_literal_underlay and use it for the transient underlay
This means we don't need to import Cwd and use abs_path.
2011-01-07 20:04:45 +00:00
Simon McVittie 44b0cea85f Assume obsolete transient pages have the same extension as the changed page 2011-01-07 19:50:34 +00:00
Simon McVittie c7bf305c81 GC unused pages in the transient underlay 2011-01-07 18:53:27 +00:00
Simon McVittie 8250c3a457 Add transient plugin, which adds ~/.ikiwiki/transient as an underlay
This can contain auto-generated things, like tag pages; if edited
they'll automatically migrate into source code control.
2011-01-07 18:53:27 +00:00
Joey Hess 56259466ee reword feed descs 2011-01-06 14:42:23 -04:00
Giuseppe Bilotta 962b1c130c inline: pass the Atom/RSS titles to the templates
The default templates are also updated to make use of this information.
The rel="alternate" attribute is also inserted, for completeness.
(cherry picked from commit 618ade535e6a7967a510d9e210edaef3d37cc9bc)
2011-01-06 14:40:33 -04:00
Joey Hess a3605a90d5 fix urlto(undef) 2011-01-05 18:08:03 -04:00
Joey Hess d991ccf134 use cgitemplate, remove misctemplate 2011-01-05 17:15:38 -04:00
Joey Hess 4a6ac6b485 add cgitemplate
cgitemplate is a modified misctemplate that takes an optional cgi object
and uses it to set the baseurl, and also optionally the forcebaseurl,
if a page is provided.

If no cgi object is provided, it will fall back to using $config{url}.
I expect this will only be needed in exceptional cases where
that doesn't much matter, such as cgierror().

showform uses cgitemplate, so there is no more need for showform_preview.
2011-01-05 17:06:11 -04:00
Joey Hess ea734d451c better handling of relative permalinks
This way, do=goto will go to the page relative to
the current location, while the permalinks in feeds
will be absolute (unless an url is not configured at all).
2011-01-05 16:26:09 -04:00
Joey Hess c91b39fdb5 factored out an urlabs from aggregate and cgi 2011-01-05 16:18:25 -04:00
Joey Hess 49928906b0 oops 2011-01-05 16:11:54 -04:00
Joey Hess 4dbb8120f7 Export three cgi env vars needed for CGI->url to work. 2011-01-05 16:08:21 -04:00
Joey Hess 3eabf323f0 Fix permalinks to recentchanges items and comments, broken by last release.
permalinks always need to be full urls
2011-01-05 15:22:55 -04:00
Joey Hess 7a88638c6c typo 2011-01-05 15:12:23 -04:00
Joey Hess 9efe370fa0 remove old unused baseurl parameter
This was I think a relic from when BASEURL was used in more templates than
use it now.
2011-01-05 14:57:26 -04:00
Joey Hess 270cbd7cf5 Fix redirect to use a full url.
Was broken (in theory) by baseurl changes in last release.
2011-01-05 14:57:04 -04:00
Joey Hess 8c9c3915ec Fix base url when previewing. Was broken by urlto changes in last release.
Added a showform_preview that is like showform, but sets forcebaseurl
to point to the page being previewed.
2011-01-05 13:50:42 -04:00
Giuseppe Bilotta 5365a72e42 unescape tag names
Since tag names are now retrieved from the file names, we must revert
the escaping process that santizes the file names. Solve by adding a
`pagetitle()` call at the end of the tagname()
(cherry picked from commit 0ee0612b1ab11d76eb3790c8db7a2ba992c54f6b)
2011-01-05 12:06:36 -04:00
Joey Hess 1b1b3927ee fix patch to not strip a leading "." unless it's part of a path
For correctness only, since a tag named ".foo" is very unlikely.
2011-01-04 15:59:28 -04:00
Joey Hess fc6c0e8b5b fix patch to not expose config setting as a regexp 2011-01-04 15:59:00 -04:00
Giuseppe Bilotta a17469e388 tag name sanitation
The use of typed links for tags and some of the consequent changes
introduced some unwanted functionality variations in the tag system. Two
problems in particular could be observed, when compared to the use of
tags in older versions of IkiWiki:

* tags in feeds (both rss and atom) would use the file path as their
  name (e.g. you would have <category term="tags/sometag" /> in an atom
  item for a page tagged sometag with a tagbase of tags), whereas they
  appeared pure before
* tags containing a slash character would appear without the slash
  character but be used with the slash character in other circumstances
  (effect visible by tagging a page with a name such as "with/slash")

Both of these issues are fixed by introducing a tagname() function that
takes a tag link and effectively reverses (as well as possible) the
effects of taglink().

A possible alternative route would have been the reintroduction of the
global %tags hash, but the new approach as the (arguable) benefit of
introducing a small layer of sanitation for tag names.
2011-01-04 15:58:42 -04:00
Joey Hess 69b9fd132d remove second parameter to include_javascript
function used to take a second parameter to control absoluteness, no longer
does
2011-01-02 18:33:05 -04:00
Joey Hess 7d0ef85d80 git: Fix bug involving attempting to web revert a commit that included changes to attachments. 2010-12-29 20:19:58 -04:00
Joey Hess 8517aa8687 bugfix 2010-12-29 20:10:28 -04:00
Joey Hess 4fb26f4e60 Add a second parameter to the rcs_diff hook, and avoid bloating memory reading in enormous commits. 2010-12-29 19:58:49 -04:00
David Bremner ab511bb39c Update highlight plugin for highlight api.
Note that in particular calling initTheme with and empty file does not
work anymore.

use of initLanguage was replaced by loadLanguage, which seems to work
in both places.

I tried to make it a bit more robust against missing a highlight package.
There are lots of warnings, but it no longer crashes.
2010-12-29 13:05:20 -04:00
Thomas Keller 6379737970 monotone.pm: while we're still only checking the major and minor
part of the version number of the monotone binary, we do not want
to give false alarm on patch or development versions
2010-12-28 01:55:12 +01:00
Paul Menzel 68e333e0bd teximg: Use `\[` and `\]` instead of not recommended `$$`.
It is not recommended to use the double dollar symbol `$$` to set displayed math [1][2].

[1] http://en.wikibooks.org/wiki/LaTeX/Mathematics
[2] http://www.math.uiuc.edu/~hildebr/tex/displays.html

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
2010-12-26 14:46:29 -04:00
Joey Hess 326c4d6af2 use CGI->url to get current absolute cgi url for openid login process 2010-12-25 15:08:22 -04:00
Joey Hess 93d7368a32 revert cgiurl change that broke openid login 2010-12-25 14:23:55 -04:00
Joey Hess beae7ef9db editpage, comment: Clean up title when editing or creating a page or comment.
Now that page.tmpl is used for cgi, the parentlinks are able to be
displayed even when creating or editing a page. So it's redundant to
include the path to the page in the title, remove it.
2010-12-25 13:38:26 -04:00
Joey Hess 9741a3f979 inline: Force an absolute page location when the inline postform is used.
There seems no need to allow selecting a location when creating a page this
way; the user should always want it to appear in the inline whose form they
submitted.
2010-12-25 13:32:57 -04:00
Joey Hess 80e3f7c309 indent 2010-12-25 13:23:23 -04:00
Joey Hess fd95afe8ea fix comment 2010-12-25 13:12:21 -04:00
intrigeri 406485917a po: do not override homepage title when it was overridden. 2010-12-22 17:33:57 +01:00
intrigeri 74055be78f po plugin: update injected urlto signature.
The lack of $from will probably hurt setups using po_link_to = current,
but at least we can fix the blocker bug that prevents any wiki using the po
plugin to build.
2010-12-20 14:36:21 +01:00
Giuseppe Bilotta bb8f76a4a0 inline: base feed names on the included page name
Use the included page name rather than the including page name. This
allows us to allow feeds in nested inlines without duplicating feeds
with the same content under different (and stupid) names.
2010-12-05 16:34:11 -04:00
Joey Hess aa65300c2f meta: Fix calling of htmlscrubber to pass the page parameter. The change of the htmlscrubber to look at page rather than destpage caused htmlscrubber_skip to not work for meta directives. 2010-12-01 20:25:05 -04:00
Joey Hess 3697a684df Merge remote branch 'smcv/ready/sslcookie-auto' 2010-11-29 16:31:25 -04:00
Simon McVittie f33c2af2c4 Always set secure cookies if logging in via HTTPS 2010-11-29 19:30:44 +00:00
Joey Hess 1182e9d0ee use one-parameter form of urlto 2010-11-29 15:07:26 -04:00
Joey Hess 0ae1e4cc0e Merge remote branch 'smcv/ready/localurl' 2010-11-29 14:43:57 -04:00
Joey Hess 170cb02479 git: Avoid adding files when committing, so as not to implicitly add files like recentchanges files that are not normally checked in, when fixing links after rename. 2010-11-29 13:42:03 -04:00
Joey Hess a5120846cb rename: Fix to pass named parameters to rcs_commit 2010-11-29 13:28:28 -04:00
Joey Hess 78a22e2eb2 git: Fix temp file location. 2010-11-29 12:01:50 -04:00
Simon McVittie 18bb93f574 pinger: avoid pinging our own local path, too 2010-11-23 23:14:38 +00:00
Simon McVittie 2411e2be1f Use local path for even more CGI URLs 2010-11-23 23:12:21 +00:00
Simon McVittie 4625e0c4d9 Pass a CGIURL into commentmoderation.tmpl
Omitting this resulted <form action=""> which is in fact a working
self-referential form, but is less obvious than it ought to be.
2010-11-23 00:20:57 +00:00
Simon McVittie 1f019ac2aa Use local paths for most references to pages 2010-11-23 00:19:10 +00:00
Simon McVittie 296e5cb2fd Use local paths for the CGI URL 2010-11-23 00:12:17 +00:00
Simon McVittie 78c595736e Use local paths when including Javascript 2010-11-23 00:06:07 +00:00
Simon McVittie d2e3741a6f Use local paths for redirection where possible 2010-11-23 00:00:11 +00:00
Joey Hess 31f0e459b8 edittemplate: Fix crash if using a .tmpl file or other non-page file as a template for a new page. 2010-11-20 14:54:43 -04:00
Joey Hess af5f162ca7 highlight: Support new format of filetypes.conf used by version 3.2 of the highlight package. 2010-11-20 12:55:26 -04:00
Simon McVittie 55515050e1 make use of precompiled regex objects 2010-11-20 00:02:49 +00:00
Joey Hess b00c6c9640 inline: Improve RSS url munging to use a proper html parser
and support all elements that HTML::Tagset knows about.

(Which doesn't include html5 just yet, but then the old version didn't either.)

Bonus: 4 times faster than old regexp method.
2010-11-16 16:57:50 -04:00
Joey Hess c502b8fe54 indentation 2010-11-16 15:40:16 -04:00
Joey Hess cedf2c0af5 Fix escaping of filenames in historyurl. (Thanks, aj) 2010-11-16 15:12:52 -04:00
Joey Hess ec6c1269d2 more: Add pages parameter to limit where the more is displayed. (thanks, dark) 2010-11-16 15:00:04 -04:00
Joey Hess b85ca8603a websetup: Fix encoding problem when restoring old setup file. 2010-11-16 14:24:15 -04:00
Joey Hess d8de98911e comments: Make comment() pagespec also match comments that are being posted. 2010-11-12 00:36:03 -04:00
Joey Hess 78de33d2ea comments: Make postcomment() pagespec work when previewing a comment. 2010-11-12 00:28:27 -04:00
Joey Hess 289b30a47d Fix htmlscrubber_skip to be matched on the source page, not the page it is inlined into. Should allow setting to "* and !comment(*)" to scrub comments, but leave your blog posts unscrubbed, etc. 2010-11-12 00:00:54 -04:00
Tuomas Jormola d32a1028ab Use author date instead of commit date
Signed-off-by: Tuomas Jormola <tj@solitudo.net>
2010-10-31 16:06:25 -04:00
Craig Lennox cf2e3cb7d9 Added missing registration of checkconfig hook. 2010-10-31 10:12:01 -04:00
Tuomas Jormola 4573524196 Added missing hook registration for checkconfig
Signed-off-by: Tuomas Jormola <tj@solitudo.net>
2010-10-30 22:02:30 -04:00
Joey Hess ac6b5c12fa squash undef 2010-10-25 23:31:41 -04:00
Joey Hess ac8aad2eca remove a last that won't work 2010-10-25 23:03:28 -04:00
Joey Hess 5c6eb167b8 highlight: Ensure that other, more-specific format plugins, like txt are used in preference to this one in case of ties. 2010-10-25 23:00:32 -04:00
Joey Hess 2076ed597c txt: Fix display when used inside a format directive.
txt's use of a format hook can't work in that case, so it needs to use a
htmlizeformat hook in this case to handle wrapping the text in pre tags.
2010-10-25 22:37:34 -04:00
Joey Hess 5db2d6f6b2 nice message if someone tries to revert a merge commit 2010-10-23 17:19:48 -04:00
Joey Hess 62a0f2f3d6 bugfix 2010-10-23 16:31:58 -04:00
Joey Hess 9ca9959eda fix web reversion when the srcdir is in a subdir of the git repo. 2010-10-23 16:19:16 -04:00
Joey Hess 1c5a3f2c67 Fix typo that broke anonymous git push. 2010-10-23 15:25:29 -04:00
Joey Hess 9b832df0d2 add a missing chomp 2010-10-19 21:38:34 -04:00
Joey Hess 8555d10f63 img: If a class is specified, don't also put the img in the img class. 2010-10-13 12:57:16 -04:00
Joey Hess 7ba0f7d297 monotone: Fix recentchanges page when the srcdir is not at the top of the monotone workspace. Thanks, tommyd. 2010-10-11 20:30:14 -04:00
Joey Hess cfbd272c8b websetup: Fix defaults of checkboxes in advanced mode.
So formbuilder has an annoying glitch, that setting the value of a
checkbox, even without force, will override the value currently on the
form. Thus the guards against changing checkbox values when a form has been
submitted.

But those guards also prevented the checkboxes for advanced items getting
the right value when going into advanced mode.

Note that if the user makes changes to advanced mode stuff and leaves
advanced mode, those changes are lost. That seems reasonable so I didn't
change it -- and it made this fix simple.
2010-10-11 11:41:34 -04:00
Joey Hess 274219ecc8 websetup: Fix saving of advanced mode changes.
The showadvanced field was not known to formbuilder when hitting the save
changes button.
2010-10-11 11:12:41 -04:00
Joey Hess 9aa9604c36 add blank line 2010-10-08 19:26:31 -04:00
Joey Hess 7d5ac1cdd9 typo 2010-10-08 19:25:35 -04:00
Joey Hess 7e9ca590c7 add message field to revert form 2010-10-08 19:19:43 -04:00
Joey Hess fb4ee927a0 propigate rcs_revert error message
and misc reorg
2010-10-08 18:59:04 -04:00
Joey Hess 4efc1f22d4 taint handling for rev 2010-10-08 18:58:47 -04:00
Joey Hess c430792148 refactor 2010-10-08 18:50:24 -04:00
Joey Hess e7d6dcfed6 remove todo item
I understand the need to avoid chdir when running git_parse_changes
for receive now. At that point, the changes have not been pushed to
the srcdir's repo yet. When running the same code for preprevert,
chdir to the srcdir is ok, and necessary.
2010-10-08 18:46:30 -04:00
Joey Hess faf94b5787 refactor check_canchange into IkiWiki library 2010-10-08 18:09:28 -04:00