Changes between Version 21 and Version 22 of AddHeadersPlugin
- Timestamp:
- Jan 17, 2016, 3:45:52 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AddHeadersPlugin
v21 v22 28 28 == Installation 29 29 30 Install as normal and enable this plugin by adding the following into your `trac.ini` file, normally found at `../conf/trac.ini`: 30 General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. 31 32 Enable this plugin by adding the following into your `trac.ini` file, normally found at `../conf/trac.ini`: 31 33 {{{#!ini 32 34 [components] … … 65 67 * ''<name>''`.class = `''<(CSS?) class of link>'' 66 68 67 `add_meta = `''<name1>''`,`''<name2>''`,``...`:: Will add [ http://en.wikipedia.org/wiki/Meta_element `meta` tags] for all given names. There is no default setting.[[BR]]69 `add_meta = `''<name1>''`,`''<name2>''`,``...`:: Will add [wikipedia:Meta_element `meta` tags] for all given names. There is no default setting.[[BR]] 68 70 [[BR]]One and only one of the following settings must be given: 69 71 * ''<name>''`.http_equiv = `''<equivalent HTTP header>'' … … 75 77 * ''<name>''`.lang = `''<language of meta tag>'' 76 78 77 See also the [#Examples example ] below.79 See also the [#Examples examples] below. 78 80 79 81 == Examples … … 81 83 === Multi-Style 82 84 83 The following example shows how to add files for a multi-style implementation, iethe user can select between different graphics styles:85 The following example shows how to add files for a multi-style implementation, so that the user can select between different graphics styles: 84 86 The !JavaScript file is located at `$TRAC_PROJECT_DIR/htdocs/js/multistyle.js` and all CSS files are located at `$TRAC_PROJECT_DIR/htdocs/css/`. 85 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`.87 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`. 86 88 87 89 Note that general CSS files are added using `add_styles`, while the others are using `add_links`. This has HTML and Trac API related reasons. … … 121 123 {{{#!html 122 124 <link title="default" type="text/css" href="/chrome/site/style.css" rel="stylesheet" /> 123 <link title="theme1" type="text/css" href="/chrome/site/theme1.css" rel="alternate stylesheet" />124 <link title="theme2" type="text/css" href="/chrome/site/theme2.css" rel="alternate stylesheet" />125 <link title="theme1" type="text/css" href="/chrome/site/theme1.css" rel="alternate stylesheet" /> 126 <link title="theme2" type="text/css" href="/chrome/site/theme2.css" rel="alternate stylesheet" /> 125 127 <meta http-equiv="keywords" content="Trac Wiki page" /> 126 128 <meta http-equiv="Content-Type" content="text/html" /> … … 134 136 # in trac.ini 135 137 [addheaders] 136 default_style_base 138 default_style_base = site/css/ 137 139 default_script_base = site/js/ 138 140 139 add_scripts 140 add_styles 141 add_scripts = abc_one,abc_two,abc_tree 142 add_styles = style_print,style_screen 141 143 }}} 142 144 … … 146 148 # in trac.ini 147 149 [addheaders] 148 default_style_base 150 default_style_base = site/css/abc_ 149 151 default_script_base = site/js/style_ 150 152 151 add_scripts 152 add_styles 153 add_scripts = one,two,tree 154 add_styles = print,screen 153 155 }}} 154 156 … … 161 163 [addheaders] 162 164 163 add_scripts 165 add_scripts = short 164 166 165 167 short.filename = /site/somewhere/Very,weird,filename @;'öäßÖÄß¼€.js … … 173 175 === General `link` tag 174 176 175 The `link` tags are used to define ''relations'' between the page and other pages, e.g.'My startpage is at ..., the next page is at ...'. Trac itself adds a couple of link tags for `help`, `up`, `prev`, etc. for some pages.177 The `link` tags are used to define ''relations'' between the page and other pages, for example 'My startpage is at ..., the next page is at ...'. Trac itself adds a couple of link tags for `help`, `up`, `prev`, etc. for some pages. 176 178 177 179 The following example would add a linked copyright notice (written in plain text) and a shortcut icon to every Trac page. Note that the information is not displayed by default to the user in any way and most browsers are ignoring link tags which aren't used for style sheets or shortcut icons.