summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/blog/models.py7
-rw-r--r--app/builder/base.py2
-rw-r--r--design/templates/archives/homepage.html12
3 files changed, 16 insertions, 5 deletions
diff --git a/app/blog/models.py b/app/blog/models.py
index a764c5c..d2fe954 100644
--- a/app/blog/models.py
+++ b/app/blog/models.py
@@ -102,8 +102,13 @@ class Entry(models.Model):
def get_image_hero_url(self):
img = self.image.url.split('post-images/')[1].split('/')[1]
- #return '%shome-images/%s' % (settings.IMAGES_URL, img)
return '/media/images/home-images/hero%s' % (img)
+
+ def get_image_hero_url_sm(self):
+ img = self.image.url.split('post-images/')[1].split('/')[1]
+ import os
+ img = os.path.splitext(img)[0]
+ return '/media/images/home-images/hero%s_sm.jpg' % (img)
@property
def state(self):
diff --git a/app/builder/base.py b/app/builder/base.py
index 2845225..59dcef8 100644
--- a/app/builder/base.py
+++ b/app/builder/base.py
@@ -288,4 +288,4 @@ class BuildMap(Build):
'IMAGES_URL': settings.BAKED_IMAGES_URL
})
t = render_to_string('archives/map.html', c).encode('utf-8')
- self.write_file('map', t)
+ self.write_file('', t, "html",'map')
diff --git a/design/templates/archives/homepage.html b/design/templates/archives/homepage.html
index 3e39e82..cbdfdcc 100644
--- a/design/templates/archives/homepage.html
+++ b/design/templates/archives/homepage.html
@@ -6,10 +6,16 @@
{% block primary %}<section class="banner">{% for object in object_list %}{% if forloop.counter == 1 %}
<article class="h-entry hentry {% cycle 'odd' 'even' %} {% cycle 'first' 'second' 'third' %}">
<div class="post--image">
- <a href="{{object.get_absolute_url}}" title="{{object.title}}"><img src="{{object.get_image_hero_url}}" alt="{{ object.title }}" class="u-photo post-image homepage--hero" /></a>
+ <a href="{{object.get_absolute_url}}" title="{{object.title}}">
+ <picture>
+ <!--<source media="(min-width: 45em)" srcset="large.jpg">-->
+ <source media="(max-width: 30em)" srcset="{{object.get_image_hero_url_sm}}">
+ <img src="{{object.get_image_hero_url}}" alt="{{ object.title }}" class="u-photo post-image homepage--hero" />
+ </picture>
+ </a>
</div>
<div class="hero--wrapper">
- <h1 class="p-name entry-title post--title main--header"><a href="{{object.get_absolute_url}}" class="u-url" title="{%if object.title_keywords%}{{object.title_keywords}}{%else%}{{object.title}}{%endif%}">{{object.title|safe|smartypants|widont}}</a></h1>
+ <h1 class="p-name entry-title post--title main--header"><a href="{{object.get_absolute_url}}" class="u-url" title="{%if object.title_keywords%}{{object.title_keywords}}{%else%}{{object.title}}{%endif%}">{{object.title|safe|smartypants}}</a></h1>
<p class="p-author author hide">Scott Gilbertson</p>
<time class="dt-published published dt-updated post--date" datetime="{{object.pub_date|date:'c'}}">{{object.pub_date|date:"F"}} <span>{{object.pub_date|date:"j, Y"}}</span></time>
<p class="p-location h-adr adr post--location main--location">
@@ -58,4 +64,4 @@
</div>
{% endblock %}
-{% block js %}<script async src="/media/js/hyphenate.min.js" type="text/javascript"></script>{% endblock%}
+{% block js %}{% comment %} <script async src="/media/js/hyphenate.min.js" type="text/javascript"></script>{% endcomment%}{% endblock%}