Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for permalink #278

Open
ctmbl opened this issue Jan 17, 2025 · 3 comments
Open

Add support for permalink #278

ctmbl opened this issue Jan 17, 2025 · 3 comments
Labels
suggestion An enhancement that may be considered in the future

Comments

@ctmbl
Copy link

ctmbl commented Jan 17, 2025

Create an endpoint in the backend for each note (for example /note/<UUID>) as alias of the natural endpoint /note/<note title>, but that doesn't change when the note is renamed.
It would automatically redirects to the natural URL and would be removed when the note is deleted.

@dullage dullage added the triage required Requires input from a maintainer label Jan 17, 2025
@dullage
Copy link
Owner

dullage commented Jan 17, 2025

The trouble with this is that it would require a way to store the mapping, which would need to be maintained whenever a file is renamed.

Currently, flatnotes is essentially stateless (apart from the note files) and it allows notes to be edited/deleted/renamed outside of flatnotes. Both are approaches I'd like to keep.

@dullage dullage removed the triage required Requires input from a maintainer label Jan 19, 2025
@dullage dullage closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2025
@ctmbl
Copy link
Author

ctmbl commented Jan 20, 2025

@dullage
Thanks for the quick answer!
I totally get your point, and agree with you that flatnotes being stateless is one of its strength.

However, if you're interested in the feature (now or in the future), you could store this information inside the notes themselves (keeping flatnotes database-less), as you already do with tags.
The HUGO framework (maybe you're already familiar with) do this with a front matter, a yml/toml/json section at the beginning of the .md file. You'll find an example here.
But this is of course just an example on how to achieve this!

I say this as a suggestion of course, so feel free to let this issue closed if not that much interested in the feature 🙂

@dullage dullage added the suggestion An enhancement that may be considered in the future label Jan 20, 2025
@dullage
Copy link
Owner

dullage commented Jan 20, 2025

For the front matter concept to work, I couldn't open each file to find the one being requested, so I'd need to keep a log of which files contained which UUIDs. At this point, unfortunately, we're back to needing a database. Now, I could keep track of this in the search index, but then essentially I'd be using the index as a database (something I already do to some degree, but it feels like a slippery slope to fall down).

I'm happy to leave this open as a suggestion to record interest, but I don't think it's something likely to be tackled in the short-term.

@dullage dullage reopened this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion An enhancement that may be considered in the future
Projects
None yet
Development

No branches or pull requests

2 participants