Skip to content

Commit

Permalink
work on blog to front page
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Ngo committed Oct 30, 2011
1 parent 7a48f4d commit 1db96b7
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 35 deletions.
4 changes: 0 additions & 4 deletions content/home.mkd
@@ -1,10 +1,6 @@
title: Home
type: home
url: /index{page}.html
image:
url: /images/firefox_crop_circle.jpg
where: top
caption: Created by the OSU LUG to celebrate <a href="http://firefoxcropcircle.com/circle">the 200 millionth download of Firefox</a>.
---

Welcome to the new OSU LUG website!
Expand Down
20 changes: 13 additions & 7 deletions media/stylesheets/base.css
Expand Up @@ -185,10 +185,22 @@ ul.subpage-list li {
height: 125px;
}

.blog-index img {
float: left;
padding-right: 20px;
max-width: 320px;
max-height: 240px;
}
.blog-top img {
float: left;
padding-right: 20px;
max-width: 960px;
max-height: 320px;
}
.blog-index h3, .blog-index h4 {
line-height: 18px;
}
.blog-index-post pre {
.blog-index pre {
display: inline;
background: white;
border: none;
Expand All @@ -204,12 +216,6 @@ ul.subpage-list li {
.blog-index-post h1, .blog-index-post h2 {
display: none;
}
.blog-index-image img {
float: left;
padding-right: 20px;
max-width: 320px;
max-height: 240px;
}
.blog-index-title {
font-size: 1.3em;
font-weight: bold;
Expand Down
96 changes: 72 additions & 24 deletions templates/home.html
Expand Up @@ -2,33 +2,81 @@

{% block content %}
<div class="container">
{% for blog in site.categories['blog'] | sort(attribute='datetime', reverse=True) %}
<!--Featured blog post-->
{% if loop.first %}
<div class="blog-top">
{% if blog.image %}
<img src="{{blog.image.url}}"/>
{% endif %}
<div style="min-height: 360px;">
<span class="blog-index-post">
{{blog.content|truncate(length=930, end="<a href="+blog.url+">...more</a>")}}
</span>
</div>
</div>
{% endif %}
<!-------------------->
{% endfor %}

<div class="row">
<div class="span10 columns">
{{page.content}}
<div class="span5 columns" style="float:right;">
<h2>Upcoming Events</h2>
<ol>{% for event in site.categories['events']|sort(attribute='datetime') %}
{% if event.datetime > site.datetime %}
<li class="list">
<h3>
<a href="{{ event.url }}">{{ event.title }}</a>
</h3>
<h4>
{% if event.location %}
{{ event.location }} -
{% endif %}
{{ event.date.strftime('%b %d, %Y') }}
</h4>
{{ event.preview }}
</li>
{% if not loop.last %}
<hr>
{% endif %}
{% endif %}
{% endfor %}
</ol>
</div>
<div class="span1 columns">&nbsp;</div>
<div class="span5 columns">
<h2>Upcoming Events</h2>
<ol>{% for event in site.categories['events']|sort(attribute='datetime') %}
{% if event.datetime > site.datetime %}
<li class="list">
<h3>
<a href="{{ event.url }}">{{ event.title }}</a>
</h3>
<h4>
{% if event.location %}
{{ event.location }} -
<div class="span10 columns">
{% for blog in site.categories['blog'] | sort(attribute='datetime', reverse=True) %}
<div class="blog-index">
{% if blog.image %}
<div class="blog-index-image">
<img src="{{blog.image.url}}"</img>
</div>
{% endif %}
<span class="blog-index-title"><a href="{{blog.url}}">{{ blog.title }}</a></span>
<span class="blog-subtitle">
{% if blog.authors %}
by {% for author in blog.authors %}
{% if loop.last and not loop.first %}and {% endif %}
{{ author.name }}{% if not loop.last %}, {% endif %}
{% endfor %}
{% endif %}
{{ event.date.strftime('%b %d, %Y') }}
</h4>
{{ event.preview }}
</li>
{% if not loop.last %}
<hr>
{% endif %}
{% endif %}
{% endfor %}</ol>
{% if blog.datetime %}
on {{ blog.datetime.strftime("%A %B %d, %Y at %I:%M %p ") }}
{% endif %}
</span>
<br/>

<div style="min-height: 200px;">
<span class="blog-index-post">
{{blog.content|truncate(length=930, end="<a href="+blog.url+">...more</a>")}}
</span>
</div>
</div>
<hr/>
<br/>
{% endfor %}
<div class="span1 columns">&nbsp;</div>
</div>
</div>
</div>

</div>
{% endblock %}

0 comments on commit 1db96b7

Please sign in to comment.