Feature #1183
closedmod_dirlist.c supporting default_css
Description
Hi there,
I'm using lighttpd for several months now on my rootserver. I had the problem that mod_dirlisting doesn't allow to specify a default_css. Sure there's external_css, but the CSS specified with this directive has to be reachable via URL. This is complicated when using vhosts, because there has to be a css file for each vhost. My modification makes it possible to specify default_css, which content will be printed out into the html file so that theres no need to be public available.
Greetz halfdan
******
http://c0demonkey.com
-- halfdan
Updated by Anonymous over 17 years ago
the file can be found at http://c0demonkey.com/files/mod_dirlisting.c
Updated by jcak77 over 16 years ago
Hi,
In your source, you've added:
BUFFER_APPEND_STRING_CONST(out, "<style type=\"text/css\">\n"); char c[80]; FILE * css; css = fopen(p->conf.default_css->ptr,"r"); if(css !=NULL) { while(fgets(c, 10, css)!=NULL) { buffer_append_string_len(out, c, strlen(c)); } } else { buffer_append_string_buffer(out, p->conf.default_css); } BUFFER_APPEND_STRING_CONST(out, "</style>");
I think you must enclose the content of the file with a CDATA section, since lighttpd generates xhtml. With the current version, things like:
body > table { ...some CSS rules... }
...will produce an invalid XHTML page because of the > symbol (which is valid in CSS).
Updated by jcak77 over 16 years ago
Also, bug 1605 supersedes this one, since you can use inlined CSS in the file pointed to by dirlisting.extra-head as well as any other XHTML directive meant to be part of <head>.
Updated by gstrauss over 8 years ago
- Description updated (diff)
- Assignee deleted (
jan) - Priority changed from High to Normal
Updated by gstrauss over 8 years ago
- Related to Feature #1458: Several listing enhancements added
Updated by gstrauss over 8 years ago
- Related to Feature #1605: patch for dirlisting.extra-head confvar added
Updated by gstrauss over 8 years ago
- Status changed from New to Wontfix
Superceded by https://redmine.lighttpd.net/issues/1458 in lighttpd 1.4.x
Also available in: Atom