tangled
alpha
login
or
join now
cass.cityboundforest.com
/
cityboundforest.com
0
fork
atom
A repo for my personal website
0
fork
atom
overview
issues
pulls
pipelines
Starting to work on blog post functionality
cass.cityboundforest.com
7 months ago
34689116
687cdd06
+30
2 changed files
expand all
collapse all
unified
split
public
blog
item
index.html
src
blog-item.ts
+19
public/blog/item/index.html
···
1
1
+
<!DOCTYPE html>
2
2
+
<html>
3
3
+
<head>
4
4
+
<link rel="stylesheet" href="/style.css" />
5
5
+
<script type="text/javascript" src="/blog-item.js"></script>
6
6
+
</head>
7
7
+
<body>
8
8
+
<div id="nav-links">
9
9
+
<span class="nav-link"><a href="/#">Home</a></span>
10
10
+
<span class="nav-link"><a href="/#about">About</a></span>
11
11
+
<span class="nav-link"><a href="/#portfolio">Portfolio</a></span>
12
12
+
<span class="nav-link"><a href="/blog">Blog</a></span>
13
13
+
<span class="nav-link"><a href="/#links">Links</a></span>
14
14
+
</div>
15
15
+
<div id="blog-content">
16
16
+
<h3 id="title"></h3>
17
17
+
</div>
18
18
+
</body>
19
19
+
</html>
+11
src/blog-item.ts
···
1
1
+
window.onload = () => {
2
2
+
fetch('https://bsky.social/xrpc/com.atproto.repo.getRecord?repo=cass.cityboundforest.com&collection=com.cityboundforest.blog&rkey=' + window.location.hash.replace('#', ''), {
3
3
+
headers: {
4
4
+
'Content-Type': 'application/json'
5
5
+
}
6
6
+
}).then((res) => {
7
7
+
return res.json();
8
8
+
}).then((data: { value: { content: string, title: string } }) => {
9
9
+
document.getElementById('title')!.innerText = data.value.title;
10
10
+
});
11
11
+
};