Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Deploying, Resets My Custom Domain #87

Closed
ToddAT opened this issue Oct 12, 2017 · 4 comments · Fixed by #351
Closed

When Deploying, Resets My Custom Domain #87

ToddAT opened this issue Oct 12, 2017 · 4 comments · Fixed by #351

Comments

@ToddAT
Copy link

ToddAT commented Oct 12, 2017

When using the deploy script, I've noticed that my custom domain configuration gets overwritten/reset. Is there something I need to set in the config? Otherwise, any idea how to fix this?

@loatheb
Copy link
Contributor

loatheb commented Oct 12, 2017

@ToddAT make your CNAME file under source folder.It will be copied to root when build result.

@green-coder
Copy link

That's worth being added to the README.md

@erikh
Copy link

erikh commented Jan 19, 2021

Agree, please add this to the README as I was super confused. Thanks.

@dimaslanjaka
Copy link

dimaslanjaka commented Jan 3, 2023

just write below codes to generate in root hexo site project. Lets assume <hexodir>/generate.js

const Hexo = require("hexo");
const fs = require("fs");
const path = require("path");

const hexo = new hexo(__dirname);
hexo
  .init()
  .then(hexo.load)
  .then(() => hexo.call("generate"))
  .then(() => {
    fs.writeFileSync(
      path.join(__dirname, "public/CNAME"),
      "www.example.net"
    );
  })
  .catch(hexo.exit);

usage: node generate.js

it should be generate the site and creating CNAME after generated

OR

creating CNAME inside source directory

OR for developer this plugin

add cname key to option and push function to event generateAfter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants