The old Pelican theme I used to use for mcol.xyz
git clone https://mcol.xyz/code/rice-theme
Log | Files | Refs | README

commit a2498a2cac29cd7e0381ae44ff8f70904c44ee79
parent c6f731b0d8af2ffad3c00b0bab82702e1b99ac98
Author: mcol <mcol@posteo.net>
Date:   Thu,  6 Aug 2020 00:52:52 +0100

add PRIVACYPOLICY with hover window

Diffstat:
Mreadme.rst | 8+++++---
Mstatic/css/main.css | 30++++++++++++++++++++++++++++--
Mtemplates/base.html | 15+++++++++++++++
3 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/readme.rst b/readme.rst @@ -37,11 +37,13 @@ Non-standard variables ========== ======================= BLOGROLL A list of lists, where each inner list has 2-4 elements in the order: name, full URL, comment, pretty URL. The second 2 elements are optional. This will be rendered below the content on a page using the blogroll template. - EXTRAHEAD A string that is added into the header of every page as is. + EXTRAHEAD (string) Extra headers to add to every page verbatim. - MENUPADTO Width to space-pad menu items to. Set this to the length of the largest item. + MENUPADTO (int) Width to space-pad menu items to. Set this to the length of the largest item. - ICONITEMS List of class-link pairs used to add icons to the menu windows (see below). + ICONITEMS (list/tuple) Class-link pairs used to add icons to the menu windows (see below). + + PRIVACYPOLICY (string) Privacy policy text. If set, the word 'privacy' will be displayed at the bottom of the page and this text will be shown when it is hovered. ========== ======================= diff --git a/static/css/main.css b/static/css/main.css @@ -39,7 +39,7 @@ html { color: var(--text); } -body { +.body { height: 96vh; display: flex; justify-content: space-evenly; @@ -75,6 +75,29 @@ h1 a:hover { } +/* PRIVACY POLICY */ + +#priv-pol { + font-size: 0.7em; + display: none; + margin-left: 30px; + transform: translateY(-115%); +} + +#priv-pol .wc { + padding: 12%; +} + +#priv { + font-size: 0.8em; + opacity: 0.5; + display: inline-block; +} + +#priv:hover + #priv-pol { + display: block; +} + /* WINDOWS */ .win { @@ -1186,7 +1209,7 @@ table { } @media (max-width: 1180px) { - body { + .body { flex-direction: column; height: unset; min-height: 97vh; @@ -1207,6 +1230,9 @@ table { #nav { margin-top: 2%; } + #priv-pol { + margin-left: 0; + } } @media (max-width: 960px) { diff --git a/templates/base.html b/templates/base.html @@ -17,8 +17,23 @@ </head> <body> + <div class=body> {% block body %} {% endblock %} + </div> + + {% if PRIVACYPOLICY %} + <div id=priv> + privacy + </div> + <div id=priv-pol class=win> + <div class=bar> + </div> + <div class=wc> + <div>{{ PRIVACYPOLICY }}</div> + </div> + </div> + {% endif %} </body> </html>