From a266997126bf8d15a4d6a5d51ae91cc3f2a62c2d Mon Sep 17 00:00:00 2001 From: David Young Date: Mon, 11 Jul 2022 17:42:10 +1200 Subject: [PATCH] Tidy up js Signed-off-by: David Young --- _snippets/recipe-tfa-ingredients.md | 2 +- manuscript/community/discord.md | 16 +++++------ manuscript/extras/javascript/discord.js | 16 ----------- manuscript/extras/javascript/plausible.js | 1 + manuscript/extras/javascript/rightmessage.js | 10 +++++++ .../extras/javascript/sortable-tables.js | 6 ----- manuscript/extras/javascript/tablesort.js | 6 +++++ manuscript/extras/javascript/widgetbot.js | 27 +++++++++++++++++++ manuscript/recipes/duplicati.md | 2 +- manuscript/recipes/linx.md | 1 + mkdocs.yml | 13 ++++----- overrides/404.html | 2 +- overrides/main.html | 23 +++++++++++++++- 13 files changed, 85 insertions(+), 40 deletions(-) delete mode 100644 manuscript/extras/javascript/discord.js create mode 100644 manuscript/extras/javascript/plausible.js create mode 100644 manuscript/extras/javascript/rightmessage.js delete mode 100644 manuscript/extras/javascript/sortable-tables.js create mode 100644 manuscript/extras/javascript/tablesort.js create mode 100644 manuscript/extras/javascript/widgetbot.js diff --git a/_snippets/recipe-tfa-ingredients.md b/_snippets/recipe-tfa-ingredients.md index bf3f07d..9542a03 100644 --- a/_snippets/recipe-tfa-ingredients.md +++ b/_snippets/recipe-tfa-ingredients.md @@ -4,7 +4,7 @@ Already deployed: * [X] [Docker swarm cluster](/docker-swarm/design/) with [persistent shared storage](/docker-swarm/shared-storage-ceph/) - * [X] [Traefik](/docker-swarm/traefik) configured per design + * [X] [Traefik](/docker-swarm/traefik/) configured per design New: diff --git a/manuscript/community/discord.md b/manuscript/community/discord.md index e9787e6..2f7ef93 100644 --- a/manuscript/community/discord.md +++ b/manuscript/community/discord.md @@ -6,21 +6,21 @@ description: The most realtime and exciting way engage with our geeky community The most realtime and exciting way engage with our geeky community is in our [Discord server](http://chat.funkypenguin.co.nz) + + + !!! question "Eh? What's a Discord? Get off my lawn, young whippersnappers!!" + Yeah, I know. I also thought Discord was just for the gamer kids, but it turns out it's great for a geeky community. Why? [Let me elucidate ya.](https://www.youtube.com/watch?v=1qHoSWxVqtE).. -Yeah, I know. I also thought Discord was just for the gamer kids, but it turns out it's great for a geeky community. Why? [Let me elucidate ya.](https://www.youtube.com/watch?v=1qHoSWxVqtE).. - -1. Native markdown for code blocks -2. Drag-drop screenshots -3. Costs nothing, no ads -4. Mobile notifications are reliable, individual channels mutable, etc + 1. Native markdown for code blocks + 2. Drag-drop screenshots + 3. Costs nothing, no ads + 4. Mobile notifications are reliable, individual channels mutable, etc ## How do I join the Discord server? 1. Create [an account](https://discordapp.com) 2. [Join the geek party](http://chat.funkypenguin.co.nz)! - - ## Code of Conduct diff --git a/manuscript/extras/javascript/discord.js b/manuscript/extras/javascript/discord.js deleted file mode 100644 index 2c5c8a4..0000000 --- a/manuscript/extras/javascript/discord.js +++ /dev/null @@ -1,16 +0,0 @@ -new Crate({ - server: '396055506072109067', - channel: '396055506663374849', - color: 'black', - indicator: false, - notifications: true, - indicator: true, - timeout: 5000 -}) - -// Display for 10 seconds + custom avatar -crate.notify({ - content: 'Need a 🤚? Hot, sweaty geeks are waiting to chat to you! Click 👇', - timeout: 5000, - avatar: 'https://avatars2.githubusercontent.com/u/1524686?s=400&v=4' -}) diff --git a/manuscript/extras/javascript/plausible.js b/manuscript/extras/javascript/plausible.js new file mode 100644 index 0000000..ca508fd --- /dev/null +++ b/manuscript/extras/javascript/plausible.js @@ -0,0 +1 @@ + diff --git a/manuscript/extras/javascript/rightmessage.js b/manuscript/extras/javascript/rightmessage.js new file mode 100644 index 0000000..d23d561 --- /dev/null +++ b/manuscript/extras/javascript/rightmessage.js @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/manuscript/extras/javascript/sortable-tables.js b/manuscript/extras/javascript/sortable-tables.js deleted file mode 100644 index fadda78..0000000 --- a/manuscript/extras/javascript/sortable-tables.js +++ /dev/null @@ -1,6 +0,0 @@ -app.document$.subscribe(function() { - var tables = document.querySelectorAll("article table") - tables.forEach(function(table) { - new Tablesort(table) - }) - }) \ No newline at end of file diff --git a/manuscript/extras/javascript/tablesort.js b/manuscript/extras/javascript/tablesort.js new file mode 100644 index 0000000..6a5afcf --- /dev/null +++ b/manuscript/extras/javascript/tablesort.js @@ -0,0 +1,6 @@ +document$.subscribe(function() { + var tables = document.querySelectorAll("article table:not([class])") + tables.forEach(function(table) { + new Tablesort(table) + }) +}) diff --git a/manuscript/extras/javascript/widgetbot.js b/manuscript/extras/javascript/widgetbot.js new file mode 100644 index 0000000..3efa3be --- /dev/null +++ b/manuscript/extras/javascript/widgetbot.js @@ -0,0 +1,27 @@ +// Display for 10 seconds + custom avatar +// crate.notify({ +// content: 'Need a 🤚? Hot, sweaty geeks are waiting to chat to you! Click 👇', +// timeout: 5000, +// avatar: 'https://avatars2.githubusercontent.com/u/1524686?s=400&v=4' +// }) + + +// This file should _not_ be routinely included, it's here to make tweaking of the widgetbot settings +// faster, since making changes doesn't require restarting mkdocs serve + + + + diff --git a/manuscript/recipes/duplicati.md b/manuscript/recipes/duplicati.md index 4c59811..05e3263 100644 --- a/manuscript/recipes/duplicati.md +++ b/manuscript/recipes/duplicati.md @@ -18,7 +18,7 @@ Similar to the other backup options in the Cookbook, we can use Duplicati to bac - Cloud services (OneDrive, Google Drive, etc) !!! note - Since Duplicati itself offers no user authentication, this design secures Duplicati behind [Traefik Forward Auth](/docker-swarm/traefik-forward-auth), so that in order to gain access to the Duplicati UI at all, authentication through the mechanism configured in traefik-forward-auth (_to GitHub, GitLab, Google, etc_) must have already occurred. + Since Duplicati itself offers no user authentication, this design secures Duplicati behind [Traefik Forward Auth](/docker-swarm/traefik-forward-auth/), so that in order to gain access to the Duplicati UI at all, authentication through the mechanism configured in traefik-forward-auth (_to GitHub, GitLab, Google, etc_) must have already occurred. ## Ingredients diff --git a/manuscript/recipes/linx.md b/manuscript/recipes/linx.md index 6d5b964..78eba50 100644 --- a/manuscript/recipes/linx.md +++ b/manuscript/recipes/linx.md @@ -1,4 +1,5 @@ --- +title: How to share screenshots with linx under Docker description: Quickly share self-destructing screenshots, text, etc --- diff --git a/mkdocs.yml b/mkdocs.yml index a9785b8..f0607ba 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -242,7 +242,7 @@ nav: - Design: premix/ansible/design.md # - Swarm: premix/swarm.md # - Kubernetes: premix/kubernetes.md - - CHANGELOG: CHANGELOG.md + - CHANGELOG: changelog.md - Support: support.md - Contribute: community/contribute.md - Community: @@ -358,12 +358,13 @@ extra_css: - extras/css/icons.css extra_javascript: - - extras/javascript/discord.js - - extras/javascript/sortable-tables.js - - extras/javascript/feedback.js - - https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js + - extras/javascript/plausible.js + # - extras/javascript/widgetbot.js # uncommented for dev + # - extras/javascript/rightmessage.js + # - extras/javascript/feedback.js + - https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js + - extras/javascript/tablesort.js - # Extensions markdown_extensions: - attr_list diff --git a/overrides/404.html b/overrides/404.html index 84430ec..d44d15b 100644 --- a/overrides/404.html +++ b/overrides/404.html @@ -1,6 +1,6 @@ {% extends "main.html" %} - + {% block libs %} {% endblock %} diff --git a/overrides/main.html b/overrides/main.html index 0bd5a00..b5c3e0b 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -21,7 +21,6 @@ {% endblock %} {% block analytics %} - @@ -45,4 +44,26 @@ {% else %} {{ config.site_name }} {% endif %} +{% endblock %} + +{% block extrahead %} + + + + + + {% endblock %} \ No newline at end of file