Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

评论处的小BUG #22

Closed
yqw1218 opened this issue Feb 26, 2015 · 2 comments
Closed

评论处的小BUG #22

yqw1218 opened this issue Feb 26, 2015 · 2 comments

Comments

@yqw1218
Copy link
Contributor

yqw1218 commented Feb 26, 2015

评论处的小BUG

模板文件 layout/post.swigdiv#disqus_thread 没有父容器,应该将 div#comments.comments 放在 {% if page.comments %} 下方。

{% if page.comments %}
    {% if (config.duoshuo and config.duoshuo.shortname) or config.duoshuo_shortname %}
      <div class="comments" id="comments">
        <div class="ds-thread" data-thread-key="{{ page.path }}"
             data-title="{{ page.title }}" data-url="{{ page.permalink }}">
        </div>
      </div>
    {% elseif config.disqus_shortname %}
      <div id="disqus_thread">
        <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
      </div>
    {% endif %}
 {% endif %}

改为

{% if page.comments %}
     <div class="comments" id="comments">
     {% if (config.duoshuo and config.duoshuo.shortname) or config.duoshuo_shortname %}
        <div class="ds-thread" data-thread-key="{{ page.path }}"
             data-title="{{ page.title }}" data-url="{{ page.permalink }}">
        </div>
    {% elseif config.disqus_shortname %}
      <div id="disqus_thread">
        <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
      </div>
    {% endif %}
    </div>
{% endif %}

简化 bower

Bower 令人诟病的一点是它下载了整个源码,而实际可用文件大概也就 min.cssmin.js。所幸后来找到了 main-bower-files,结合 Gulp 只将所需文件拷贝到静态资源目录中,例如从 bower_components 拷贝到 vendor ,同时 ignore bower_components。使用例子可见 bower.jsongulpfile.js

使用了一下确实能起到精简文件的作用,可以尝试 : )

@iissnan
Copy link
Owner

iissnan commented Feb 27, 2015

👍

@iissnan
Copy link
Owner

iissnan commented Feb 27, 2015

对于 Hexo 主题,Bower package 的简化好像没有太大作用,因为里面的大多数文件还是必须的。

@iissnan iissnan closed this as completed Mar 5, 2015
iamsea pushed a commit to iamsea/hexo-theme-next that referenced this issue Jan 15, 2018
Fix misleading description of gitment
wangpei72 pushed a commit to wangpei72/hexo-theme-next that referenced this issue Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants