Skip to content

Commit

Permalink
contact-imprint-from-functions-json-website-file
Browse files Browse the repository at this point in the history
  • Loading branch information
ti ko authored and ti ko committed Jan 16, 2024
1 parent cbd49e1 commit 128f736
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 56 deletions.
5 changes: 1 addition & 4 deletions content/contact.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
---
type: contact
---

- email: t "at" tik1.net
- Whatsapp: +49 1573 95 98 220
---
1 change: 1 addition & 0 deletions content/imprint.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Responsible for the website:
Timo Körner

Hepberg, Germany
](../../fun/public/imprint.md)
18 changes: 14 additions & 4 deletions layouts/contact/single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{{ partial "head.html" }}
<div id="contact">
<h3 style="margin-top: 60px;margin-bottom: 30px;">Kontakt</h3>

{{.Content}}
<div style='padding-top:50px'></div>

{{ partial "foot.html" }}
<div id="content"></div>
<div id=bottomnav></div>
</div>
<script type="module">
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();
res = (res.filter(val => val.key === 'contact'))[0].val;
document.getElementById('content').innerHTML = marked.parse(res);
}
</script>
{{ partial "foot.html" }}
18 changes: 14 additions & 4 deletions layouts/imprint/single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{{ partial "head.html" }}
<div id="imprint">
<h3 style="margin-top: 60px">Imprint</h3>

{{.Content}}
<div style='padding-top:50px'></div>

{{ partial "foot.html" }}
<div id="content"></div>
<div id=bottomnav></div>
</div>
<script type="module">
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();
res = (res.filter(val => val.key === 'imprint'))[0].val;
document.getElementById('content').innerHTML = marked.parse(res);
}
</script>
{{ partial "foot.html" }}
11 changes: 5 additions & 6 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
style="margin-top: 40px; margin-bottom: 70px; font-size: 5rem; color: #fef6e4; text-shadow: 5px 5px 0px #172c66, 10px 10px 0px #001858, 15px 15px 0px #f9bc60,20px 20px 0px #ff8e3c, 25px 25px 0px #9656a1;">
Online classes</h2>

<div id="yellowtail">Timo Körner</div>


<div id="content">
<div id="yellowtail">Timo Körner</div>
</div>
<div id=bottomnav></div>
</div>
{{ partial "foot.html" }}

<script>
// console.log(0)
</script>
<script src=/client.js></script>

</html>
10 changes: 1 addition & 9 deletions layouts/partials/foot.html
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
</div>
<div id=bottomnav></div>
</div>

<script>

// console.log(123)
</script>
<script src="/nav.js"></script>
<script src="/foot.js"></script>
3 changes: 1 addition & 2 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<body style="width:800px;padding-top: 80px;margin-left: auto;margin-right: auto;">
<div id=container class="container" style="padding-bottom: 80px;">
<div id="topnav">
<h4 class="mt-5 mb-3" style="color: white;">
Timo' s classes
<h4 id=header class="mt-5 mb-2" style="color: white;">
</h4>
</div>
15 changes: 4 additions & 11 deletions static/client.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@

document.title = tiko

var net_host = 'http://localhost'
// var net_host = 'https://tifun.netlify.app'
var net_fun = '/.netlify/functions/'

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

// console.log(res)

var main_div = document.createElement('div')
main_div.id = 'data'
container.append(main_div)
var content = document.getElementById('content')
var list = document.createElement('ul')
main_div.append(list)
content.prepend(list)

res = groupBy(res, 'cat');
// console.log(2, res)

for (var elem in res) {
var head = document.createElement('h5')
Expand All @@ -31,6 +23,7 @@ async function data() {
list.append(li)
}
}

}

function groupBy(objectArray, property) {
Expand Down
16 changes: 8 additions & 8 deletions static/nav.js → static/foot.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

// console.log(4)
var net_host
net_host = 'https://tifun.netlify.app'
if (location.hostname === 'localhost') net_host = 'http://localhost'

var tiko = "Tiko's"
var net_fun = '/.netlify/functions/'

var aref = document.createElement("a");
var tiko = "Timo's classes"

header.textContent = tiko

// var test = document.createElement("a");
// test.classList.add('focus')
// test.textContent = 'test'
// test.href = '/'
// bottomnav.append(test)
var aref = document.createElement("a");

topnav.classList.add('fixed-top', 'bg-dark')
bottomnav.classList.add('fixed-bottom', 'bg-dark')
Expand Down
12 changes: 4 additions & 8 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@ body {
font-family: 'roboto', sans-serif;
width: 800px;
padding-top: 80px;
margin-left: auto;
margin-right: auto;
/* margin-left: auto; */
/* margin-right: auto; */
}

#yellowtail {
font-family: 'yellowtail', sans-serif;
font-size: x-large;
}

#topnav a,
#topnav,
#bottomnav a {
font-size: 17px;
float: left;
color: #f2f2f2;
text-decoration: none;
padding: 10px 10px;
padding: 10px 20px;
}

#topnav a:hover {
background-color: #ddd;
color: black;
}

/* Add an active class to highlight the current page */
a.active {
Expand Down

0 comments on commit 128f736

Please sign in to comment.