I am currently working on a simple PHP script for static comments for a planned Hugo installation, that basically works as follows:
- Submit the post’s RelPermalink as the
post_id. - Write the comment into a YAML file under
Permalink/comments/. - Run Hugo.
- The rendered page in
/publiccontains the new comment.
Simple (and already working), in theory. In practice, RelPermalink is not necessarily the same thing as the actual permalink. I basically need an easy(ish) way to HTTP POST a post’s source’s path back.
Example: posts with a new title, posts which will be published a month later, … all of those have a RelPermalink that’s not identical with the source folder, so my script will fail. What I would need is a way to have OrigPermalink or something in my partial template, so a post stored under content/posts/2024/10/foo/index.md can have a template variable that contains [posts/]2024/10/foo or something, regardless of what title or date is set in the front matter.
Any ideas?