From 1220329ce4a5bd0d4833c867273297c98653bc55 Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Thu, 14 Oct 2021 21:50:32 +0200 Subject: [PATCH 01/19] Add a simple test facility with tox and GitHub actions In order to ensure that feature additions don't break existing Flex theme deployments, build the docs site on any branch push and PR. To do so, * Add a simple tox.ini that runs "pelican -s docs/pelicanconf.py" in virtualenvs configured for Python versions 3.6 - 3.9. * Add an additional GitHub Actions workflow that invokes these testenvs with the matching Python version, and runs on any branch push and on any pull request. --- .github/workflows/pelican-test.yaml | 28 ++++++++++++++++++++++++++++ tox.ini | 16 ++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/pelican-test.yaml create mode 100644 tox.ini diff --git a/.github/workflows/pelican-test.yaml b/.github/workflows/pelican-test.yaml new file mode 100644 index 0000000..4264ff5 --- /dev/null +++ b/.github/workflows/pelican-test.yaml @@ -0,0 +1,28 @@ +name: Pelican test +on: + - push + - pull_request +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - 3.6 + - 3.7 + - 3.8 + - 3.9 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install tox tox-gh-actions + - name: Test with tox + run: tox diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..142865b --- /dev/null +++ b/tox.ini @@ -0,0 +1,16 @@ +[tox] +envlist = py{36,37,38,39} +skipsdist = True + +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39 + +[testenv] +deps = + -r docs/requirements.txt +commands = + pelican -s docs/pelicanconf.py From 20725c8dc0971582d6aa7e6371f150f0e23897c9 Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Wed, 13 Oct 2021 21:02:27 +0200 Subject: [PATCH 02/19] Support Series plugin The Pelican Series plugin (https://github.com/pelican-plugins/series) is a convenient way for authors to link articles together as multiple installments of a series. Add support for the Series plugin to this theme: render articles belonging to a series with a footer pointing to the preceding and following articles in the series, using the same styling as "related posts" links. This implementation is heavily inspired by the Series plugin in the Pelican bootstrap3 theme (MIT licensed): https://github.com/getpelican/pelican-themes/blob/master/pelican-bootstrap3/templates/includes/series.html Fixes #289. --- README.md | 2 ++ templates/article.html | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/README.md b/README.md index 5e740f4..7b85617 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ The minimalist [Pelican](http://blog.getpelican.com/) theme. - Open Graph - Rich Snippets (JSON-LD) - Related Posts (via [plugin](https://github.com/getpelican/pelican-plugins/tree/master/related_posts) or AddThis) +- Series (via [plugin](https://github.com/pelican-plugins/series)) - Minute read (via [plugin](https://github.com/getpelican/pelican-plugins/tree/master/post_stats)) - [Multiple Code Highlight Styles](https://github.com/alexandrevicenzi/Flex/wiki/Code-Highlight) - [Translation Support](https://github.com/alexandrevicenzi/Flex/wiki/Translations) @@ -41,6 +42,7 @@ The minimalist [Pelican](http://blog.getpelican.com/) theme. - [I18N Sub-sites](https://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites) - [Minute read](https://github.com/getpelican/pelican-plugins/tree/master/post_stats) - [Related Posts](https://github.com/getpelican/pelican-plugins/tree/master/related_posts) +- [Series](https://github.com/pelican-plugins/series) - [Representative image](https://github.com/getpelican/pelican-plugins/tree/master/representative_image) - [Neighbors](https://github.com/getpelican/pelican-plugins/tree/master/neighbors) - [Tipue Search](https://github.com/getpelican/pelican-plugins/blob/master/tipue_search/) diff --git a/templates/article.html b/templates/article.html index 44d3fe1..e7ccd8e 100644 --- a/templates/article.html +++ b/templates/article.html @@ -83,6 +83,29 @@ {% endif %} + {% if article.series %} + + {% endif %} + {% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.article_bottom %} Date: Tue, 28 Dec 2021 22:11:17 +0100 Subject: [PATCH 03/19] Fix tipue search The tipue plugin registers itself as pelican.plugins.tipue_search (namespace plugin) in the latest version see here: https://github.com/getpelican/pelican-plugins/commit/7fe8f3f05cd1f39951967010586025e2230c0ede Keep old style tipue_search to be compatible with old versions. To use the search one would need to add "search" to DIRECT_TEMPLATES in pelicanconf.py so that search.html is copied to the output folder: DIRECT_TEMPLATES = ["index", "tags", "categories", "archives", "search"] --- templates/base.html | 4 ++-- templates/search.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/base.html b/templates/base.html index fca8d45..ffb8fc0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -69,7 +69,7 @@ href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/pygments/{{ PYGMENTS_STYLE|default('github') }}.min.css"> {% endif %} - {% if PLUGINS and 'tipue_search' in PLUGINS %} + {% if PLUGINS and ('tipue_search' in PLUGINS or 'pelican.plugins.tipue_search' in PLUGINS) %} {% endif %} @@ -174,7 +174,7 @@ {% if SITESUBTITLE %}

{{ SITESUBTITLE }}

{% endif %} - {% if PLUGINS and 'tipue_search' in PLUGINS %} + {% if PLUGINS and ('tipue_search' in PLUGINS or 'pelican.plugins.tipue_search' in PLUGINS)%} diff --git a/templates/search.html b/templates/search.html index 2af8292..9a15f65 100644 --- a/templates/search.html +++ b/templates/search.html @@ -1,4 +1,4 @@ -{% if PLUGINS and 'tipue_search' in PLUGINS %} +{% if PLUGINS and ('tipue_search' in PLUGINS or 'pelican.plugins.tipue_search' in PLUGINS) %} {% extends 'base.html' %} {% block title %}{{ _('Search') }} - {{ SITENAME|striptags }}{% endblock title %} {% block content %} From 6d821518f166479152a759c5bfcb88dfb81b0914 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Tue, 1 Mar 2022 03:14:17 +0100 Subject: [PATCH 04/19] Fix: correct custom CSS URL for I18N pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit problem description: When using the i18n_subsites plugin – which is somehow supported by this theme – the SITEURL is modified for all but the default language, causing the construction {{ SITEURL }}/{{ CUSTOM_CSS }} to change as well. This in principle affects all such template constructions where SITEURL is prepended to a custom loading path. One exception is {{ THEME_STATIC_DIR }}, which is adjusted by the i18n_subsites code to still match for translations. solution: The i18n plugin introduces an additional context variable {{ main_siteurl }}, which always points at the original unmodified SITEURL. As unfortunately this variable is not present in non-i18n sites, it's existence is checked first, taking SITEURL as a fallback. This special handling is acceptable IMHO, as at first glance I could not find any other affected URLs in templates. follow-up to #192 --- templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base.html b/templates/base.html index fca8d45..9e311e7 100644 --- a/templates/base.html +++ b/templates/base.html @@ -78,7 +78,7 @@ {% if CUSTOM_CSS %} - + {% endif %} {% if FEED_ALL_ATOM %} From 4e99152aff85ca8dc86fe2514f8a2fb6fc0f1b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20Kirchg=C3=A4ssner?= Date: Mon, 7 Mar 2022 13:55:35 +0100 Subject: [PATCH 05/19] support stork search - add search css - include js and wasm from cdn or locally - initialize js --- README.md | 1 + static/stork/stork-dark.css | 208 ++++++++++++++++++++++++++++++++++++ templates/base.html | 30 +++++- 3 files changed, 237 insertions(+), 2 deletions(-) create mode 100644 static/stork/stork-dark.css diff --git a/README.md b/README.md index 5e740f4..725b920 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ The minimalist [Pelican](http://blog.getpelican.com/) theme. - [Related Posts](https://github.com/getpelican/pelican-plugins/tree/master/related_posts) - [Representative image](https://github.com/getpelican/pelican-plugins/tree/master/representative_image) - [Neighbors](https://github.com/getpelican/pelican-plugins/tree/master/neighbors) +- [Pelican Search](https://github.com/pelican-plugins/search) - [Tipue Search](https://github.com/getpelican/pelican-plugins/blob/master/tipue_search/) - [SEO](https://github.com/pelican-plugins/seo) diff --git a/static/stork/stork-dark.css b/static/stork/stork-dark.css new file mode 100644 index 0000000..09f162d --- /dev/null +++ b/static/stork/stork-dark.css @@ -0,0 +1,208 @@ +.stork-wrapper-dark { + position: relative; + font-family: inherit; + box-sizing: border-box; + font-size: 1em; + padding: unset; + + --stork-blue-2: #a5d8ff; + + --stork-violet-4: #9775fa; + --stork-violet-5: #845ef7; + --stork-violet-10: #52366d; + + --stork-lime-3: #c0eb75; + + --stork-gray-1: #f1f3f5; + --stork-gray-3: #dee2e6; + --stork-gray-7: #495057; + --stork-gray-8: #343a40; + --flex-red: #d9411e; + + --stork-border-color: var(--stork-gray-7); + --stork-background-color: var(--stork-gray-8); + --stork-text-color: var(--flex-red); +} + +.stork-wrapper-dark *, +.stork-wrapper-dark *:before, +.stork-wrapper-dark *:after { + box-sizing: border-box; +} + +.stork-wrapper-dark .stork-input { + width: 100%; + height: 2.4em; + font-size: 1em; + padding: 0.4em 0.8em; + position: relative; + box-shadow: inset 0 0.1em 0.3em hsla(0, 0%, 0%, 0.1); + border: 1px solid var(--stork-border-color); + border-radius: 8px; + background-color: var(--stork-gray-3); + color: var(--stork-gray-8); + font-family: inherit; +} + +.stork-wrapper-dark .stork-input:focus { + outline: none; + background-color: var(--stork-gray-8); + color: var(--stork-gray-3); +} + +.stork-wrapper-dark .stork-progress { + position: absolute; + display: block; + content: ""; + bottom: 1px; + background-color: var(--stork-violet-5); + box-shadow: 0 0 8px var(--stork-violet-4); + height: 1px; + transition: width 0.25s ease, opacity 0.4s ease 0.4s; +} + +.stork-wrapper-dark .stork-output { + position: absolute; + width: 100%; + margin-top: 0.5em; + border-radius: 4px; + display: flex; + flex-direction: column; + z-index: 100; + color: var(--stork-text-color); + font-weight: 400; + font-family: inherit; + text-align: unset; + padding: unset; +} + +.stork-wrapper-dark .stork-attribution a:link, +.stork-wrapper-dark .stork-attribution a:visited { + color: var(--stork-blue-2); +} + +.stork-wrapper-dark .stork-output-visible { + border: 1px solid var(--stork-border-color); + box-shadow: 0px 0.4px 2.2px rgba(0, 0, 0, 0.011), + 0px 1px 5.3px rgba(0, 0, 0, 0.016), 0px 1.9px 10px rgba(0, 0, 0, 0.02), + 0px 3.4px 17.9px rgba(0, 0, 0, 0.024), 0px 6.2px 33.4px rgba(0, 0, 0, 0.029), + 0px 15px 80px rgba(0, 0, 0, 0.04); + background: var(--stork-background-color); +} + +.stork-wrapper-dark .stork-message { + width: 100%; + padding: 0.5em 1em; + color: var(--stork-text-color); +} + +.stork-wrapper-dark .stork-attribution { + width: 100%; + padding: 0.5em 1em; + font-size: 0.8em; + color: var(--stork-text-color); +} + +.stork-wrapper-dark .stork-results { + margin: 0; + padding: 0; + width: 100%; + list-style-type: none; + max-height: 25em; + overflow-y: scroll; + border-top: 1px solid var(--stork-border-color); + border-bottom: 1px solid var(--stork-border-color); + box-shadow: inset 0em 0.7em 0.2em -0.5em hsla(0, 0%, 0%, 0.08), + inset 0em -0.7em 0.2em -0.5em hsla(0, 0%, 0%, 0.08); +} + +.stork-wrapper-dark .stork-result:not(:last-child) { + border-bottom: 1px solid var(--stork-border-color); +} + +.stork-wrapper-dark .stork-result.selected { + background: var(--stork-violet-10); +} + +.stork-wrapper-dark .stork-result a:link { + padding: 1em; + display: block; + color: currentcolor; + text-decoration: none; +} + +.stork-wrapper-dark .stork-result p { + margin: 0; +} + +.stork-wrapper-dark .stork-title { + padding: unset; + font-weight: bold; + font-size: 0.95em; + margin: 0 0 0.75em 0; + color: var(--stork-text-color); + + /* Flexbox container for the title and the score, when debugging */ + display: flex; + justify-content: space-between; +} + +.stork-wrapper-dark .stork-excerpt { + font-size: 0.8em; + line-height: 1; + margin: 0; + color: var(--stork-gray-3); + padding: unset; + + /* Flexbox container for the title and the score, when debugging */ + display: flex; + justify-content: space-between; +} + +.stork-wrapper-dark .stork-excerpt:not(:last-of-type) { + margin-bottom: 0.6em; +} + +.stork-wrapper-dark .stork-highlight { + background-color: var(--stork-lime-3); + padding: 0 0.1em; +} + +.stork-wrapper-dark .stork-error { + outline: 2px solid #c92a2a; +} + +.stork-wrapper-dark .stork-close-button { + position: absolute; + /* bottom: 0; */ + right: 0; + margin: 0.7em 0.6em; + height: 1.2em; + width: 1.2em; + padding: 0px; + background: linear-gradient( + to bottom, + hsl(0, 0%, 85%) 0%, + hsl(0, 0%, 83%) 100% + ); + border: 1px solid hsla(0, 0%, 50%, 0.3); + font-size: 1em; + color: hsl(0, 0%, 50%); + border-radius: 15%; + line-height: 1; +} + +.stork-wrapper-dark .stork-close-button svg { + width: 0.8em; + position: relative; + top: 1px; +} + +.stork-wrapper-dark .stork-close-button:hover { + background: hsla(0, 0%, 78%); + cursor: pointer; +} + +.stork-wrapper-dark .stork-close-button:active { + background: hsla(0, 0%, 65%); +} diff --git a/templates/base.html b/templates/base.html index 3f3c651..005e690 100644 --- a/templates/base.html +++ b/templates/base.html @@ -73,7 +73,15 @@ {% if USE_GOOGLE_FONTS != False %} {% endif %} - + + {% endif %} + + {% if PLUGINS and 'pelican.plugins.search' in PLUGINS %} + {% if THEME_COLOR_AUTO_DETECT_BROWSER_PREFERENCE or not THEME_COLOR or THEME_COLOR == "light" %} + + {% endif %} + {% endif %} @@ -182,7 +190,12 @@ {% endif %} - + {% if PLUGINS and 'pelican.plugins.search' in PLUGINS %} +
+ +
+
+ {% endif %} {% if (pages and DISPLAY_PAGES_ON_MENU) or LINKS %}