apache > lenya
 

Serving Static Resources

Serving Static Resources

Lenya now serves static resources out of the box. Publications can either use these predefined mappings, or provide their own. The following MIME types are handled:

  • CSS
  • Javascript
  • Images (GIF, JPEG and PNG)
  • PDF
  • Shockwave Flash (*.swf)

To use the built-in matching, these resources need to be stored in the appropriate directories within a publication, and called with the proper URLs.

MIME TypePrefixDirectory
CSScss/resources/css/
Javascriptjavascript/resources/javascript/
Imagesimages/resources/images/
PDFpdf/resources/pdf/
Flashflash/resources/flash/

An image would thus be called with <img src="images/logo.gif" /> You dont have to worry about absolute vs relative image paths as long as you use URLs that follow this pattern.