aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFran├žois Kooman <fkooman@tuxed.net>2019-08-08 15:15:49 +0200
committerFran├žois Kooman <fkooman@tuxed.net>2019-08-08 15:15:49 +0200
commit7bd25b7cc4a539b21d6aeef13a53e4aa9d401020 (patch)
treef57b49415b4ec29c23295bdce79db66a624a281a
parent14245d93c47381e9f425cc42094ee20257fe90f9 (diff)
downloadwww.tuxed.net-7bd25b7cc4a539b21d6aeef13a53e4aa9d401020.zip
www.tuxed.net-7bd25b7cc4a539b21d6aeef13a53e4aa9d401020.tar.gz
www.tuxed.net-7bd25b7cc4a539b21d6aeef13a53e4aa9d401020.tar.xz
link to post history in git instead of manually writing post updates
-rw-r--r--bin/generate.php2
-rw-r--r--views/post.php13
2 files changed, 9 insertions, 6 deletions
diff --git a/bin/generate.php b/bin/generate.php
index a8787f8..066d455 100644
--- a/bin/generate.php
+++ b/bin/generate.php
@@ -8,6 +8,7 @@ use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use League\CommonMark\Ext\SmartPunct\SmartPunctExtension;
+$cgitRepoWebUrl = 'https://git.tuxed.net/fkooman/www.tuxed.net/';
$dateTime = new DateTime();
$postDir = sprintf('%s/posts', $baseDir);
$pageDir = sprintf('%s/pages', $baseDir);
@@ -104,6 +105,7 @@ foreach (glob(sprintf('%s/*.md', $postDir)) as $postFile) {
'title' => $postInfo['title'],
'modified' => isset($postInfo['modified']) ? $postInfo['modified'] : null,
'fileName' => $postOutputFile,
+ 'postHistory' => $cgitRepoWebUrl.'log/'.basename($postDir).'/'.basename($postFile),
];
$postsList[] = $blogPost;
diff --git a/views/post.php b/views/post.php
index 0c554cd..9471d37 100644
--- a/views/post.php
+++ b/views/post.php
@@ -1,14 +1,15 @@
<?php $this->layout('base'); ?>
<?php $this->start('content'); ?>
<h2><?php echo $this->e($pageTitle); ?></h2>
- <?php echo $post['htmlContent']; ?>
-
- <p class="center">
+ <p>
<small>
Published on <?php echo $this->e($post['published']); ?>
-<?php if ($post['modified']): ?>
- (Updated on <?php echo $this->e($post['modified']); ?>)
-<?php endif; ?>
</small>
</p>
+ <?php echo $post['htmlContent']; ?>
+
+<?php if ($post['modified']): ?>
+ <p class="center"><small>Last Modified on <?php echo $this->e($post['modified']); ?></small></p>
+<?php endif; ?>
+ <p class="center"><small><a href="<?php echo $this->e($post['postHistory']); ?>">History</a></small></p>
<?php $this->stop(); ?>