From e3b237d9baf2e2771fd212b74103538ab80fe805 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Sun, 2 Aug 2020 19:17:05 +0200 Subject: [PATCH 1/3] source decorate content plugin from pypi --- homepage/pelicanconf.py | 3 +- homepage/plugins/decorate_content/__init__.py | 1 - .../decorate_content/decorate_content.py | 33 ------------------- homepage/requirements.txt | 1 + 4 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 homepage/plugins/decorate_content/__init__.py delete mode 100644 homepage/plugins/decorate_content/decorate_content.py diff --git a/homepage/pelicanconf.py b/homepage/pelicanconf.py index d88e54e..11847a4 100644 --- a/homepage/pelicanconf.py +++ b/homepage/pelicanconf.py @@ -1,5 +1,6 @@ import os from datetime import datetime +from pelican_decorate_content import decorate_content # If your site is available via HTTPS, make sure SITEURL begins with https:// RELATIVE_URLS = False @@ -44,7 +45,7 @@ PAGE_SAVE_AS = '{slug}/index.html' ARTICLE_SAVE_AS = 'blog/{slug}/index.html' PLUGIN_PATHS = ['./plugins'] -PLUGINS = ['decorate_content', 'assets'] +PLUGINS = [decorate_content, 'assets'] MARKDOWN = { 'extension_configs': { diff --git a/homepage/plugins/decorate_content/__init__.py b/homepage/plugins/decorate_content/__init__.py deleted file mode 100644 index 1dd5d68..0000000 --- a/homepage/plugins/decorate_content/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .decorate_content import * diff --git a/homepage/plugins/decorate_content/decorate_content.py b/homepage/plugins/decorate_content/decorate_content.py deleted file mode 100644 index 11ebd65..0000000 --- a/homepage/plugins/decorate_content/decorate_content.py +++ /dev/null @@ -1,33 +0,0 @@ -from json import loads - -from pelican import signals -from pelican.contents import Article, Page, Static -from bs4 import BeautifulSoup - - -def content_object_init(instance): - if isinstance(instance, (Article, Page, Static)): - plugin_settings = instance.settings.get("DECORATE_CONTENT", {}) - content_overrides = ( - instance.metadata.get("decorate_content", None) - if instance.metadata is not None - else None - ) - - settings = plugin_settings.copy() - settings.update( - loads(content_overrides) if content_overrides is not None else {} - ) - - soup = BeautifulSoup(instance._content, "html.parser") - - for selector, class_names in settings.items(): - elems = soup.select(selector) - for elem in elems: - elem["class"] = elem.get("class", []) + class_names - - instance._content = soup.decode() - - -def register(): - signals.content_object_init.connect(content_object_init) diff --git a/homepage/requirements.txt b/homepage/requirements.txt index 5b51f91..6118304 100644 --- a/homepage/requirements.txt +++ b/homepage/requirements.txt @@ -2,3 +2,4 @@ pelican==4.0.1 markdown==3.1.1 git+git://github.com/miracle2k/webassets#d1f3455e383446ca4ab0c644f326ee937e68e809 beautifulsoup4==4.8.1 +pelican-decorate-content==0.1.1 From 0b079631ee5f19670c25e0d6c4e388dea7c340e5 Mon Sep 17 00:00:00 2001 From: Hendrik Niefeld Date: Mon, 3 Aug 2020 15:28:33 +0200 Subject: [PATCH 2/3] add links --- homepage/pelicanconf.py | 2 ++ homepage/theme/templates/base.html | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/homepage/pelicanconf.py b/homepage/pelicanconf.py index 11847a4..935bf4f 100644 --- a/homepage/pelicanconf.py +++ b/homepage/pelicanconf.py @@ -85,11 +85,13 @@ DECORATE_CONTENT = { DOCS_URL = 'https://docs.offen.dev' GITHUB_REPO = 'https://github.com/offen/offen' +ROADMAP = 'https://github.com/offen/offen/projects/1' CONTACT_EMAIL = 'hioffen@posteo.de' PGP_KEY_FILE = '74B041E23DB29D552644CEB1B18C633D6967FE3F.asc' PATREON_URL = 'https://www.patreon.com/offen' LINKEDIN_URL = 'https://www.linkedin.com/company/hioffen' TWITTER_URL = 'https://twitter.com/hioffen' +MASTODON_URL = 'https://fosstodon.org/@offen' RELEASE_DIRECT_URL = 'https://get.offen.dev' DOCKER_DIRECT_URL = 'https://hub.docker.com/r/offen/offen' HEROKU_DIRECT_URL = 'https://heroku.com/deploy?template=https://github.com/offen/heroku/tree/master' diff --git a/homepage/theme/templates/base.html b/homepage/theme/templates/base.html index 83774a7..cd4d559 100644 --- a/homepage/theme/templates/base.html +++ b/homepage/theme/templates/base.html @@ -48,11 +48,14 @@
  • Summary
  • +
  • + Blog +
  • Deep dive
  • - Blog + Roadmap
  • About @@ -177,6 +180,9 @@

    Twitter

    +

    + Mastodon +

    Legal Notice

    From 4aa0342d1245779068c62fa6e632b8d14a6bc8c6 Mon Sep 17 00:00:00 2001 From: Hendrik Niefeld Date: Tue, 4 Aug 2020 23:03:16 +0200 Subject: [PATCH 3/3] add support note on hp --- homepage/content/pages/about.md | 2 +- homepage/theme/static/css/fix.css | 9 ++++++++- .../theme/static/images/nlnet-logo-gray.svg | 13 ++++++++++++ homepage/theme/templates/index.html | 20 +++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 homepage/theme/static/images/nlnet-logo-gray.svg diff --git a/homepage/content/pages/about.md b/homepage/content/pages/about.md index a1895bc..01f71ab 100644 --- a/homepage/content/pages/about.md +++ b/homepage/content/pages/about.md @@ -14,7 +14,7 @@ Offen is created by [Frederik Ring][frederik-ring]{: target="_blank"} and [Hendr [![NLnet Foundation](/theme/images/nlnet-logo.svg){:width="160px" height="60px" class="mt4"}](https://nlnet.nl/){: target="_blank"} -We are happy to work with [NLnet Foundation][nlnet-foundation]{: target="_blank"} who complement our activities within their [Next Generation Internet][next-generation-internet]{: target="_blank"} initiative. +We are happy to work with [NLnet Foundation,][nlnet-foundation]{: target="_blank"} which actively supports our efforts as part of its [Next Generation Internet][next-generation-internet]{: target="_blank"} initiative. [nlnet-foundation]: https://nlnet.nl/ [next-generation-internet]: https://nlnet.nl/NGI/ diff --git a/homepage/theme/static/css/fix.css b/homepage/theme/static/css/fix.css index ea231af..1759176 100644 --- a/homepage/theme/static/css/fix.css +++ b/homepage/theme/static/css/fix.css @@ -84,6 +84,9 @@ LAYOUT } /* HWidths and heights */ +.wx64 { + width: 100%; +} .wx18 { width: 18rem; } @@ -156,7 +159,11 @@ LAYOUT height: 33rem; } } - +@media only screen and (min-width: 64em) { + .wx64 { + width: 64rem; + } +} /* Margins an paddings */ .ptx-feature-2 { padding-top: 9rem; diff --git a/homepage/theme/static/images/nlnet-logo-gray.svg b/homepage/theme/static/images/nlnet-logo-gray.svg new file mode 100644 index 0000000..beb19a1 --- /dev/null +++ b/homepage/theme/static/images/nlnet-logo-gray.svg @@ -0,0 +1,13 @@ + + + + + +image/svg+xml + + + + + + + diff --git a/homepage/theme/templates/index.html b/homepage/theme/templates/index.html index e434523..6a005e3 100644 --- a/homepage/theme/templates/index.html +++ b/homepage/theme/templates/index.html @@ -100,6 +100,26 @@ + +
    +
    +
    +
    +
    +
    +
    + NLnet logo gray +
    +
    +

    + We are happy to work with NLnet Foundation, which actively supports our efforts as part of its Next Generation Internet initiative. +

    +
    +
    +
    +
    +
    +