How can I hide (but not delete) core pages?

I want the photos & archive pages to exist, but not be visible in the blog category links.

They don’t have the:

" Include this page in your blog navigation"

toggle like others do.

How could I hide them from navigation, but still leave them as reachable and linkable?

1 Like

search and stats plugins have the same problem (but worse since they don’t even have Page to edit), but I expect those have to be handled by the plugin maintainers as a config option.

@sod handled this differently (better IMO!) for surprise me.

1 Like

Photos and Archives really should have that “Include this page” checkbox. I’ll work on adding that. In the meantime you will probably need to create a custom theme that overrides the header to just show the links you want instead of having Micro.blog manage it.

2 Likes

The custom theme approach, as @manton suggests, is definitely the most elegant. If you’re okay with a hack, you could add this to your custom CSS.

/* Hide the last two list items in the header navigation. */
.header > nav li:nth-last-child(-n+2) {
  display: none;
}

Ideas are percolating for how we could better handle plug-in pages via nifty user interfaces in this thread. So, hopefully, this will get better in the future.

Customizing your theme template is the only/best solution here, especially as it pertains to plug-ins adding pages.

There’s probably something like this in your header partial:

{{ with site.Menus.main }}
      {{ range . }}
        <a class="{{ if eq .URL $url }}active{{ end }}" href="{{ .URL }}">
          {{ .Name }}
        </a>
      {{ end }}
{{ end }}

And you’ll want to eliminate that and instead hardcode the links to pages you want to be in your navigation (or possibly filter out certain URLs from the range instead).

@sod I tried this hack without success tonight. I’m trying to hide everything after the “HeyDingus :arrow_upper_right:” item. I’ve also tried the nav a[href='/stats/'] { display: none; } trick, but it leaves weird spacing for the list item, even though the content of the list item itself is hidden. I thought since this looked like it worked on the <li> bit that this would be cleaner, but alas, nay.

Every theme is different and my hack needs adjusting to fit yours. Here’s one solution:

/* Hide the last three list items in the header navigation. */
.menu li:nth-last-child(-n+3) {
  display: none;
}
1 Like

You’ve done it! Thank you! :grin:

I apologize if that reply came across as whiny. I was so excited to find your solution after being stumped for months.

As a newbie, I really appreciate all your guidance for the Micro.blog community, and your help tonight.

1 Like

Your reply didn’t appear whiny to me, no need to apologize. :blush: I’m happy to hear that it worked out.

Any update on when this might be rolled out? It would be good to have an easy option to hide these pages rather than needing to fiddle around with a custom theme.

While we wait to add the checkbox as an option, there is functionality behind the scenes right now where I can set those special pages to be hidden on your blog if you want. Email help with a list of pages you want to exclude from the navigation and I can update it for you.