Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| public:computers:pureblog [02/03/26 08:51 GMT] – [Addons] john | public:computers:pureblog [03/03/26 07:32 GMT] (current) – [Installation & Configuration] john | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| - | ====== | + | ====== |
| - | ** Description | + | ** I've installed Pure Blog ** |
| - | ===== Section One ===== | + | 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:// | ||
| + | |||
| + | Webfonts 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 ===== | ===== Addons ===== | ||
| - | <file archive.php> | + | 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. | ||
| + | |||
| + | |||
| + | < | ||
| + | <?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; ?> | ||
| + | |||
| + | </ | ||
| + | |||
| + | <?php endif; ?> | ||
| + | |||
| + | </ | ||
| + | |||
| + | <?php render_footer_layout($config, | ||
| + | |||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | <file php archive.php> | ||
| <?php | <?php | ||
| declare(strict_types=1); | declare(strict_types=1); | ||
| Line 65: | Line 338: | ||
| </ | </ | ||
| - | </code> | + | </file> |
| Line 72: | Line 345: | ||
| - | {{tag>}} | + | {{tag>pure blog}} |
| Page created | Page created | ||