Build the most in hexo blog under Mac, and build the hexo blog on mac

Source: Internet
Author: User
Tags disqus disqus comments

Build the most in hexo blog under Mac, and build the hexo blog on mac

Xiao Wu intends to migrate his blog to github. In order to make myself a powerful programmer, I am also very hard-working. So I set up an hexo blog and can install it as much as possible, the following describes the setup process for your reference.

Migration address: www.devilwwj.com

Step 1 apply for a domain name

You can also go to another website to apply for a domain name at http://www.xinnet.com.

When I apply for a. com top-level domain name here, it is more expensive than. cn. net. In order to save trouble, I directly bought a three-year domain name validity period. You can choose it on your own.

Step 2 configure DNS resolution

Go to my account> my domain name to renew the domain name, change the management password, set mydns resolution, and transfer the domain name. After selecting the domain name, click "mydns resolution Settings" to configure the dns, for example:

The following is how we add the Host Name (A record). We Add the following record. The IP address corresponds to the github IP address.

A record IP
Devilwwj.com 192.30.252.153
Devilwwj.com 192.30.252.154
Www.devilwwj.com 192.30.252.153
Www.devilwwj.com 192.30.252.154

As shown in:

Step 3 create a github Repository

Register a github account and create a github repository.

Step 4 download Node. js

Step 5 install npm

After installing the latest Node. js version, we can use the npm command.

The npm command cannot be found in mac. The solution is as follows:

sudo ln -s /usr/local/bin/node /usr/bin/nodesudo ln -s /usr/local/lib/node /usr/lib/nodesudo ln -s /usr/local/bin/npm /usr/bin/npmsudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf
Step 7 install hexo
sudo npm install -g hexo
Step 8 create an hexo Project

Create a project in the specified folder using the command line:

sudo hexo init

Here we have completed the hexo installation, the specific effect:

Step 9 test hexo locally

In the command line, enter sudo hexo server or its abbreviation sudo hexo s:

hexo devilwwj$ sudo hexo sINFO  Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.

Then we can enter localhost: 4000 in the address bar of the browser, so that we can locally test the project we have set up.

Step 10 deploy to github

Enter the following command in the command line to deploy hexo:

sudo hexo generatesudo hexo deploy

You can also do this directly:

sudo hexo d -g


Step 11 bind a domain name

To enable Internet access to our website, we need to create a CNAME under the source directory, that is, our alias, and then redeploy it to github.

Step 12 change skin

If you are not satisfied with the default skin, you can clone others' themes by cloning them:

git clone https://github.com/ppoffice/hexo-theme-hueman.git themes/hueman

Then, configure the topic in _ config. yml:

# Extensions: plug-ins and skins # Plugins: http://hexo.io/plugins/## Themes: http://hexo.io/themes/theme: hueman

Finally, the configuration of _ config. yml is shown as follows:

# Hexo Configuration # Docs: http://hexo.io/docs/configuration.html## Source: https://github.com/hexojs/hexo/# Site information title: IT_xiao Xiao Wu subtitle: In the impetuous world anquiet knock Code description: IT_xiao Xiao Wu blog | Android | java | Macauthor: devilwwjlanguage: zh-nnmail: 659982592@qq.comtimezone: # URL # If your site is put in a subdirectory, set url as 'HTTP: // yoursite.com/child' and root as '/child/' url: http://www.devilwwj.com # your domain name root:/permalink: year/: month/: day/: title/permalink_defaults: # Directory file Directory source_dir: sourcepublic_dir: publictag_dir: tagsarchive_dir: Category: categoriescode_dir: downloads/codei18n_dir: langskip_render: # Writing # Write option new_post_name: title. md # File name of new postsdefault_layout: posttitlecase: false # Transform title into upload: true # Open external links in new tabfilename_case: 0render_drafts: login: falsefuture: truehighlight: # code highlight enable: true line_number: true # Whether to display the row number tab_replace: # Category & Tag directory and label default_category: uncategorizedcategory_map: tag_map: # archive setting #2: enable pagination #1: Disable pagination #0: Fully Disablearchive: 2 category: 2tag: 2 # Date/Time format Time and Date format # Hexo uses Moment. js to parse and display date # You can customize the date format as defined in # Assets YYYY-MM-DDtime_format: HH: mm: ss # Pagination page # Set per_page to 0 to disable paginationper_page: 10pagination_dir: page # Extensions: plug-ins and skins # Plugins: http://hexo.io/plugins/## Themes: javashueman # Disqus disqus comments, similar to saying, domestic general use of disqus_shortname: devilwwjplugins: # plug-ins, for example, generate the-hexo-generator-feed-hexo-generator-sitemap # Feed Atomfeed: type: atom path: atom. xml limit: 20 # sitemapsitemap: path: sitemap. xml # Markdown syntax # paigfm: true pedantic: false sanitize: false tables: true breaks: true smartLists: true smartypants: true # Deployment configuration # Docs: Deployment type: git repository: https://github.com/devilWwj/devilwwjHexo.git # Your github page repository branch: gh-pages

If you do not understand what is described above, you can leave a message below. After that, Little Wu will continue to optimize hexo and summarize the optimization method into a blog post posted on this site, see you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.