Hexo: Deploying hexo in github but wont render css

Created on 7 Dec 2017  路  8Comments  路  Source: hexojs/hexo

Environment Info

Node version(node -v): 8.9.1

Your site _config.yml (Optional):

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

# Site
title: 馃唵rite Once
subtitle:
description:
author: Achmad Naufal
language:
timezone:
favicon: /images/favicon.ico

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://github.com/nooballday/dev-blog.git
root: /
permalink: :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_link: true # Open external links in new tab
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:

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

# 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: material-flow

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: https://github.com/nooballday/dev-blog.git
  branch: master


````

Your theme `_config.yml` (Optional): 

Search

search:
enable: true
service: hexo # google/hexo/algolia/azure/baidu
# google
google_api_key:
google_engine_id:
# algolia
algolia_app_id:
algolia_api_key:
algolia_index_name:
# azure
azure_service_name:
azure_index_name:
azure_query_key:
# baidu
baidu_api_id:

friends link

links:
# - name: ClassicOldSong
# url: https://ccoooss.com
# - name: Frantic1048
# url: https://frantic1048.logdown.com/
# - name: Hclmaster
# url: https://hclmaster.github.io/
# - name: WANG Hs眉-Tung
# url: https://whst.github.io/

navigation menu

menu:

widgets

widgets:

  • about
  • links
  • categories
  • tagcloud

Less

less:
compress: true

use url, not username

social:

```

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

For BUG

For question

i am trying to deploy a hexo blog in github https://nooballday.github.io/hexo-blog/ this one, but it wont render the css. i followed this guide to deploy hexo site in github. i'am kinda new to hexo.

For feature request

Most helpful comment

i got the other one working too! this is quite a good Friday morning! i am going to close it. Thankyou again @tcrowe

All 8 comments

Hiyo @nooballday can you try fixing these settings right here https://hexo.io/docs/configuration.html#URL then let us know if it worked? Your url and root look wrong based on being in the /hexo-blog directory!

hi @tcrowe thanks for the help, the first solution works, but after i go to sub pages say archives or my post the css failed to load

GET https://nooballday.github.io/css/bootstrap.min.css net::ERR_ABORTED nooballday.github.io/:27
GET https://nooballday.github.io/js/highlight.pack.js net::ERR_ABORTED nooballday.github.io/:157 
GET https://nooballday.github.io/css/style.light.css net::ERR_ABORTED nooballday.github.io/:30 
GET https://nooballday.github.io/js/highlight.pack.js net::ERR_ABORTED (index):157 
GET https://nooballday.github.io/img/default-banner-dark.jpg 404 () (index):157 

because it doesn't go to my actual url which is https://nooballday.github.io/hexo-blog. i cant fix it as i dont know how to set up url to my github's url. i've tried to hack to the custom theme itself but no luck.

Lets see the url and root in your config again pls!

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

# Site
title: Hexo
subtitle:
description:
author: John Doe
language:
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://nooballday.github.io/hexo-blog
root: /
permalink: :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_link: true # Open external links in new tab
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:

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

# 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: aero-dual

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

oh nevermind, i got it wrong in the root part XD

Aha you got it! 馃挭

i got the other one working too! this is quite a good Friday morning! i am going to close it. Thankyou again @tcrowe

Was this page helpful?
0 / 5 - 0 ratings