Cloud-oriented Life

Cloud Native Technology Improves Lives

hexo-related-popular-posts

Hexo is a fast, simple & powerful blog framework. It use plugins to provide features powerful APIs for limitless extensibility. Various plugins are available to support most template engines (EJS, Pug, Nunjucks, and many others). Easily integrate with existing NPM packages (Babel, PostCSS, Less/Sass, etc).

hexo-related-popular-posts plugin is a hexo plugin that generates a list of links to related posts or popular posts.

Installation

Use npm to install hexo-related-popular-posts package.

1
2
3
$ npm install hexo-related-popular-posts --save

$ hexo clean

Configuration

This plugin integrated in «NexT», you may adjust options in NexT config:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# _config.next.yml

# Related popular posts
# Dependencies: https://github.com/tea3/hexo-related-popular-posts
related_posts:
# DoItYourself
# enable: false
enable: true
title: # Custom header, leave empty to use the default one
display_in_home: false
params:
maxCount: 5
#PPMixingRate: 0.0
#isDate: false
#isImage: false
#isExcerpt: false

Usage

If tags are included in the article, related articles can be displayed as a list. For example, add a tag like the following markdown file.

1
2
3
4
5
6
7
8
9
---
title: Hello World
tags:
- program
- diary
- web
---
Welcome to [Hexo](https://hexo.io/)! This is a sample article. Let's add some tags as above.
...

Finally, you can visit your site in the browser, and check whether the site works correctly after Hexo restarted or regenerated.

References

[1] GitHub - tea3/hexo-related-popular-posts: A hexo plugin that generates a list of links to related posts and popular posts. Also , this plugin can get Visitor Counts (PV) on posts. - https://github.com/tea3/hexo-related-popular-posts

[2] Hexo - https://hexo.io/

helm-nfs-server-provisioner-example

NFS Server Provisioner

nfs-client-provisioner - https://github.com/helm/charts/tree/master/stable/nfs-client-provisioner is an out-of-tree dynamic provisioner for Kubernetes. You can use it to quickly & easily deploy shared storage that works almost anywhere throught Network File System (NFS).

This chart will deploy the Kubernetes nfs provisioner. This provisioner includes a built in NFS server, and is not intended for connecting to a pre-existing NFS server. If you have a pre-existing NFS Server, please consider using the nfs-client-provisioner - https://github.com/helm/charts/tree/master/stable/nfs-client-provisioner instead.

This article is about how to use Helm to install nfs-server-provisioner on Kubernetes (K8S).

Read more »

hexo-filter-nofollow

Hexo is a fast, simple & powerful blog framework. It use plugins to provide features powerful APIs for limitless extensibility. Various plugins are available to support most template engines (EJS, Pug, Nunjucks, and many others). Easily integrate with existing NPM packages (Babel, PostCSS, Less/Sass, etc).

hexo-filter-nofollow plugin add nofollow attribute to all external links automatically.

hexo-filter-nofollow add `rel=“noopener external nofollow noreferrer” to all external links for security, privacy and SEO. Read more.

Installation

Use npm to install hexo-filter-nofollow package.

1
2
3
$ npm install hexo-filter-nofollow --save

$ hexo clean

Configuration

It will generate sitemap.xml in the public folder by default after hexo-filter-nofollow installation.

You can configure this plugin in ./_config.yml.

1
2
3
4
5
6
nofollow:
enable: true
field: site
exclude:
- 'exclude1.com'
- 'exclude2.com'

The follow is the options:

  • enable - Enable the plugin. Default value is true.

  • field - The scope you want the plugin to proceed, can be ‘site’ or ‘post’. Default value is site.

    • ‘post’ - Only add nofollow attribute to external links in your post content

    • ‘site’ - Add nofollow attribute to external links of whole sites

  • exclude - Exclude hostname. Specify subdomain when applicable, including www. ‘exclude1.com’ does not apply to www.exclude1.com nor en.exclude1.com.

Finally, you can visit your site in the browser, and check whether the site works correctly after Hexo restarted or regenerated.

References

[1] hexojs/hexo-filter-nofollow: Add nofollow attribute to all external links automatically. - https://github.com/hexojs/hexo-filter-nofollow/

[2] Link types - HTML: HyperText Markup Language | MDN - https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types

[3] Qualify Outbound Links for SEO | Google Search Central - https://developers.google.com/search/docs/advanced/guidelines/qualify-outbound-links

[4] Hexo - https://hexo.io/

sea-orm-cli

SeaORM is a relational ORM to help you build light weight and concurrent web services in Rust

sea-orm-cli is a tool to discover all tables in a database and generate a corresponding SeaORM entity file for each table.

Read more »

kube-prometheus stack

MinIO is a High Performance Object Storage released under Apache License v2.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads.

MinIO supports distributed mode. In distributed mode, you can pool multiple drives (even on different machines) into a single object storage server.

This article is about how to use Helm to deploy Minio on Kubernetes (K8S).

Read more »

hexo-generator-feed

Hexo is a fast, simple & powerful blog framework. It use plugins to provide features powerful APIs for limitless extensibility. Various plugins are available to support most template engines (EJS, Pug, Nunjucks, and many others). Easily integrate with existing NPM packages (Babel, PostCSS, Less/Sass, etc).

hexo-generator-feed plugin will generate Atom 1.0 or RSS 2.0 feed files for Hexo pages, posts, categories, tags.

Installation

Use npm to install hexo-generator-feed package.

1
2
3
$ npm install hexo-generator-feed --save

$ hexo clean

Configuration

In the front-matter of your post, you can optionally add a description, intro or excerpt setting to write a summary for the post. Otherwise the summary will default to the excerpt or the first 140 characters of the post.

1
2
3
4
5
6
7
---
title: lorem ipsum
date: 2020-01-02
description:
intro:
excerpt:
---

You can configure this plugin in _config.yml.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# _config.yml

feed:
enable: true
type: atom
path: atom.xml
limit: 20
hub:
content:
content_limit: 140
content_limit_delim: ' '
order_by: -date
icon: icon.png
autodiscovery: true
template:

Visit Options - https://github.com/hexojs/hexo-generator-feed#options to learn more options.

Finally, you can visit <Your Site Url>/atom.xml in the browser, and check whether the atom.xml works correctly after Hexo restarted or regenerated.

References

[1] GitHub - hexojs/hexo-generator-feed: Feed generator for Hexo. - https://github.com/hexojs/hexo-generator-feed

[3] Hexo - https://hexo.io/

hexo-generator-sitemap

Hexo is a fast, simple & powerful blog framework. It use plugins to provide features powerful APIs for limitless extensibility. Various plugins are available to support most template engines (EJS, Pug, Nunjucks, and many others). Easily integrate with existing NPM packages (Babel, PostCSS, Less/Sass, etc).

hexo-generator-sitemap plugin will generate sitemap files for Hexo pages, posts, categories, tags.

Installation

Use npm to install hexo-generator-sitemap package.

1
2
3
$ npm install hexo-generator-sitemap --save

$ hexo clean

Configuration

It will generate sitemap.xml in the public folder by default after hexo-generator-sitemap installation.

You can configure this plugin in ./_config.yml.

1
2
3
4
5
6
sitemap:
path: sitemap.xml
template: ./sitemap_template.xml
rel: false
tags: true
categories: true

The follow is the options:

  • path - Sitemap path. (Default: sitemap.xml)

  • template - Custom template path. This file will be used to generate sitemap.xml. (See default template)

  • rel - Add rel-sitemap to the site’s header. (Default: false)

  • tags - Add site’s tags. (Default: true)

  • categories - Add site’s categories. (Default: true)

Exclude Posts/Pages

Add sitemap: false to the post/page’s front matter in order to exclude from sitemap.

1
2
3
4
5
---
title: lorem ipsum
date: 2020-01-02
sitemap: false
---

Finally, you can visit <Your Site Url>/sitemap.xml in the browser, and check whether the sitemap.xml works correctly after Hexo restarted or regenerated.

FAQs

no such file or directory, open ‘./sitemap_template.xml’

1
2
3
4
5
6
$ hexo g
...
INFO Start processing
FATAL {
err: Error: ENOENT: no such file or directory, open './sitemap_template.xml'
...

Check hexo and hexo-generator-sitemap version:

1
2
hexo 6.0.0
hexo-generator-sitemap 3.0.1

Comment template: ./sitemap_template.xml within ./_config.yml, and run hexo g again.

1
2
3
4
5
6
sitemap:
path: sitemap.xml
- template: ./sitemap_template.xml
rel: false
tags: true
categories: true

References

[1] GitHub - hexojs/hexo-generator-sitemap: Sitemap generator for Hexo. - https://github.com/hexojs/hexo-generator-sitemap

[2] Build and submit a sitemap  |  Google Search Central  |  Google Developers - https://developers.google.com/search/docs/advanced/sitemaps/build-sitemap

[3] Hexo - https://hexo.io/

asdf and Python Plugin

asdf is a single CLI tool for managing multiple runtime versions. It extend with a simple plugin system to install your favourite language: Dart, Elixir, Flutter, Golang (Go), Java, Node.js, Python, Ruby …

This article is about how to use asdf and Python plugin to install multiple Python versions on macOS with the Homebrew package manager.

Read more »
0%