This is the 6th day of my participation in the August More Text Challenge

All about Hexo — My Hexo column

Zero foreword

Following on from the previous article, this article will talk about the rest of the map:

Google Indexed

Relative to Baidu, Google’s efficiency is ridiculously high 🐶, the method is similar to Baidu.

  1. Open Google Search center, log in and fill in your domain name:

  2. Then copy the resulting record:

  3. Open domain name console, parse add TXT record:

  4. Verification successful:

  5. Open Google sitemaps and add the sitemap.xml file from the previous post, as follows:

Two robots. TXT

The role of robots.txt is to tell the search engine what content in this website can be climbed, which is forbidden to climb.

  1. Modify the file in the source folder in the root directory.

  2. To add directories that you want to be crawled or don’t want to be crawled, refer to mine:

     User-agent: *
     Allow: /
     Allow: /posts/
     Disallow: /tags/
     Disallow: /categories/
     Disallow: /about/
     Disallow: /archives/
     Disallow: /js/
     Disallow: /css/
     Disallow: /fonts/
     Disallow: /lib/
    Copy the code
  3. After the configuration is complete, deploy it.

Three URL optimization

In general, the best structure for a website is three clicks from the front page to any page, but Hexo compiles a five-tier structure: domain name/year/month/day/article title. This structure is very bad for SEO, crawlers often can’t climb our articles, so we need to optimize the URL.

Plan a

  1. Change the domain name/post title structure directly and change the permalink item in the blog root configuration file:

     url: https://www.heeh.xyz
     permalink: :title.html    # modified
     permalink_defaults:
    Copy the code
  2. However, since the title of our article is usually in Chinese, it will be escaped into a pile of extremely long number symbols, which makes it uncomfortable to share links, so WE still recommend plan 2.

Scheme 2

  1. NPM install hexo-abbrlink –save

  2. Modify the site configuration file:

     permalink: post/:abbrlink.html      # modified
     
     # add
     abbrlink:
       alg: crc16        Crc32 is optional, slightly more complex and longer than CRC16
       rep: hex          Optional dec, decimal number
    Copy the code
  3. The site structure becomes the domain name /posts/xxx.html.


All see here, a thumbs up bai 😆

How to set up the free chart bed blog will be updated in two days ~ welcome to pay attention to exchange

More interesting articles: Mancuoj’s homepage – Articles – Nuggets (juejin. Cn)