| 1 | = Add HTML Headers to Trac Pages in a simple way = |
| 2 | |
| 3 | == Description == |
| 4 | |
| 5 | This plug-in allows Trac 0.11 server admins to add script and link headers into all trac pages without having to create a Chrome template file. |
| 6 | |
| 7 | == Installation == |
| 8 | Copy the single python file into the '`plugins`' directory of your trac installation and add the following into the config file (normally '`conf/trac.ini`'): |
| 9 | |
| 10 | {{{ |
| 11 | [components] |
| 12 | addheaders.* = enabled |
| 13 | }}} |
| 14 | |
| 15 | |
| 16 | == Bugs/Feature Requests == |
| 17 | |
| 18 | Existing bugs and feature requests for AddHeadersPlugin are |
| 19 | [report:9?COMPONENT=AddHeadersPlugin here]. |
| 20 | |
| 21 | If you have any issues, create a |
| 22 | [http://trac-hacks.org/newticket?component=AddHeadersPlugin&owner=martin_s new ticket]. |
| 23 | |
| 24 | == Download == |
| 25 | |
| 26 | Download the zipped source from [download:addheadersplugin here]. |
| 27 | |
| 28 | == Source == |
| 29 | |
| 30 | You can check out AddHeadersPlugin from [http://trac-hacks.org/svn/addheadersplugin here] using Subversion, or [source:addheadersplugin browse the source] with Trac. |
| 31 | |
| 32 | == Example == |
| 33 | |
| 34 | {{{ |
| 35 | The following example shows how to add files for a multi-style implementation: |
| 36 | The JavaScript file is located "$TRAC_PROJECT_DIR/htdocs/js/multistyle.js" and all CSS files are located at "$TRAC_PROJECT_DIR/htdocs/css/". A general style file 'common.css' is included which holds all common style definition. The default style is in 'default.css' and the alternative styles in 'theme1.css' and 'theme2.css'. |
| 37 | |
| 38 | # in trac.ini |
| 39 | [addheaders] |
| 40 | default_style_base = site/css/ |
| 41 | default_script_base = site/js/ |
| 42 | |
| 43 | add_scripts = multistyle |
| 44 | add_styles = common |
| 45 | add_links = style0,style1,style2 |
| 46 | |
| 47 | style0.rel = stylesheet |
| 48 | style0.type = text/css |
| 49 | style0.title = default |
| 50 | style0.href = /chrome/site/default.css |
| 51 | |
| 52 | style1.rel = alternate stylesheet |
| 53 | style1.type = text/css |
| 54 | style1.title = theme1 |
| 55 | style1.href = /chrome/site/theme1.css |
| 56 | |
| 57 | style2.rel = alternate stylesheet |
| 58 | style2.type = text/css |
| 59 | style2.title = theme2 |
| 60 | style2.href = /chrome/site/theme2.css |
| 61 | }}} |
| 62 | |
| 63 | |
| 64 | == Recent Changes == |
| 65 | |
| 66 | [[ChangeLog(addheadersplugin, 3)]] |
| 67 | |
| 68 | == Author/Contributors == |
| 69 | |
| 70 | '''Author:''' [wiki:martin_s] [[BR]] |
| 71 | '''Contributors:''' |