hugo-PaperMod
hugo-PaperMod copied to clipboard
Add a "Off The Record" / Hidden post mode
What does this PR change? What problem does it solve?
I sometime want to share a post with selected readers only, for review or private discussion.
This branch adds a Front Matter variable offTheRecord, which allows you to publish a post and share the URL while hiding this post from:
- the post list on the homepage
- the archive page
- the search results
- the RSS feeds
- the Sitemap
The search engine indexation is also set to noindex, nofollow for these posts.
What's left to do?
- hide the post from the
/tags/pages (#wontfix: I do not use tags in OTR posts) - hide posts from section pages (details: consider a page http://localhost:1313/blogg/markdown/ - the page is successfully hidden from home but is listed at http://localhost:1313/blogg/)
- check schema_json
- update the documentation
- write a disclaimer:
Do not rely on this for strong confidentiality The post can be found in your Git repo, if it's public and the URL can be guessed if too obvious [...] The way you share the link matters. See "Gmail is opening and caching URLs within emails without user intervention" for example [...]
This branch is published early, unpolished, for the interested. I will probably have no time to work on it in the near future, feel free to build upon / close this PR
Was the change discussed in an issue or in the Discussions before?
Not on this tracker, but this is an implementation of an idea by Zachary Wade Betz, reviewed and discussed on discourse.gohugo.io.
PR Checklist
- [x] I have enabled maintainer edits for this PR.
- [x] I have verified that the code works as described/as intended.
- [x] This change does not include any CDN resources/links.
- [x] This change does not include any unrelated scripts such as bash and python scripts.
- [ ] This change updates the overridden internal templates from HUGO's repository.
Updated
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
Update: the hidden posts are now properly excluded from the Sitemap
Note: this branch is temporarily broken - Update: fixed
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
The branch was rewritten to include the last changes published upstream
I finally published a post about this feature integration in Papermod: https://roneo.org/en/hugo-hidden-posts/
@RoneoOrg The page is still listed in
- tags and term pages
Hi and thanks for the review!
The tag stuff is a known issue and I won't work on it in the near future.
Quoting myself:
What's left to do?
- hide the post from the /tags/ pages (#wontfix: I do not use tags in OTR posts)
The only change I may contribute is to rename the feature from OffTheRecord (too pedantic IMHO) to something like private
The page is still listed in
- section pages
Nice catch! I'm adding this issue to the list in the first post^^
In an ideal scenario, only single.html should generate the page and everywhere else it should be bypassed
We won't merge it until it works everywhere. Because you don't use tags you'll not be fixing it 🤷♂️.
We won't go ahead with this one then until someone else makes a PR who wishes to make it work everywhere.
We won't merge it until it works everywhere
Sure! I'll ping the devs that showed interest in this feature
I'll ping the devs that showed interest in this feature
That's a shame: I can't retrieve the usernames of the people who thumbed up this PR. I wanted to invite them to contribute to these last fixes, but I can't apparently ping them.
I'll ping the devs that showed interest in this feature
That's a shame: I can't retrieve the usernames of the people who thumbed up this PR. I wanted to invite them to contribute to these last fixes, but I can't apparently ping them.
Try this

Try this
Yes that's what I did, but Github autocompletion did not find any match, I guess these visible account names do not correspond to the usernames I could ping with @yashasomething for example
Try this
Yes that's what I did, but Github autocompletion did not find any match, I guess these visible account names do not correspond to the usernames I could ping with
@yashasomethingfor example
Okay @RoneoOrg
@yashasolutions, @philipgriffin, @Th3Shadowbroker, and @gtreshchev Please help us with this PR if anyone is available
sorry didn't see the notification earlier, is there anything that need to be done?
Hi there,
here is a recap of the stuff to be done:
- [ ] 1. Hide posts from section pages (see these details)
- [ ] 2. Hide post from the /tags/ pages
- [ ] 3. Hide posts from series pages
- [ ] 4. Check if the posts appear in
schema.json - [ ] 5. Determine an appropriate name for this feature
(candidates:offTheRecord/privatePost/privatePage/ or simplyprivate?) - [ ] 6. Write a disclaimer (see this suggestion)
- [ ] 7. Update the documentation
/cc @yashasolutions
Now every external link is opened is a new tab with rel=noreferrer, to hide the Referer header and leak no referrer information
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
Todo:
- [ ] Check if hidden posts are correctly hidden from navigation (Previous / Next buttons at the bottom of posts)
- [ ] Check the compatibilty with this PR #1049
