Hide page title

I’m trying to hide the page title on a single page, and don’t even know if that’s possible, but if I can only hide it on all of them, it’ll work as well.

Added
header .page-title { display: none; }
to my working CSS, but the titles still show up.

Ideas? Thanks.

Looks like the class in your theme is masthead-title not .page-title.

As for hiding it on just one page, that would probably best be done by customizing your theme and editing the template.

CleanShot 2021-05-13 at 18.31.53@2x

Thank you.
I changed it, but this is not exactly what I was looking for, I probably have not explained myself correctly. Your edit hides the name of the blog and I’m looking for a way to hide the individual pages name on the page.
When I visit my about page, or any other, there’s that page’s name below the site name and navigation. That’s the one I want to hide.

It’s not in the header, which is why header .page-title doesn’t select that element. Instead, you can put h1.page-title as the selector.

CleanShot 2021-05-13 at 21.33.23@2x

1 Like

Yes! Thank you :blush:
And I believe I have also learned how to do it the next time around, so thank you again.

I’m resuscitating this to keep the topic together!

What’s the simplest, general-purpose way to hide the page title on a page?
Ideally it could be done from the markdown page editor on micro.blog itself… Without making a template? But if a template is necessary - how?

This entirely depends on your theme. But probably the most robust way would be to edit your single.html template to remove it (which will remove it for all single posts, or with some clever filtering, can be specific).

Can I pass Hugo parameters via the Micro.blog page editor? So I would basically do what you suggested and do an “if parameter” then title, and for each page pass that parameter in the editor, so I don’t have to mess too much with the templates

No-- Micro.blog does not support custom front matter. You would have to use a category/tag/taxonomy, which Micro.blog does support.

Oh right, thank you. I’m not good on Hugo - how would I insert an if - then into the template for which the condition for the if would be “the page is this page”? Either by url or… IDK?

So basically hardcoding into the template the page for which I want the condition to “work”

In your _default/term.html page you can use {{ if eq .Data.Term "my_category" }} to wrap things based on your category, for example.

It’s pretty non-trivial. Another option would be to make the page by saying content/my_page.md and then making layouts/my_page/single.html and in that content/my_page.md page you can set the type to my_page to use a custom layout (if this is truly one page).

1 Like