support u-photo outside of the e-content

This commit is contained in:
Kyle Mahan 2016-02-15 10:07:34 -08:00
parent 9e8200e4a2
commit ecb2b8ed7a
4 changed files with 31 additions and 14 deletions

View file

@ -2,7 +2,7 @@
REMOTE_USER=kmahan REMOTE_USER=kmahan
HOST=orin.kylewm.com HOST=orin.kylewm.com
REMOTE_PATH=/srv/www/kylewm.com/woodwind REMOTE_PATH=/srv/www/woodwind.xyz/woodwind
ssh $REMOTE_USER@$HOST bash -c "' ssh $REMOTE_USER@$HOST bash -c "'

View file

@ -1,28 +1,37 @@
asyncio-redis==0.14.2
beautifulsoup4==4.4.1
bleach==1.4.2
blinker==1.4
certifi==2015.11.20.1
cffi==1.5.0
click==6.2
cryptography==1.2.1
feedparser==5.2.1
Flask==0.10.1 Flask==0.10.1
Flask-DebugToolbar==0.10.0 Flask-DebugToolbar==0.10.0
Flask-Login==0.3.2 Flask-Login==0.3.2
Flask-Micropub==0.2.5 Flask-Micropub==0.2.5
Flask-SQLAlchemy==2.1 Flask-SQLAlchemy==2.1
html5lib==0.9999999
idna==2.0
itsdangerous==0.24
Jinja2==2.8 Jinja2==2.8
MarkupSafe==0.23 MarkupSafe==0.23
SQLAlchemy==1.0.11
Werkzeug==0.11.3
asyncio-redis==0.14.2
beautifulsoup4==4.4.1
bleach==1.4.2
feedparser==5.2.1
html5lib==0.9999999
mf2py==1.0.2 mf2py==1.0.2
mf2util==0.2.11 mf2util==0.2.12
ndg-httpsclient==0.4.0
psycopg2==2.6.1 psycopg2==2.6.1
pyOpenSSL==0.15.1
pyasn1==0.1.9 pyasn1==0.1.9
pycparser==2.14
pyOpenSSL==0.15.1
pyquerystring==1.0.2 pyquerystring==1.0.2
pytz==2015.7 pytz==2015.7
redis==2.10.5 redis==2.10.5
requests==2.9.1 requests==2.9.1
rq==0.5.6 rq==0.5.6
sgmllib3k==1.0.0
six==1.10.0 six==1.10.0
SQLAlchemy==1.0.11
uWSGI==2.0.12 uWSGI==2.0.12
websockets==3.0 websockets==3.0
Werkzeug==0.11.3
wheel==0.24.0

View file

@ -506,7 +506,7 @@ def hentry_to_entry(hentry, feed, backfill, now):
if 'url' in value]) if 'url' in value])
# simple properties, just transfer them over wholesale # simple properties, just transfer them over wholesale
for prop in ('syndication', 'location'): for prop in ('syndication', 'location', 'photo'):
value = hentry.get(prop) value = hentry.get(prop)
if value: if value:
entry.set_property(prop, value) entry.set_property(prop, value)

View file

@ -45,6 +45,14 @@
{% if entry.title %} {% if entry.title %}
<h1>{{ entry.title }}</h1> <h1>{{ entry.title }}</h1>
{% endif %} {% endif %}
{% set photo = entry.get_property('photo') %}
{% if photo and (not entry.content or '<img' not in entry.content) %}
<div class="photo">
<img src="{{ photo | proxy_image }}" />
</div>
{% endif %}
{% if entry.content %} {% if entry.content %}
<div class="content"> <div class="content">
{{ entry.content_cleaned | proxy_all | add_preview }} {{ entry.content_cleaned | proxy_all | add_preview }}
@ -59,7 +67,7 @@
<code>@</code> {% if 'url' in location %}<a href="{{ location.url }}">{{ location.name }}</a>{% else %}{{ location.name }}{% endif %} <code>@</code> {% if 'url' in location %}<a href="{{ location.url }}">{{ location.name }}</a>{% else %}{{ location.name }}{% endif %}
</div> </div>
{% endif %} {% endif %}
<a class="permalink" href="{{ entry.permalink }}"> <a class="permalink" href="{{ entry.permalink }}">
<time datetime="{{ entry.published | isoformat }}"> <time datetime="{{ entry.published | isoformat }}">
{{ entry.published | relative_time }} {{ entry.published | relative_time }}
@ -69,7 +77,7 @@
<i class="fa fa-external-link"></i> <i class="fa fa-external-link"></i>
</a> </a>
{% if entry.get_property('syndication') %} {% if entry.get_property('syndication') %}
| {% for synd in entry.get_property('syndication') %} <a href="{{ synd }}">{{ synd | domain_for_url}}</a>{% endfor %} | {% for synd in entry.get_property('syndication') %} <a href="{{ synd }}">{{ synd | domain_for_url}}</a>{% endfor %}
{% endif %} {% endif %}