wiki:TipAndDoc/project/trac/templates

Version 2 (modified by mitty, 14 years ago) (diff)

--

Templates for Trac

  • Trac 0.11以降を対象

site.html

  • Trac 0.11で新しく環境を作成すると、/path/to/trac/env/templates/site.htmlが自動生成される。
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:py="http://genshi.edgewall.org/" py:strip="">
      <!--! Custom match templates go here -->
    </html>
    
    • globalのtrac.iniなどで指定([inherit] templates_dir)したsite.htmlは各環境ごとのsite.htmlで上書きされるため、0.11からupgradeした場合などは注意が必要。
  • 0.12ではsite.html.sampleが自動生成される
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:xi="http://www.w3.org/2001/XInclude"
          xmlns:py="http://genshi.edgewall.org/"
          py:strip="">
      <!--!
        This file allows customizing the appearance of the Trac installation.
        Add your customizations here and rename the file to site.html. Note that
        it will take precedence over a global site.html placed in the directory
        specified by [inherit] templates_dir.
        
        More information about site appearance customization can be found here:
        
          http://trac.edgewall.org/wiki/TracInterfaceCustomization#SiteAppearance
      -->
    </html>
    
  • site.htmlを空のファイル(0byte)にするとエラーになる
    TemplateSyntaxError: no element found: line 1, column 0 (/path/to/global/trac/templates/site.html, line 1)