Make the ntags cycle every week
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-26 14:37:52 +02:00
parent f12247d278
commit 4cd42b9824

View File

@ -6,30 +6,33 @@
<meta charset="utf-8">
<script type="text/JavaScript">
var redir_url = "https://ipng.ch/";
const urls = {
"ntag00": "/s/articles/2021/09/21/vpp-linux-cp-part7/",
"ntag01": "/s/articles/2021/12/23/vpp-linux-cp-virtual-machine-playground/",
"ntag02": "/s/articles/2022/01/12/case-study-virtual-leased-line-vll-in-vpp/",
"ntag03": "/s/articles/2022/02/14/case-study-vlan-gymnastics-with-vpp/",
"ntag04": "/s/articles/2022/03/27/vpp-configuration-part1/",
"ntag05": "/s/articles/2022/10/14/vpp-lab-setup/",
"ntag06": "/s/articles/2023/03/11/case-study-centec-mpls-core/",
"ntag07": "/s/articles/2023/04/09/vpp-monitoring/",
"ntag08": "/s/articles/2023/05/28/vpp-mpls-part-4/",
"ntag09": "/s/articles/2023/11/11/debian-on-mellanox-sn2700-32x100g/",
"ntag10": "/s/articles/2023/12/17/debian-on-ipngs-vpp-routers/",
"ntag11": "/s/articles/2024/01/27/vpp-python-api/",
"ntag12": "/s/articles/2024/02/10/vpp-on-freebsd-part-1/",
"ntag13": "/s/articles/2024/03/06/vpp-with-babel-part-1/",
"ntag14": "/s/articles/2024/04/06/vpp-with-loopback-only-ospfv3-part-1/",
"ntag15": "/s/articles/2024/04/27/freeix-remote/",
"END": "/"
};
const ntag_list = [
"/s/articles/2021/09/21/vpp-linux-cp-part7/",
"/s/articles/2021/12/23/vpp-linux-cp-virtual-machine-playground/",
"/s/articles/2022/01/12/case-study-virtual-leased-line-vll-in-vpp/",
"/s/articles/2022/02/14/case-study-vlan-gymnastics-with-vpp/",
"/s/articles/2022/03/27/vpp-configuration-part1/",
"/s/articles/2022/10/14/vpp-lab-setup/",
"/s/articles/2023/03/11/case-study-centec-mpls-core/",
"/s/articles/2023/04/09/vpp-monitoring/",
"/s/articles/2023/05/28/vpp-mpls-part-4/",
"/s/articles/2023/11/11/debian-on-mellanox-sn2700-32x100g/",
"/s/articles/2023/12/17/debian-on-ipngs-vpp-routers/",
"/s/articles/2024/01/27/vpp-python-api/",
"/s/articles/2024/02/10/vpp-on-freebsd-part-1/",
"/s/articles/2024/03/06/vpp-with-babel-part-1/",
"/s/articles/2024/04/06/vpp-with-loopback-only-ospfv3-part-1/",
"/s/articles/2024/04/27/freeix-remote/"
];
let key = window.location.hash.slice(1);
if (key in urls) {
redir_url = urls[key];
var redir_url = "https://ipng.ch/";
var key = window.location.hash.slice(1);
if (key.startsWith("ntag")) {
let week = Math.round(new Date().getTime() / 1000 / (7*24*3400));
let num = parseInt(key.slice(-2));
let idx = (num + week) % ntag_list.length;
console.log("(ntag " + num + " + week number " + week + ") % " + ntag_list.length + " = " + idx);
redir_url = ntag_list[idx];
}
console.log("Redirecting to " + redir_url + " - off you go!");
@ -40,7 +43,7 @@ window.location = redir_url;
<pre>
Usage: https://ipng.ch/app/go/#&lt;key&gt;
Example: <a href="/app/go/#END">#END</a>
Example: <a href="/app/go/#ntag00">#ntag00</a>
Also, this page requires javascript.