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

Why codeblocks cannot show code type (code language name)? #642

Closed
3 tasks done
Zhaopudark opened this issue Apr 26, 2023 · 4 comments
Closed
3 tasks done

Why codeblocks cannot show code type (code language name)? #642

Zhaopudark opened this issue Apr 26, 2023 · 4 comments
Labels

Comments

@Zhaopudark
Copy link

Issue Checklist

Expected behavior

I want any code block shows the language name as many practices of Next examples, e.g.:

image

in pinlyu's post https://pinlyu.com/posts/30/, where the language name bash is shown on code blocks.

I do not know whether Next does not support this feature or if it is just a bug I encountered.

Actual behavior

  • Links to demo site with this issue: https://little-train.com/posts/1757b5a2.html

  • Links to repository or source code of the blog:

      ```yaml
      path:
        Windows: E:/Datasets/BraTS/BraTS2022
        Linux: /mnt/e/Datasets/BraTS/BraTS2022
      ```
      Or, it can be regarded as a nested `dict` in Python as:
      
      ```python
      multiple_paths = {
          'path':{
              'Windows':'E:/Datasets/BraTS/BraTS2022',
              'Linux':'/mnt/e/Datasets/BraTS/BraTS2022'
          },
      }
      ```
    
  • Screenshots: the following is the screenshot that no language name shows

image

Steps to reproduce the behavior

hexo clean && hexo g

Node.js and NPM Information

v20.0.0
9.6.3

Package dependencies Information

$ npm ls --depth 0
[email protected] C:\Users\xxx\work\Blog
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Hexo Configuration

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: "xxxxx"
subtitle: "xxxxx"
description: "xxxx"
keywords: 
  - xx
  - xxxx
author: xx xxxx
language: # 指定语言,会影响主题显示的语言,按需修改
  - zh-CN
  - en  
timezone: Asia/Shanghai

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://little-train.com
#设置永久链接
permalink: posts/:abbrlink.html  # 此处可以自己设置,也可以直接使用 :/abbrlink
# permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: true
  tab_replace: ''
  wrap: true
  hljs: false 
prismjs:
  enable: true
  preprocess: true
  line_number: true
  tab_replace: ''



# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:


# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next  


symbols_count_time:
  symbols: true
  time: true
  total_symbols: true
  total_time: true
  exclude_codeblock: false
  wpm: 275
  suffix: "mins."

NexT Configuration

cache:
  enable: false

# Schemes
# scheme: Muse
# scheme: Mist
# scheme: Pisces
scheme: Gemini

menu:
  home: / || fa fa-home
  about: /about/ || fa fa-user
  tags: /tags/ || fa fa-tags
  categories: /categories/ || fa fa-th
  archives: /archives/ || fa fa-archive
  #schedule: /schedule/ || fa fa-calendar
  sitemap: /sitemap.xml || fa fa-sitemap
  commonweal: /404/ || fa fa-heartbeat

# Enable / Disable menu icons / item badges.
menu_settings:
  icons: true
  badges: true

social_icons:
  enable: true
  icons_only: false
  transition: true

tag_icon: true

related_posts:
  enable: true
  icon: fa fa-signs-post

mobile_layout_economy: true


codeblock:
  # Code Highlight theme
  # All available themes: https://theme-next.js.org/highlight/
  theme:
    light: default
    dark: stackoverflow-dark
  prism:
    light: prism
    dark: prism-dark
  copy_button:
    enable: true
    style: mac

index_with_subtitle: true


math:
  every_page: false
  mathjax:
    enable: true
    tags: ams
  katex:
    enable: false
    copy_tex: false

mediumzoom: true

pace:
  enable: true
  color: blue
  theme: minimal

canvas_ribbon:
  enable: true

Other Information

No response

@Zhaopudark Zhaopudark added the Bug Something isn't working label Apr 26, 2023
@welcome
Copy link

welcome bot commented Apr 26, 2023

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

@stevenjoezhang
Copy link
Member

There is no such feature in theme NexT. IMHO, the language of the code is obvious according to the context.

@Zhaopudark
Copy link
Author

@stevenjoezhang Thanks for the answer. I got it. It's not a bug.😁

@stevenjoezhang stevenjoezhang added Question and removed Bug Something isn't working labels May 23, 2023
@stevenjoezhang
Copy link
Member

There is another feature request opened here; feel free to join the discussion: #780

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

2 participants