hexojs / hexo

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

Big files in folder "./source/" can't copy in floder "./public/" completely | source 文件夹中的大文件无法完全复制到 public 文件夹中 #4976

Closed Liynw closed 1 year ago

Liynw commented 2 years ago

I put a large css file(27KB) in ./source/ (path: ./source/assets/css/custom.css), but it can't be copied completely in ./public/ after hexo g.

Check List

Please check followings before submitting a new issue.

Expected behavior

There is a css file ./public/assets/css/custom.css and it's the same as ./source/assets/css/custom.css after hexo g.

Actual behavior

However, ./public/assets/css/custom.css was only 6KB and it was a part of ./source/assets/css/custom.css.

How to reproduce?

Is the problem still there under "Safe mode"?

Yes.

Environment & Settings

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

v16.15.0
8.6.0

Your site _config.yml (Optional)

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

# Site
title: Saiodgm の 博客儿
subtitle: 'hi! ヾ(≧▽≦*)o'
description: 'cqbz 最菜'
keywords: Saiodgm's blog
author: Saiodgm
language: zh-CN
timezone: UTC

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://oi.saiodgm.gq
permalink: posts/:abbrlink/
permalink_defaults:
pretty_urls:
  trailing_index: false # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: false # 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:
  - kernel.html

# 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
  pagination_dir: page

# 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: 20
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: butterfly

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repo:
    github: https://cqbzljt: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@github.com/cqbzljt/OIBlog.git,master

# Something interesting
## feed
feed:
  enable: true
## sitemap
sitemap:
  path: sitemap.xml
baidusitemap:
  path: baidusitemap.xml

# abbrlink config
abbrlink:
  alg: crc32      #support crc16(default) and crc32
  rep: hex        #support dec(default) and hex
  drafts: false   #(true)Process draft,(false)Do not process draft. false(default)

bangumi: # 追番设置
  enable: true
  source: bili
  path:
  vmid: 1402843748
  title: 'B 站追番列表'
  quote: '无聊的时候瞎搞?QwQ'
  show: 1
  lazyload: true
  loading: /img/loading.gif
  metaColor:
  color:
  webp: false
  progress:
  proxy:
    host: '代理host'
    port: '代理端口'
  extra_options:
    key: value
cinema: # 追剧设置
  enable: false
  path:
  vmid:
  title: '追剧列表'
  quote: '生命不息,追剧不止!'
  show: 1
  lazyload: true
  loading:
  metaColor:
  color:
  webp:
  progress:
  extra_options:
    key: value

# Live2D
## https://github.com/EYHN/hexo-helper-live2d
live2d:
  enable: true #开关插件版看板娘
  scriptFrom: local # 默认
  pluginRootPath: live2dw/ # 插件在站点上的根目录(相对路径)
  pluginJsPath: lib/ # 脚本文件相对与插件根目录路径
  pluginModelPath: assets/ # 模型文件相对与插件根目录路径
  # scriptFrom: jsdelivr # jsdelivr CDN
  # scriptFrom: unpkg # unpkg CDN
  # scriptFrom: https://npm.elemecdn.com/live2d-widget@3.x/lib/L2Dwidget.min.js # 你的自定义 url
  tagMode: false # 标签模式, 是否仅替换 live2d tag标签而非插入到所有页面中
  debug: false # 调试, 是否在控制台输出日志
  model:
    use: live2d-widget-model-wanko # npm-module package name
    # use: wanko # 博客根目录/live2d_models/ 下的目录名
    # use: ./wives/wanko # 相对于博客根目录的路径
    # use: https://npm.elemecdn.com/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json # 你的自定义 url
  display:
    position: right #控制看板娘位置
    width: 150 #控制看板娘大小
    height: 300 #控制看板娘大小
  mobile:
    show: true # 手机中是否展示

# hexo-offline-popup.
service_worker:
  maximumFileSizeToCacheInBytes: 6291456 # 缓存的最大文件大小,以字节为单位,此处设置为6MB。
  staticFileGlobs:
    - public/**/*.{js,html,xml,css,png,jpg,gif,svg,webp,eot,ttf,woff,woff2}
    # - public/**/*.{html,xml} #精简版使用这行即可
  # 静态文件合集,如果你的站点使用了例如webp格式的文件,请将文件类型添加进去。。
  # 注意,此处的文件类型就是会缓存下来的所有文件类型,如果不需要缓存那么多,
  # 而只是想判断网页更新与否,缓存html和xml即可。
  stripPrefix: public
  verbose: false
  runtimeCaching:
    # CDNs - should be cacheFirst, since they should be used specific versions so should not change
    - urlPattern: /* # 如果你需要加载CDN資源,请配置该选项,如果沒有,可以不配置。
      handler: cacheFirst
      options:
        origin: unpkg.com # 又拍云
    - urlPattern: /*
      handler: cacheFirst
      options:
        origin: cdn.jsdelivr.net # jsdelivr
    - urlPattern: /*
      handler: cacheFirst
      options:
        origin: npm.elemecdn.com
    # 更多cdn可自行参照上述格式进行配置。

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

hexo-site@0.0.0 D:\Website\saiodgm.gq\Blog-Pages\oiblog
├── ajv@6.12.3
├── ansi-regex@5.0.1
├── async@2.6.4
├── botui@0.3.6
├── braces@2.3.2
├── cryptiles@4.1.3
├── debug@2.6.9
├── diff@3.5.0
├── ejs@3.1.8
├── glob-parent@5.1.2
├── glob@7.2.0
├── gulp-clean-css@4.3.0
├── gulp-fontmin@0.7.4
├── gulp-html-minifier-terser@6.0.1
├── gulp-htmlclean@2.7.22
├── gulp-terser@2.1.0
├── hexo-abbrlink@2.2.1
├── hexo-bilibili-bangumi@1.7.5
├── hexo-butterfly-artitalk@1.0.4
├── hexo-butterfly-clock@1.0.7
├── hexo-butterfly-footer-beautify@1.0.6
├── hexo-butterfly-tag-plugins-plus@1.0.17
├── hexo-butterfly-wowjs@1.0.5
├── hexo-deployer-git@3.0.0
├── hexo-filter-gitcalendar@1.0.8
├── hexo-generator-archive@1.0.0
├── hexo-generator-baidu-sitemap@0.1.9
├── hexo-generator-category@1.0.0
├── hexo-generator-feed@3.0.0
├── hexo-generator-index@2.0.0
├── hexo-generator-json-content@4.2.3
├── hexo-generator-search@2.4.3
├── hexo-generator-sitemap@3.0.1
├── hexo-generator-tag@1.0.0
├── hexo-helper-live2d@3.1.0
├── hexo-offline-popup@1.0.3
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-kramed@0.1.4
├── hexo-renderer-mathjax@0.6.0
├── hexo-renderer-pug@3.0.0
├── hexo-renderer-stylus@2.0.1
├── hexo-server@3.0.0
├── hexo-theme-landscape@0.0.3
├── hexo-wordcount@6.0.1
├── hexo@6.2.0
├── highlight.js@11.5.1
├── hoek@6.1.3
├── live2d-widget-model-wanko@1.0.5
├── lodash.template@4.5.0
├── lodash@4.17.21
├── marked@4.0.15
├── minimist@1.2.6
├── mout@1.2.3
├── node-fetch@3.2.4
├── nth-check@2.0.1
├── path-parse@1.0.7
├── postcss@8.4.13
├── striptags@3.2.0
├── sync-exec@0.6.2
├── trim-newlines@4.0.2
└── xmldom@0.6.0

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"
  },
  "hexo": {
    "version": "6.2.0"
  },
  "dependencies": {
    "ajv": "^6.12.3",
    "ansi-regex": "^5.0.0",
    "async": "^2.6.4",
    "botui": "^0.3.6",
    "braces": "^2.3.1",
    "cryptiles": "^4.1.1",
    "debug": "^2.6.9",
    "diff": "^3.5.0",
    "ejs": "^3.1.6",
    "glob": "^7.2.0",
    "glob-parent": "^5.1.2",
    "hexo": "^6.2.0",
    "hexo-abbrlink": "^2.2.1",
    "hexo-bilibili-bangumi": "^1.7.5",
    "hexo-butterfly-artitalk": "^1.0.4",
    "hexo-butterfly-clock": "^1.0.7",
    "hexo-butterfly-footer-beautify": "^1.0.6",
    "hexo-butterfly-tag-plugins-plus": "^1.0.17",
    "hexo-butterfly-wowjs": "^1.0.5",
    "hexo-deployer-git": "^3.0.0",
    "hexo-filter-gitcalendar": "^1.0.8",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-baidu-sitemap": "^0.1.9",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^3.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-json-content": "^4.2.3",
    "hexo-generator-search": "^2.4.3",
    "hexo-generator-sitemap": "^3.0.1",
    "hexo-generator-tag": "^1.0.0",
    "hexo-helper-live2d": "^3.1.0",
    "hexo-offline-popup": "^1.0.3",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-kramed": "^0.1.4",
    "hexo-renderer-mathjax": "^0.6.0",
    "hexo-renderer-pug": "^3.0.0",
    "hexo-renderer-stylus": "^2.0.1",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^0.0.3",
    "hexo-wordcount": "^6.0.1",
    "highlight.js": "^11.5.1",
    "hoek": "^6.1.3",
    "live2d-widget-model-wanko": "^1.0.5",
    "lodash": "^4.17.21",
    "lodash.template": "^4.5.0",
    "marked": "^4.0.15",
    "minimist": "^1.2.6",
    "mout": "^1.2.3",
    "node-fetch": "^3.2.4",
    "nth-check": "^2.0.1",
    "path-parse": "^1.0.7",
    "postcss": "^8.4.13",
    "striptags": "^3.2.0",
    "sync-exec": "^0.6.2",
    "trim-newlines": "^4.0.2",
    "xmldom": "^0.6.0"
  },
  "devDependencies": {
    "gulp-clean-css": "^4.3.0",
    "gulp-fontmin": "^0.7.4",
    "gulp-html-minifier-terser": "^6.0.1",
    "gulp-htmlclean": "^2.7.22",
    "gulp-terser": "^2.1.0"
  }
}

Others

I don't know if it's deliberately, but it brings me some problems.

D-Sketon commented 2 years ago

You can add the directory of the css files to the setting skip_render in _config.yml By the way, I think all files except html and markdown should skip rendering by default

stevenjoezhang commented 1 year ago

@cqbzljt You can try to apply this patch: https://github.com/hexojs/hexo/pull/5118

stevenjoezhang commented 1 year ago

I will close this Issue because I believe it has been fixed. If the problem still exists, please feel free to reopen it.