Coder Social home page Coder Social logo

st666a / hexo-hide-posts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prinsss/hexo-hide-posts

0.0 0.0 0.0 66 KB

A plugin to hide specific posts from your Hexo blog and make them only accessible by links. (隐藏 Hexo 文章)

License: MIT License

JavaScript 100.00%

hexo-hide-posts's Introduction

hexo-hide-posts

npm-version hexo-version

中文文档

A plugin to hide specific posts from your Hexo blog and make them only accessible by links.

Hide means your posts will not come up in article lists (homepage, archive, category, tag, feed, sitemap, whatever), or search results either (by telling search engines not to index these pages with a "noindex" meta tag). Only those who know the link can view the post, and you can share the link with anyone.

This means that posts marked as hidden could still be seen by anyone, but only if they guess the link.

Installation

$ npm install hexo-hide-posts --save

Usage

Add hidden: true to the front-matter of posts which you want to hide.

e.g. Edit source/_posts/lorem-ipsum.md:

---
title: 'Lorem Ipsum'
date: '2019/8/10 11:45:14'
hidden: true
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

This post will not be shown anywhere, but you can still access it by https://hexo.test/lorem-ipsum/. (If you want to completely prevent a post from rendering, just set it as a draft.)

To get a list of hidden posts, you can run hexo hidden:list from command line.

For developers, all_posts and hidden_posts added to Local Variables may be useful.

Config

In your site's _config.yml:

# hexo-hide-posts
hide_posts:
  enable: true
  # Change the filter name to fit your need
  filter: hidden
  # Generators which you want to expose all posts (include hidden ones) to.
  # Common generators: index, tag, category, archive, sitemap, feed, etc.
  public_generators: []
  # Add "noindex" meta tag to prevent hidden posts from being indexed by search engines
  noindex: true

e.g. Set filter to secret, so you can use secret: true in front-matter instead.

Note: although most of generator plugins respect a naming convention that they register generator with the name in their package names, the generator name could be arbitrary. For example, hexo-generator-searchdb does not register generators with name searchdb, but xml and json. For accurate generator name, you should check their source code.

License

MIT

hexo-hide-posts's People

Contributors

prinsss avatar h404bi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.