« Shipping faster than you can upgrade | Main | Off by one »

So, that took a while to figure out

base.html

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>{% block title %}Stubbie Title{% endblock %}</title>
    {% include "base_meta_inc.html" %}
{% block extraheader %}
<link rel="alternate" 
   type="application/atom+xml" 
   title="atom" href="/{{weblog.slug}}/feed/atom.xml" />
{% endblock %}
  </head>
  <body 
      id="{% block bodyid %}home{% endblock %}" 
      class="{% block bodyclass %}home{% endblock %}">
    <div id="container">
      {% block "content-header %}
        <div id="content-header" class="header">
        </div>
      {% endblock %}
      {% block columnwrap %}
        <div id="columnwrap">
          {% block content %}
            <div id="content-main" class="main">
            </div>
          {% endblock %}
          {% block content-sidebar %}
            <div id="content-sidebar" class="sidebar">
            </div>
          {% endblock %}
        </div>
     {% endblock %}
     {% block footer %}
         <div id="footer" class="main"> 
         </div>
     {% endblock %}
    </div>
  </body>
</html>

weblog/main_weblog.html

{% extends "base.html" %}
{% block "content-header %}
  <div id="content-header">    
    {% include "skins/weblog_logo.html" %}
    {% include "skins/weblog_content_header.html" %}
  </div>
{% endblock %}
{% block extraheader %}
   {{ block.super }}
<link rel="alternate" 
   type="application/atom+xml" 
   title="atom" href="/{{weblog.slug}}/feed/atom.xml" />
  {% include "skins/extraheaders_inc.html" %}
{% endblock %}
{% block content %}
  <div id="content-main" class="sidebar">
    {% include "skins/main_weblog_content_inc.html" %}
  </div>
{% endblock %}
{% block content-sidebar %}
  <div id="content-sidebar" class="sidebar">
    {% include "skins/main_weblog_sidebar_inc.html" %}
  </div>
{% endblock %}
{% block footer %}
  <div id="footer">
    {% include "skins/weblog_footer_inc.html" %}
  </div>
{% endblock %}

skins/

  • extraheaders_inc.html
  • weblog_logo.html
  • weblog_content_header.html
  • main_weblog_content_inc.html
  • main_weblog_sidebar_inc.html
  • weblog_footer_inc.html

It's a start I suppose. Thank God for Django templates is all I can say. Writing composable makefiles back in the day was easier than figuring out skinnable templates. "Support multiple weblogs" - I must be insane

File under 'I need meaningful work that involves floating point numbers'


February 28, 2007 09:30 PM

Comments

Post a comment

(you may use HTML tags for style)




Remember Me?

Trackback Pings

TrackBack URL for this entry:
http://www.dehora.net/mt/mt-tb.cgi/2047