Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 29, 2025

Implements the ability to hide posts from listings while keeping them accessible via direct link. Users can now mark posts as hidden for use cases like Q&A content or draft sharing.

Implementation

Filters posts with hidden: true from:

  • Posts list page (layouts/_default/list.html)
  • Recent posts section (layouts/partials/sections/recent-posts.html)
  • Search index (layouts/_default/index.json)
  • RSS feed (layouts/_default/rss.xml)
  • Sitemap (layouts/_default/sitemap.xml)

Each location now applies where $posts "Params.hidden" "!=" true after existing filters.

Usage

---
title: "Hidden Post"
date: 2024-01-01T10:00:00Z
hidden: true
---

The post remains accessible at its permalink but won't appear in any listing or feed. Added inline documentation to archetypes/default.md.

Original prompt

This section details on the original issue you should resolve

<issue_title>Hidden posts</issue_title>
<issue_description>First of all, thanks to all the contributors for this amazing theme!

Describe the solution you'd like

I want to be able to write and hide some posts.
More precisely, I want them not to appear on the "Posts" page or the posts list, or (even better) just if we are already on the page.
The idea is to be able to keep hidden some content, but still accessible with the right link.
Ideally, this can be done by adding a hidden: true parameter.

Describe alternatives you've considered

I tried to add .md files with a name different than index in posts/ but it does not work.
A partial solution is to create a different directory content/hidden and put the posts inside.
However, it does not use background images, and it would be better to be able to keep all the posts and content in the same directory.

Additional context

I want to use this feature to propose content with questions / answers (hidden) posts.
If you have any ideas about how I can implement this feature, please let me know !
</issue_description>

Comments on the Issue (you are @copilot in this section)

@hossainemruz You should be able to achieve it by using different menu name in the post front-matter. Currently, we only show items of a menu named `sidebar` in the side navigation. For example following post should not be shown in the sidebar.
---
title: "Markdown Samples"
date: 2020-06-08T08:06:25+06:00
description: Markdown rendering samples
menu:
  hidden:
    name: Markdown Sample
    identifier: markdown
    weight: 30
author:
  name: Jessica Jonas
  image: /images/author/jessica.png
math: true
---

Notice the menu section. I have used hidden instead of sidebar. You can use any name except sidebar. That will result the post not showing in the side nav.</comment_new>
<comment_new>@hossainemruz
I am afraid it is not possible now. We have to add support for that.</comment_new>
<comment_new>@hossainemruz
Yes @rishu-7549. That will be proper way. Feel free to send a PR.</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Oct 29, 2025

Deploy Preview for toha-ci ready!

Name Link
🔨 Latest commit 8dc26f5
🔍 Latest deploy log https://app.netlify.com/projects/toha-ci/deploys/6913c7cb8b4f89000827da1d
😎 Deploy Preview https://deploy-preview-1094--toha-ci.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI and others added 2 commits October 29, 2025 08:53
Co-authored-by: hossainemruz <12577390+hossainemruz@users.noreply.github.com>
Co-authored-by: hossainemruz <12577390+hossainemruz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ability to write and hide posts Add support for hidden posts via hidden: true front matter parameter Oct 29, 2025
Copilot AI requested a review from hossainemruz October 29, 2025 08:56
@hossainemruz hossainemruz marked this pull request as ready for review November 11, 2025 23:08
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

@hossainemruz hossainemruz added the enhancement New feature or request label Nov 11, 2025
@hossainemruz hossainemruz merged commit cdde52e into main Nov 11, 2025
12 checks passed
@hossainemruz hossainemruz deleted the copilot/add-hidden-posts-feature branch November 11, 2025 23:36
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

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

Labels

enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hidden posts

2 participants