From c688953bc00fec99ea4727e3ea122687f3a018ae Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 10:12:38 +0700 Subject: [PATCH 01/18] Cosmetics, add 'analytics' comment --- templates/base.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/base.html b/templates/base.html index 2f445bf..5a140c8 100644 --- a/templates/base.html +++ b/templates/base.html @@ -36,6 +36,8 @@ + + {% include 'fragments/google_analytics.html' %} From 43c9c419c08ed170104557e1d62fe42f36bcbc29 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 10:14:17 +0700 Subject: [PATCH 02/18] Fix feeds href everywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per https://docs.getpelican.com/en/stable/settings.html#feed-settings: FEED_DOMAIN = None, i.e. base URL is "/" The domain prepended to feed URLs. Since feed URLs should always be absolute, it is highly recommended to define this (e.g., “https://feeds.example.com”). If you have already explicitly defined SITEURL (see above) and want to use the same domain for your feeds, you can just set: FEED_DOMAIN = SITEURL. Using `href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}"` in the template seems to be the right way to do things, by looking at other themes, eg the default theme in Pelican itself: https://github.com/getpelican/pelican/blob/master/pelican/themes/simple/templates/base.html Obviously, this change might break things for some users of the theme. If someone used to have this definition in `publishconf.py`: FEED_ALL_ATOM = SITEURL + '/feeds/all.atom.xml' Then they should update to: FEED_DOMAIN = SITEURL FEED_ALL_ATOM = 'feeds/all.atom.xml' --- templates/base.html | 4 ++-- templates/sidebar.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/base.html b/templates/base.html index 5a140c8..8fd03a8 100644 --- a/templates/base.html +++ b/templates/base.html @@ -34,8 +34,8 @@ {% endif %} - - + + {% include 'fragments/google_analytics.html' %} diff --git a/templates/sidebar.html b/templates/sidebar.html index 858e294..0ce5798 100644 --- a/templates/sidebar.html +++ b/templates/sidebar.html @@ -35,7 +35,7 @@ {% endif %} {% endfor %} - + From 2dd1cd6d270113187dd8d0ae0d6e0b6022641a2f Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 10:23:22 +0700 Subject: [PATCH 03/18] Move feeds into a fragment file --- templates/base.html | 2 +- templates/fragments/feeds.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 templates/fragments/feeds.html diff --git a/templates/base.html b/templates/base.html index 8fd03a8..4cee3cd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -35,7 +35,7 @@ {% endif %} - + {% include 'fragments/feeds.html' %} {% include 'fragments/google_analytics.html' %} diff --git a/templates/fragments/feeds.html b/templates/fragments/feeds.html new file mode 100644 index 0000000..b1b6267 --- /dev/null +++ b/templates/fragments/feeds.html @@ -0,0 +1 @@ + From a6a9b793896a982e2427a6d9c431fd3efe92432f Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 10:27:06 +0700 Subject: [PATCH 04/18] Update feeds fragment, add support for every feed-related variables All this boilerplate is taken straight from the pelican simple theme: - https://github.com/getpelican/pelican/blob/master/pelican/themes/simple/templates/base.html --- templates/fragments/feeds.html | 25 ++++++++++++++++++++++++- templates/sidebar.html | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/templates/fragments/feeds.html b/templates/fragments/feeds.html index b1b6267..cec3ac1 100644 --- a/templates/fragments/feeds.html +++ b/templates/fragments/feeds.html @@ -1 +1,24 @@ - +{% if FEED_ALL_ATOM %} + +{% endif %} +{% if FEED_ALL_RSS %} + +{% endif %} +{% if FEED_ATOM %} + +{% endif %} +{% if FEED_RSS %} + +{% endif %} +{% if CATEGORY_FEED_ATOM and category %} + +{% endif %} +{% if CATEGORY_FEED_RSS and category %} + +{% endif %} +{% if TAG_FEED_ATOM and tag %} + +{% endif %} +{% if TAG_FEED_RSS and tag %} + +{% endif %} diff --git a/templates/sidebar.html b/templates/sidebar.html index 0ce5798..7c2c2b9 100644 --- a/templates/sidebar.html +++ b/templates/sidebar.html @@ -35,7 +35,7 @@ {% endif %} {% endfor %} - + From 8a20068fe6110ae173292c23ae2ec9122038227b Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 14:22:47 +0700 Subject: [PATCH 05/18] Update google_analytics fragment, add support for GA_COOKIE_DOMAIN Per Pelican simple theme and Google Analytics documentation: - https://developers.google.com/analytics/devguides/collection/analyticsjs - https://github.com/getpelican/pelican/blob/master/pelican/themes/notmyidea/templates/analytics.html --- templates/fragments/google_analytics.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/templates/fragments/google_analytics.html b/templates/fragments/google_analytics.html index c9390eb..dbd5fe9 100644 --- a/templates/fragments/google_analytics.html +++ b/templates/fragments/google_analytics.html @@ -1,10 +1,11 @@ {% if GOOGLE_ANALYTICS %} - + {% endif %} From 6fe74116dced5eac67666c752e9dbd994c11f718 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 14:46:57 +0700 Subject: [PATCH 06/18] Update disqus fragment Per Pelican simple theme and Disqus official documentation: - https://github.com/getpelican/pelican/blob/master/pelican/themes/notmyidea/templates/disqus_script.html - https://disqus.com/admin/universalcode/ --- templates/fragments/disqus.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/fragments/disqus.html b/templates/fragments/disqus.html index 4dce6ce..e1905e1 100644 --- a/templates/fragments/disqus.html +++ b/templates/fragments/disqus.html @@ -3,10 +3,11 @@ {% endif %} From b3ad890a46c2ba7348c960ef4c6d58b87b8f2a75 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 14:50:29 +0700 Subject: [PATCH 07/18] Re-indent disqus fragment --- templates/fragments/disqus.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/templates/fragments/disqus.html b/templates/fragments/disqus.html index e1905e1..f36500e 100644 --- a/templates/fragments/disqus.html +++ b/templates/fragments/disqus.html @@ -1,13 +1,13 @@ {% if DISQUS_SITENAME %} -
- - +
+ + {% endif %} From 96b87d97d9e603158fc58a330bfed1a68486afd0 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 15:24:28 +0700 Subject: [PATCH 08/18] Document supported theme settings in the readme --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 4d13fa4..e7bd75c 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,22 @@ You can see a live demo [here](http://jvanz.github.io/) ![Screenshot](screenshot.png) Pull requests are welcome + + +## Settings + +List of Pelican's settings that are supported by this theme. Refer to the +[Pelican's documentation](https://docs.getpelican.com/en/stable/settings.html) +for more details. + +- `FEED_*` and `*_FEED_*` +- `DISQUS_SITENAME` +- `GOOGLE_ANALYTICS` +- `GA_COOKIE_DOMAIN` +- `SITESUBTITLE` + +Additional settings: + +- `BIO` - short biography to display in the sidebar, eg. `Hello world` +- `PROFILE_IMAGE` - image to display in the sidebar, eg. `avatar.png` +- `FONT_AWESOME` - Fontawesome kit, eg `https://kit.fontawesome.com/{{ FONT_AWESOME }}.js` From 000b3370f4bc5de1e91e073e77c47ff7c0609054 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 15:57:40 +0700 Subject: [PATCH 09/18] Use Fork Awesome as the default icon font, and rework settings In 16e3058, a FONT_AWESOME setting was introduced and used as such: "https://kit.fontawesome.com/{{ FONT_AWESOME }}.js" Also in 16e3058, the default way to fetch Font Awesome was changed to Javascript (before we used to load is as CSS). The present commit does several changes: - Revert the default back to CSS (instead of JS), as I think that for a font, there's no need for Javascript. A font is a static asset, so it's enough to load it as a static CSS file, both for privacy and security. Also, think about those who disable JS in their browser. - Remove the `FONT_AWESOME` setting, as it's a bit too limiting to force users into `kit.fontawesome.com`, it doesn't leave much space for configuration. - Instead, introduce two variables `FONT_AWESOME_CSS` and `FONT_AWESOME_JS`, so that users have more freedom to define how they want to load the Font Awesome. - Use Fork Awesome as the default, if no setting is given by user. Meaning that we get back to the `fa` css classes (instead of `fas` or `fab`) --- README.md | 9 ++++++++- templates/base.html | 8 +++++--- templates/sidebar.html | 6 +++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e7bd75c..cc12492 100644 --- a/README.md +++ b/README.md @@ -26,4 +26,11 @@ Additional settings: - `BIO` - short biography to display in the sidebar, eg. `Hello world` - `PROFILE_IMAGE` - image to display in the sidebar, eg. `avatar.png` -- `FONT_AWESOME` - Fontawesome kit, eg `https://kit.fontawesome.com/{{ FONT_AWESOME }}.js` +- `FONT_AWESOME_CSS` - URL to get Font Awesome as CSS +- `FONT_AWESOME_JS` - URL to get Font Awesome as Javascript + +By default, the theme uses **Fork Awesome**, which is fetched from +`cdn.jsdelivr.net`. Fork Awesome is a drop-in replacement for Font Awesome v4, +but is not compatible with Font Awesome v5 and later, so if you want to use +Font Awesome v5+, setting `FONT_AWESOME_CSS` is not enough, you will also need +to modify the templates. diff --git a/templates/base.html b/templates/base.html index 4cee3cd..61a8937 100644 --- a/templates/base.html +++ b/templates/base.html @@ -28,10 +28,12 @@ - {% if FONT_AWESOME %} - + {% if FONT_AWESOME_JS %} + + {% elif FONT_AWESOME_CSS %} + {% else %} - + {% endif %} diff --git a/templates/sidebar.html b/templates/sidebar.html index 7c2c2b9..ac6681d 100644 --- a/templates/sidebar.html +++ b/templates/sidebar.html @@ -16,7 +16,7 @@ {% for name, link in SOCIAL %} {% if name == 'email' %} - + {% elif name in ['academia', 'acclaim', 'acm', 'acmdl', 'ads', 'arxiv', 'biorxiv', 'ceur', 'coursera', 'cv', 'dataverse', @@ -31,12 +31,12 @@ {% else %} - + {% endif %} {% endfor %} - + From 408dca0b734b41f8e76f0762586f931782993b90 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 16:13:58 +0700 Subject: [PATCH 10/18] Make Academicon font optional --- README.md | 1 + templates/base.html | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cc12492..1c6036d 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Additional settings: - `PROFILE_IMAGE` - image to display in the sidebar, eg. `avatar.png` - `FONT_AWESOME_CSS` - URL to get Font Awesome as CSS - `FONT_AWESOME_JS` - URL to get Font Awesome as Javascript +- `FONT_ACADEMICONS` - set to `True` to fetch the [Academicons font](https://jpswalsh.github.io/academicons/) By default, the theme uses **Fork Awesome**, which is fetched from `cdn.jsdelivr.net`. Fork Awesome is a drop-in replacement for Font Awesome v4, diff --git a/templates/base.html b/templates/base.html index 61a8937..9545775 100644 --- a/templates/base.html +++ b/templates/base.html @@ -27,7 +27,6 @@ - {% if FONT_AWESOME_JS %} {% elif FONT_AWESOME_CSS %} @@ -35,6 +34,9 @@ {% else %} {% endif %} + {% if FONT_ACADEMICONS %} + + {% endif %} {% include 'fragments/feeds.html' %} From 07c1ecef159f0f2d8828c7a367a38d889dab0cbb Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Tue, 19 Feb 2019 16:26:13 +0700 Subject: [PATCH 11/18] Remove paragraph from the article urls, in the index page --- templates/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/index.html b/templates/index.html index a24cb00..63591d6 100644 --- a/templates/index.html +++ b/templates/index.html @@ -4,8 +4,8 @@
{% for article in articles_page.object_list %}
-

- {{ article.title }} +

+ {{ article.title }}

From 0a635b03c977e151c327b1458c33d48e1dd697a1 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 16:27:46 +0700 Subject: [PATCH 12/18] Complete the readme with authors and license --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 1c6036d..8bcfd6e 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,14 @@ By default, the theme uses **Fork Awesome**, which is fetched from but is not compatible with Font Awesome v5 and later, so if you want to use Font Awesome v5+, setting `FONT_AWESOME_CSS` is not enough, you will also need to modify the templates. + + +## Authors + +- Original theme by [Mark Otto](https://github.com/mdo): +- Ported to Pelican by [José Guilherme Vanz](https://github.com/jvanz) + + +## License + +Released under the [MIT license](LICENSE) From de62fe7b4726fdf2b9f0afb0080b96c6f720f77c Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 22:11:30 +0700 Subject: [PATCH 13/18] Add the COLOR_THEME variable --- README.md | 2 ++ templates/base.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bcfd6e..6c1a09e 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Additional settings: - `BIO` - short biography to display in the sidebar, eg. `Hello world` - `PROFILE_IMAGE` - image to display in the sidebar, eg. `avatar.png` +- `COLOR_THEME` - base colors for the theme, choose from `08` to `0f`, + refer to for details. - `FONT_AWESOME_CSS` - URL to get Font Awesome as CSS - `FONT_AWESOME_JS` - URL to get Font Awesome as Javascript - `FONT_ACADEMICONS` - set to `True` to fetch the [Academicons font](https://jpswalsh.github.io/academicons/) diff --git a/templates/base.html b/templates/base.html index 9545775..0dffada 100644 --- a/templates/base.html +++ b/templates/base.html @@ -45,7 +45,7 @@ {% include 'fragments/google_analytics.html' %} - + {% include 'sidebar.html' %}

{% block content %} From d54ac6880cf4f4c7592b094ac2773628bc71f567 Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 26 Jul 2020 22:20:37 +0700 Subject: [PATCH 14/18] Fix CSS for other background colors Basically, we just lighten or darken where need be, instead of hardcoding colors. --- static/css/hyde.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/static/css/hyde.css b/static/css/hyde.css index fc3a705..e5b2645 100644 --- a/static/css/hyde.css +++ b/static/css/hyde.css @@ -91,7 +91,7 @@ html { .sidebar-about .profile-picture { margin: 0 auto; border-radius: 50%; - border: 2px solid #5b8da2; + border: 2px solid #0001; max-width: 5rem; } @@ -102,7 +102,7 @@ html { .sidebar-nav-item { display: block; padding: .25rem 0.5rem; - background: #7dafc4; + background: #fff2; margin: 0 .2rem; border-radius: .25rem; text-transform: uppercase; @@ -113,11 +113,11 @@ html { } a.sidebar-nav-item:hover, a.sidebar-nav-item:focus { - background: #6096ac; + background: #0001; text-decoration: none; } .sidebar-nav-item.active { - color: #6096ac; + color: #0001; background: #fff; } a.sidebar-nav-item.active:hover, From cdb83aabc251b60e6a4068ae7d65769b5e76dc1e Mon Sep 17 00:00:00 2001 From: Arnaud Rebillout Date: Sun, 17 Feb 2019 12:41:03 +0700 Subject: [PATCH 15/18] Add support for MENUITEMS and DISPLAY_PAGES_ON_MENU With this commit, `.sidebar-nav` is renamed to `.sidebar-social`. Then a new class `.sidebar-nav` is created and used for the menu items. This change more or less restores `.sidebar-nav` originally was in the `hyde.css` file. Since `DISPLAY_PAGES_ON_MENU` defaults to `True`, this commit will modify the appearance of your site. To go back to the previous behavior, add this to your pelicanconf.py: DISPLAY_PAGES_ON_MENU = False References: - - --- README.md | 3 +++ static/css/hyde.css | 7 +++++++ templates/sidebar.html | 16 +++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c1a09e..aec7e11 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,13 @@ List of Pelican's settings that are supported by this theme. Refer to the for more details. - `FEED_*` and `*_FEED_*` +- `DISPLAY_PAGES_ON_MENU` - `DISQUS_SITENAME` - `GOOGLE_ANALYTICS` - `GA_COOKIE_DOMAIN` - `SITESUBTITLE` +- `MENUITEMS` +- `SOCIAL` Additional settings: diff --git a/static/css/hyde.css b/static/css/hyde.css index e5b2645..ec0b9b6 100644 --- a/static/css/hyde.css +++ b/static/css/hyde.css @@ -98,6 +98,13 @@ html { /* Sidebar nav */ .sidebar-nav { margin-bottom: 1rem; + list-style: none; + padding-left: 0; +} +.sidebar-social { + display: flex; + justify-content: center; + align-items: center; } .sidebar-nav-item { display: block; diff --git a/templates/sidebar.html b/templates/sidebar.html index ac6681d..4ae6d0f 100644 --- a/templates/sidebar.html +++ b/templates/sidebar.html @@ -12,7 +12,21 @@

{{ BIO }}

-