Skip to content

"hexo g" doesn't copy dir in source/_posts/ to public/post/ #5671

@youyeyejie

Description

@youyeyejie

Check List

  • I have already read Docs page & Troubleshooting page.
  • I have already searched existing issues and they are not help to me.
  • I examined error or warning messages and it's difficult to solve.
  • I am using the latest version of Hexo. (run hexo version to check)
  • My Node.js is matched the required version.

Expected behavior

运行hexo g时,位于source/_post/下的文件夹下的内容不会被复制到public/post/ 下,即
when I run hexo g, the content under the folder under source/_post/ will not be copied to public/post/, i.e.

source/
  |-_posts/
        |-test.md
        |-test/
             |-1.png

在“hexo g”之后,我希望它会是
after hexo g ,I hope it will be

public
  |-post/
        |-test/
             |-index.html
             |-1.png

Actual behavior

在“hexo g”之后,实际上是
after hexo g , acctually it's

public
  |-post/
        |-test/
             |-index.html

只有运行 “hexo cl && hexo g" 才能实现预期效果
The desired effect can only be achieved by running hexo cl & & hexo g

How to reproduce?

  1. npm install hexo-asset-img --save
  2. hexo new "test"
  3. touch source/_posts/test/1.png
  4. hexo g

Is the problem still there under Safe mode?

yes

Your Node.js & npm version

v22.17.0
11.4.2

Your Hexo and Plugin version

Your package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "7.3.0"
  },
  "dependencies": {
    "font-awesome": "^4.7.0",
    "hexo": "^7.3.0",
    "hexo-asset-img": "^1.2.0",
    "hexo-deployer-git": "^4.0.0",
    "hexo-filter-github-emojis": "^3.0.5",
    "hexo-filter-mermaid-diagrams": "^1.0.5",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-index": "^4.0.0",
    "hexo-generator-search": "^2.4.3",
    "hexo-generator-sitemap": "^3.0.1",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-pandoc": "^0.5.0",
    "hexo-renderer-pug": "^3.0.0",
    "hexo-renderer-stylus": "^3.0.1",
    "hexo-server": "^3.0.0",
    "hexo-shiki-plugin": "^1.0.27",
    "hexo-theme-landscape": "^1.0.0",
    "hexo-wordcount": "^6.0.1"
  }
}

Your site's _config.yml (Optional)

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

# Site
title: 有野野芥的博客
subtitle: "YYYJ's Blog"
description: '有野野芥的博客'
keywords:
  - yyyj
  - YYYJ
  - youyeyejie
  - 有野野芥
author: youyeyejie
language: zh-CN
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://youyeyejie.github.io
permalink: posts/: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
sitemap:
  path: sitemap.xml

# 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
syntax_highlighter: 
highlight:
  enable: false
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: false
  tab_replace: ''
prism_plugin:
  mode: 'preprocess'    # realtime/preprocess
  theme: 'tomorrow'
  line_number: true    # default false
  custom_css: ''

# 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: 8
  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: 16
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: fluid

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo: [email protected]:youyeyejie/youyeyejie.github.io.git
  branch: main

# Plugins
shiki:
  theme: one-dark-pro # highlight-theme:one-dark-pro / github-light / github-dark / material-theme-palenight
  line_number: true # whether to show the line_number
  beautify: true # whether to add highlight tool true or false
  highlight_copy: true # copy button
  highlight_lang: true # show the code language
  highlight_height_limit: 360 # code-block max height,unit: px
  is_highlight_shrink: false # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
  copy: # copy message
    success: 'Copy Success'
    error: 'Copy Error'
    no_support: 'Browser Not Support'

Others

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions