Skip to content

Commit

Permalink
sortedy-by-category--sayings-moved-to-end
Browse files Browse the repository at this point in the history
  • Loading branch information
ti ko authored and ti ko committed Feb 3, 2024
1 parent 43c8edb commit e2e1e26
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion layouts/contact/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
test()
async function test() {
var res = await (await (fetch(net_host + net_fun + 'utils'))).json();
var res = await (await (fetch(net_host + net_fun + 'website'))).json();
res = (res.filter(val => val.key === 'contact'))[0].val;
document.getElementById('container').innerHTML = marked.parse(res);
}
Expand Down
2 changes: 1 addition & 1 deletion layouts/imprint/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
test()
async function test() {
var res = await (await (fetch(net_host + net_fun + 'utils'))).json();
var res = await (await (fetch(net_host + net_fun + 'website'))).json();
res = (res.filter(val => val.key === 'imprint'))[0].val;
document.getElementById('container').innerHTML = marked.parse(res);
}
Expand Down
8 changes: 3 additions & 5 deletions static/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ document.title = tiko

data()
async function data() {
var res = await (await (fetch(net_host + net_fun + 'utils'))).json()
let res = await (await (fetch(net_host + net_fun + 'website'))).json()
res = res.filter(val => val.cat !== 'static')
res = groupBy(res, 'cat');

var content = document.getElementById('container')
var list = document.createElement('ul')
content.prepend(list)

res = groupBy(res, 'cat');
document.getElementById('container').prepend(list)

for (var elem in res) {
var head = document.createElement('h5')
Expand Down
2 changes: 1 addition & 1 deletion static/foot.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ for (var elem of ['index', "contact", 'imprint']) {
bottomnav.append(ahref)
}

let path = window.location.pathname.split('/').pop().replace('.html', '')
let path = window.location.pathname.split('/').pop().replace('.html', '') || 'index'
const element = document.getElementById(path)
if (element) element.classList.add('active');

0 comments on commit e2e1e26

Please sign in to comment.