搜索引擎优化 | 为了让浏览器搜到我的网站,我做了这几件事

各个浏览器添加站点

百度

百度搜索资源平台:https://ziyuan.baidu.com/site/index#/

添加网站》HTML标签验证》在源代码head标签中添加meta标签

image-20231010033732054

谷歌

Google Search Console:https://search.google.com/search-console

添加资源

搜狗

搜狗搜索资源平台:https://zhanzhang.sogou.com/index.php/dashboard/websiteAdd

增加网站》HTML标签验证》在源代码head标签中添加meta标签

image-20231010033519895

image-20231010133758833

360

360站长平台:https://zhanzhang.so.com/sitetool/site_manage

添加网站》验证站点》代码验证

image-20231010034316425

image-20231010133533761

TDK

在浏览器的搜索结果中,能否出现我们的网站,有四成的因素取决于我们的tdk三个标签是否正确编写,即 t(title),d(Meta Description),k(Meta keywords))。

因此非常有必要,在页面源代码中加入title标签、<meta name="description" content=""><meta name="keywords" content="">,并正确填写其文本,这样会提高爬虫的收录

image-20231010062224558

以下代码填写至head.html中,即可在生成页面的时候将这几项信息添加至页面源代码。

		<title>
        {{ if .IsHome }} Hello {{ .Site.Params.author }} |
        {{ .Title }} {{ else }} {{ .Title }} |
        {{ .Site.Title }} {{ end }}
		</title>
    <!--  description-->
    <meta name='description' itemprop="description"
          content="{{if .IsPage}}{{substr .Summary 0 200}}{{ else }}{{ .Site.Params.Description }}{{ end }}">
    {{ with .Site.Params.description }}
    <meta name="description" content="{{ . }}">
    {{ end }}
    <!--  keywords-->
    {{ if .Keywords }}
    <meta name="keywords" content="{{ delimit .Keywords ", " }}" >
    {{else}}
    <meta name="keywords" content="{{ delimit .Site.Params.Keywords ", " }}" >
    {{ end }}


648 字