ZEROKISEKI / hexo-theme-cube

a theme for hexo
MIT License
56 stars 23 forks source link

您的tags页可以分享一下吗? #9

Open m9rco opened 6 years ago

m9rco commented 6 years ago

刚刚看了下tags 页是没有的

m9rco commented 6 years ago

另外我的代码 高亮好像不起作用呢? 我同样用了您的gulp方式来对主题做修改

m9rco commented 6 years ago

![Uploading image.png…]()

m9rco commented 6 years ago

另外,感觉您对新作,就http://sora3.coding.me/archives/ 很酷炫呢,要是把header 换到旧的这个上 应该很酷吧

m9rco commented 6 years ago

还有一个 favicon 没地方设置呢

ZEROKISEKI commented 6 years ago

在车上没法解答,先做个bug标记一下,你说的tags页没有是指/tags路径没有吗?如果是的话可以看下有没有hexo new page tags生成tags/index.md

m9rco commented 6 years ago

是的,但是我生成的 没有样式呢,想要你的样式看看,你是放coding里的吗?可是没找着呢

m9rco commented 6 years ago

依然没找着在哪设置的,另外 ,可以参考一下您的配置吗?

ZEROKISEKI commented 6 years ago

如果能生成tags页面的话,应该是有样式的, 样式的css文件是在source/sass/_archive.scss里面,我的示例页面的配置其实差不多的。。。,不过还是贴一下,另外,关于代码高亮的问题,应该是可以的,只要改了对应gulp文件夹里面的变量重新生成应该是有的,


theme: cube

# background display for mobile, not for pc
header:
  background: http://cube-1252774894.cosgz.myqcloud.com/background.jpg
  # both pc and mobile required title(make it the same as your hexo site _config.yml's title)
  title: senrenbankaの部落格

# background display for pc
# you can use url or path relative
# `background: background.png` refers to the path "source/images/background.png"
background: http://cube-1252774894.cosgz.myqcloud.com/background.jpg

# the background image width and height (you can see your image file to get them)
width: 1920
height: 1080

# this variable is used to locate your background
# for example, if you want to locate display your background from top
# you just need to type it: position: 0
position: 300

# this variable is used to make the background header being fuzzy
# if your do not need the filter blur on the top, make it empty, it means that: `blur: `
blur: 5

# yeah, it is just to make your avatar rounded(true) or not(false)
avatar: true

menu:
  # index
  - title: 首页
    icon: home
    url: /
  # archives
  - title: 归档
    icon: archive
    url: archives
  # categories
  - title: 分类
    icon: categories
    url: categories
  # tags
  - title: 标签
    icon: tags
    url: tags
  # about-me
  - title: 关于我
    icon: about
    url: about-me

sidebar:
  links:
    - title: GitHub
      url: https://github.com/ZEROKISEKI
      # icon can be url or path
      icon: http://cube-1252774894.cosgz.myqcloud.com/links/GitHub.png
    - title: Coding
      url: https://coding.net/u/SORA1
      icon: http://cube-1252774894.cosgz.myqcloud.com/links/Coding.png
    - title: SF社区
      url: https://segmentfault.com/u/aonosora
      icon: http://cube-1252774894.cosgz.myqcloud.com/links/SF.png
    - title: 开发者头条
      url: https://toutiao.io/u/148070
      icon: http://cube-1252774894.cosgz.myqcloud.com/links/开发者头条.png
  friend_links:
    - title: 罗大佬
      url: https://blog.micblo.com/
      # icon only url
      icon: http://cube-1252774894.cosgz.myqcloud.com/friend_links/micblo.png
    - title: DIYgod
      url: https://www.anotherhome.net/
      icon: http://cube-1252774894.cosgz.myqcloud.com/friend_links/DIYgod.jpg
    - title: 咪西西の部落格
      url: https://aonosora.com/

# only path, refer to source/images
friend_links: friend_links.jpg

widgets:
- search
- author
- music
- recent_posts
- categories
- tagcloud
- links
- friend_links

# when you want to use the search, firstly make the `search: true`,
# then you should install hexo-generator-json-content
# run `npm install hexo-generator-json-content -save` (in your hexo directory)
search: true

# supported by DIYgod awesome project APlayer, you can find more on https://github.com/MoePlayer/APlayer
# and you can see the doc on https://aplayer.js.org/docs/#/

# mode can be `random`, `single`, `circulation`(loop), `order`(no loop)
# if you have the lrc file, make the `showlrc` true, else make it false
music_setting:
  auto: false
  mode: circulation
  narrow: false
  mutex: true
  showlrc: true
  theme:
  preload: auto
  maxHeight: 513px

# if you use path, make sure your hexo _config.yml has set the correcting url
# url: http://www.yoururl.com/path/to/.mp3 or .lrc or ...
# you'd better place your music and image, lrc to another site, and use url instead of path
# if you don't want to use this widget, just make that `music: `
music:
  - title: Dear friends
    author: TRIPLANE
    source: http://cube-1252774894.cosgz.myqcloud.com/music/source/TRIPLANE - Dear friends.mp3
    lrc: http://cube-1252774894.cosgz.myqcloud.com/music/lrc/Dear friends - TRIPLANE.lrc
    image: http://cube-1252774894.cosgz.myqcloud.com/music/image/TRIPLANE - Dear friends.jpg
  - title: Butter-Fly
    author: 和田光司
    source: http://cube-1252774894.cosgz.myqcloud.com/music/source/和田光司 - Butter-Fly (ピアノヴァージョン).mp3
    lrc: http://cube-1252774894.cosgz.myqcloud.com/music/lrc/Butter-Fly (ピアノヴァージョン) - 和田光司.lrc
    image: http://cube-1252774894.cosgz.myqcloud.com/music/image/和田光司 - Butter-Fly (ピアノヴァージョン).jpg
  - title: 宵闇花火
    author: 葉月ゆら
    source: http://cube-1252774894.cosgz.myqcloud.com/music/source/葉月ゆら - 宵闇花火.mp3
    lrc: http://cube-1252774894.cosgz.myqcloud.com/music/lrc/宵闇花火 - 葉月ゆら.lrc
    image: http://cube-1252774894.cosgz.myqcloud.com/music/image/葉月ゆら - 宵闇花火.jpg

# before using the comment
# make use you know how to set the params
comment:
  # your disqus_shortname
  disqus:
  changyan:
    appid:
    conf:
  youyan:
  # gitment: https://github.com/imsun/gitment
  # make sure you know how to set it
  gitment:
    owner:
    repo:
    oauth:
      client_id:
      client_secret:

# some setting about comment module
comment_setting:
  changyan:
    hide_notice: true

analytics:
  baidu:
  google:
ZEROKISEKI commented 6 years ago

另外,关于favicon的问题,你可以在站点目录的source文件夹下面放一个favicon.ico试试(强制刷新)

m9rco commented 6 years ago

好的 ,麻烦您,能不能看下主目录下的配置文件啊,我怀疑是那里导致 tag 等分页出不来。

m9rco commented 6 years ago

我的高亮是直接没有高亮,就白版文字,另外,我指的tag是地址栏的/tag,我希望它是/themes/cube-generator/layout/tag.ejs才是,而不是跑/source 下去找

m9rco commented 6 years ago

另外 您的图标放在哪里的呀 ,找了好久没找到 223333

ZEROKISEKI commented 6 years ago

能看一下hexo g产生的结果? 另外有没有示例站点可以提供,我看一下高亮是怎么回事,图标的话,如果你是要找代码的话,是没有的,因为hexo默认只要你在站点目录的source下放一个favicon.ico,就会用这个作为网站图标,比如我这个http://sora1.coding.me/favicon.ico

m9rco commented 6 years ago

https://360kids.github.io/2018/07/07/httpCode/ 比如这个 它的高亮就 有点问题

ZEROKISEKI commented 6 years ago

看了一下,这个站点就/tags是无法访问的, 其他的单个tag比如https://360kids.github.io/tags/intellectual/是可以访问,sora1.coding.me的代码目录如下所示,是有tags/index.html的:

截图1

站点目录的_config.yml并没有做任何的配置,只是简单声明了theme:cube而已,你看下你的站点的source/tags/index.md是否有指定渲染的路径(layout/tags.ejs),像下面这样:

截图1

然后高亮的问题我看了一下,是代码渲染成html元素使用了figure元素,导致highlight.js无法渲染,正常的pre>code是可以渲染的,这个问题我看下能不能让highlight.js对figure元素做一下渲染

m9rco commented 6 years ago

会提示page.posts 里没有内容。仅有的一篇文章也是有tags的,我想我应该看看手册

/archive.ejs:16
    14|         <% } else { %>
    15|         <ul class="posts">
 >> 16|             <% page.posts.forEach(function (post) { %>
    17|             <li class="post">
    18|                 <a href="<%- url_for(post.path) %>"><%= post.title %></a>
    19|             </li>
ZEROKISEKI commented 6 years ago

这个下面的错误描述是什么(比如什么xxx undefined之类的)?

m9rco commented 6 years ago

page.posts 的值为undefined

m9rco commented 6 years ago

这个解决了,发现其实我克隆下来的 和你仓库的不一致 ,我复制了一份就好啦 ,谢谢您

m9rco commented 6 years ago

对啦 , 您对那个图标是在哪弄的呀,代码高亮我可以怎样解决呢?

ZEROKISEKI commented 6 years ago

图标的话有两种,一种是直接在站点/source放一个favicon.ico,hexo自动默认那个为图标,另一种是用hexo的辅助函数:


<%- favicon_tag(path) %>

那个path可以在主题/config.yml设置,比如设置一个favicon: xxx, 然后将上面那句话放到/layout/_partial/head.ejs中:


<%- favicon_tag(theme.favicon) %>

关于代码高亮的,这个我目前在改,我看看能不能让highlight.js渲染figure元素

m9rco commented 6 years ago

哇哇哇 ,感谢您

m9rco commented 6 years ago

呃呃 ,对了,您header 图标是在哪设置的呢?看起来是font awesome,但好像设置起来没什么用

ZEROKISEKI commented 6 years ago

如果说的是上面的menu栏的图标的话, 是font awesome,但是去掉前面的fa前缀,比如fa fa-home在menu只需填home即可, 如果是header背景图的话,在_config.yml应该有对应的说明了

ghost commented 5 years ago

上面的图没有了,不知道您这个tags页面是怎么解决的,我也是找不到这个页面 除了这个还有categories页面和about-me页面,都是这种情况呢。。。

picpo commented 5 years ago

刚刚看了下tags 页是没有的

试试 layout: tags