Skip to content

Random page#323

Merged
oleeskild merged 7 commits intooleeskild:mainfrom
palol:random-page
Mar 21, 2026
Merged

Random page#323
oleeskild merged 7 commits intooleeskild:mainfrom
palol:random-page

Conversation

@palol
Copy link
Copy Markdown
Contributor

@palol palol commented Jun 22, 2025

Random navigation

For "serendipity" ~ randomly skipping through a garden is really fun. An easy way to do that is to route /random to re-direct the website to another valid page on the website (even hidden).

Notes

  • The random selection respects the dg-publish frontmatter setting
  • Includes proper error handling and fallback behavior
  • Uses Eleventy's collections.note to dynamically generate the list of available notes
  • Additional details posted here: https://www.paologabriel.com/swamp/random-navigation/
  • Also includes details on adding a "button"
  • Example of hidden interaction ~ I hid a picture of my cats on the same website above. can you find it?
  • Could be a toggle in the plug-in, but that's beyond my skill set; also conflicts with a published page named "random"

@oleeskild
Copy link
Copy Markdown
Owner

Perfect! The one thing I'm a bit concerned about here is that it will cause an error if people have a note named random. Perhaps it could have a link that has characters that are invalid for an obsidian note. Or something else to make sure it doesn't break peoples sites just because they have a note called random, which I assume i common.

Do you have any good ideas on how to solve this?

@palol
Copy link
Copy Markdown
Contributor Author

palol commented Mar 9, 2026

Perfect! The one thing I'm a bit concerned about here is that it will cause an error if people have a note named random. Perhaps it could have a link that has characters that are invalid for an obsidian note. Or something else to make sure it doesn't break peoples sites just because they have a note called random, which I assume i common.

Do you have any good ideas on how to solve this?

Simplest solution might be to make the route /~random/. I think the special character "_" also works.

Comment thread src/site/_includes/layouts/random.njk Outdated
@oleeskild oleeskild merged commit 8f4035f into oleeskild:main Mar 21, 2026
@oleeskild
Copy link
Copy Markdown
Owner

Looks good to me! Merging it in. Thanks 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants