GitHub blog Construction and SEO site Collection of Hexo Framework

Intro:   I've been thinking about being an independent blog for a long time, and I didn't put it on the agenda for a long time because I was worried that I was childish and for a variety of other reasons. Alth

I’ve been thinking about being an independent blog for a long time, and I didn’t put it on the agenda for a long time because I was worried that I was childish and for a variety of other reasons. Although every day shouting sincere and backward body practice, body repair and then home Qi Guozhi world peace, but in the end can not get rid of their own mediocre label; although every day so hard, endure so much loneliness and pain, but do not see how good they are ah! In the process of browsing other people’s technical stickers, gradually dispel this kind of concern, self-criticism is not desirable for a technical personnel, it is like a cage that binds yourself, how do you know the expanse of the sky, and how do you know that you are really worthless if you do not do it?!

The following is my experience of building my own blog on GitHub, which I hope is good for you. The article is divided into four parts:

Gossip less, first take a look at my blog effect:, if you are engaged in iOS, please give a Star at GitHub in Renbo’an.

Markdown has gradually evolved into a general text markup language in the blog platform because of its simplicity and easy to learn, and its influence is not only in the blog platform, but also GitHub and Wikipedia are compatible with markdown syntax. The existing blog framework for markdown support is better, roughly Ghost, Jekyll and Hexo and so on, I use the Hexo framework. Hexo is a simple and efficient blog framework, which can render markdown documents quickly, support Chinese well, rely less, and support Node.

/ / detect whether the environment is configured to complete npm– version git– if the environment is configured, Checkout the GitHub Page library of GitHub to the local:

/ / Terminal command mode git clone-o github [email protected]:zonghongyan/ openDesk.png in order to separate the code from the source code, I use the branch framework source code in the debug branch, and master is the published code.

/ / Terminal command mode git branch debug GitHub client creates a branch. PNG We just need to use npm to complete the Hexo framework generation work:

After developer$ npm install-g hexo-cli/ usr/local/bin/hexo-& gt; / usr/local/lib/node_modules/hexo-cli/bin/hexo / usr/local/lib / [email protected] installs Hexo, you can build the station:

/ / build a station hexo init INFO Start blogging with Hexo! Cd npm install copies the git file to the corresponding directory, git add. Update the git file & gt;git commit commit & gt;git push-u origin debug into the branch debug.

At this point, after the Hexo framework has been generated, we can do debug, to enter the following instructions in the site directory:

Hexo s-debug

It is important to note that if you modify the site directory, you need to npm install again.

Hexo has a lot of theme style, I prefer NexT, black and white as the main tone, simple and clear, not fancy.

After the success of git clone themes/next next clone.png clone, you can see that there is an additional next directory in the theme directory, which is the subject file:

(1) enable the theme to open the _ config.yml file in the site directory and find the theme: landscape, to change to theme: next.

(2) topic validation validation is similar to the preview of the landscape topic in the previous section, executing: hexo s or hexo s-debug directly in the site directory.

Here, the basic Hexo framework NexT topic blog has been created. (3) the site publishes the _ config.yml file in the open site directory, finds the deploy section, and the configuration is as follows:

# Deployment # # Docs: deploy: type: git repo: [email protected]:yousite/ branch: master then cd to the site directory in the terminal and execute:

Hexo clean / / clear the last publish file hexo g or hexo generate / generate the publish file hexo d or hexo deploy / / if there is a problem executing the hexo deploy publication, it may be because the git kit of the hexo framework is not installed and can be executed in the site directory:

Npm install hexo-deployer-git– save then republishes the commit file after it goes to the branch. Finally, type: directly in the website, and you can see the effect.

#. / commonweal: / 404.html in the themes/next/_config.yml document also requires third-party support if it requires an evaluation system, content sharing, etc.

The main functions of my blog are: traffic statistics, evaluation system, in-station search, ~ ~ talk about hot comment ~ ~ (now changed to Gitment), reward, public welfare 404and so on. Let me briefly state a few points:

The evaluation system NexT theme supports the multi-talk and Disqus comment system, and I use the multi-talk evaluation. To use more, you first create a site in more than one word. Http://, after logging in, click on the home page to install, create the site, and fill out the form. Site name: write casually, site address is:, say more about domain name: this column is more important, say that the content of domain name in the subject directory _ config.yml file duoshuo_shortname configuration, remember here is the topic configuration file.

Share is also configured in the topic profile as follows:

#. / the # duoshuo_share duoshuo_share: true in the themes/next/_config.yml file says that the hot review is configured in the subject configuration file as follows: #. / themes/next/_config.yml file # duoshuo_hotartical duoshuo_hotartical: true has now been updated and uses Gitment because of the outage of service For more details, see: under the Hexo blog framework, Gitment replaces more comments and other functional configurations are similar here, a really independent blog is basically built, and a lot of people are done there, but I think the purpose of our blog is to help as many others as possible, but unfortunately, it seems that Github has done crawling prevention. In this way, our blog will not usually be included by the search engine, so we have to submit it to the search engine on our own initiative.

Verify that the site is included to verify that the site is included, directly in Baidu or Google: site:yousite, will be prompted:

Google_site_verification: true baidu_site_verification: true (2) in the subject directory themes/next/layout/_partials/head.swig file, configure the token value of the token configuration diagram:

{% if theme.baidu_site_verification%} & lt;meta name= “baidu-site-verification” content= “iZjCbg5MoG” / & gt; {% endif%} (3) republish your site after it is configured:

Hexo clean hexo g hexo d (4) click finish validation

After the verification is completed, their own website will be submitted, such as the following figure, after a period of time in Baidu to verify whether the site can be included, it is said to be a week.

Related Passages:

Leave a Reply

Your email address will not be published. Required fields are marked *