diff options
Diffstat (limited to 'blog/index.php')
| -rw-r--r-- | blog/index.php | 178 |
1 files changed, 62 insertions, 116 deletions
diff --git a/blog/index.php b/blog/index.php index 1fbe75a..aed6c5f 100644 --- a/blog/index.php +++ b/blog/index.php @@ -6,134 +6,80 @@ error_reporting(E_ALL); <!DOCTYPE html> <html lang="en"> <head> + <?php + $stag = $_GET["tag"]; + $nostag = empty($stag); + ?> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Blog</title> - <link href="../style.css" rel="stylesheet" type="text/css" media="all"> - <style> - ul#articles { - margin: 0; - margin-top: 1rem; - display: flex; - flex-direction: column; - padding-left: 0; - list-style: none; - } - .blogentry { - max-width: 100%; - list-style: none; - display: inline-block; - margin: calc(var(--stdpadding)/2) 0; - padding: var(--stdpadding); - - border-left: var(--stdaccentborder); - background: linear-gradient(var(--blockbghover) 0 0) 0 / var(--bgpos, 0) no-repeat; - transition: background .3s, border .3s; - } - .blogentry:hover { - --bgpos: 100%; - } - ul#articles h2 { - margin: calc(var(--stdpadding)/2) 0; - } - /*ul h2:first-of-type::before { - content: "Articles - " - }*/ - article img, article video, article iframe { - filter:drop-shadow(var(--stddropshadow)); - } - .blogentry > * { - display: block; - margin: 0.1rem 0; - box-sizing: border-box; - } - .entrysummary { - font-size: .9em; - color: gainsboro; - } - .entrytag { - font-size: .9em; - color: #bbbbbb; - font-style: italic; - display: inline-block; - margin-right: 1ch; - } - .entrydate { - font-weight: bold; - } - .entrytitle { - padding-left: initial; - border-left: initial; - } - article:first-of-type h2::before { - content: 'Journal - '; - } - </style> - <?php include($_SERVER['DOCUMENT_ROOT'] . '/seasonal.php'); ?> + <title><?php if(!$nostag) { echo("#$stag | ");} ?> isoblog | isopod.cool v4</title> + <link href="/style.css" rel="stylesheet" type="text/css" media="all"> </head> <body> - <?php include($_SERVER['DOCUMENT_ROOT'] . '/nav.php'); bg(true); ?> - <h1>isoblog</h1> - <h2 id="caption">inane ramblings</h2> - <nav> - <a href="blog.atom">atom feed</a> + <?php include($_SERVER['DOCUMENT_ROOT'] . '/header.php'); ?> + <main> + <h2><?php if(!$nostag) { echo("#$stag");} else { echo("isoblog"); } ?></h2> + <p class="h2caption">inane ramblings</p> + <nav class="pagenav"> + <ul> + <li><a href="blog.atom">atom feed</a></li> + <?php + $content = simplexml_load_file("blog.atom"); + $year = "-69420"; + $yc = 0; + foreach($content->entry as $entry) { + $nyr = substr($entry->published, 0, 4); + if($nyr != $year) { + $year = $nyr; + echo "<li><a href='#$year'>$year</a></li>"; + } + } + ?> + </ul> + </nav> <?php - $content = simplexml_load_file("blog.atom"); + if(!$nostag) { + echo "<p class='backlink'><a href='.'>All articles</a></p>"; + } + echo "<ul id='articles'>"; $year = "-69420"; $yc = 0; foreach($content->entry as $entry) { - $nyr = substr($entry->published, 0, 4); - if($nyr != $year) { - $year = $nyr; - echo "<a href='#$year'>$year</a>"; - } - } - ?> - </nav> - <?php - $stag = $_GET["tag"]; - $nostag = empty($stag); - if(!$nostag) { - echo "<a style='display: block; margin-top: 1rem; margin-bottom: 1rem;' href='.'>All articles</a>"; - } - echo "<ul id='articles'>"; - $year = "-69420"; - $yc = 0; - foreach($content->entry as $entry) { - - $pfilt = false; - if(!$nostag) { - foreach($entry->category as $cat) { - $term = $cat["term"]; - if($stag == $term) { - $pfilt = true; + + $pfilt = false; + if(!$nostag) { + foreach($entry->category as $cat) { + $term = $cat["term"]; + if($stag == $term) { + $pfilt = true; + } } } - } - if($pfilt or $nostag) { - $nyr = substr($entry->published, 0, 4); - if($nyr != $year) { - $year = $nyr; - echo "<li><h2 id='$year'>$year</h2></li>"; - } - $dt = substr($entry->published, 0, 10); - $ti = $entry->title; - $wn = ""; - if(preg_match('/2022-0(5|4)-(21|25|13)/', $dt)) { - $wn = "title=\"This post is on the archived v2 version of the site. It will not load if you don't have Javascript enabled, and expect jank if viewing on mobile. You have been warned.\" "; - } - $cats = ""; - foreach($entry->category as $cat) { - $term = $cat["term"]; - $cats = $cats."<a class='entrytag' href='?tag=".$term."'>".$term."</a>"; + if($pfilt or $nostag) { + $nyr = substr($entry->published, 0, 4); + if($nyr != $year) { + $year = $nyr; + echo "<li><h3 id='$year'>$year</h3></li>"; + } + $dt = substr($entry->published, 0, 10); + $ti = $entry->title; + $wn = ""; + if(preg_match('/2022-0(5|4)-(21|25|13)/', $dt)) { + $wn = "title=\"This post is on the archived v2 version of the site. It will not load if you don't have Javascript enabled, and expect jank if viewing on mobile. You have been warned.\" "; + } + $cats = ""; + foreach($entry->category as $cat) { + $term = $cat["term"]; + $cats = $cats."<a class='entrytag' href='?tag=".$term."'>".$term."</a>"; + } + + echo "<li class='blogentry'><time class='entrydate'>".$dt."</time><h4 class='entrytitle'><a ".$wn."href='".$entry->link["href"]."'>".$ti."</h4></a><p class='entrysummary'>".$entry->summary."</p><p>".$cats."</p></li>"; } - - echo "<li class='blogentry'><time class='entrydate'>".$dt."</time><h4 class='entrytitle'><a ".$wn."href='".$entry->link["href"]."'>".$ti."</h4></a><span class='entrysummary'>".$entry->summary."</span><span>".$cats."</span></li>"; } - } - echo "</ul>"; - ?> - + echo "</ul>"; + ?> + </main> + <?php include($_SERVER['DOCUMENT_ROOT'] . '/footer.php'); ?> </body> </html> |
