Adding support for AVATARS

This commit is contained in:
Lucas Cimon 2018-03-08 18:09:39 +01:00
parent 4908cf9d79
commit 37b1adc7a5
No known key found for this signature in database
GPG Key ID: 08DA831E717571EE
4 changed files with 25 additions and 3 deletions

View File

@ -15,7 +15,7 @@ def sed(filepath, pattern, value):
f.truncate()
# Generating CSS bundle
print('Generating CSS bundle')
short_hash = sha1(cat('static/main.css')).hexdigest()[:7]
sed('templates/base.html', '-SHORTSHA1-[a-z0-9]+.css', '-SHORTSHA1-{}.css'.format(short_hash))
bundle_filename = 'bundle-SHORTSHA1-{}.css'.format(short_hash)
@ -24,7 +24,7 @@ with open('static/' + bundle_filename, 'wb') as bundle:
bundle.write(cat('static/csslibs/solarized-highlight.css'))
bundle.write(cat('static/main.css'))
# Generating JS bundle
print('Generating JS bundle')
short_hash = sha1(cat('static/js/social.js') + cat('static/js/filter-tags.js')).hexdigest()[:7]
sed('templates/base.html', '-SHORTSHA1-[a-z0-9]+.js', '-SHORTSHA1-{}.js'.format(short_hash))
for SHARE, MG_FILTER_TAGS in itertools.product(range(2), repeat=2):
@ -41,3 +41,4 @@ for SHARE, MG_FILTER_TAGS in itertools.product(range(2), repeat=2):
bundle.write(cat('static/js/social.js'))
if MG_FILTER_TAGS:
bundle.write(cat('static/js/filter-tags.js'))

View File

@ -389,6 +389,12 @@ a {
.mg-cloud-tag-badge {
color: #d14905; }
img.mg-avatar {
display: inline-block;
max-width: 48%;
padding: .3rem;
}
.mg-fadeable {
max-height: 100vh;

View File

@ -304,6 +304,12 @@ a {
.mg-cloud-tag-badge {
color: #d14905; }
img.mg-avatar {
display: inline-block;
max-width: 48%;
padding: .3rem;
}
.mg-fadeable {
max-height: 100vh;

View File

@ -54,7 +54,7 @@
{% endif %}
{% endblock %}
<link rel="stylesheet" type="text/css" href="{{SITEURL}}/theme/bundle-SHORTSHA1-b785cd8.css">
<link rel="stylesheet" type="text/css" href="{{SITEURL}}/theme/bundle-SHORTSHA1-e07d6a1.css">
</head>
<body>
<!--[if lt IE 7]>
@ -117,6 +117,15 @@
</div>
{% endif %}
{% if AVATARS %}
<div class="uk-panel uk-panel-box">
<h2 class="uk-panel-title">Avatars</h2>
{% for img_uri in AVATARS %}
<img class="mg-avatar" src="{{ img_uri }}" alt="An avatar I use on the web" title="An avatar I use on the web">
{% endfor %}
</div>
{% endif %}
{% if READINGS %}
<div class="uk-panel uk-panel-box">
<h2 class="uk-panel-title">En ce moment je lis</h2>