{{py:
from deliverance.util.converters import asbool
}}
<ruleset>

  <server-settings>
    <server>{{host}}</server>
    <execute-pyref>true</execute-pyref>
    <dev-allow>127.0.0.1</dev-allow>
    <dev-htpasswd>deliv-users.htpasswd</dev-htpasswd>
  </server-settings>

  <proxy path="/_theme">
    <dest href="{here}/../theme" />
  </proxy>

<!-- You can add other paths that are dispatched to other hosts, for example:
  <proxy path="/trac" class="default trac">
    <dest href="http://localhost:10000" />
  </proxy>
-->

  <!-- Editor access: -->
  <proxy path="/editor">
    <dest href="{{proxy_url}}/VirtualHostBase/{wsgi.url_scheme}/{HTTP_HOST}/{{site_name}}/VirtualHostRoot/_vh_editor" />
{{if asbool(proxy_rewrite_links):}}
    <response rewrite-links="1" />
{{endif}}
  </proxy>
  <!-- Don't theme the editor, and don't theme Kupu's empty page: -->
  <match path="/editor" abort="1" />
  <match path="wildcard:*/emptypage" abort="1" />

  <proxy path="/">
    <dest href="{{proxy_url}}/VirtualHostBase/{wsgi.url_scheme}/{HTTP_HOST}/{{site_name}}/VirtualHostRoot" />
{{if asbool(proxy_rewrite_links):}}
    <response rewrite-links="1" />
{{endif}}
  </proxy>

  <theme href="/_theme/theme.html" />

<!-- You can use class="..." to specify particular rules for particular paths or hosts:

  <rule class="trac">
    <drop content="link[href$='/trac.css']" />
    <replace content="children:#content" theme="children:#theme-content" nocontent="abort" />
    <append content="children:#mainnav" theme="children:#sidebar" />
    <append content="children:#metanav" theme="children:#sidebar" />
  </rule>

-->

  <!-- These are the default rules for anything with class="default" or no class: -->
  <rule>
    <!-- You could move the title of the page into the body like this:
    <replace content="children:title" theme="children:#page-title" nocontent="ignore" move="0" />
    -->
    <replace content="children:#content" theme="children:#content" nocontent="abort" />
    <!-- You could move dynamically-generated (or managed) navigation into the page with this:
    <replace content="children:#menu" href="/theme-files/deliv-sidebar.html" theme="children:#sidebar" />
    -->
  </rule>

</ruleset>
