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 a "Off The Record" / Hidden post mode #712

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

RoneoOrg
Copy link

@RoneoOrg RoneoOrg commented Jan 5, 2022

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

  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended.
  • This change does not include any CDN resources/links.
  • 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.

@RoneoOrg
Copy link
Author

RoneoOrg commented Jan 5, 2022

Updated

@sonarcloud
Copy link

sonarcloud bot commented Jan 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@RoneoOrg
Copy link
Author

Update: the hidden posts are now properly excluded from the Sitemap

@RoneoOrg
Copy link
Author

RoneoOrg commented Mar 31, 2022

Note: this branch is temporarily broken - Update: fixed

@sonarcloud
Copy link

sonarcloud bot commented Mar 31, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@RoneoOrg
Copy link
Author

The branch was rewritten to include the last changes published upstream

@RoneoOrg
Copy link
Author

RoneoOrg commented Apr 1, 2022

I finally published a post about this feature integration in Papermod: https://roneo.org/en/hugo-hidden-posts/

@martin2250 martin2250 mentioned this pull request Apr 30, 2022
7 tasks
Copy link
Owner

@adityatelange adityatelange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RoneoOrg The page is still listed in

@RoneoOrg
Copy link
Author

RoneoOrg commented Jun 2, 2022

@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^^

@adityatelange
Copy link
Owner

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.

@RoneoOrg
Copy link
Author

RoneoOrg commented Jun 2, 2022

We won't merge it until it works everywhere

Sure! I'll ping the devs that showed interest in this feature

@RoneoOrg
Copy link
Author

RoneoOrg commented Jun 2, 2022

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.

@adityatelange
Copy link
Owner

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
image

@RoneoOrg
Copy link
Author

RoneoOrg commented Jun 3, 2022

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

@adityatelange
Copy link
Owner

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

Okay @RoneoOrg


@yashasolutions, @philipgriffin, @Th3Shadowbroker, and @gtreshchev Please help us with this PR if anyone is available

@yashasolutions
Copy link

sorry didn't see the notification earlier, is there anything that need to be done?

@RoneoOrg
Copy link
Author

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 simply private ?)
  • 6. Write a disclaimer (see this suggestion)
  • 7. Update the documentation

/cc @yashasolutions

@sonarcloud
Copy link

sonarcloud bot commented Jun 23, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@RoneoOrg
Copy link
Author

Now every external link is opened is a new tab with rel=noreferrer, to hide the Referer header and leak no referrer information

@sonarcloud
Copy link

sonarcloud bot commented Aug 16, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarcloud
Copy link

sonarcloud bot commented Sep 30, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@icy-comet icy-comet mentioned this pull request Feb 18, 2023
7 tasks
@RoneoOrg
Copy link
Author

RoneoOrg commented Jul 6, 2023

Todo:

  • Check if hidden posts are correctly hidden from navigation (Previous / Next buttons at the bottom of posts)
  • Check the compatibilty with this PR Show related posts #1049

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.

3 participants