prinsss / hexo-hide-posts

A plugin to hide specific posts from your Hexo blog and make them only accessible by links. (隐藏 Hexo 文章)
MIT License
197 stars 19 forks source link

Pages #9

Closed janvaniperen closed 4 years ago

janvaniperen commented 5 years ago

Am I right that this does not work for a page? Can I change that somewhere so it does allow for pages to be hidden?

prinsss commented 5 years ago

No, it only works for posts now. I'll see if I can add pages support.

prinsss commented 5 years ago

Hello there! Sorry for being late *_*

But as far as I can see, pages are currently not being processed by most of the generators (archives, categories, tags, feeds, etc.). So in most cases, pages should be only accessible by their permanent links...

Would you please tell me what your situation is, and how is this plugin supposed to support hiding pages? Thank you!

janvaniperen commented 5 years ago

on my site I created a page that should not be indexed and should only be found when people scan a QR code on my business card. It leads them here: https://janvaniperen.com/mip/ Hence the need to hide from search engines/indexing

prinsss commented 5 years ago

Okay, I see. I will try to implement it in further release. :)

For now, here is a workaround:

Add <!-- flag of hidden posts --> to the Markdown source of page you want to hide, then the plugin will read it and add a <meta name="robots" content="noindex"> for that page.

Check generated HTML to see if it works.

janvaniperen commented 4 years ago

Mmmm, does not seem to work for me. But now understand I can just manually add a robots.txt file and just exclude it there... when it's just a couple of pages it is an easier solution I guess...

prinsss commented 4 years ago

Apologies for the long period of inactivity. The plugin was just updated to 0.1.1, and it should support hiding pages now. Feel free to reopen if there is any problem.