krb5 commit: Reduce copied code in layout.html

Tom Yu tlyu at MIT.EDU
Thu Jan 31 15:40:49 EST 2013


https://github.com/krb5/krb5/commit/044a831217e7d4fc95ecfe83b5bb9840bd13f363
commit 044a831217e7d4fc95ecfe83b5bb9840bd13f363
Author: Tom Yu <tlyu at mit.edu>
Date:   Thu Jan 17 23:29:59 2013 -0500

    Reduce copied code in layout.html
    
    layout.html unneccesarily copied code from the parent
    agogo/layout.html content block just to alter the sidebar.  Override
    various subblocks of the sidebar instead.

 doc/_templates/layout.html |   50 +++++++++++++++++--------------------------
 1 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html
index fa0ddc8..66396b5 100644
--- a/doc/_templates/layout.html
+++ b/doc/_templates/layout.html
@@ -60,33 +60,23 @@
     </div>
 {% endblock %}
 
-{%- block content %}
-    <div class="content-wrapper">
-        <div class="content">
-            {%- block sidebar2 %} {%- endblock %}
-            {%- block sidebar1 %}
-                <div class="sidebar">
-                    <h2>{{ _('On this page') }} </h2>
-                    {{ toc }}
-                    <br/>
-                    <h2>{{ _('Table of contents') }}</h2>
-                    {{ toctree(collapse=true, maxdepth=3, titles_only=true, includehidden=false) }}
-                    <br/>
-                    <h4><a href="{{ pathto('index') }}">Full Table of Contents
-                    </a></h4>
-                    <h4>{{ _('Search') }}</h4>
-                    <form class="search" action="{{ pathto('search') }}" method="get">
-                        <input type="text" name="q" size="18" />
-                        <input type="submit" value="{{ _('Go') }}" />
-                        <input type="hidden" name="check_keywords" value="yes" />
-                        <input type="hidden" name="area" value="default" />
-                    </form>
-                </div>
-            {%- endblock %}
-            <div class="document">
-                 {%- block document %}{{ super() }}{%- endblock %}
-            </div>
-            <div class="clearer" ></div>
-        </div>
-    </div>
-{% endblock %}
+{%- block sidebartoc %}
+    <h2>{{ _('On this page') }}</h2>
+    {{ toc }}
+    <br/>
+    <h2>{{ _('Table of contents') }}</h2>
+    {{ toctree(collapse=true, maxdepth=3, titles_only=true,
+               includehidden=false) }}
+    <br/>
+    <h4><a href="{{ pathto('index') }}">Full Table of Contents</a></h4>
+{%- endblock %}
+
+{%- block sidebarsearch %}
+    <h4>{{ _('Search') }}</h4>
+    <form class="search" action="{{ pathto('search') }}" method="get">
+      <input type="text" name="q" size="18" />
+      <input type="submit" value="{{ _('Go') }}" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+{%- endblock %}


More information about the cvs-krb5 mailing list