[Sputnik-list] Directory pages
Jérôme Vuarand
jerome.vuarand at gmail.com
Fri Feb 1 03:14:18 GMT+2 2008
2008/2/1, Jérôme Vuarand <jerome.vuarand at gmail.com>:
> 2008/1/31, Yuri Takhteyev <yuri at sims.berkeley.edu>:
> > > I'd like to edit pages with slashes in their name (for example
> > > http://mydomain.net/foo/bar). But whenever I try to edit such a page,
> > > the slashes are replaced by underscores. How can I configure Sputnik
> > > to achieve that ?
> >
> > That would be closer to "hacking" than configuring, but you can edit
> > the value of "pattern" in dirify() in sputnik/util.lua
> >
> > function dirify(text)
> > local pattern = [[[%?%+%=%%%s%'%"%/%\]+]]
> > text = text or ""
> > return text:gsub(pattern, "_")
> > end
> >
> > If there is much interest, I can make this configurable through a
> > config variable, something like
> >
> > ILLEGAL_URL_CHARACTERS = [[?+=%'"/\]]
> >
> > (plus hardcode %s). Or I could remove "/" from that list.
>
> > The reason I included "/" there is because I am thinking of one day
> > adding "groups" which will give "/" a specific meaning
>
> I noticed that the page name is used in the database (the wiki-data
> directory). Will slashes in page names be handled properly in the
> default versium backend (either by creating subdirs or by escaping it)
> ?
I tried but it failed in a versium error. Do you know what would be
the best way to escape the slash in the page name in versium so that
it doesn't get interpreted as a directory seperator ? Below is the
error I got.
Sputnik ran but failed due to an unexpected error.
Error details: ...sputnik/rocks/versium/8.01.01-0/lua/versium/init.lua:258:
Versium storage error: File Versium: Can't open file:
/path/to/wiki-data/foo/bar/000001 in mode w
stack traceback:
...sputnik/rocks/sputnik/8.01.01-0/lua/sputnik/init.lua:494: in
function <...sputnik/rocks/sputnik/8.01.01-0/lua/sputnik/init.lua:492>
[C]: in function 'error'
...sputnik/rocks/versium/8.01.01-0/lua/versium/init.lua:258: in
function 'storage_error'
...cks/versium/8.01.01-0/lua/versium/storage/simple.lua:28: in
function '_open_file'
...cks/versium/8.01.01-0/lua/versium/storage/simple.lua:43: in
function '_write_file'
...cks/versium/8.01.01-0/lua/versium/storage/simple.lua:197: in
function <...cks/versium/8.01.01-0/lua/versium/storage/simple.lua:184>
(tail call): ?
...s/versium/8.01.01-0/lua/versium/smart/repository.lua:76: in
function 'save_node'
...ks/versium/8.01.01-0/lua/versium/smart/smartnode.lua:228: in function 'save'
...rocks/sputnik/8.01.01-0/lua/sputnik/actions/wiki.lua:126: in
function <...rocks/sputnik/8.01.01-0/lua/sputnik/actions/wiki.lua:117>
(tail call): ?
...sputnik/rocks/sputnik/8.01.01-0/lua/sputnik/init.lua:459: in
function <...sputnik/rocks/sputnik/8.01.01-0/lua/sputnik/init.lua:440>
(tail call): ?
(tail call): ?
[C]: in function 'xpcall'
...sputnik/rocks/sputnik/8.01.01-0/lua/sputnik/init.lua:489: in
function 'mypcall'
...sputnik/rocks/sputnik/8.01.01-0/lua/sputnik/init.lua:512: in
function <...sputnik/rocks/sputnik/8.01.01-0/lua/sputnik/init.lua:511>
[C]: in function 'pcall'
...ath/to/sputnik/share/lua/5.1/wsapi/cgi.lua:43: in function 'run'
Sputnik.cgi:12: in main chunk
[C]: ?
More information about the Sputnik-list
mailing list