hexojs / hexo

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

Hexo Subfolder Cant Resolve CSS JS Etc and Broken whole site #5086

Closed dimaslanjaka closed 1 year ago

dimaslanjaka commented 1 year ago

Check List

Please check followings before submitting a new issue.

Versions

Problems

Hexo subfolder broken the renderer

_config.yml

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

# Site
title: Chimeraland WMI
subtitle: 'Unofficial Chimeraland WMI'
description: 'Unofficial Chimeraland WMI'
keywords:
  - chimeraland
  - monster
  - attendant
  - recipe
  - pet
author: L3n4r0x
language: en
timezone: 'Asia/Jakarta'

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://www.webmanajemen.com/chimeraland
root: /chimeraland/
permalink: :title.html #:year/:month/:day/:title/
permalink_defaults:

# 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 links
external_link:
  # true: Open ext in new tab, rel nofollow
  enable: true
  # apply resolution
  ## site: apply to the whole site
  ## post: apply only to post
  field: site
  # safelink, to encode all external links with outbound page (good for seo and ads)
  ## see: https://github.com/dimaslanjaka/safelink
  safelink:
    # enable salink redirector
    enable: true
    # exclude url to safelinkify
    exclude:
      - webmanajemen.com
      - git.webmanajemen.com
    # safelink url
    redirect: https://www.webmanajemen.com/page/safelink.html?url=
    type: base64
    password: unique-password
  # exclude host from external link filter
  exclude:
    - webmanajemen.com
    - web-manajemen.blogspot.com
    - dimaslanjaka.github.io
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:

# 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

# 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

# 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

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

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

# Markdown-it config
## Docs: https://github.com/celsomiranda/hexo-renderer-markdown-it/wiki/
markdown:
  render:
    html: true
  plugins:
    - markdown-it-abbr
    - markdown-it-footnote
    - markdown-it-ins
    - markdown-it-sub
    - markdown-it-sup
  anchors:
    # Minimum level for ID creation. (Ex. h2 to h6)
    level: 2
    # A suffix that is prepended to the number given if the ID is repeated.
    collisionSuffix: 'v'
    # If `true`, creates an anchor tag with a permalink besides the heading.
    permalink: true
    # Class used for the permalink anchor tag.
    permalinkClass: header-anchor
    # The symbol used to make the permalink
    permalinkSymbol: ¶

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: git@github.com:dimaslanjaka/chimeraland.git
  branch: gh-pages
  message: 'Revising'
  name: dimaslanjaka
  email: dimaslanjaka@gmail.com

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include: []
exclude: ['**/tmp/**', '**/ads/**']
ignore: []

## https://github.com/dimaslanjaka/hexo-adsense
adsense:
  enable: true
  #pub: ca-pub-1165447249910969 # mine
  pub: ca-pub-2188063137129806
  # in-article ads source
  article_ads:
    - 'source/ads/in_article_kiki.html'
    - 'source/ads/in_article_kiki2.html'
  # ads field
  field: 'site' # post=only post, site=all pages and posts
  # auto redirect to https
  https: false
  # block user with adblock enabled
  adblock: false
  # amp or javascript
  type: javascript
  # exclude pattern, disable adding adsense
  exclude:
    - '*.min.html'
    - '**/exclude/**/*'

package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "homepage": "https://www.webmanajemen.com/chimeraland/",
  "repository": {
    "url": "https://github.com/dimaslanjaka/chimeraland.git",
    "type": "git"
  },
  "hexo": {
    "version": "6.3.0"
  },
  "scripts": {
    "start": "npm run serve",
    "clean": "hexo clean",
    "server": "hexo server -p 4000",
    "serve": "hexo server -p 4000",
    "copy": "sbg copy --nocache",
    "build": "hexo generate && gulp safelink",
    "update": "npx npm-check-updates -u -x hexo && npm update safelinkify hexo-generator-redirect"
  },
  "dependencies": {
    "ansi-colors": "^4.1.3",
    "axios": "^1.1.3",
    "bluebird": "^3.7.2",
    "debug": "^4.3.4",
    "hexo": "^6.3.0",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-redirect": "github:dimaslanjaka/hexo-generator-redirect",
    "hexo-generator-sitemap": "3.0.1",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-markdown-it": "^6.1.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "file:themes/landscape",
    "safelinkify": "file:../../safelink",
    "sharp": "^0.31.1",
    "upath": "^2.0.1"
  },
  "devDependencies": {
    "gulp": "^4.0.2",
    "gulp-dom": "file:../../static-blog-generator-hexo/packages/gulp-dom",
    "hexo-post-parser": "file:../../hexo-post-parser",
    "npm-run-all": "^4.1.5",
    "static-blog-generator": "file:../../static-blog-generator",
    "ts-node": "^10.9.1",
    "typescript": "^4.8.4"
  }
}

Screenshots

image

stevenjoezhang commented 1 year ago

Is the issue resolved after installing hexo-renderer-stylus? https://github.com/next-theme/hexo-theme-next/issues/582

dimaslanjaka commented 1 year ago

Is the issue resolved after installing hexo-renderer-stylus? next-theme/hexo-theme-next#582

not that, this error because of the warehouse cache. i was installing hexo-renderer-stylus before, but not fixed. i fixed it after delete all node_modules, npm cache, move project folder.

dimaslanjaka commented 1 year ago

this error will occurs when you change the template and the project inside subfolder, the fixed way is: