feat: remove previous/next article navigation for cleaner layout; simplify metadata display
This commit is contained in:
1 parent
72a45c1b7f
commit
0efbb4b2b5
3 files changed
+12
-94
No files matched your search
@@ -1974,56 +1974,6 @@ button:focus:not(:focus-visible) {
|
||||
/* Separate the comments widget from the share row so it doesn't feel cramped. */
|
||||
.utterances { margin-top: var(--space-xl) !important; }
|
||||
|
||||
/* ========================================
|
||||
PREV / NEXT ARTICLE NAV
|
||||
======================================== */
|
||||
.post-nav {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: var(--space-sm);
|
||||
margin: var(--space-lg) 0;
|
||||
}
|
||||
|
||||
.post-nav-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
min-width: 0;
|
||||
padding: var(--space-sm) var(--space-md);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--bg-surface);
|
||||
color: var(--text-primary);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.post-nav-link:hover {
|
||||
border-color: var(--accent);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: var(--shadow-md);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.post-nav-next { justify-content: flex-end; text-align: right; }
|
||||
|
||||
.post-nav-text { display: flex; flex-direction: column; min-width: 0; }
|
||||
|
||||
.post-nav-meta {
|
||||
font-size: var(--font-size-xs);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.post-nav-title {
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.post-nav .bd-icon { flex: 0 0 auto; color: var(--text-muted); margin: 0; }
|
||||
|
||||
/* ========================================
|
||||
RELATED POSTS
|
||||
======================================== */
|
||||
@@ -2241,7 +2191,6 @@ button:focus:not(:focus-visible) {
|
||||
RESPONSIVE
|
||||
======================================== */
|
||||
@media (max-width: 767.98px) {
|
||||
.post-nav { grid-template-columns: 1fr; }
|
||||
h1.title { font-size: 1.9rem; }
|
||||
h2.title { font-size: 1.5rem; }
|
||||
|
||||
|
||||
+7
-2
@@ -702,8 +702,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
var pres = document.querySelectorAll('.content pre, .tab-panel pre');
|
||||
Array.prototype.forEach.call(pres, enhance);
|
||||
// Regular code blocks only — the tabbed component (.tab-group) has its
|
||||
// own frame, so adding a header inside each panel would double-frame it.
|
||||
var pres = document.querySelectorAll('.content pre');
|
||||
Array.prototype.forEach.call(pres, function (pre) {
|
||||
if (pre.closest && pre.closest('.tab-group')) return;
|
||||
enhance(pre);
|
||||
});
|
||||
})();
|
||||
|
||||
/* --------------------------------------------------------
|
||||
|
||||
+5
-41
@@ -47,23 +47,10 @@
|
||||
<h1 class="title"><?php echo blowdit_text($page->title()); ?></h1>
|
||||
|
||||
<?php if (!$page->isStatic() && !$url->notFound()): ?>
|
||||
<!-- Creation date, reading time and (if edited) updated date -->
|
||||
<?php
|
||||
$bdPubRaw = $page->getValue('date');
|
||||
$bdModRaw = $page->getValue('dateModified');
|
||||
$bdUpdated = '';
|
||||
if ($bdModRaw && class_exists('Date')
|
||||
&& substr($bdModRaw, 0, 10) !== substr($bdPubRaw, 0, 10)
|
||||
&& $bdModRaw > $bdPubRaw) {
|
||||
$bdUpdated = Date::format($bdModRaw, DB_DATE_FORMAT, 'M j, Y');
|
||||
}
|
||||
?>
|
||||
<!-- Creation date and reading time -->
|
||||
<div class="metadata mb-4">
|
||||
<span><?php echo blowdit_icon('calendar'); ?><?php echo $page->date(); ?></span>
|
||||
<span><?php echo blowdit_icon('clock'); ?><?php echo $L->get('Reading time') . ': ' . $page->readingTime() ?></span>
|
||||
<?php if ($bdUpdated): ?>
|
||||
<span><?php echo blowdit_icon('calendar'); ?><?php echo $L->get('Updated') . ': ' . htmlspecialchars($bdUpdated, ENT_QUOTES, 'UTF-8'); ?></span>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
@@ -116,23 +103,17 @@
|
||||
</article>
|
||||
|
||||
<?php
|
||||
// ---- Prev/next + related posts ----
|
||||
// ---- Related posts ----
|
||||
// Best-effort via Bludit's Pages API; wrapped so any API difference degrades
|
||||
// to nothing instead of erroring the page.
|
||||
if (!$page->isStatic() && !$url->notFound()) {
|
||||
$bdOlder = null; $bdNewer = null; $bdRelated = array();
|
||||
$bdRelated = array();
|
||||
try {
|
||||
global $pages;
|
||||
if (isset($pages) && method_exists($pages, 'getList')) {
|
||||
$bdKeys = $pages->getList(1, 10000, true); // published, newest-first
|
||||
$bdKeys = $pages->getList(1, 10000, true); // published
|
||||
if (is_array($bdKeys)) {
|
||||
$bdKeys = array_values($bdKeys);
|
||||
$bdCur = $page->key();
|
||||
$bdI = array_search($bdCur, $bdKeys, true);
|
||||
if ($bdI !== false) {
|
||||
if (isset($bdKeys[$bdI + 1])) { $bdOlder = new Page($bdKeys[$bdI + 1]); }
|
||||
if ($bdI > 0 && isset($bdKeys[$bdI - 1])) { $bdNewer = new Page($bdKeys[$bdI - 1]); }
|
||||
}
|
||||
$bdCat = $page->categoryKey();
|
||||
$bdTags = array_keys($page->tags(true));
|
||||
foreach ($bdKeys as $bdK) {
|
||||
@@ -148,27 +129,10 @@
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$bdOlder = null; $bdNewer = null; $bdRelated = array();
|
||||
$bdRelated = array();
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($bdOlder || $bdNewer) : ?>
|
||||
<nav class="post-nav" aria-label="<?php echo $L->get('Pagination'); ?>">
|
||||
<?php if ($bdOlder) : ?>
|
||||
<a class="post-nav-link post-nav-prev" href="<?php echo $bdOlder->permalink(); ?>">
|
||||
<?php echo blowdit_icon('chevron-left'); ?>
|
||||
<span class="post-nav-text"><span class="post-nav-meta"><?php echo $L->get('Previous'); ?></span><span class="post-nav-title"><?php echo blowdit_text($bdOlder->title()); ?></span></span>
|
||||
</a>
|
||||
<?php else : ?><span></span><?php endif ?>
|
||||
<?php if ($bdNewer) : ?>
|
||||
<a class="post-nav-link post-nav-next" href="<?php echo $bdNewer->permalink(); ?>">
|
||||
<span class="post-nav-text"><span class="post-nav-meta"><?php echo $L->get('Next'); ?></span><span class="post-nav-title"><?php echo blowdit_text($bdNewer->title()); ?></span></span>
|
||||
<?php echo blowdit_icon('chevron-right'); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
</nav>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!empty($bdRelated)) : ?>
|
||||
<section class="related-posts">
|
||||
<h2 class="related-posts-title"><?php echo $L->get('Related posts'); ?></h2>
|
||||
|
||||
Reference in new issue
Block a user