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() f.truncate()
# Generating CSS bundle print('Generating CSS bundle')
short_hash = sha1(cat('static/main.css')).hexdigest()[:7] short_hash = sha1(cat('static/main.css')).hexdigest()[:7]
sed('templates/base.html', '-SHORTSHA1-[a-z0-9]+.css', '-SHORTSHA1-{}.css'.format(short_hash)) sed('templates/base.html', '-SHORTSHA1-[a-z0-9]+.css', '-SHORTSHA1-{}.css'.format(short_hash))
bundle_filename = 'bundle-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/csslibs/solarized-highlight.css'))
bundle.write(cat('static/main.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] 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)) 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): 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')) bundle.write(cat('static/js/social.js'))
if MG_FILTER_TAGS: if MG_FILTER_TAGS:
bundle.write(cat('static/js/filter-tags.js')) bundle.write(cat('static/js/filter-tags.js'))

View File

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

View File

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

View File

@ -54,7 +54,7 @@
{% endif %} {% endif %}
{% endblock %} {% 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> </head>
<body> <body>
<!--[if lt IE 7]> <!--[if lt IE 7]>
@ -117,6 +117,15 @@
</div> </div>
{% endif %} {% 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 %} {% if READINGS %}
<div class="uk-panel uk-panel-box"> <div class="uk-panel uk-panel-box">
<h2 class="uk-panel-title">En ce moment je lis</h2> <h2 class="uk-panel-title">En ce moment je lis</h2>