diff --git a/index.html b/index.html index e6b5783..48dc8d3 100644 --- a/index.html +++ b/index.html @@ -30,10 +30,18 @@

// Hex Studios

Developer, biker, musician, engineer, and an unapologetic centrist in the deep red south. The real @hexstudios. + +

Pinned posts

@@ -46,26 +54,26 @@ async function loadPosts() { const list = document.getElementById('posts-list'); try { - const res = await fetch('posts/list.php'); - const posts = await res.json(); + const res = await fetch('posts/list.php'); + const posts = await res.json(); - if (!posts.length) { - list.innerHTML = '
  • No posts yet.
  • '; - return; - } + if (!posts.length) { + list.innerHTML = '
  • No posts yet.
  • '; + return; + } - posts.forEach(post => { - const li = document.createElement('li'); - const a = document.createElement('a'); - a.textContent = post.title; - a.href = post.type === 'html' - ? 'posts/' + post.file - : 'post.html?file=' + encodeURIComponent(post.file); - li.appendChild(a); - list.appendChild(li); - }); + posts.forEach(post => { + const li = document.createElement('li'); + const a = document.createElement('a'); + a.textContent = post.title + " | " + post.date; + a.href = post.type === 'html' + ? 'posts/' + post.file + : 'post.html?file=' + encodeURIComponent(post.file); + li.appendChild(a); + list.appendChild(li); + }); } catch (err) { - list.innerHTML = '
  • Couldn\u2019t load posts.
  • '; + list.innerHTML = '
  • Couldn\u2019t load posts.
  • '; } } diff --git a/styles/main.css b/styles/main.css index 3306bc6..56bb3e9 100644 --- a/styles/main.css +++ b/styles/main.css @@ -62,15 +62,23 @@ hr { /* post lists on the main page */ #posts-section ul, -#sticky-posts-section ul { +#sticky-posts-section ul, +#links-section ul { list-style: none; padding: 0; } #posts-section li, -#sticky-posts-section li { +#sticky-posts-section li, +#links-section li { margin: 0.5em 0; } +#posts-section li::before, +#sticky-posts-section li::before, +#links-section li::before { + content: "> "; +} + /* post.html */ .back-link { display: inline-block;