Hexo: why deploy had reset custom domain for github pages

Created on 12 Mar 2017  ·  9Comments  ·  Source: hexojs/hexo

Environment Info

Node version(node -v)

v6.10.0

Your site _config.yml

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

# Site
title: 牵猪的仓鼠
subtitle:
description:
author: amlove2
language:
timezone:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://s.amlove.cn
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: false #关闭hexo渲染高亮,使用主题代码块高亮
  line_number: true
  auto_detect: false
  tab_replace:

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

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

...

Your theme _config.yml

# Hexo Configuration
...

Plugin version(npm ls --depth 0)

+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

For BUG

when i was execute cmd ` hexo deploy`, my custom domain for github page has reset.I don't know why it.I read github doc , After each command, the  `repo.pages_https_redirect_disabled`  had  be called.please tell me how to solve it.

My question is exactly the same it

我遇到一个问题,执行 hexo deploy 之后,自定义的域名就会被清除掉,必须手动在github 上重新配置一下,不知道为什么. 貌似是触发了 repo.pages_https_redirect_disabled, 因为启用了https 的github page是不支持自定义域名的,请问这个如何破

Most helpful comment

Have you put the CNAME file in hexo source folder?

All 9 comments

Have you put the CNAME file in hexo source folder?

NoahDragon is right.

deploy 下面加一行:
delete: false

Hey so will hexo clean delete the CNAME file from the source folder?

Hey so will hexo clean delete the CNAME file from the source folder?

no, it won't delete it.

append following line to your script in .travis.yml after the hexo generate works for me:

script:
  - hexo generate # generate static files
  - echo "ray-eldath.me" > public/CNAME

Have you put the CNAME file in hexo source folder?

how to put CNAME in hexo source folder?
i am clueless

Have you put the CNAME file in hexo source folder?

how to put CNAME in hexo source folder?
i am clueless

You just create a file named CNAME under the 'source' folder.
like this
image

the content of CNAME is your domains:
image

Have you put the CNAME file in hexo source folder?

how to put CNAME in hexo source folder?
i am clueless

You just create a file named CNAME under the 'source' folder.
like this
image

the content of CNAME is your domains:
image

thank you sir

Was this page helpful?
0 / 5 - 0 ratings