Commits

Daniel Hemmingsen committed 19942fc

Stylesheet cleaning, added markdown support for posts (Blog)

Comments (0)

Files changed (6)

demenza_site/blog/models.py

     slug = models.SlugField()
     excerpt = models.TextField(blank=True,
                                help_text="Small teaser. (Optional)")
-    body = models.TextField()
+    body = models.TextField(help_text="Markdown <a href=\"http://daringfireball.net/projects/markdown/\">supported</a>")
     publish_at = models.DateTimeField(default=datetime.datetime.now(),
                                       help_text="Date and time post should become visible.")
     blog = models.ForeignKey(Blog, related_name="posts")
         })
 
     class Meta:
-        ordering = ['publish_at', '-modified', '-created']
+        ordering = ['publish_at', '-modified', '-created']

demenza_site/settings.py

     'django.contrib.sites',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+    'django.contrib.markup',
     # Uncomment the next line to enable the admin:
     'django.contrib.admin',
     # Uncomment the next line to enable admin documentation:

templates/blog/post_archive.html

 
 {% block main %}
 <section>
-<header>
-    <h2>Recent Posts</h2>
-</header>
     {% if latest|length %}
     {% for post in latest %}
     <header>
-        <h3><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
+        <h2><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h2>
         Posted {{ post.publish_at|date }} by {{ blog.user.get_full_name }}
     </header>
         <p>{{ post.excerpt|linebreaks }}</p>
         <p>Sorry, there a no posts yet. Check back soon.</p>
     {% endif %}
 </section>
-{% endblock %}
+{% endblock %}

templates/blog/post_detail.html

         {% endwith %}
 {% endblock %}
 
+{% load markup %}
+
 {% block main %}
 <section>
 <header>
-    <h3>{{ object.title }}</h3>
+    <h2>{{ object.title }}</h2>
 </header>
 <article>
         Posted {{ object.publish_at }} by {{ object.blog.user.get_full_name }}
                 {{ tag }},
             {% endfor %}
         <br /><br />
-    {{ object.body|linebreaks }}
+    {{ object.body|markdown }}
 </article>
 <nav>
     {% with object.get_previous_by_publish_at as prev %}
     {% endwith %}
 </nav>
 </section>
-{% endblock %}
+{% endblock %}

templates/layouts/css/style.css

 /**
  * Primary styles
  *
- * Author: 
+ * Author: Daniel Hemmingsen 
  */
 
 header, footer, aside, nav, article {
 }
 
 h1, h2 {
-    font-family: "lobster-1", "lobster-2", "helvetica";
     color: #fff;
     line-height: 44px;
     padding: 22px 0;
 }
 
 h1 {
+    font-family: "lobster-1", "lobster-2", helvetica;
     font-size: 36px;
 }
 
 h2 {
+    font-family: "ff-cocon-web-pro-1", "ff-cocon-web-pro-2", sans-serif;
     font-size: 28px;
 }
 
 h3, h3 a {
-    font-family: "ff-cocon-web-pro-1","ff-cocon-web-pro-2", helvetica;
     color: #fff;
     font-size: 24px;
 }
 
+article h3 {
+    padding: 0 0 10px 0;
+    font-family: "caflisch-script-pro-1","caflisch-script-pro-2", sans-serif;
+    color: #888;
+    font-size: 28px;
+}
+
+article p {
+    font-family: "droid-serif-1","droid-serif-2",sans-serif;
+}
+
+article a {
+    color: #fff;
+}
+
+article a:hover {
+    text-decoration: underline;
+}
+
 p {
     color: #ccc;
     padding-bottom: 22px;
     float: left;
 }
 
-nav ul li a {  
+nav ul li a {
+    font-family: arial;  
     display: block;
     margin-right: 20px;
     width: 100px;
     line-height: 44px;
     text-decoration: none;
     color: #777;
+    text-transform: uppercase;
 }
 
 nav ul li a:hover {
 aside section {
     margin: 22px 0 0 22px;
     padding: 11px 22px;
-    background: url("images/sidebar_section_background.png") repeat-x;
     -moz-border-radius: 11px;
     -webkit-border-radius: 11px;
 }

templates/layouts/site_base.html

     <script src="/static/js/libs/modernizr-1.7.min.js"></script>
 
     <!-- TypeKit Fonts -->
-    <script type="text/javascript" src="http://use.typekit.com/ucw1lah.js"></script>
-    <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
 
 </head>
 
     </nav>
 <div id="content">
     <div id="mainContent">
-        <section>
+        
             {% block main %}{% endblock %}
-        </section>
+        
     </div>
     <aside>
         <section>
   </script>
 
 </body>
-</html>
+</html>