diff options
Diffstat (limited to 'notes/index.php')
| -rw-r--r-- | notes/index.php | 153 |
1 files changed, 64 insertions, 89 deletions
diff --git a/notes/index.php b/notes/index.php index e3398ae..d883e38 100644 --- a/notes/index.php +++ b/notes/index.php @@ -6,108 +6,83 @@ 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>Notes</title> - <link href="../style.css" rel="stylesheet" type="text/css" media="all"> - <style> - .noteentry { - max-width: 100%; - list-style: none; - display: inline-block; - margin: var(--stdpadding) 0; - } - .noteentry h3 { - margin-top: 0; - } - /*ul h2:first-of-type::before { - content: "Articles - " - }*/ - .noteentry > * { - display: block; - box-sizing: border-box; - } - .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; - } - </style> - <?php include($_SERVER['DOCUMENT_ROOT'] . '/seasonal.php'); ?> + <title><?php if(!$nostag) { echo("#$stag | ");} ?> notes | 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(); ?> - <h1>isonotes</h1> - <h2 id="caption">superfluous commentary</h2> - <nav> - <a href="notes.atom">atom feed</a> + <?php include($_SERVER['DOCUMENT_ROOT'] . '/header.php');?> + <main> + <h2><?php if(!$nostag) { echo("#$stag");} else { echo("isonotes"); } ?></h2> + <p class="h2caption">good writing + superfluous commentary</p> + <nav class="pagenav"> + <ul> + <li><a href="https://blog.jim-nielsen.com/2023/notes-dot-jim-nielsen-dot-com/">what?</a></li> + <li><a href="notes.atom">atom feed</a></li> + <?php + $content = simplexml_load_file("notes.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("notes.atom"); + if(!$nostag) { + echo "<p class='backlink'><a href='.'>All notes</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 notes</a>"; - } - $year = "-69420"; - $yc = 0; - $yeag = false; - foreach($content->entry as $entry) { - - if($yeag) { - echo "<hr>"; - } else { - $yeag = true; - } - $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 "<h2 id='$year'>$year</h2>"; - } - $dt = substr($entry->published, 0, 10); - $ti = $entry->title; - $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 "<h3 id='$year'>$year</h3>"; + } + $dt = substr($entry->published, 0, 10); + $ti = $entry->title; + $cats = ""; + foreach($entry->category as $cat) { + $term = $cat["term"]; + $cats = $cats."<a class='entrytag' href='?tag=".$term."'>".$term."</a>"; + } + + $entryurl = $entry->link["href"]; + $entryprotocol = preg_replace("/:\/\/(.*)/", "://", $entryurl); + $entrysite = preg_replace(array("/(.*):\/\//", "/\/(.*)/"), "", $entryurl); + + echo("<li><article class='blogentry'><p class='entrydate'><time>$dt</time> • <a href='$entryprotocol$entrysite'>$entrysite</a></p><h4 class='entrytitle'><a href='".$entry->link["href"]."'>$ti</h4></a><div class='entrysummary'>$entry->summary</div><p>$cats</p></article></li>"); } - - echo "<article class='noteentry'><time class='entrydate'>$dt</time><h3 class='entrytitle'><a href='".$entry->link["href"]."'>$ti</h3></a>$entry->summary<span>$cats</span></article>"; } - } - ?> - + echo "</ul>"; + ?> + </main> + + <?php include($_SERVER['DOCUMENT_ROOT'] . '/footer.php');?> </body> </html> |
