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

代码高亮和首页部分内容预览问题 #9

Closed
baagod opened this issue Oct 25, 2018 · 2 comments
Closed

代码高亮和首页部分内容预览问题 #9

baagod opened this issue Oct 25, 2018 · 2 comments

Comments

@baagod
Copy link

baagod commented Oct 25, 2018

这是个很漂亮的主题,很喜欢,不过我碰到两个问题,能教教我吗?

代码好像不能设置高亮?不知道怎么设置或在哪里可以设置?因为我不会定制 html,所以你能指引一下吗?
a3390b92-096c-4059-9561-311492354962

第二个是的内容预览部分如果碰到代码,显示效果就不太好了:
8330cc61-2cf0-4a6e-80bf-644e9089ceea

@darkduckgo
Copy link

@sumimakito 作者是已经不维护这个主题了么, 如果是的话可以在README顶部说一声吧.
然后问下接收PR么? 打搅了

@sumimakito
Copy link
Owner

由于这一段时间一直很忙,没有空修 Bug,关于代码高亮的问题可以使用 hexo-prism-plugin,这个依赖已在 README 文档中补上了。

可以使用 yarn add hexo-prism-pluginnpm install --save hexo-prism-plugin 安装。

可以参考 README 或以下内容对主配置进行修改:

theme: typography

highlight:
  enable: false # we'll use the prism plugin instead

plugin:
  - hexo-prism-plugin
  # ... other plugins

# For syntax highlighting
prism_plugin:
  mode: 'preprocess'
  theme: 'default'
  line_number: true 

另摘要部分确实存在截断代码的问题,修复后代码块 <pre></pre> 将不会出现在摘要中。

感谢支持。

journey-ad pushed a commit to journey-ad/hexo-theme-typography that referenced this issue Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants