Compare commits
No commits in common. "bc8d7923b47c421f076255e88691aa38fcd90114" and "7edc5d01654c43f278ff88eb3169d8434cdd4372" have entirely different histories.
bc8d7923b4
...
7edc5d0165
5 changed files with 56 additions and 46 deletions
|
@ -1,40 +1,6 @@
|
||||||
{% macro hEntry(entry, indent_width) -%}
|
{% macro hEntry(entry, indent_width) -%}
|
||||||
{%- set i = ' ' * indent_width -%}
|
{%- set i = ' ' * indent_width -%}
|
||||||
<article class="h-entry media">
|
<article class="card h-entry">
|
||||||
{{i}}<aside class="info">
|
|
||||||
{{i}}<a class="p-author h-card" href="{{ entry.author.url }}">
|
|
||||||
{{i}}<img class="u-photo img-fluid" src="{{ entry.author.avatar.url }}" alt="{{ entry.author.name }}" />
|
|
||||||
{{i}}<span class="p-name sr-only">{{ entry.author.name }}</span>
|
|
||||||
{{i}}</a>
|
|
||||||
{{i}}<a class="u-uid u-url" href="{{ entry.url }}">
|
|
||||||
{{i}}<time class="dt-published" datetime="{{ entry.published.isoformat() }}">
|
|
||||||
{{i}}<i class="fas fa-calendar" aria-hidden="true"></i>
|
|
||||||
{{i}}{{ entry.published | naturaltime }}
|
|
||||||
{{i}}</time>
|
|
||||||
{{i}}</a>
|
|
||||||
{{i}}<time class="dt-updated" datetime="{{ entry.updated.isoformat() }}"{% if (entry.updated | naturaltime) == (entry.published | naturaltime) %} hidden{% endif %}>
|
|
||||||
{{i}}<i class="fas fa-pencil-alt" aria-hidden="true"></i>
|
|
||||||
{{i}}{{ entry.updated | naturaltime }}
|
|
||||||
{{i}}</time>
|
|
||||||
{{i}}<a class="u-url" href="{{ entry.short_url }}">
|
|
||||||
{{i}}<i class="fas fa-link" aria-hidden="true"></i>
|
|
||||||
{{i}}{{ entry.short_url | friendly_url }}
|
|
||||||
{{i}}</a>
|
|
||||||
{% for c in entry.cats.all() %}
|
|
||||||
{{i}}<a class="p-category" href="{{ c.url }}">
|
|
||||||
{{i}}<i class="fas fa-paw" aria-hidden="true"></i>
|
|
||||||
{{i}}{{ c.name }}
|
|
||||||
{{i}}</a>
|
|
||||||
{% endfor %}
|
|
||||||
{% for s in entry.syndications.all() %}
|
|
||||||
{{i}}<a class="u-syndication" href="{{ s.url }}">
|
|
||||||
{{i}}<i class="{{ s.profile.site.icon }}" aria-hidden="true"></i>
|
|
||||||
{{i}}{{ s.profile }}
|
|
||||||
{{i}}</a>
|
|
||||||
{% endfor %}
|
|
||||||
{{i}}</aside>
|
|
||||||
|
|
||||||
{{i}}<div class="card">
|
|
||||||
{% if entry.photo %}
|
{% if entry.photo %}
|
||||||
{{i}}<img class="card-img-top u-photo" src="{{ entry.photo.url }}" />
|
{{i}}<img class="card-img-top u-photo" src="{{ entry.photo.url }}" />
|
||||||
|
|
||||||
|
@ -47,8 +13,52 @@
|
||||||
{{i}}{{ entry.content | markdown }}
|
{{i}}{{ entry.content | markdown }}
|
||||||
{{i}}</div>
|
{{i}}</div>
|
||||||
{{i}}</div>
|
{{i}}</div>
|
||||||
|
|
||||||
|
{{i}}<div class="card-footer">
|
||||||
|
{{i}}<a class="p-author h-card" href="{{ entry.author.url }}">
|
||||||
|
{{i}}<img class="u-photo" src="{{ entry.author.avatar.url }}" />
|
||||||
|
{{i}}{{ entry.author.name }}
|
||||||
|
{{i}}</a>
|
||||||
|
{{i}}<a class="u-uid u-url" href="{{ entry.url }}">
|
||||||
|
{{i}}<time class="dt-published" datetime="{{ entry.published.isoformat() }}">
|
||||||
|
{{i}}<i class="fas fa-calendar" aria-hidden="true"></i>
|
||||||
|
{{i}}{{ entry.published | naturaltime }}
|
||||||
|
{{i}}</time>
|
||||||
|
{{i}}</a>
|
||||||
|
{% if entry.updated != entry.published %}
|
||||||
|
{{i}}<time class="dt-updated" datetime="{{ entry.updated.isoformat() }}">
|
||||||
|
{{i}}<i class="fas fa-pencil-alt" aria-hidden="true"></i>
|
||||||
|
{{i}}{{ entry.updated | naturaltime }}
|
||||||
|
{{i}}</time>
|
||||||
|
{% endif %}
|
||||||
|
{{i}}<a class="u-url" href="{{ entry.short_url }}">
|
||||||
|
{{i}}<i class="fas fa-link" aria-hidden="true"></i>
|
||||||
|
{{i}}{{ entry.short_url | friendly_url }}
|
||||||
|
{{i}}</a>
|
||||||
{{i}}</div>
|
{{i}}</div>
|
||||||
|
|
||||||
|
{% if entry.cats.exists() %}
|
||||||
|
{{i}}<div class="card-footer">
|
||||||
|
{% for c in entry.cats.all() %}
|
||||||
|
{{i}}<a class="p-category" href="{{ c.url }}">
|
||||||
|
{{i}}<i class="fas fa-paw" aria-hidden="true"></i>
|
||||||
|
{{i}}{{ c.name }}
|
||||||
|
{{i}}</a>
|
||||||
|
{% endfor %}
|
||||||
|
{{i}}</div>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% if entry.syndications.exists() %}
|
||||||
|
{{i}}<div class="card-footer">
|
||||||
|
{% for s in entry.syndications.all() %}
|
||||||
|
{{i}}<a class="u-syndication" href="{{ s.url }}">
|
||||||
|
{{i}}<i class="{{ s.profile.site.icon }}" aria-hidden="true"></i>
|
||||||
|
{{i}}{{ s.profile }}
|
||||||
|
{{i}}</a>
|
||||||
|
{% endfor %}
|
||||||
|
{{i}}</div>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
{{i}}<script class="p-json-ld" type="application/ld+json">{{ entry.json_ld | tojson }}</script>
|
{{i}}<script class="p-json-ld" type="application/ld+json">{{ entry.json_ld | tojson }}</script>
|
||||||
{{i}}</article>
|
{{i}}</article>
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
|
@ -10,23 +10,7 @@ ol.entries, div.entry
|
||||||
&:last-child
|
&:last-child
|
||||||
margin-bottom 0
|
margin-bottom 0
|
||||||
|
|
||||||
.h-entry.media
|
.card.h-entry
|
||||||
> 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
|
.e-content
|
||||||
ul
|
ul
|
||||||
list-style-type disc
|
list-style-type disc
|
||||||
|
@ -42,3 +26,14 @@ ol.entries, div.entry
|
||||||
max-width 100%
|
max-width 100%
|
||||||
> :last-child
|
> :last-child
|
||||||
margin-bottom 0
|
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
|
||||||
|
|
|
@ -9,7 +9,6 @@ from django_activeurl.ext.django_jinja import ActiveUrl
|
||||||
|
|
||||||
from entries.kinds import all as entry_kinds
|
from entries.kinds import all as entry_kinds
|
||||||
from .markdown import markdown
|
from .markdown import markdown
|
||||||
from ..theme import color as theme_color
|
|
||||||
from ..utils import friendly_url, load_package_json
|
from ..utils import friendly_url, load_package_json
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +29,6 @@ def environment(**options):
|
||||||
'package': load_package_json(),
|
'package': load_package_json(),
|
||||||
'settings': settings,
|
'settings': settings,
|
||||||
'static': staticfiles_storage.url,
|
'static': staticfiles_storage.url,
|
||||||
'theme_color': theme_color,
|
|
||||||
'url': reverse,
|
'url': reverse,
|
||||||
})
|
})
|
||||||
return env
|
return env
|
||||||
|
|
|
@ -5,24 +5,21 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
|
||||||
<title class="p-name">{% if title %}{{ title }} ~ {% endif %}{{ request.site.name }}</title>
|
<title class="p-name">{% if title %}{{ title }} ~ {% endif %}{{ request.site.name }}</title>
|
||||||
|
{% block head %}{% endblock %}
|
||||||
{% if atom is defined %}
|
{% if atom is defined %}
|
||||||
<link rel="alternate" type="application/atom+xml" href="{{ atom }}" />
|
<link rel="alternate" type="application/atom+xml" href="{{ atom }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if rss is defined %}
|
{% if rss is defined %}
|
||||||
<link rel="alternate" type="application/rss+xml" href="{{ rss }}" />
|
<link rel="alternate" type="application/rss+xml" href="{{ rss }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% block head %}{% endblock %}
|
|
||||||
|
|
||||||
<base href="{{ request.build_absolute_uri(url('home:index')) }}" />
|
|
||||||
<link rel="authorization_endpoint" href="{{ url('lemonauth:indie') }}" />
|
<link rel="authorization_endpoint" href="{{ url('lemonauth:indie') }}" />
|
||||||
<link rel="canonical" href="{{ request.build_absolute_uri() }}" />
|
|
||||||
<link rel="hub" href="{{ settings.PUSH_HUB }}" />
|
|
||||||
<link rel="manifest" href="{{ url('wellknowns:manifest') }}" />
|
<link rel="manifest" href="{{ url('wellknowns:manifest') }}" />
|
||||||
<link rel="micropub" href="{{ url('micropub:micropub') }}" />
|
<link rel="micropub" href="{{ url('micropub:micropub') }}" />
|
||||||
|
<link rel="hub" href="{{ settings.PUSH_HUB }}" />
|
||||||
<link rel="token_endpoint" href="{{ url('lemonauth:token') }}" />
|
<link rel="token_endpoint" href="{{ url('lemonauth:token') }}" />
|
||||||
|
|
||||||
<meta name="generator" content="{{ package.name }} {{ package.version }}" />
|
<meta name="generator" content="{{ package.name }} {{ package.version }}" />
|
||||||
<meta name="theme-color" content="{{ theme_color(10) }}" />
|
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
|
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
|
||||||
integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||||
|
|
|
@ -24,7 +24,17 @@ def manifest(request):
|
||||||
'start_url': urljoin(base, start_url),
|
'start_url': urljoin(base, start_url),
|
||||||
|
|
||||||
'background_color': color(0),
|
'background_color': color(0),
|
||||||
'theme_color': color(10),
|
'theme_color': color(2),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 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')
|
return JsonResponse(app, content_type='application/manifest+json')
|
||||||
|
|
Loading…
Reference in a new issue