random navigation

Signpost11 Signposts
Sapling5 Saplings
Chest5 Chests
Seedling4 Seedlings
Tree2 Trees
Withered1 Withered
Stone1 Stone

"Random note" implementation guide

This guide provides step-by-step instructions for implementing a random note navigation feature in the digital garden.

Overview

The random feature allows users to navigate to a randomly selected note via a floating button and a dedicated /random route.

These changes need to be made to your digital garden repository, not your Obsidian vault.

Instructions

Step 1: Create the Random Route Layout

Step 2: Create the Random Route File

Step 3: Add the Floating Random Button Styles

Step 4: Create the Random Button Component

Step 5: Add Random Button in Your Layouts

Features Implemented

How It Works

  1. Button Click: User clicks the floating random button
  2. Navigation: JavaScript redirects to /random route
  3. Collection Processing: Eleventy template processes all notes in collections.note
  4. Filtering: Only notes with dg-publish: true are included
  5. Random Selection: JavaScript picks a random note from the filtered list
  6. Redirect: User is automatically redirected to the selected note
  7. Fallback: If no published notes exist, user is redirected to home page

File Locations

Notes

Patch