hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.48k stars 4.86k forks source link

hexo new post makes a wrong markdown file #4834

Closed pshdev1030 closed 2 years ago

pshdev1030 commented 2 years ago

Check List

Please check followings before submitting a new issue.

Expected behavior

If I make new post to using hexo new post "title", The expected result is

title: 'title'
date: 'date'
category: ''
tags: []
description: ''
toc: true

Actual behavior

But the actual result is

---
title:
  '[object Object]': null
date:
  '[object Object]': null
tags: []
category: ''
description: ''
toc: true
---

How to reproduce?

Is the problem still there under "Safe mode"?

Yes

Environment & Settings

Node.js & npm version(node -v && npm -v)

$ node -v && npm -v
v14.15.5
7.6.0

Your site _config.yml (Optional)

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

# Site
title: 개발 블로그
subtitle: ""
description: 프론트엔드를 공부하고 있습니다.
keywords:
author: 박성현
language: ko
timezone: "Asia/Seoul"

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://pshdev1030.github.io
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: false
  tab_replace: ""
  wrap: true
  hljs: false
prismjs:
  enable: false
  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: icarus
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo: https://github.com/pshdev1030/pshdev1030.github.io
  branch: master
  name: 박성현
  email: pshdev1030@gmail.com
robotstxt:
  useragent: "*"
  allow:
    - /
  sitemap: https://pshdev1030.github.io/sitemap.xml
nofollow:
  enable: true
  exclude:
feed:
  type: rss2
  path: rss2.xml
  limit: 20
sitemap:
  path: sitemap.xml
  tag: false
  category: false

Your theme _config.yml (Optional)

Hexo and Plugin version(npm ls --depth 0)

hexo-site@0.0.0 C:\Users\SDPark-pc\Desktop\REACT\blog\hexo
├── bulma-stylus@0.8.0
├── hexo-autonofollow@1.0.1
├── hexo-component-inferno@0.13.0
├── hexo-deployer-git@3.0.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-robotstxt@0.2.0
├── hexo-generator-seo-friendly-sitemap@0.2.1
├── hexo-generator-tag@1.0.0
├── hexo-renderer-ejs@1.0.0
├── hexo-renderer-inferno@0.1.3
├── hexo-renderer-marked@4.1.0
├── hexo-renderer-stylus@2.0.1
├── hexo-server@2.0.0
├── hexo-theme-landscape@0.0.3
├── hexo@5.4.0
├── inferno-create-element@7.4.11
└── inferno@7.4.11

Your package.json package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server",
    "start": "hexo clean & hexo generate --deploy & git add . & git commit -m "
  },
  "hexo": {
    "version": "5.4.0"
  },
  "dependencies": {
    "bulma-stylus": "^0.8.0",
    "hexo": "^5.0.0",
    "hexo-autonofollow": "^1.0.1",
    "hexo-component-inferno": "^0.13.0",
    "hexo-deployer-git": "^3.0.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-robotstxt": "^0.2.0",
    "hexo-generator-seo-friendly-sitemap": "^0.2.1",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-inferno": "^0.1.3",
    "hexo-renderer-marked": "^4.0.0",
    "hexo-renderer-stylus": "^2.0.0",
    "hexo-server": "^2.0.0",
    "hexo-theme-landscape": "^0.0.3",
    "inferno": "^7.4.11",
    "inferno-create-element": "^7.4.11"
  }
}

Others

This error is occured after 21.12.02. I install 2 plugin at 21.12.02. That is hexo-all-minifier and hexo-filter-cleanup and There are any Changes.

The same problem continues to occur even if i delete the plugin and proceed.

How can i solve this error? I have modified the source code of the blog to public. https://github.com/pshdev1030/hexo

Thank you!

SukkaW commented 2 years ago

What did you put under your scaffolds folders?

pshdev1030 commented 2 years ago

What did you put under your scaffolds folders? There are three files in scaffolds folders

  1. ./scaffolds/draft

    ---
    title: {{ title }}
    tags:
    ---
  2. ./scaffolds/draft

    ---
    title: { { title } }
    date: { { date } }
    toc: true
    ---
  3. ./scaffolds/post I revised it for temporary use.

before

---
title: { { title } }
date: { { date } }
toc: true
---

after

---
title: ""
date: 2021-11-26 17:15:02
tags: []
category: ""
description:
toc: true
---

Thank you for the comments!

suzhihao commented 2 years ago

{ { title } } should be {{ title }}

pshdev1030 commented 2 years ago

thank you!