From 8a9dda332aef80c891eb95d875899d7172962050 Mon Sep 17 00:00:00 2001 From: Freezed Date: Sun, 20 Jan 2019 23:36:15 +0100 Subject: [PATCH] Add a commit link in footer Do some change in CSS and HTML indentatior The commit link is build with 3 new template files : - time - date - commit Each file is updated during CI, before _pelican_ build HTML files. --- .gitlab-ci.yml | 3 + mytheme/static/css/main.css | 12 ++-- mytheme/templates/article_infos.html | 34 +++++------ mytheme/templates/base.html | 86 ++++++++++++++++------------ mytheme/templates/commit | 1 + mytheme/templates/date | 1 + mytheme/templates/time | 1 + pelicanconf.py | 3 + pubconf-devel.py | 3 + pubconf-master.py | 3 + 10 files changed, 87 insertions(+), 60 deletions(-) create mode 100644 mytheme/templates/commit create mode 100644 mytheme/templates/date create mode 100644 mytheme/templates/time diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7cd1b5c..af8adec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,9 @@ pages: - devel script: - pip install -r requirements.txt + - date --utc +%H:%M > mytheme/templates/time + - date --utc +%d/%m/%Y > mytheme/templates/date + - echo $CI_COMMIT_SHORT_SHA > mytheme/templates/commit - pelican -s "pubconf-${CI_COMMIT_REF_NAME}.py" --fatal warnings artifacts: when: on_success diff --git a/mytheme/static/css/main.css b/mytheme/static/css/main.css index 3d53bc6..f211555 100644 --- a/mytheme/static/css/main.css +++ b/mytheme/static/css/main.css @@ -335,21 +335,21 @@ img.left, figure.left {float: left; margin: 0 2em 2em 0;} #about .primary {float: left; width: 165px;} #about .primary strong {color: #C64350; display: block; font-size: 1.286em;} #about .photo {float: left; margin: 5px 20px;} - #about .url:link, #about .url:visited {text-decoration: none;} - #about .bio {float: right; width: 500px;} -.foobar { - margin: 0 20px 0 0; - width: 185px; +.spaced { + margin: 0 30px 0 0; } /* Footer *****************/ #contentinfo {padding-bottom: 2em; text-align: right;} - +footer .mentions { + text-align: center; + font-size: 80%; +} /***** Sections *****/ /* Blog */ .hentry { diff --git a/mytheme/templates/article_infos.html b/mytheme/templates/article_infos.html index 83586f3..ee9c452 100644 --- a/mytheme/templates/article_infos.html +++ b/mytheme/templates/article_infos.html @@ -1,19 +1,19 @@ diff --git a/mytheme/templates/base.html b/mytheme/templates/base.html index f0803f4..5dcea1f 100644 --- a/mytheme/templates/base.html +++ b/mytheme/templates/base.html @@ -1,38 +1,38 @@ - - {% block title %}{{ SITENAME }}{%endblock%} - - - {% if FEED_ALL_ATOM %} - - {% endif %} - {% if FEED_ALL_RSS %} - - {% endif %} - {% block extra_head %}{% endblock extra_head %} + + {% block title %}{{ SITENAME }}{%endblock%} + + + {% if FEED_ALL_ATOM %} + + {% endif %} + {% if FEED_ALL_RSS %} + + {% endif %} + {% block extra_head %}{% endblock extra_head %} {% include 'github.html' %} {% block content %} {% endblock %} @@ -40,21 +40,33 @@ diff --git a/mytheme/templates/commit b/mytheme/templates/commit new file mode 100644 index 0000000..7bb9b33 --- /dev/null +++ b/mytheme/templates/commit @@ -0,0 +1 @@ +<foobar> diff --git a/mytheme/templates/date b/mytheme/templates/date new file mode 100644 index 0000000..5ca0db6 --- /dev/null +++ b/mytheme/templates/date @@ -0,0 +1 @@ +20/01/19 diff --git a/mytheme/templates/time b/mytheme/templates/time new file mode 100644 index 0000000..06a416b --- /dev/null +++ b/mytheme/templates/time @@ -0,0 +1 @@ +22:11:50 diff --git a/pelicanconf.py b/pelicanconf.py index b6c8e64..b2b180b 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -68,3 +68,6 @@ TAG_SAVE_AS = 'tags/{slug}/index.html' TAG_URL = 'tags/{slug}/' YEAR_ARCHIVE_SAVE_AS = 'articles/{date:%Y}/index.html' YEAR_ARCHIVE_URL = 'articles/{date:%Y}/' + +# URL of the repo to link build commit +REPO_COMMIT_URL = 'http://git.localhost/repo/commit' diff --git a/pubconf-devel.py b/pubconf-devel.py index 5d41e3f..5ed2566 100644 --- a/pubconf-devel.py +++ b/pubconf-devel.py @@ -19,3 +19,6 @@ CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' LINKS = (('Archives', '/mypelican/articles/'), ('Tags', '/mypelican/tags/'), ('Mentions légales', '/mypelican/pages/mentions-legales/'),) + +# URL of the repo to link build commit +REPO_COMMIT_URL = 'https://gitlab.com/free_zed/mypelican/commit' diff --git a/pubconf-master.py b/pubconf-master.py index 99d4c12..8d60e79 100644 --- a/pubconf-master.py +++ b/pubconf-master.py @@ -15,3 +15,6 @@ SITEURL = 'https://free_zed.gitlab.io' FEED_ALL_ATOM = 'feeds/all.atom.xml' CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' + +# URL of the repo to link build commit +REPO_COMMIT_URL = 'https://gitlab.com/free_zed/free_zed.gitlab.io/commit'