Browse Source

page archive

windhamdavid 6 years ago
parent
commit
90d1fa2a09
4 changed files with 76 additions and 15 deletions
  1. 22 0
      inc/utils.php
  2. 44 0
      page-archive.php
  3. 3 3
      page-desk.php
  4. 7 12
      page-sitemap.php

+ 22 - 0
inc/utils.php

@@ -83,4 +83,26 @@ function pull_til() {
 		if (++$i == 13) break;	
 	}	
 }
+function pull_til_all() {
+	include('lib/dom.php');
+
+	$url = 'https://davidawindham.com/til/til.html'; 
+	$html = file_get_html($url);
+	$i = 0;
+	foreach ($html->find('.markdown-section ul li ul li') as $li) {
+	    echo $li;
+	}	
+}
+function bookmarks_all() {
+	require_once('lib/dom.php');
+
+	$url = 'https://davidawindham.com/bookmarks/'; 
+	$html = file_get_html($url);
+	$i = 0;
+	foreach ($html->find('.linklist-item-title a') as $li) {
+	    if (!empty($html)) {
+			echo $li . '<br />';
+		}
+	}	
+}
 

+ 44 - 0
page-archive.php

@@ -0,0 +1,44 @@
+<?php
+/*
+Template Name: Posts
+*/
+
+get_header(); ?>
+
+	<div class="container">
+		<article id="content" class="single" role="main">
+			<div class="entry-content">
+				<header class="page-header">
+					<h1 class="cm-sans">Archive</h1>
+					<p>This is a list of every posts, til (today I learned), and bookmark I've published on this website. There a many other pages published on subdomains and elsewhere on this website. For a list of everything published on the website, please see the <a href="<?php echo site_url(); ?>/sitemap">sitemap</a>.</p>
+				</header>
+				<div class="row">
+					<div class="col-md-6">
+						<h5>Posts</h5>
+						<ul>
+							<?php $recentposts = get_posts(array( 'numberposts' => -1, 'offset' => 0 ) ); foreach ($recentposts as $post) : setup_postdata($post); ?>
+							       <li style="color:#777"><?php echo get_the_date('m/d/y'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
+							<?php endforeach; ?>
+						</ul>
+					</div>
+					<div class="col-md-6">
+
+						<h5>Today I Learned</h5>
+						<ul>
+							<?php pull_til_all(); ?>
+						</ul>	
+
+
+						<h5>Bookmarks</h5>
+						<ul>
+							<?php bookmarks_all(); ?>
+						</ul>	
+
+					</div>
+				</div>
+				
+			</div>
+		</article>
+	</div>
+	
+<?php get_footer('home'); ?>

+ 3 - 3
page-desk.php

@@ -22,10 +22,10 @@ get_header(); ?>
 			<div class="col-sm-4 studio-tools">
 				<ul>
 					<li>Recent Posts</li>
-					<?php $recentposts = get_posts('numberposts=49'); foreach ($recentposts as $post) : setup_postdata($post); ?>
+					<?php $recentposts = get_posts('numberposts=50'); foreach ($recentposts as $post) : setup_postdata($post); ?>
 					       <li style="color:#777"><?php echo get_the_date('m/d/y'); ?> - <a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
 					<?php endforeach; ?>
-					<li class="pull-right"><a href="https://davidawindham.com/til/til.html">All Posts -></a></li>
+					<li class="pull-right"><a href="<?php echo site_url(); ?>/archive/"><b>All Posts -></b></a></li>
 				</ul>
 			</div>	
 			<div class="col-sm-3">
@@ -61,7 +61,7 @@ get_header(); ?>
 						<h5>Today I Learned</h5>
 						<ul>
 							<?php pull_til(); ?>
-							<li class="pull-right"><a href="https://davidawindham.com/til/til.html">All TIL -></a></li>
+							<li class="pull-right"><a href="https://davidawindham.com/til/til.html"><b>All TIL -></b></a></li>
 						</ul>	
 					</div>
 				</div>

+ 7 - 12
page-sitemap.php

@@ -87,17 +87,12 @@ get_header(); ?>
 							<ul>
 								<li><span class="fa fa-server fa-fw"></span> Sub Domains
 									<ul>
-										<li><a href="http://photo.davidawindham.com" title="Photo" ><span class="fa fa-camera-retro fa-fw"></span> Photo</a></li>
-										<br />
-										<li><a href="http://code.davidawindham.com" title="Code" ><span class="fa fa-code fa-fw"></span> Code</a></li>
-										<br />
-										<li><a href="http://show.davidawindham.com" title="Show" ><span class="fa fa-area-chart fa-fw"></span> Show</a></li>
-										<br />
-										<li><a href="http://radio.davidawindham.com" title="Radio" ><span class="fa fa-microphone fa-fw"></span> Radio</a></li>
-										<br />
-										<li><a href="http://chess.davidawindham.com" title="Chess" ><span class="fa fa-gamepad fa-fw"></span> Chess</a></li>
-										<br />
-										<li><a href="http://chat.davidawindham.com" title="Chat" ><span class="fa fa-comments fa-fw"></span> Chat</a></li>
+										<a href="http://photo.davidawindham.com" title="Photo" ><span class="fa fa-camera-retro fa-fw"></span> Photo</a>
+										&nbsp; | <a href="http://code.davidawindham.com" title="Code" ><span class="fa fa-code fa-fw"></span> Code</a>
+										&nbsp; | <a href="http://show.davidawindham.com" title="Show" ><span class="fa fa-area-chart fa-fw"></span> Show</a>
+										&nbsp; | <a href="http://radio.davidawindham.com" title="Radio" ><span class="fa fa-microphone fa-fw"></span> Radio</a>
+										&nbsp; | <a href="http://chess.davidawindham.com" title="Chess" ><span class="fa fa-gamepad fa-fw"></span> Chess</a>
+										&nbsp; | <a href="http://chat.davidawindham.com" title="Chat" ><span class="fa fa-comments fa-fw"></span> Chat</a>
 									</ul>
 								</li>
 							</ul>
@@ -107,7 +102,7 @@ get_header(); ?>
 									<ul>
 										<a target="_blank" href="http://gzet.net" title="GZET" ><span class="fa fa-globe fa-fw"></span> gzet.net</a>
 										&nbsp; | <a target="_blank" href="http://juryd.com" title="Juryd" ><span class="fa fa-globe fa-fw"></span> juryd.com</a>
-										&nbsp; | <a target="_blank" href="http://helloginny.com" title="Hello Ginny" ><span class="fa fa-globe fa-fw"></span> helloginny.com</a>
+										&nbsp; | <a target="_blank" href="https://peoplespants.com" title="Ginny Gast" ><span class="fa fa-globe fa-fw"></span> peoplespants.com</a>
 									</ul>
 								</li>
 								<hr>