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

Import error when set dark theme of codeblock #1580

Closed
3 tasks done
HanielF opened this issue Nov 16, 2020 · 2 comments
Closed
3 tasks done

Import error when set dark theme of codeblock #1580

HanielF opened this issue Nov 16, 2020 · 2 comments
Labels

Comments

@HanielF
Copy link

HanielF commented Nov 16, 2020

Please follow this Issue template to provide relevant information, such as source code repositories, blog links, and screenshots, which will help us investigate.
请按照此 Issue 模版提供相关信息,例如源码仓库、博客链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist

  • I am using the latest version of NexT.
  • I have read the relevant documents of Hexo and NexT.
  • I have reviewed the latest Roadmap on GitHub and searched for current issues, which does not help me.

Expected behavior

The theme of codeblock will be set to the corresponding theme no matter in light or dark mode.

Actual behavior

  1. The codeblock render will behave correctly only when the theme of light mode is set to the dark mode theme, namely theme: light: atom-one-dark-reasonabl.
    Actually, I wanna to configure it in theme: dark: atom-one-dark-reasonabl.

  2. If the light theme and dark theme is the same, the error occurs:

ERROR Asset render failed: css/main.css
Error: /Users/hanielxx/Development/hanielxx.github.io/themes/next-geek/source/css/_common/scaffolding/highlight/highlight.styl:9:46
5| }
6|
7| if (hexo-config('darkmode')) {
8| @media (prefers-color-scheme: dark) {
9| @import hexo-config('highlight.dark.file') if (hexo-config('highlight.enable'));
---------------------------------------------------^
10| @import hexo-config('prism.dark') if (hexo-config('prism.enable'));
11| }
12| }

import loop has been found

The config of hightlight and prismjs:

highlight:
  enable: true
  line_number: true
  auto_detect: true
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

Config of codeblock as follows:

  codeblock:
    # Code Highlight theme
    # All available themes: https://theme-next.js.org/highlight/
    theme:
      light: atom-one-dark-reasonable
      dark: default
    prism:
      light: prism
      dark: prism-dark
    # Add copy button on codeblock
    copy_button:
      enable: true
      # Available values: default | flat | mac
      style: mac
      show_result: true
  • Links to demo site with this issue: N/A
  • Links to repository or source code of the blog: N/A

Steps to reproduce the behavior

  1. set the config of highlight and prismjs as follows:
highlight:
  enable: true
  line_number: true
  auto_detect: true
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''
  1. set the config of codeblock as follows:
  codeblock:
    # Code Highlight theme
    # All available themes: https://theme-next.js.org/highlight/
    theme:
      light: atom-one-dark-reasonable
      dark: atom-one-dark-reasonable
    prism:
      light: prism
      dark: prism-dark
    # Add copy button on codeblock
    copy_button:
      enable: true
      # Available values: default | flat | mac
      style: mac
      show_result: true
  1. As for the question 2, the config of codeblock:
  codeblock:
    # Code Highlight theme
    # All available themes: https://theme-next.js.org/highlight/
    theme:
      light: atom-one-dark-reasonable
      dark: atom-one-dark-reasonable
    prism:
      light: prism
      dark: prism-dark
    # Add copy button on codeblock
    copy_button:
      enable: true
      # Available values: default | flat | mac
      style: mac
      show_result: true

Environment Information

Node.js and NPM Information

v14.13.1 
6.14.8

Package dependencies Information

hexo-site@0.0.0 *****************
├── balloon-css@1.2.0
├── gitalk@1.7.0
├── hexo@4.2.1
├── hexo-autonofollow@1.0.1
├── hexo-baidu-url-submit@0.0.6
├── hexo-deployer-git@2.1.0
├── hexo-generator-archive@1.0.0
├── hexo-generator-category@1.0.0
├── hexo-generator-feed@3.0.0
├── hexo-generator-index@2.0.0
├── hexo-generator-search@2.4.1
├── hexo-generator-searchdb@1.3.3
├── hexo-generator-sitemap@2.1.0
├── hexo-generator-tag@1.0.0
├── hexo-neat@1.0.9
├── hexo-pagination@1.0.0
├── hexo-renderer-ejs@1.0.0
├── hexo-renderer-marked@3.3.0
├── hexo-renderer-stylus@2.0.1
├── hexo-server@2.0.0
├── hexo-word-counter@0.0.2
├── hexo-wordcount@6.0.1
├── lodash@4.17.20
├── lunr@2.3.9
└── nprogress@0.2.0

Hexo Configuration

It was showed above.

NexT Configuration

It was showed above.

Other Information

@HanielF HanielF added the Bug label Nov 16, 2020
@welcome
Copy link

welcome bot commented Nov 16, 2020

Thanks for opening this issue, maintainers will get back to you as soon as possible!

@HanielF
Copy link
Author

HanielF commented Nov 16, 2020

OK, Thanks.

@HanielF HanielF closed this as completed Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant