# hexo-fun-time

> hexo-fun-time is a tag plugin for Hexo. It can provide you fun time.

Latest version **0.0.4** (published 2019-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install hexo-fun-time
pnpm add hexo-fun-time
yarn add hexo-fun-time
bun add hexo-fun-time
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2019-09-12 |
| First published | 2019-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Drunkman |
| Maintainers | drunkman |
| Keywords | tag, hexo |

## Links

- npm: https://www.npmjs.com/package/hexo-fun-time
- Repository: https://github.com/Drunkman/hexo-fun-time
- Homepage: https://github.com/Drunkman/hexo-fun-time#readme
- Issues: https://github.com/Drunkman/hexo-fun-time/issues
- npm.io page: https://npm.io/package/hexo-fun-time

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.19.0
- [deasync](https://npm.io/package/deasync.md) ^0.1.15

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 0.0.4 (latest) — 2019-09-12
- 0.0.3 — 2019-08-29
- 0.0.2 — 2019-08-27
- 0.0.1 — 2019-08-26

## README

## Introduction

This is a hexo tag plugin which allows you to render fun time in you blog.

It is just for fun.

## Installation

To install, run the following command in the root directory of hexo:
```
npm install hexo-fun-time --save
```

## Usage
#### simple Usage

	{% funTime %}

#### disable render
If you want to disable this function, you can setting in `_config.yml`
```yaml
fun_time:
  disable: true
```
#### change default style
If you want to change default style, you can setting style in `_config.yml`, 
you can set three part: body, title, content

For example:
```yaml
fun_time:
  style: 
    body:
      margin: "10px 10px 10px auto" # body align right side
    title:
      font-size: 50px # change font size
    content:
      font-size: 30px # change font size
      
```
The default style is:
```yaml
fun_time:
  style: 
    body:
      width: "400px",
      padding: "10px",
      margin: "10px auto",
      border: "#000 2px dotted; border-radius: 10px"
    title:
      font-size: "24px",
      font-style: "italic",
      text-shadow: "0 0 0.2em #8F7, 0 0 0.2em #8F7"
    content:
```

#### custom data resource
You can custom your own data resource by add `content_api` and `content_field` in `_config.yml`.
```yaml
fun_time:
  content_api: "http://api.avatardata.cn/Joke/NewstJoke?key={yourAppKey}&rows=10"
  content_field: "result.[].content"

```
The `content_api` is api where your jokes get from. 

The `content_field` is the string that define the content location in response of your api.
It is few of word join by '.'. If word is not '[]', it represent a property of object, if word is '[]', it represent this property is array.

For Example, the `content_field` of follow code is `result.[].content`.
```json5
{ 
  result: 
   [ { content: '楼主大四女生，这几天和同一宿舍的女生一起去找工作，在火车站，碰到一个大姐，带着一个四五岁的小男孩侯车，小男孩总是粘着我，要坐我腿上，同宿舍的女生很是羡慕我有人缘，我得意的问小男孩：“你为什么老是喜欢坐姐姐腿上？” 小男孩用稚嫩的口气回答：“姐姐腿上肉多，坐着舒服” 我：“尼玛，这是谁家小哔崽子，快点领走！”',
       hashId: '8d914207de87e464bc99055a02160d27',
       unixtime: '1554778627',
       updatetime: '2019-04-09 10:57:07' },
     { content: '女：“我购物车里的那些水果牛奶饮料零食你赶紧给我买！” 男：“着什么急呀？” 女：“天越来越热了，会放坏的。”',
       hashId: '7236a1fe92605a8b5540c4279bd8f973',
       unixtime: '1554778627',
       updatetime: '2019-04-09 10:57:07' }],
  error_code: 0,
  reason: 'Succes',
} 
```
More example show in [here](/test/objectUtilsTest.js).

## Credits
Thanks the [RollToolsApi](https://github.com/MZCretin/RollToolsApi) project for default joke resource!

---
_Source: https://npm.io/package/hexo-fun-time · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
