1
0
mirror of https://github.com/funkypenguin/geek-cookbook/ synced 2025-12-12 17:26:19 +00:00

Tidy up js

Signed-off-by: David Young <davidy@funkypenguin.co.nz>
This commit is contained in:
David Young
2022-07-11 17:42:10 +12:00
parent 650e553566
commit a266997126
13 changed files with 85 additions and 40 deletions

View File

@@ -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:

View File

@@ -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)
<!-- markdownlint-disable MD033 -->
<iframe src="https://e.widgetbot.io/channels/396055506072109067/456689991326760973" height="600" width="800"></iframe>
!!! 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)!
<!-- markdownlint-disable MD033 -->
<iframe src="https://discordapp.com/widget?id=396055506072109067&theme=dark" width="350" height="400" allowtransparency="true" frameborder="0"></iframe>
## Code of Conduct

View File

@@ -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'
})

View File

@@ -0,0 +1 @@
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>

View File

@@ -0,0 +1,10 @@
<!-- RightMessage -->
<script type="text/javascript">
(function(p, a, n, d, o, b, c) {
o = n.createElement('script'); o.type = 'text/javascript'; o.async = true; o.src = 'https://tb.rightmessage.com/'+p+'.js';
b = n.getElementsByTagName('script')[0]; d = function(h, u, i) { var c = n.createElement('style'); c.id = 'rmcloak'+i;
c.type = 'text/css'; c.appendChild(n.createTextNode('.rmcloak'+h+'{visibility:hidden}.rmcloak'+u+'{display:none}'));
b.parentNode.insertBefore(c, b); return c; }; c = d('', '-hidden', ''); d('-stay-invisible', '-stay-hidden', '-stay');
setTimeout(o.onerror = function() { c.parentNode && c.parentNode.removeChild(c); }, a); b.parentNode.insertBefore(o, b);
})('1802694484', 20000, document);
</script>

View File

@@ -1,6 +0,0 @@
app.document$.subscribe(function() {
var tables = document.querySelectorAll("article table")
tables.forEach(function(table) {
new Tablesort(table)
})
})

View File

@@ -0,0 +1,6 @@
document$.subscribe(function() {
var tables = document.querySelectorAll("article table:not([class])")
tables.forEach(function(table) {
new Tablesort(table)
})
})

View File

@@ -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
<script src="https://cdn.jsdelivr.net/npm/@widgetbot/crate@3"></script>
<script>
const devbutton = new Crate({
server: '396055506072109067',
channel: '456689991326760973' // Cookbook channel
color: '#000',
indicator: false,
notifications: true,
indicator: true,
timeout: 5000,
glyph: 'https://avatars2.githubusercontent.com/u/1524686?s=400&v=4'
})
devbutton.notify('Hello __world__\n```js\n// This is Sync!\n```')
</script>

View File

@@ -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

View File

@@ -1,4 +1,5 @@
---
title: How to share screenshots with linx under Docker
description: Quickly share self-destructing screenshots, text, etc
---

View File

@@ -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

View File

@@ -1,6 +1,6 @@
{% extends "main.html" %}
<!-- Content -->
<!-- For 404 tracking using Plausible -->
{% block libs %}
<script>plausible("404",{ props: { path: document.location.pathname } });</script>
{% endblock %}

View File

@@ -21,7 +21,6 @@
{% endblock %}
{% block analytics %}
<!-- <script src="https://cdn.jsdelivr.net/npm/@widgetbot/crate@3" async defer></script> -->
<script src="/js/i-am-groot.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<!-- RightMessage -->
@@ -45,4 +44,26 @@
{% else %}
<title>{{ config.site_name }}</title>
{% endif %}
{% endblock %}
{% block extrahead %}
<!-- For widgetbot -->
<!-- <script src='https://cdn.jsdelivr.net/npm/@widgetbot/crate@3' async defer>
const button = new Crate({
server: '396055506072109067', // Funky Penguin
channel: '456689991326760973', // Cookbook channel
// username: 'Website Reader',
// color: '#000',
notifications: true,
indicator: true // most recent change
})
button.notify({
content: 'Need a 🤚? Hot, sweaty geeks are waiting to chat to you! Click 👇',
timeout: 100000
})
</script> -->
{% endblock %}