Ticket #1183 (new enhancement)

Opened 16 months ago

Last modified 6 months ago

mod_dirlist.c supporting default_css

Reported by: halfdan Owned by: jan
Priority: high Milestone: 1.5.0
Component: mod_dirlisting Version: 1.4.15
Severity: normal Keywords: css, dirlisting
Cc: Blocked By:
Need User Feedback: no Blocking:

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

Attachments

Change History

in reply to: ↑ description   Changed 16 months ago by anonymous

  Changed 6 months ago by jcak77

  • pending unset

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).

  Changed 6 months ago by jcak77

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>.

Add/Change #1183 (mod_dirlist.c supporting default_css)

Author



Change Properties
<Author field>
Action
as new
 
Note: See TracTickets for help on using tickets.