Leisurely Fool

A leisurely fool float in the ocean


  • Home

  • Tags6

  • Categories5

  • Archives10

  • About

  • Search

Build Personal Blog -- Bring your blog to the world (SEO)

Posted on 2019-08-19 Edited on 2019-08-20 In Other Learning , Hexo Views: Valine: 818 1 mins.

Add Google Analytics

  1. Register on Google Analytics

  2. Apply a new account for your website and you will get an tracking_id like UA-14xxxx949-1

  3. Update NexT _config.yml

    1
    2
    3
    google_analytics:
    tracking_id: UA-14xxxx949-1
    localhost_ignored: true

Add SEO Related

Add Sitemap

  1. npm install hexo-generator-sitemap --save

  2. Add following config in hexo _config.yml:

    1
    2
    sitemap:  
    path: sitemap.xml
  3. change URL to your own domain

Add robot.txt

  1. Create a new file named robot.txt under the folder hexo source, and fill in the following text.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    User-agent: *
    Allow: /
    Allow: /archives/

    Disallow: /vendors/
    Disallow: /js/
    Disallow: /css/
    Disallow: /fonts/
    Disallow: /vendors/
    Disallow: /fancybox/

    Sitemap: https://pojian.xyz/sitemap.xml
    Sitemap: https://pojian.xyz/baidusitemap.xml
  2. hexo clean

  3. hexo g -d

  4. Add sitemap to Google Search Console

  • Post author: Lin Ce
  • Post link: https://leisurelyfool.com/posts/35959.html
  • Copyright Notice: All articles in this blog are licensed under BY-NC-SA unless stating additionally.
hexo SEO
Tweet
Share
Link
Send
Send
Build Personal Blog -- Integrate Feedback (Valine) with Hexo (NexT)
八月碎碎念
  • Table of Contents
  • Overview
Lin Ce

Lin Ce

Major in Application of ML and DL
10 posts
5 categories
6 tags
GitHub E-Mail
  1. 1. Add Google Analytics
  2. 2. Add SEO Related
    1. 2.1. Add Sitemap
    2. 2.2. Add robot.txt
© 2019 Lin Ce | 9k | 8 mins.
|
0%