From 984c146e370dc153720375c97213ef663cb3670d Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sat, 17 Aug 2019 21:33:15 +0200 Subject: [PATCH] Self-host twemoji and the CSS --- Makefile | 9 ++++++++- config.py | 2 +- templates/layout.html | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3e83dee..ed25fc6 100644 --- a/Makefile +++ b/Makefile @@ -35,9 +35,16 @@ microblogpub: # Rebuild the Docker image docker build . --no-cache -t microblogpub:latest +.PHONY: css +css: + # Download pure.css if needed + [[ ! -f static/pure.css ]] && curl https://unpkg.com/purecss@1.0.1/build/pure-min.css > static/pure.css + # Download the emojis from twemoji if needded + [[ ! -d static/twemoji ]] && wget https://github.com/twitter/twemoji/archive/v12.1.2.tar.gz && tar xvzf https://github.com/twitter/twemoji/archive/v12.1.2.tar.gz && mv twemoji-12.1.2/assets/svg static/twemoji && rm -rf twemoji-12.1.2 + # Run the docker-compose project locally (will perform a update if the project is already running) .PHONY: run -run: microblogpub +run: microblogpub css # (poussetaches and microblogpub Docker image will updated) # Update MongoDB docker pull mongo:3 diff --git a/config.py b/config.py index 607e62c..85ee003 100644 --- a/config.py +++ b/config.py @@ -155,7 +155,7 @@ if conf.get("emojis"): EMOJIS = conf["emojis"] # Emoji template for the FE -EMOJI_TPL = '{raw}' +EMOJI_TPL = '{raw}' if conf.get("emoji_tpl"): EMOJI_TPL = conf["emoji_tpl"] diff --git a/templates/layout.html b/templates/layout.html index 63a4600..1f2ff6a 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -5,7 +5,7 @@ {% block title %}{{ config.NAME }}'s microblog{% endblock %} - + {% if not request.args.get("older_than") and not request.args.get("previous_than") %}{% endif %}