hexojs / hexo

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

every "hexo new" commands, it creates an empty folder in drafts/posts. #4248

Closed sj602 closed 4 years ago

sj602 commented 4 years ago

Check List

Please check followings before submitting a new issue.

Expected behavior

posts or drafts created only .md files

Actual behavior

posts or drafts created with a same name folder and .md files

How to reproduce?

hexo new draft(post) blabla

Environment & Settings

Node.js & npm version

npm: 6.14.4
node: v10.15.1

Your site _config.yml (Optional)

Your theme _config.yml (Optional)

# I STRONGLY recommend you to use a CDN to speed up loading of pages.
# There is many free CDN like Cloudinary or you can also use indirectly
# by using services like Google Photos.

# If you want to store images yourself, please read this guidelines:
# For users, if you only use this theme, put your images directly in `source/assets/images` folder
# But if you want to add local images, you can put your images directly in `source/assets/images` folder
# For developpers, if you modify this theme, put your images in `source/_images` folder and
# use grunt task `build` to synchronize assets

# Image directory (default: images)
image_dir: assets/images

# ---------------------
# Sidebar Configuration
# ---------------------

#    You can add groups of links and links much as you want
#    You just have to respect the indentation : `groups of links` -> `link` -> `title, link, icon`
#    E.g:
#    -------------
#    sidebar:                   # DON'T modify this variable name
#         menu:                 # Name of your groups of links (changeable)
#             home:             # Name of your link (changeable)
#                title: Home    # Title of your link displayed
#                url: /         # URL of the link. If the URL is internal, domain name is not necessary
#                icon: home     # CSS class names of the Font Awesome icon
#                               # Go to https://fontawesome.com/icons?d=gallery&m=free to find icons you want
sidebar:
  menu:
    home:
      title: global.home
      url: /
      icon: fa fa-home
    categories:
      title: global.categories
      url: /all-categories
      icon: fa fa-bookmark
    tags:
      title: global.tags
      url: /all-tags
      icon: fa fa-tags
    archives:
      title: global.archives
      url: /all-archives
      icon: fa fa-archive
    search:
      title: global.search
      url: "#search"
      icon: fa fa-search
      # `open-algolia-search` classes are used to open algolia search modal
      class: open-algolia-search
    about:
      title: global.about
      url: "#about"
      icon: fa fa-question
  author_links:
    github:
      title: global.github
      url: https://github.com/sj602
      icon: fab fa-github
    # stack_overflow:
    #     title: global.stack_overflow
    #     url: http://stackoverflow.com/users
    #     icon: fab fa-stack-overflow
    # twitter:
    #     title: global.twitter
    #     url: https://twitter.com/
    #     icon: fab fa-twitter
    facebook:
      title: global.facebook
      url: https://www.facebook.com/profile.php?id=100003671903401
      icon: fab fa-facebook
    # google_plus:
    #     title: global.google_plus
    #     url: https://plus.google.com/
    #     icon: fab fa-google-plus
    linked_in:
      title: global.linkedin
      url: https://www.linkedin.com/in/jinseon602/
      icon: fab fa-linkedin
    # mail:
    #     title: global.mail
    #     url: mailto: "tjswls602@gmail.com"
    #     icon: fa fa-envelope
  # rss:
  #   rss:
  #     title: global.rss
  #     url: /atom.xml
  #     icon: fa fa-rss

# --------------------
# Header configuration
# --------------------

# The link at the right of the header is customizable
# You can add a link (as an icon) at the right of the header instead of the author's gravatar image or author's picture.
# By default, author's gravatar or author's picture is displayed if `icon` is empty
# DON'T edit `header`, `right_link`, `url`, `icon` and `class` variable name
# E.g to display a shortcut to open algolia search window :
#     url: /#search
#     icon: "fa fa-search"
#     class: open-algolia-search
header:
  right_link:
    url: /#about
    icon:
    class:

# ------
# Author
# ------

# Your biography and your job is editable in each languages files in `languages` folder
author:
  email: tjswls602@gmail.com
  location: Seoul
  # Your profile picture located in folder `source/_images/` (development)
  # or in `source/assets/images/` (production)
  # or you can use an external url
  # Overwritten by your gravatar image if `gravatar_email` is filled
  picture: profile.png
  # Your Twitter username without the @. E.g : `tranquilpeak`
  # twitter:
  # Your personal google plus profile id, not your blog or business page id.
  # E.g : `+JohnDoe` or `123812884128439`
  # google_plus:
  # Your businnes google plus profile id. If not provided, personal will be used instead.
  # E.g : `+Tranquilpeak` or `123812884128439`
  # google_plus_business:

# -------------
# Customization
# -------------

# Define the behavior of the sidebar
# 1: Display extra large sidebar on extra large screen, large sidebar on large screen,
# medium sidebar on medium screen and header bar on small screen and
# extra large sidebar is swiped on extra large screen and large sidebar on all lower screen (default)
# 2: Display large sidebar on large screen, medium sidebar on medium screen and
# header bar on small screen and large sidebar is swiped
# 3: Display medium sidebar on large and medium screen and header bar on small screen and
# medium sidebar is swiped
# 4: Display header bar on all screens, extra large sidebar is swiped on extra large screen and
# large sidebar is swiped on all lower screens
# 5: Display header bar on all screens and large sidebar is swiped on large screen
# 6: Display header bar on all screens and medium sidebar is swiped
sidebar_behavior: 2
# Hide sidebar on all article page to let article take full width to improve reading, and
# enjoy wide images and cover images. (true: enable, false: disable)
clear_reading: true
# Display thumbnail image of each post on index pages (false: disabled, true: enabled)
thumbnail_image: true
# Display thumbnail image at the right of title in index pages (`right`, `left` or `bottom`)
# Set this value to `right` if you have old posts to keep the old style on them
# and define `thumbnailImagePosition` on a post to overwrite this setting
thumbnail_image_position: right
# Automatically select the cover image or the first photo from the gallery of a post if
# there is no thumbnail image as the thumbnail image
# Set this value to `true` if you have old posts that use the cover image or the first photo as the thumbnail image
# and set `autoThumbnailImage` to `false` on a post to overwrite this setting
auto_thumbnail_image: true
# Your blog cover picture. I STRONGLY recommend you to use a CDN to speed up loading of pages.
# There is many free CDN like Cloudinary or you can also use indirectly
# by using services like Google Photos.
# Current image is on AWS S3 and delivered by AWS CloudFront.
# Otherwise put your image in folder `source/_images/` (development)
# or in `source/assets/images/` if you can't or don't want to build the theme,
# and use relative url : `your-image.png`
cover_image: cover.jpg
# Your favicon located in folder `source/_images/` (development) or in `source/assets/images/` (production)
favicon: profile.png
# Display an image gallery at the end of a post which have photos variables (false: disabled, true: enabled)
image_gallery: true
# Pagination behavior of archive, category and tag pages (false: pagination disabled, true: pagination enabled)
archive_pagination: true
category_pagination: true
tag_pagination: true

# ---------------
# Comment systems
# ---------------

# Your Disqus shortname
disqus_shortname: sj602-github-io
# Your Gitment information
# Read https://github.com/imsun/gitment#get-started to setup Gitment
gitment:
  # Switch
  enable: false
  # Your Github ID (Github username):
  github_id: sj602
  # The repo to store comments:
  repo:
  # Your client ID:
  client_id:
  # Your client secret:
  client_secret:
  # The attribute of posts to use to link them to GitHub issues.
  # See all attributes: https://hexo.io/docs/variables#Page-Variables
  # `path` is recommended because the identifier needs to be unique and shorter than 50 characters.
  post_identifier: permalink

# Your Gitalk information
# Read https://github.com/gitalk/gitalk#options to set up Gitalk
gitalk:
  # Switch
  enable: false
  # Your client ID:
  client_id:
  # Your client secret:
  client_secret:
  # Your Github ID (Github username):
  owner:
  # The repo to store comments:
  repo:
  # The attribute of posts to use to link them to GitHub issues.
  # See all attributes: https://hexo.io/docs/variables#Page-Variables
  # `path` is recommended because the identifier needs to be unique and shorter than 50 characters.
  post_identifier: path
  # See all options: https://github.com/gitalk/gitalk#options
  options:
    language: "en"
    perPage: 10
    distractionFreeMode: false
    enableHotKey: true
    pagerDirection: "first"

# -------------------
# Integrated services
# -------------------

# Your Google analystics web property ID : UA-XXXXX-X
google_analytics_id: UA-91560310-2
# Your Baidu analystics web property ID : 9505a5af654a2478f93fd6c0ae4f687d
baidu_analytics_id:
# Your Gravatar email. Overwrite `author.picture` everywhere in the blog
gravatar_email:
# Your Facebook user ids used to connect your blog with your facebook user accounts (Facebook Insights). Separate ids with comma. e.g : 9830047,1003342
fb_admin_ids:
# Your Facebook app id used to connect your blog with your facebook app account (Facebook Insights). E.g : 9841307
fb_app_id:

# ---------------
# Sharing options
# ---------------

# Comment or uncomment lines to disable or enable sharing options.
# If you want to add a sharing option, follow these steps.
# E.g: with `foo_bar` social network:
#
# 1. Add a new option based on the other.
# ```
# sharing_options:
#     foo_bar:
#         icon: "fa-foo_bar"
#         url: "https://www.foo_bar.com/sharer/sharer.php?u={{post.permalink}}"
# ```
#
# 2. Add a line in the language file that you use (location: `themes/tranquilpeak/languages/`)
# ```
# global:
#     share_on_foo_bar: "Share on Foo Bar"
# ```
sharing_options:
  facebook:
    icon: "fab fa-facebook"
    url: "https://www.facebook.com/sharer/sharer.php?u={{post.permalink}}"
#   twitter:
#     icon: "fab fa-twitter"
#     url: "https://twitter.com/intent/tweet?text={{post.permalink}}"
#   google_plus:
#     icon: "fab fa-google-plus"
#     url: "https://plus.google.com/share?url={{post.permalink}}"
# Business Social Networks
#    linkedin:
#        icon: "fab fa-linkedin"
#        url: "https://www.linkedin.com/shareArticle?mini=true&url={{post.permalink}}"
#    xing:
#        icon: "fab fa-xing"
#        url: "https://www.xing.com/spi/shares/new?url={{post.permalink}}"
# Asian social networks
#    weibo:
#        title: "Weibo"
#        icon: "fab fa-weibo"
#        url: "http://service.weibo.com/share/share.php?&title={{post.permalink}}"
#    qq:
#        title: "QQ"
#        icon: "fab fa-qq"
#        url: "http://connect.qq.com/widget/shareqq/index.html?url={{post.permalink}}&title={{post.title}}"
#    qzone:
#        title: "Qzone"
#        icon: "fa fa-star"
#        url: "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={{post.permalink}}"
#    renren:
#        title: "Renren"
#        icon: "fab fa-renren"
#        url: "http://widget.renren.com/dialog/share?resourceUrl={{post.permalink}}"
# Russian social networks
#    vk:
#        title: "VK"
#        icon: "fab fa-vk"
#        url: "https://vk.com/share.php?url={{post.permalink}}"
#    odnoklassniki:
#        title: "Odnoklassniki"
#        icon: "fab fa-odnoklassniki"
#        url: "https://connect.ok.ru/offer?url={{post.permalink}}"

sitemap:
  path: sitemap.xml

nofollow:
  enable: true

# robots.txt
robotstxt:
  User-agent: "*"
  Allow: /
  Sitemap: /sitemap.xml

algolia:
  appId: ""
  apiKey: ""
  adminApiKey: ""
  chunkSize: 5000
  indexName: "blog"
  fields:
    - title
    - tags
    - date
    - categories
    - excerpt
    - excerpt:strip
    - content:strip:truncate,0,500
    - permalink
    - thumbnailImageUrl

# Busuanzi Counter
busuanzi:
  enabled: true
  method: pv # method: uv

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

hexo-site@0.0.0 /Users/seonjin/Documents/projects/sj602.github.io
├── hexo@4.2.0
├── hexo-algoliasearch@0.4.2
├── hexo-auto-canonical@0.1.1
├── hexo-autonofollow@1.0.1
├── hexo-deployer-git@2.1.0
├── hexo-generator-archive@1.0.0
├── hexo-generator-category@1.0.0
├── hexo-generator-feed@2.2.0
├── hexo-generator-index@1.0.0
├── hexo-generator-json-content@4.2.3
├── hexo-generator-robotstxt@0.2.0
├── hexo-generator-seo-friendly-sitemap@0.0.25
├── hexo-generator-tag@1.0.0
├── hexo-related-popular-posts@4.0.0
├── hexo-renderer-ejs@1.0.0
├── hexo-renderer-marked@2.0.0
├── hexo-renderer-stylus@1.1.0
├── hexo-server@1.0.0
├── hexo-symbols-count-time@0.7.1
└── hexo-wordcount@6.0.1

Your package.json package.json

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

# Site
title: Jinko the Snokl
subtitle: ""
description: "A Voyage to Freedom"
keywords:
author: Jin Seon
language: ko
timezone: "Asia/Seoul"

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://sj602.github.io
root: /
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: true
relative_link: false
future: true
highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace: ""
  wrap: true
  hljs: false

# 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
## Use post's date for updated date unless set in front-matter
use_date_for_updated: false

# Pagination
## Set per_page to 0 to disable pagination
per_page: 1
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: tranquilpeak

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:sj602/sj602.github.io.git
  branch: master

feed:
  type: atom
  path: atom.xml
  limit: 20

markdown:
  render:
    html: true
    xhtmlOut: false
    breaks: true
    linkify: true
    typographer: true
    quotes: "“”‘’"
  plugins:
    - markdown-it-abbr
    - markdown-it-footnote
    - markdown-it-ins
    - markdown-it-sub
    - markdown-it-sup

algolia:
  appId: ""
  apiKey: ""
  adminApiKey: ""
  chunkSize: 5000
  indexName: "blog"
  fields:
    - title
    - tags
    - date
    - categories
    - excerpt
    - excerpt:strip
    - content:strip:truncate,0,500
    - permalink
    - thumbnailImageUrl

# robots.txt
robotstxt:
  User-agent: "*"
  Allow: /
  Sitemap: /sitemap.xml

# sitemap auto generator
sitemap:
  path: sitemap.xml

symbols_count_time:
  symbols: true
  time: true
  total_symbols: true
  total_time: true
  exclude_codeblock: false
  awl: 4
  wpm: 275
  suffix: "분"

Others

stevenjoezhang commented 4 years ago

Hello, there is a discussion about it: #3974 I'm closing this issue. Please join the discussion there :)