garden: port content, rebuild public/, add new scripts and features
- Ported Ludo profile from vault to garden - Added auto-rebuild watcher scripts - Updated static data snapshots - Added garden-features.js and api-garden.json - Added GARDEN-CONTENT-GAPS.md for tracking - Rebuilt Hugo public/ output
This commit is contained in:
parent
8c06ab2836
commit
5703e606d0
222 changed files with 1728 additions and 594 deletions
|
|
@ -112,13 +112,6 @@
|
|||
// ── Fetch & render ────────────────────────────────────────────────
|
||||
|
||||
async function loadGardenFeed() {
|
||||
// Show loading placeholders
|
||||
document.querySelectorAll('[data-garden]').forEach(function (el) {
|
||||
if (!el.hasAttribute('data-garden-loaded')) {
|
||||
el.innerHTML = '<p data-text="dim" class="garden-loading">…</p>';
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
var resp = await fetch(GARDEN_API, {
|
||||
headers: { 'Accept': 'application/json' },
|
||||
|
|
@ -137,8 +130,14 @@
|
|||
});
|
||||
} catch (err) {
|
||||
console.warn('[garden-feed] API unreachable:', err.message);
|
||||
document.querySelectorAll('[data-garden]').forEach(function (el) {
|
||||
if (!el.hasAttribute('data-garden-loaded')) {
|
||||
// Graceful degradation: if the API is down, keep existing static content
|
||||
// rather than replacing it with an error message. Only show unavailable
|
||||
// status on elements that still show the loading placeholder.
|
||||
document.querySelectorAll('[data-garden]:not([data-garden-loaded])').forEach(function (el) {
|
||||
// If the element's children are just a loading placeholder, show error.
|
||||
// Otherwise leave the static Hugo-rendered content in place.
|
||||
var text = (el.textContent || '').trim();
|
||||
if (text === '…' || text === '' || el.children.length === 0) {
|
||||
el.innerHTML = '<p data-text="dim">Garden feed unavailable.</p>';
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue