npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hexo-douban-pro

v1.0.20

Published

Generate douban pages of books , movies, musics and games for Hexo.

Downloads

30

Readme

hexo-douban-pro

一个在 Hexo 页面中嵌入豆瓣个人主页的小插件.

npm Coverage Status NPM version npm GitHub license

NPM

环境要求

  • Node版本不大于10,否则会爬取不了数据。
  • Node版本不大于10,否则会爬取不了数据。
  • Node版本不大于10,否则会爬取不了数据。

使用vercel + Hexo的话,在vercel设置选择中找到Node版本选择10即可。

安装

$ npm install hexo-douban-pro --save

配置

将下面的配置写入站点的配置文件 _config.yml 里(不是主题的配置文件).

douban:
  user: mythsman
  builtin: false
  book:
    title: 'This is my book title'
    quote: 'This is my book quote'
  movie:
    title: 'This is my movie title'
    quote: 'This is my movie quote'
  game:
    title: 'This is my game title'
    quote: 'This is my game quote'
  music:
    title: 'This is my music title'
    quote: 'This is my music quote'
  timeout: 10000 
  • user: 你的豆瓣ID.打开豆瓣,登入账户,然后在右上角点击 "个人主页" ,这时候地址栏的URL大概是这样:"https://www.douban.com/people/xxxxxx/" ,其中的"xxxxxx"就是你的个人ID了。
  • builtin: 是否将生成页面的功能嵌入hexo shexo g中,默认是false,另一可选项为true(1.x.x版本新增配置项)。
  • title: 该页面的标题.
  • quote: 写在页面开头的一段话,支持html语法.
  • timeout: 爬取数据的超时时间,默认是 10000ms ,如果在使用时发现报了超时的错(ETIMEOUT)可以把这个数据设置的大一点。

如果只想显示某一个页面(比如movie),那就把其他的配置项注释掉即可。

使用

1.x.x版本

在1.x.x版本中,使用hexo douban命令即可生成指定页面,如果不加参数,那么默认参数为-bgmi

需要注意的是,通常大家都喜欢用hexo d来作为hexo deploy命令的简化,但是当安装了hexo douban之后,就不能用hexo d了,因为hexo doubanhexo deploy的前缀都是hexo d

$ hexo douban -h
Usage: hexo douban

Description:
Generate pages from douban

Options:
  -b, --books   Generate douban books only
  -g, --games   Generate douban games only
  -m, --movies  Generate douban movies only
  -i, --musics  Generate douban musics only

如果配置了builtin参数为true,那么除了可以使用hexo douban命令之外,hexo ghexo s也内嵌了生成页面的功能。

升级

我会不定期更新一些功能或者修改一些Bug,所以如果想使用最新的特性,可以用下面的方法来更新:

  1. 修改package.json内hexo-douban的版本号至最新
  2. 重新安装最新版本npm install hexo-douban-pro --save

或者使用npm install hexo-douban-pro --update --save直接更新。

显示

如果上面的配置和操作都没问题,就可以在生成站点之后打开 //yourblog/books//yourblog/movies, //yourblog/games, 来查看结果.

菜单

如果上面的显示没有问题就可以在主题的配置文件 _config.yml 里添加如下配置来为这些页面添加菜单链接.

menu:
  Home: /
  Archives: /archives
  books: /books     #This is your books page
  movies: /movies   #This is your movies page
  games: /games   #This is your games page
  musics: /musics   #This is your games page

截图

我们在下面这些常见的主题里测试了插件的使用效果:

hexo-theme-landscape

landscape

hexo-theme-next

next

hexo-theme-yilia

yilia

hexo-theme-indigo

indigo

hexo-theme-aath

aath

FeedBack

如果大家在使用的过程中有什么问题或者意见,欢迎随时提issue。

Lisense

MIT