iissnan / hexo-theme-next

Elegant theme for Hexo.
http://notes.iissnan.com
MIT License
15.87k stars 3.62k forks source link

The cloud tag and the running time of the site doesn't show up at the sidebar #2121

Closed ComplicatedPhenomenon closed 6 years ago

ComplicatedPhenomenon commented 6 years ago

I agree and want to create new issue


Expected behavior

The running time showed once. But after I failed to install some other library with npm, it didn't show up again.

Actual behavior

The running time of the site and the cloud tag didn't show up at the sidebar

Steps to reproduce the behavior

  1. themes/next/layout/_custom/sidebar.swig
    <div id="days"></div>
    </script>
    <script language="javascript">
    function show_date_time(){
    window.setTimeout("show_date_time()", 1000);
    BirthDay=new Date("04/19/2017 06:00:00");
    today=new Date();
    timeold=(today.getTime()-BirthDay.getTime());
    sectimeold=timeold/1000
    secondsold=Math.floor(sectimeold);
    msPerDay=24*60*60*1000
    e_daysold=timeold/msPerDay
    daysold=Math.floor(e_daysold);
    e_hrsold=(e_daysold-daysold)*24;
    hrsold=setzero(Math.floor(e_hrsold));
    e_minsold=(e_hrsold-hrsold)*60;
    minsold=setzero(Math.floor((e_hrsold-hrsold)*60));
    seconds=setzero(Math.floor((e_minsold-minsold)*60));
    document.getElementById('days').innerHTML="WALL-E!"+daysold+"Days"+hrsold+"Hours"+minsold+"Minutes"+seconds+"Seconds";
    }
    function setzero(i){
    if (i<10)
    {i="0" + i};
    return i;
    }
    show_date_time();
    </script>
  2. themes/next/layout/_macro/sidebar.swig

            ....
          {# Blogroll #}
          {% if theme.links %}
            <div class="links-of-blogroll motion-element {{ "links-of-blogroll-" + theme.links_layout | default('inline') }}">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-{{ theme.links_icon | default('globe') | lower }}"></i>
                {{ theme.links_title }}
              </div>
              <ul class="links-of-blogroll-list">
                {% for name, link in theme.links %}
                  <li class="links-of-blogroll-item">
                    <a href="{{ link }}" title="{{ name }}" target="_blank">{{ name }}</a>
                  </li>
                {% endfor %}
              </ul>
            {% include '../_custom/sidebar.swig' %}
            </div>
          {% endif %}
         ...
    {% 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 %}
    

3.source/css/_custom/custom.styl

       // 自定义的侧栏时间样式
          #days {
               display: block;
               color: rgb(202, 225, 255);
               font-size: 13px;
              margin-top: 15px;
           }

Hexo Information

hexo: 3.5.0
hexo-cli: 1.0.4
os: Linux 4.13.0-36-generic linux x64
http_parser: 2.7.0
node: 6.11.4
v8: 5.1.281.108
uv: 1.9.1
zlib: 1.2.11
ares: 1.13.0
icu: 57.1
modules: 48
openssl: 1.0.2g

NexT Information

NexT Version:

v5.1.4

NexT Scheme:

[] All schemes
[x] Muse
[] Mist
[] Pisces
[] Gemini

Other Information

npm ls -depth 0
hexo-site@0.0.0 /home/wm/Playground/BuildABlogSite
├── hexo@3.5.0
├── hexo-deployer-git@0.3.1
├── hexo-generator-archive@0.1.5
├── hexo-generator-category@0.1.3
├── hexo-generator-feed@1.2.2
├── hexo-generator-index@0.2.1
├── hexo-generator-tag@0.2.0
├── hexo-inject@1.0.0 extraneous
├── hexo-math@3.0.4 extraneous
├── hexo-migrator-wordpress@0.1.2
├── hexo-renderer-ejs@0.3.1
├── hexo-renderer-kramed@0.1.4
├── hexo-renderer-marked@0.3.2
├── hexo-renderer-pandoc@0.2.2 extraneous
├── hexo-renderer-stylus@0.3.3
├── hexo-server@0.2.2
├── hexo-tag-cloud@2.0.9
└── hexo-wordcount@3.0.2

npm ERR! extraneous: hexo-inject@1.0.0 /home/wm/Playground/BuildABlogSite/node_modules/hexo-inject
npm ERR! extraneous: hexo-math@3.0.4 /home/wm/Playground/BuildABlogSite/node_modules/hexo-math
npm ERR! extraneous: hexo-renderer-pandoc@0.2.2 /home/wm/Playground/BuildABlogSite/node_modules/hexo-renderer-pandoc
ivan-nginx commented 6 years ago

v5.1.4

Version is not supported anymore, but seems issue actual for both versions.

But this part of code — is your custom code. Basic support can't resolve any issues with 3rd-party parts of code, sorry.

ivan-nginx commented 6 years ago

NexT is rebased into organization repo. If you want new feature, fix, or support, create new in NexT v6.x repo (desirable in English).

There is instructions on English or Chinese how to update from v5.1.x to v 6.x

You also may read this for details.