yuang01 / hexo-theme-bamboo

Hexo博客主题,功能强大,美观
https://hexo-theme-bamboo.netlify.app/
MIT License
414 stars 59 forks source link

HEXO plugins #12

Closed lorezyra closed 3 years ago

lorezyra commented 3 years ago

Hi,

I like your site. Been studying your theme for HEXO and after reading your blog on the tags, I’m finding issues. What plugins are you using for your site? Did you build a custom module for all the tags you document here: https://yuang01.gitee.io/2021/02/08/hexo-theme-bamboo-new/#%E4%B8%8B%E8%BD%BD ?

I’m using the latest version of HEXO v5.4. When I attempt to use the progress tag, HEXO errors with: Unhandled rejection Nunjucks Error: _posts/Markup-manual-2.md [Line 2, Column 206] unknown block tag: progress

Any suggestions?

yuang01 commented 3 years ago

Just write it like this in the article

{% progress 70 danger content %}

Check the version of my theme from the 'package. json' file in my theme folder. The progress tag should be above version 1.8.1

lorezyra commented 3 years ago

That's exactly how I wrote it in the markdown file.

Markup-manual-2.md:

---
title: Markup Manual
date: 2021-05-28 16:45:12
description: ''
tags: [hexo-blog]
categories: fun
category: true
toc: true
tocOpen: true
sticky: 999
comments: true
lang: en_US
indexing: true
home_posts_tag: false
swiper: false
swiperImg: 
top: false
donate: false
geolocation: Japan
mathjax: true
---

## Testing out the documented features of HEXO & JS in the bamboo theme
 All originally from: https://yuang01.gitee.io
 The purpose of this post is to see if everything documented actually works...

## Progess bars 进度条

### 进度条示例
{% progress 70 danger 进度条测试 %}
{% progress 60 info 进度条测试 %}
{% progress 60 success 进度条测试 %}
{% progress 60 warning 进度条测试 %}
{% progress 60 primary 进度条测试 %}

However, when I run hexo generate I see the error:

 $ hexo generate
INFO  Validating config
INFO  Start processing
FATAL {
  err: Error [Nunjucks Error]: _posts/Markup-manual-2.md [Line 2, Column 206] unknown block tag: progress
      =====               Context Dump               =====
      === (line number probably different from source) ===
    1 | <h2 id="Testing-out-the-documented-features-of-HEXO-amp-JS-in-the-bamboo-theme"><a href="#Testing-out-the-documented-features-of-HEXO-amp-JS-in-the-bamboo-theme" class="headerlink" title="Testing out the documented features of HEXO &amp; JS in the bamboo theme"></a>Testing out the documented features of HEXO &amp; JS in the bamboo theme</h2><p> All originally from: <a href="https://yuang01.gitee.io/">https://yuang01.gitee.io</a><br> The purpose of this post is to see if everything documented actually works…</p>
    2 | <h2 id="Progess-bars-进度条"><a href="#Progess-bars-进度条" class="headerlink" title="Progess bars 进度条"></a>Progess bars 进度条</h2><h3 id="进度条示例"><a href="#进度条示例" class="headerlink" title="进度条示例"></a>进度条示例</h3>{% progress 70 danger 进度条测试 %}
    3 | <!--code0-->
    4 | 
      =====             Context Dump Ends            =====
      at formatNunjucksError (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/hexo/lib/extend/tag.js:171:13)
      at /Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/hexo/lib/extend/tag.js:246:36
      at tryCatcher (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/bluebird/js/release/promise.js:649:10)
      at Promise._settlePromises (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/bluebird/js/release/promise.js:725:18)
      at _drainQueueStep (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/bluebird/js/release/async.js:93:12)
      at _drainQueue (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/bluebird/js/release/async.js:86:9)
      at Async._drainQueues (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/bluebird/js/release/async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (/Users/lorezyra/Documents/blog.RichieBartlett.com/node_modules/bluebird/js/release/async.js:15:14)
      at processImmediate (node:internal/timers:464:21) {
    line: 2,
    location: '\x1B[35m_posts/Markup-manual-2.md\x1B[39m [Line 2, Column 206]',
    type: 'unknown block tag: progress'
  }
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

Hexo is saying it doesn't recognize the progress tag.

When I run hexo version I see this:

$ hexo version 
INFO  Validating config
hexo: 5.4.0
hexo-cli: 4.2.0
os: Darwin 20.5.0 darwin x64
node: 15.14.0
v8: 8.6.395.17-node.28
uv: 1.41.0
zlib: 1.2.11
brotli: 1.0.9
ares: 1.17.1
modules: 88
nghttp2: 1.43.0
napi: 8
llhttp: 2.1.3
openssl: 1.1.1k
cldr: 38.1
icu: 68.2
tz: 2020d
unicode: 13.0

All this is running on my MacBookPro with MacOS 11.4.

When I remove that line {% progress 70 danger 进度条测试 %} hexo generates without error. What version of HEXO are you running?

lorezyra commented 3 years ago

Check the version of my theme from the 'package. json' file in my theme folder. The progress tag should be above version 1.8.1

I don't find that file in your master branch. Should I be using your dev branch??

yuang01 commented 3 years ago

Yes,use dev

lorezyra commented 3 years ago

Ah!!! I see now... these tags are defined in: hexo-theme-bamboo-2.0.0\scripts\tag

hexo-theme-bamboo-2.0.0
├── README.md
├── _config.yml
├── package.json
├── scripts
│   ├── tag
│   │   ├── btn.js
│   │   ├── btns.js
│   │   ├── checkbox.js
│   │   ├── folding.js
│   │   ├── gallery.js
│   │   ├── ghcard.js
│   │   ├── image.js
│   │   ├── inline-labels.js
│   │   ├── link.js
│   │   ├── media.js
│   │   ├── note.js
│   │   ├── progress.js
│   │   ├── site.js
│   │   ├── span.js
│   │   ├── tabs.js
│   │   ├── timeline.js
│   │   ├── title.js
│   │   └── titleB.js
│   └── z-lazyload
│       ├── index.js
│       └── lib
│           └── process.js

THANKS!

yuang01 commented 3 years ago

you 're right