Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| public:computers:pureblog [03/03/26 07:24 GMT] – [Installation & Configuration] john | public:computers:pureblog [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | < | ||
| - | |||
| - | |||
| - | ====== Pure Blog ====== | ||
| - | |||
| - | ** I've installed Pure Blog ** | ||
| - | |||
| - | After trying the Blog Plugin in dokuwiki and Chyrp-Lite PHP/SQLite blogging platform I switched to Pure Blog. | ||
| - | |||
| - | It's just what I need, and nothing extra to make it big and bloated. | ||
| - | |||
| - | |||
| - | ===== Installation & Configuration ===== | ||
| - | |||
| - | FIXME | ||
| - | |||
| - | See [[https:// | ||
| - | |||
| - | Fonts used | ||
| - | |||
| - | * {{ : | ||
| - | * {{ : | ||
| - | |||
| - | |||
| - | ==== CSS ==== | ||
| - | |||
| - | <code css> | ||
| - | .tag-cloud a { | ||
| - | margin: 0 0.5rem; | ||
| - | | ||
| - | |||
| - | } | ||
| - | |||
| - | .archive li { | ||
| - | line-height: | ||
| - | font-size: 1.1rem; | ||
| - | list-style-type: | ||
| - | } | ||
| - | |||
| - | body { | ||
| - | font-size: 1rem; | ||
| - | line-height: | ||
| - | } | ||
| - | |||
| - | main { | ||
| - | max-width: 50rem; | ||
| - | } | ||
| - | |||
| - | article { | ||
| - | margin-bottom: | ||
| - | } | ||
| - | |||
| - | p.post-archive-view { | ||
| - | font-size : 1.1rem; | ||
| - | line-height: | ||
| - | } | ||
| - | main h1 { | ||
| - | font-size: 2.8rem; | ||
| - | } | ||
| - | |||
| - | header, footer{ | ||
| - | font-family: | ||
| - | font-size: 1.1rem; | ||
| - | } | ||
| - | |||
| - | footer { | ||
| - | margin-top: 3rem; | ||
| - | } | ||
| - | |||
| - | main h1, main h2, main h3, main h4, main h5, main h6 { | ||
| - | margin-left: | ||
| - | font-family: | ||
| - | } | ||
| - | |||
| - | .tag-list { | ||
| - | border-top: 1px solid var(--border-color); | ||
| - | padding-top: | ||
| - | } | ||
| - | |||
| - | .post-nav { | ||
| - | margin-top : 0; | ||
| - | margin-bottom: | ||
| - | } | ||
| - | @font-face { | ||
| - | font-family: | ||
| - | src: url('/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | @font-face { | ||
| - | font-family: | ||
| - | src: url('/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | @font-face { | ||
| - | font-family: | ||
| - | src: url('/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | @font-face { | ||
| - | font-family: | ||
| - | src: url('/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | @font-face { | ||
| - | font-family: | ||
| - | src: url('/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | @font-face { | ||
| - | font-family: | ||
| - | src: url('/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | @font-face { | ||
| - | font-family: | ||
| - | src: url('/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | @font-face { | ||
| - | font-family: | ||
| - | src: url('/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | } | ||
| - | |||
| - | :root { | ||
| - | --font-stack: | ||
| - | } | ||
| - | |||
| - | pre { | ||
| - | font-family: | ||
| - | } | ||
| - | |||
| - | code { | ||
| - | font-family: | ||
| - | } | ||
| - | |||
| - | </ | ||
| - | ===== Addons ===== | ||
| - | |||
| - | Kev sent me 2 PHP scripts to provide a Tag-Cloud and a full site Archive page. | ||
| - | |||
| - | I tweaked them a bit, and here are my current versions. | ||
| - | |||
| - | |||
| - | <file php tag-cloud.php> | ||
| - | <?php | ||
| - | |||
| - | |||
| - | |||
| - | declare(strict_types=1); | ||
| - | |||
| - | |||
| - | |||
| - | $pageTitle = 'Tag Cloud'; | ||
| - | |||
| - | $metaDescription = 'All tags, sized by how often they appear.'; | ||
| - | |||
| - | |||
| - | |||
| - | $tagIndex = load_tag_index(); | ||
| - | |||
| - | $tagCounts = []; | ||
| - | |||
| - | if ($tagIndex) { | ||
| - | |||
| - | foreach ($tagIndex as $slug => $slugs) { | ||
| - | |||
| - | $tagCounts[$slug] = count($slugs); | ||
| - | |||
| - | } | ||
| - | |||
| - | } | ||
| - | |||
| - | |||
| - | |||
| - | // Collect original display names from posts (slugs alone lose capitalisation/ | ||
| - | |||
| - | $originalNames = []; | ||
| - | |||
| - | foreach (get_all_posts(false) as $post) { | ||
| - | |||
| - | foreach (($post[' | ||
| - | |||
| - | $slug = normalize_tag($tag); | ||
| - | |||
| - | if (!isset($originalNames[$slug])) { | ||
| - | |||
| - | $originalNames[$slug] = $tag; | ||
| - | |||
| - | } | ||
| - | |||
| - | } | ||
| - | |||
| - | } | ||
| - | |||
| - | |||
| - | |||
| - | // Sort alphabetically by display name | ||
| - | |||
| - | uksort($tagCounts, | ||
| - | |||
| - | return strcasecmp($originalNames[$a] ?? $a, $originalNames[$b] ?? $b); | ||
| - | |||
| - | }); | ||
| - | |||
| - | |||
| - | |||
| - | $maxCount = $tagCounts ? max($tagCounts) : 1; | ||
| - | |||
| - | $minCount = $tagCounts ? min($tagCounts) : 1; | ||
| - | |||
| - | $range | ||
| - | |||
| - | |||
| - | |||
| - | require PUREBLOG_BASE_PATH . '/ | ||
| - | |||
| - | render_masthead_layout($config, | ||
| - | |||
| - | ?> | ||
| - | |||
| - | < | ||
| - | |||
| - | < | ||
| - | |||
| - | |||
| - | |||
| - | <?php if (empty($tagCounts)): | ||
| - | |||
| - | <p>No tags found.</ | ||
| - | |||
| - | <?php else: ?> | ||
| - | |||
| - | <p class=" | ||
| - | |||
| - | <?php foreach ($tagCounts as $slug => $count): | ||
| - | |||
| - | $name = $originalNames[$slug] ?? $slug; | ||
| - | |||
| - | $ratio | ||
| - | |||
| - | $fontSize = round(0.85 + $ratio * 1.4, 2); | ||
| - | |||
| - | $postWord = $count === 1 ? ' | ||
| - | |||
| - | echo '<a href="/ | ||
| - | |||
| - | . ' style=" | ||
| - | |||
| - | . ' title="' | ||
| - | |||
| - | . e($name) . ' | ||
| - | |||
| - | endforeach; ?> | ||
| - | |||
| - | </p> | ||
| - | |||
| - | <?php endif; ?> | ||
| - | |||
| - | </ | ||
| - | |||
| - | <?php render_footer_layout($config, | ||
| - | |||
| - | </ | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | </ | ||
| - | |||
| - | <file php archive.php> | ||
| - | <?php | ||
| - | declare(strict_types=1); | ||
| - | |||
| - | $allPosts = get_all_posts(false); | ||
| - | $postsByYear = []; | ||
| - | |||
| - | foreach ($allPosts as $entry) { | ||
| - | $year = !empty($entry[' | ||
| - | $postsByYear[$year][] = $entry; | ||
| - | } | ||
| - | |||
| - | krsort($postsByYear, | ||
| - | |||
| - | $pageTitle = ' | ||
| - | $metaDescription = ' | ||
| - | ?> | ||
| - | <?php require PUREBLOG_BASE_PATH . '/ | ||
| - | <?php render_masthead_layout($config); | ||
| - | <main class=archive> | ||
| - | < | ||
| - | < | ||
| - | < | ||
| - | |||
| - | <?php if (!$allPosts): | ||
| - | <p>No published posts yet.</ | ||
| - | <?php else: ?> | ||
| - | <?php foreach ($postsByYear as $year => $yearPosts): | ||
| - | < | ||
| - | <ul> | ||
| - | <?php foreach ($yearPosts as $postItem): ?> | ||
| - | <li> | ||
| - | <?php if (!empty($postItem[' | ||
| - | < | ||
| - | <time datetime="<? | ||
| - | <?= e(date(' | ||
| - | </ | ||
| - | < | ||
| - | & | ||
| - | <?php endif; ?> | ||
| - | <a href="/<? | ||
| - | <?= e((string) ($postItem[' | ||
| - | </a> | ||
| - | </li> | ||
| - | <?php endforeach; ?> | ||
| - | </ul> | ||
| - | <?php endforeach; ?> | ||
| - | <?php endif; ?> | ||
| - | </ | ||
| - | </ | ||
| - | <?php render_footer_layout($config); | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | ===== Further Information ===== | ||
| - | |||
| - | |||
| - | {{tag> | ||
| - | |||
| - | Page created | ||
| - | |||
| - | Page updated : ~~LASTMOD~~ | ||