Coder Social home page Coder Social logo

hexo-tag-cloud's Introduction

Hi there 👋

hexo-tag-cloud's People

Contributors

d0n9x1n avatar taqini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hexo-tag-cloud's Issues

部署后没有显示内容

作者好,感谢做出这个优秀的插件.但是我现在遇到了一点问题
我看了#7 但还是存在一些问题 .deploy_git文件夹下也有js/tagcloud和js/tagcanvas文件

Expected Behavior

hexo clean
hexo g
hexo d 分别执行
按照文档应该有
但之后网站没有出现词云

Actual Behavior

网站 https://sekyoro.top/
image
DOM也加载出来了
image
同时我看两个文件也是加载了的

同时hexo s预览发现能正常显示
image

Steps to Reproduce the Problem

package.json内容
`{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "5.4.0"
},
"dependencies": {
"hexo": "^5.0.0",
"hexo-algoliasearch": "^1.0.0",
"hexo-baidu-url-submit": "0.0.6",
"hexo-bilibili-bangumi": "^1.8.5",
"hexo-blog-encrypt": "^3.1.6",
"hexo-deployer-git": "^3.0.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-baidu-sitemap": "^0.1.9",
"hexo-generator-category": "^1.0.0",
"hexo-generator-feed": "^3.0.0",
"hexo-generator-index": "^2.0.0",
"hexo-generator-index-pin-top": "^0.2.2",
"hexo-generator-search": "^2.4.1",
"hexo-generator-sitemap": "^2.1.0",
"hexo-generator-tag": "^1.0.0",
"hexo-offline-popup": "^1.0.3",
"hexo-pdf": "^1.1.1",
"hexo-related-popular-posts": "^5.0.1",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-kramed": "^0.1.4",
"hexo-renderer-stylus": "^2.0.0",
"hexo-server": "^2.0.0",
"hexo-sliding-spoiler": "^1.2.1",
"hexo-symbols-count-time": "^0.7.1",
"hexo-tag-aplayer": "^3.0.4",
"hexo-tag-cloud": "2.1.*",
"hexo-theme-landscape": "^0.0.3",
"hexo-util": "^2.5.0",
"hexo-wordcount": "^6.0.1"
}

Env

OS win10

change css style

I have used your widget, and sure it's nice. But the default font style like font-color, font-family is not suitable to my blog's theme. Can you provide an improvement so that we can write the css freely.

Next主题不显示代码云

image
作者您好,这个代码云没显示代码云,只有下边的标签,已经按教程步骤完成所有的配置

关于标签页置顶回滚问题

你好是这样的,我在NexT主题中使用了标签云插件后在我的归档页和标签页下拉到最后页面会出现回滚的情况,在sidebar中注释掉标签云代码回复正常,请问这是插件的bug吗?

附上出错的网址:

f12:

自己前端水平有限也不太明白,下面附上我的sidebar:

{% macro render(display_toc) %}
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      {%- set display_toc = page.toc.enable and display_toc %}
      {%- if display_toc %}
        {%- set toc = toc(page.content, { class: "nav", list_number: page.toc.number, max_depth: page.toc.max_depth }) %}
        {%- set display_toc = toc.length > 1 and display_toc %}
      {%- endif %}

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          {{ __('sidebar.toc') }}
        </li>
        <li class="sidebar-nav-overview">
          {{ __('sidebar.overview') }}
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
        {%- if display_toc %}
          <div class="post-toc motion-element">{{ toc }}</div>
        {%- endif %}
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        {{ partial('_partials/sidebar/site-overview.swig', {}, {cache: theme.cache.enable}) }}

        {{- next_inject('sidebar') }}
      </div>


      <!-- hitokoto 

      <p></p>


      <div class="hitokoto-title">
      <i class="fas fa-adjust"></i>
      <b>一言</b>
      </div>

      <div id="hitokoto">:D 获取中...</div>
      <center><p id="hitofrom">:D 获取中...</p></center>

      <script src="https://cdn.jsdelivr.net/npm/bluebird@3/js/browser/bluebird.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/[email protected]/fetch.min.js"></script>
      <script>
      fetch('https://v1.hitokoto.cn')
        .then(function (res){
          return res.json();
        })
        .then(function (data) {
          var hitokoto = document.getElementById('hitokoto');
          hitokoto.innerText = '\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + data.hitokoto;
          var hitofrom = document.getElementById('hitofrom');
          hitofrom.innerText = "——" + data.from + '\xa0'; 
        })
        .catch(function (err) {
          console.error(err);
        })
      </script>
      -->
+      {% if site.tags.length > 1 %}
+      <script type="text/javascript" charset="utf-8" src="{{ url_for('/js/tagcloud.js') }}"></script>
+      <script type="text/javascript" charset="utf-8" src="{{ url_for('/js/tagcanvas.js') }}"></script>
+      <div class="widget-wrap">
+          <h5 class="widget-title"></h5>
+          <div id="myCanvasContainer" class="widget tagcloud">
+              <canvas width="250" height="250" id="resCanvas" style="width:100%">
+                 {{ list_tags() }}
+              </canvas>
+         </div>
+      </div>
+      {% endif %}




      {%- if theme.back2top.enable and theme.back2top.sidebar %}
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>
      {%- endif %}

    </div>
  </aside>
  <div id="sidebar-dimmer">
  </div>
{% endmacro %}

配置文件如下:

# hexo-tag-cloud 标签云 | see https://github.com/MikeCoder/hexo-tag-cloud
tag_cloud:
  textFont: Trebuchet MS, Helvetica # 字体
  textColor: '#555' # 字体颜色
  textHeight: 14 # 字体高度
  outlineColor: '#FFFFFF' # 字体背景色
  maxSpeed: 0.1 # 标签云最大移动速度   

安装版本:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "5.4.0"
  },
  "dependencies": {
    "hexo": "^5.0.0",
    "hexo-abbrlink": "^2.2.1",
    "hexo-baidu-url-submit": "^0.0.6",
    "hexo-deployer-git": "^2.1.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-baidu-sitemap": "^0.1.9",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^3.0.0",
    "hexo-generator-index-pin-top": "^0.2.2",
    "hexo-generator-searchdb": "^1.3.3",
    "hexo-generator-sitemap": "^2.1.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-helper-live2d": "^3.1.1",
    "hexo-lazyload": "^1.3.6",
    "hexo-lazyload-image": "^1.0.9",
    "hexo-neat": "^1.0.9",
    "hexo-related-popular-posts": "^5.0.1",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^3.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^2.0.0",
    "hexo-symbols-count-time": "^0.7.1",
    "hexo-tag-aplayer": "^3.0.4",
+   "hexo-tag-cloud": "^2.1.2",
    "hexo-tag-dplayer": "^0.3.3",
    "hexo-theme-landscape": "^0.0.3",
    "hexo-wordcount": "^6.0.1"
  }
}

执行 npm install 命令就出错

然后执行hexo其他操作就有问题了

FATAL Cannot read property 'code' of undefined
TypeError: Cannot read property 'code' of undefined
    at C:\Users\Shinelon\AppData\Roaming\npm\node_modules\hexo-cli\lib\find_pkg. js:23:25
    at tryCatcher (C:\Users\Shinelon\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\Shinelon\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\Users\Shinelon\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromise0 (C:\Users\Shinelon\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\Users\Shinelon\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\bluebird\js\release\promise.js:689:18)
    at Async._drainQueue (C:\Users\Shinelon\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (C:\Users\Shinelon\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\Users\Shinelon\AppData\Roaming\npm\node_modules\hexo-cli\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

非标签页也会出现标签云

Expected Behavior

按照操作,“hexo d”以后,在标签页就可以看到标签云了

Actual Behavior

但是,在其他页,比如about,categories等也会出现标签云,并且在标签页点击标签跳转以后,也会出现标签云

Steps to Reproduce the Problem

  1. npm install --save hexo-tag-cloud
  2. next/layout/_macro/sidebar.swig内添加代码
  3. hexo cl;hexo g;hexo s,等到标签页出现标签云时,同时也发现了上述问题

补充:tag canvas.js和tagcloud.js文件都已经导入,在public中也有(非手动导入)

Specifications

(The version of the project, operating system, hardware etc.)
hexo: 3.7.0
hexo-cli: 1.1.0
os: Windows_NT 10.0.14393 win32 x64
http_parser: 2.7.0
node: 8.9.0
v8: 6.1.534.46
uv: 1.15.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 57
nghttp2: 1.25.0
openssl: 1.0.2l
icu: 59.1
unicode: 9.0
cldr: 31.0.1
tz: 2017b

标签页不能显示标签云

安装貌似好像应该是正确的,,但最关键的标签页没有任何显示。
安装
hexo c && hexo g生成的public 目录下没有 tagcloud.xml 和 tagcloud.swf 文件
没有xml与swf
next/layout/page.swig中的部分代码

            {#<div class="tag-cloud-tags">
              {{ tagcloud({min_font: 14, max_font: 30, amount: 300, color: true, start_color: '#582e4b', end_color: '#111'}) }}
            </div>#}

 {% if site.tags.length > 1 %}
<script type="text/javascript" charset="utf-8" src="/js/tagcloud.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/tagcanvas.js"></script>
<div class="widget-wrap">
<div id="myCanvasContainer" class="widget tagcloud">
<canvas width="500" height="500" id="resCanvas" style="width=100%">
{{ list_tags() }}
</canvas>
</div>
</div>
{% endif %}

hexo/_config.yml文件中也加入了

#tag_cloud
tag_cloud:
  textColour: \#2626ff
  outlineColour: \#9999ff
  textHeight: 25

清除和生成了pulic文件
g
但部署到服务器上却一点效果都没有
无效果
即使用url的方式引入js还是没效果

你好,可以切换为普通标签云吗

Expected Behavior

你好,可以切换为普通标签云吗,不使用canvas

Actual Behavior

Steps to Reproduce the Problem

Specifications

(The version of the project, operating system, hardware etc.)

[suggestion] Use Hexo's url_for for subdirectory deployment.

This demo for NexT them fails if blog is deployed in a subdirectory: .js wrong path.

{% if site.tags.length > 1 %}
<script type="text/javascript" charset="utf-8" src="/js/tagcloud.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/tagcanvas.js"></script>
<div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div id="myCanvasContainer" class="widget tagcloud">
        <canvas width="250" height="250" id="resCanvas" style="width=100%">
            {{ list_tags() }}
        </canvas>
    </div>
</div>
{% endif %}

If deployed in a subdirectory, i.e., root = /blog/ for example, the following changes will help.

  • "/js/tagcloud.js" to "{{ url_for('/js/tagcloud.js') }}"
  • "/js/tagcanvas.js" to "{{ url_for('/js/tagcanvas.js') }}"

It makes use of the official Hexo helper url_for (see here), so that browser can find .js with correct url.

Please confirm this. Thx.

您好,大佬,目前标签页无法显示

打扰您啦,这是我的标签页地址
https://dlovexj.cn/tags/
我是按照您的说明之前成功的,但是现在我使用的主题更新了,不过在关键位置跟之前几乎是一样哒,我还是按照之前的方法,先安装插件,然后在page-header.ejs 处添加代码,可是并没有出现,包括hexo s 也没有出现,可以帮帮我嘛,蟹蟹,♥

tagcloud无法在icarus主题下的右侧widget处显示。

Tag cloud无法在icarus主题下的右侧widget处显示。
在左侧和下方都显示正常,但在右侧无法显示(有tagcloud的标题,看不到球体)


用朋友的icarus主题blog的tag cloud放在右侧显示,也出现同样的问题,应该不是我的个例问题。

左侧(正常)

右侧(异常)

[click]我的icarus主题blog链接(tagcloud暂时放右侧)
查看tagcloud在左侧的显示效果可将网页以一半屏幕大小显示

另:作者您提供的ejs代码无法在icarus主题下正常显示widget的白色背景
可以使用以下代码替换(~/themes/icarus/layout/widget/tagcloud.ejs)

<% if (site.tags.length) { %>
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            <%= __('widget.tag_cloud') %>
        </h3>
        <script type="text/javascript" charset="utf-8" src="<%- url_for('/js/tagcloud.js') %>"></script>
        <script type="text/javascript" charset="utf-8" src="<%- url_for('/js/tagcanvas.js') %>"></script>
        <canvas width="250" height="250" id="resCanvas" style="width:100%">
            <%- tagcloud() %>
        </canvas>
    </div>
</div>
<% } %>

njk用户应该修改哪个文件啊?

安装步骤都是按照说明在做。但我的设置文件都是njk。
按说明修改了next/layout/_macro/sidebar.njk,但是没有出现标签云。
请问怎么回事呢。

tag cloud can't show up

Expected Behavior

The tags should show up on the side bar

Actual Behavior

nothing happened

Steps to Reproduce the Problem

  1. the .js files(tagcanvas, tagcloud) have been existed and I also insert the code into the side bar
  <div class="site-state-item">
              {% if site.tags.length > 1 %}
                <script type="text/javascript" charset="utf-8" src="/js/tagcloud.js"></script>
                <script type="text/javascript" charset="utf-8" src="/js/tagcanvas.js"></script>
                <div class="widget-wrap">
                    <h3 class="widget-title">Tag Cloud</h3>
                    <div id="myCanvasContainer" class="widget tagcloud">
                        <canvas width="250" height="250" id="resCanvas" style="width=100%">
                            {{ list_tags() }}
                        </canvas>
                    </div>
              </div>
              {% endif %}
           </div> 

Specifications

(The version of the project, operating system, hardware etc.)
Thank you very much.

无法显示tag

无法显示标签..不知道如何解决,在tag.swif下添加代码无法显示,如何解决?
image

C:\hexo\themes\next\layout\_macro下的sidebar.swig文件部分代码

{% macro render(is_post) %}
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      {% set display_toc = is_post and theme.toc.enable %}

      {% if display_toc and toc(page.content).length > 1 %}
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            {{ __('sidebar.toc') }}
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            {{ __('sidebar.overview') }}
          </li>
        </ul>
      {% endif %}
      ......
      {% if display_toc and toc(page.content).length > 1 %}
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            {% if page.toc_number === undefined %}
              {% set toc = toc(page.content, { "class": "nav", list_number: theme.toc.number }) %}
            {% else %}
              {% set toc = toc(page.content, { "class": "nav", list_number: page.toc_number }) %}
            {% endif %}

            {% if toc.length <= 1 %}
              <p class="post-toc-empty">{{ __('post.toc_empty') }}</p>
            {% else %}
              <div class="post-toc-content">{{ toc }}</div>
            {% endif %}

          </div>
        </section>
      <!--/noindex-->
      {% endif %}

       // 以下是插入的标签云代码
       <% if (site.tags.length){ %>
         <script type="text/javascript" charset="utf-8" src="/js/tagcloud.js"></script>
         <script type="text/javascript" charset="utf-8" src="/js/tagcanvas.js"></script>
         <div class="widget-wrap">
          <h3 class="widget-title"><%= __('tagcloud') %></h3>
          <div id="myCanvasContainer" class="widget tagcloud">
            <canvas width="250" height="250" id="resCanvas" style="width=100%">
              <%- tagcloud() %>
            </canvas>
          </div>
      </div>
      <% } %>
    </div>
  </aside>
{% endmacro %}

Tag Cloud显示空白

按照文档安装成功后,却未成功显示,反而显示为空白。
1
查看源代码后发现tags均已导入,但是却未正常显示,请问这是什么问题?
2

Butterfly主题修改后没效果

我的主题是butterfly,已经安装了hexo-tag-cloud,修改了card_tags.pug的内容。

我 hexo clean && hexo g && hexo s后结果为
结果

我的版本

  • hexo-tag-cloud: ^2.1.2
  • butterfly: 4.5.1
  • hexo: 6.3.0
  • hexo-cli: 4.3.0

标签云中HTML特殊字符编码没有被转义

Expected Behavior

希望标签云中显示的是“矩阵快速幂+”

Actual Behavior

“+”的HTML特殊字符编码没有进行转义:

截图 2023-03-27 13-43-24

Steps to Reproduce the Problem

文章的标签:
截图 2023-03-27 13-44-55

Specifications

(The version of the project, operating system, hardware etc.)
Ubuntu 22.04

> npm list
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] extraneous
├── [email protected]
├── [email protected] extraneous
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] extraneous
├── [email protected]
└── [email protected]

[提供代码] 组合命令失效/hexo s复制js文件 解决方案

简单修改了一下index.js文件:

var fs = require('hexo-fs');
var pathFn = require('path');
var Hexo = require('hexo');
var log = require('hexo-log')({
  debug: false,
  silent: false
});

hexo.extend.filter.register('after_generate', function(post) {
	log.info("--- 开始运行 hexo-tag-cloud 插件 ---");

解决之前issue中遗留的一些问题:#11 #7
1
经测试,命令hexo s可以自动生成js文件。
2
经测试,命令hexo d -g可以成功部署。

下面提供index.js的全部代码:

// Copyright © 2016 TangDongxin

// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

var fs = require('hexo-fs');
var pathFn = require('path');
var Hexo = require('hexo');
var log = require('hexo-log')({
  debug: false,
  silent: false
});

hexo.extend.filter.register('after_generate', function(post) {
	log.info("--- 开始运行 hexo-tag-cloud 插件 ---");
    /*if (!fs.existsSync(pathFn.join(hexo.public_dir, 'tags'))) {
		log.info("Return");
        return;
    }*/
    var libPath = pathFn.join(pathFn.join(pathFn.join(hexo.base_dir, 'node_modules'), 'hexo-tag-cloud'), 'lib');

    var tagcanvasPubPath = pathFn.join(pathFn.join(hexo.public_dir, 'js'), 'tagcanvas.js');
    var tagcloudPubPath  = pathFn.join(pathFn.join(hexo.public_dir, 'js'), 'tagcloud.js');
	log.info("已复制 tagcanvas.js tagcloud.js 到 public/js/");
    fs.copyFile(pathFn.join(libPath, 'tagcanvas.js'), tagcanvasPubPath);

    var tagCloudJsContent = "function addLoadEvent(func) {"
                                + "var oldonload = window.onload;"
                                + "if (typeof window.onload != 'function') {"
                                    + "window.onload = func;"
                                + "} else {"
                                    + "window.onload = function() {"
                                        + "oldonload();"
                                        + "func();"
                                    + "}"
                                + "}"
                            + "}"
                            + "addLoadEvent(function() {"
                                + "console.log('tag cloud plugin rock and roll!');"
                                + " try {"
                                    + " TagCanvas.textFont = " + (!(hexo.config.tag_cloud && hexo.config.tag_cloud.textFont) ? "'Trebuchet MS, Helvetica, sans-serif';" : "'" + hexo.config.tag_cloud.textFont + "';")
                                    + " TagCanvas.textColour = " + (!(hexo.config.tag_cloud && hexo.config.tag_cloud.textColour) ? "'#333';" : "'" + hexo.config.tag_cloud.textColour + "';")
                                    + " TagCanvas.textHeight = " + (!(hexo.config.tag_cloud && hexo.config.tag_cloud.textHeight) ? "15;" : hexo.config.tag_cloud.textHeight + ";")
                                    + " TagCanvas.outlineColour = " + (!(hexo.config.tag_cloud && hexo.config.tag_cloud.outlineColour) ? "'#E2E1C1';" : "'" + hexo.config.tag_cloud.outlineColour + "';")
                                    + " TagCanvas.outlineMethod = 'block';"
                                    + " TagCanvas.maxSpeed = 0.03;"
                                    + " TagCanvas.minBrightness = 0.2;"
                                    + " TagCanvas.depth = 0.92;"
                                    + " TagCanvas.pulsateTo = 0.6;"
                                    + " TagCanvas.initial = [0.1,-0.1];"
                                    + " TagCanvas.decel = 0.98;"
                                    + " TagCanvas.reverse = true;"
                                    + " TagCanvas.hideTags = false;"
                                    + " TagCanvas.shadow = '#ccf';"
                                    + " TagCanvas.shadowBlur = 3;"
                                    + " TagCanvas.weight = false;"
                                    + " TagCanvas.imageScale = null;"
                                    + " TagCanvas.fadeIn = 1000;"
                                    + " TagCanvas.clickToFront = 600;"
                                    + " TagCanvas.Start('resCanvas');"
                                    + " TagCanvas.tc['resCanvas'].Wheel(false)"
                                + "} catch(e) {"
                                    + " console.log(e);"
                                    + " document.getElementById('myCanvasContainer').style.display = 'none';"
                                + " }"
                            + " });";
    fs.writeFile(tagcloudPubPath, tagCloudJsContent);
	log.info("--- hexo-tag-cloud 插件运行完毕 ---");
});

@MikeCoder 希望尽快merge :)

ParticleX主题用不了标签云,不知道如何解决😭

Expected Behavior

网站资料卡下面应该会显示标签云

Actual Behavior

网站资料卡下面应该没有显示标签云

Steps to Reproduce the Problem

  1. 改json文件,再npm安装插件
    2.发现ParticleX主题layout文件夹里没有_widget文件夹,也没有tagcloud.ejs文件
    3.直接在layout文件夹里新建tagcloud.ejs文件,再复制粘贴那段替换的文件
    4.添加tag-cloudd的配置在根目录下的_config.yml文件
    5.命令终端hexo clean后再hexo g和hexo s
    6.发现资料卡下面并未生成标签云
    7.把tagcloud.ejs里的<%- url_for('/js/tagcloud.js') %>和<%- url_for('/js/tagcanvas.js') %>改成tagcloud.js和tagcanvas.js的绝对路径
    8.重新hexo clean,hexo g,hexo s后发现还是没有标签云出现
    9.所以不知道怎么解决,不知道是不是没有默认主题就用不了标签云😨

Specifications

操作系统是Windows11家庭版,Hexo用的主题是ParticleX

可以帮助我一下吗

我用的是Annie主题,这是我的Github我发现操作顺序都一致,文件也正常生成,但是耗子好像没有那个xml,提交也是hexo g与d分开提交的,大神可以帮帮我嘛,打扰您了

本地测试正常,部署到线上就失效

我看了一下tag的配置文件,路径指向的是src="/js/tagcloud.js"src="/js/tagcanvas.js",也就是说,这两个文件都是生成再js目录下的,但我本地成功在这个目录是没有找到这两个文件的,之后用find命令找到在/public/js/下,在hexo的.gitignore文件中,这个目录是被忽略的,线上就是在js目录下找不到对应的两个文件而加载失败的。
随后我又将tag的配置文件路径指向`src="/public/js/tagcloud.js",部署到线上仍然不行,请问如何解决?这个标签云真的很不错的说。

It doesn't work

Expected Behavior

All right.

Actual Behavior

It doesn't work.

Steps to Reproduce the Problem

  1. npm install hexo-tag-cloud --save
  2. hexo clean && hexo g && hexo s

Specifications

Here is my package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "4.2.0"
  },
  "dependencies": {
    "hexo": "^4.0.0",
    "hexo-deployer-git": "^2.1.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^2.2.0",
    "hexo-generator-index": "^1.0.0",
    "hexo-generator-searchdb": "^1.2.0",
    "hexo-generator-sitemap": "^2.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0",
    "hexo-tag-cloud": "^2.1.1"
  },
  "devDependencies": {}
}

debug.log
debug.log

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.