From 5cf566251ae267eebce5b375c1d58fff14a7e5aa Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 28 Jun 2018 11:03:31 +1000 Subject: [PATCH 1/3] Redesign the display of entry 'metadata', like author and category, to be way more space-efficient - should make tiny statuses less 'heavy' --- entries/jinja2/entries/h-entry.html | 52 ++++++++++--------------- entries/static/entries/css/h-entry.styl | 29 ++++++++------ 2 files changed, 38 insertions(+), 43 deletions(-) diff --git a/entries/jinja2/entries/h-entry.html b/entries/jinja2/entries/h-entry.html index b9a05f6..6d55eb2 100644 --- a/entries/jinja2/entries/h-entry.html +++ b/entries/jinja2/entries/h-entry.html @@ -1,64 +1,54 @@ {% macro hEntry(entry, indent_width) -%} {%- set i = ' ' * indent_width -%} -
- {% if entry.photo %} - {{i}} - - {% endif %} - {{i}}
- {% if entry.name %} - {{i}}

{{ entry.name }}

- {% endif %} - {{i}}
- {{i}}{{ entry.content | markdown }} - {{i}}
- {{i}}
- - {{i}} - - {% if entry.cats.exists() %} - {{i}} - - {% endif %} - {% if entry.syndications.exists() %} - {{i}}
{%- endmacro %} diff --git a/entries/static/entries/css/h-entry.styl b/entries/static/entries/css/h-entry.styl index 2fb7701..1177403 100644 --- a/entries/static/entries/css/h-entry.styl +++ b/entries/static/entries/css/h-entry.styl @@ -10,7 +10,23 @@ ol.entries, div.entry &:last-child margin-bottom 0 -.card.h-entry +.h-entry.media + > aside.info + display flex + flex-direction column + align-items center + font-size 0.8rem + margin-right 1rem + + a.p-author + text-align center + img.u-photo + border-radius .25rem + height 3em + > * + margin-bottom .25rem + > .card + flex 1 .e-content ul list-style-type disc @@ -26,14 +42,3 @@ ol.entries, div.entry max-width 100% > :last-child margin-bottom 0 - - .card-footer - text-align center - > * - display inline-block - margin-right 1rem - &:last-child - margin-right 0 - .h-card > img - height 1em - vertical-align baseline From dec5ef153b1f184a5a0cc4ac62fdecb97ca6e8ba Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 28 Jun 2018 11:10:56 +1000 Subject: [PATCH 2/3] Set a theme-color in the template again, so mobile Chrome uses it properly --- lemoncurry/jinja2/__init__.py | 2 ++ lemoncurry/jinja2/lemoncurry/layout.html | 3 ++- wellknowns/views/manifest.py | 12 +----------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lemoncurry/jinja2/__init__.py b/lemoncurry/jinja2/__init__.py index cf944df..e463d47 100644 --- a/lemoncurry/jinja2/__init__.py +++ b/lemoncurry/jinja2/__init__.py @@ -9,6 +9,7 @@ from django_activeurl.ext.django_jinja import ActiveUrl from entries.kinds import all as entry_kinds from .markdown import markdown +from ..theme import color as theme_color from ..utils import friendly_url, load_package_json @@ -29,6 +30,7 @@ def environment(**options): 'package': load_package_json(), 'settings': settings, 'static': staticfiles_storage.url, + 'theme_color': theme_color, 'url': reverse, }) return env diff --git a/lemoncurry/jinja2/lemoncurry/layout.html b/lemoncurry/jinja2/lemoncurry/layout.html index 09800e4..1d02480 100644 --- a/lemoncurry/jinja2/lemoncurry/layout.html +++ b/lemoncurry/jinja2/lemoncurry/layout.html @@ -5,13 +5,13 @@ {% if title %}{{ title }} ~ {% endif %}{{ request.site.name }} - {% block head %}{% endblock %} {% if atom is defined %} {% endif %} {% if rss is defined %} {% endif %} + {% block head %}{% endblock %} @@ -20,6 +20,7 @@ + diff --git a/wellknowns/views/manifest.py b/wellknowns/views/manifest.py index d50cf16..45f108b 100644 --- a/wellknowns/views/manifest.py +++ b/wellknowns/views/manifest.py @@ -24,17 +24,7 @@ def manifest(request): 'start_url': urljoin(base, start_url), 'background_color': color(0), - 'theme_color': color(2), + 'theme_color': color(10), } - # icons = FaviconImg.objects.filter( - # faviconFK__isFavicon=True, - # rel__in=rels, - # ).order_by('size') - # app['icons'] = [{ - # 'type': 'image/png', - # 'sizes': '{0}x{0}'.format(icon.size), - # 'src': urljoin(base, icon.faviconImage.url), - # } for icon in icons] - return JsonResponse(app, content_type='application/manifest+json') From bc8d7923b47c421f076255e88691aa38fcd90114 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 28 Jun 2018 11:19:32 +1000 Subject: [PATCH 3/3] Restore the and rel="canonical" URLs to the layout --- lemoncurry/jinja2/lemoncurry/layout.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lemoncurry/jinja2/lemoncurry/layout.html b/lemoncurry/jinja2/lemoncurry/layout.html index 1d02480..e2328e4 100644 --- a/lemoncurry/jinja2/lemoncurry/layout.html +++ b/lemoncurry/jinja2/lemoncurry/layout.html @@ -13,10 +13,12 @@ {% endif %} {% block head %}{% endblock %} + + + -