【实测】各类meta标签的作用说明-Discuz教程下载

【实测】各类meta标签的作用说明

开通本站Svip会员,全站资源免费下
  1. <meta name="keywords" contect="关键词">
  2. <meta name="description" contect="内容描述">
  3. <meta name="author" contect="作者名称">
  4. <meta name="Robots" content="all|none|index|noindex|follow|nofollow">
  5. <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/> 移动端自适应
  6. <meta name="generator" content="软件名称,用于下载站">
  7. <meta name="copyright" content="标注版权">
  8. <meta name="revisit-after" content="7 days" > 如果页面不是经常更新,为了减轻搜索引擎爬虫对服务器带来的压力,可以设置一个爬虫的重访时间。如果重访时间过短,爬虫将按它们定义的默认时间来访问。 默认为7天
  9. <meta name="renderer" content="webkit"> //默认webkit内核
  10. <meta name="renderer" content="ie-comp"> //默认IE兼容模式
  11. <meta name="renderer" content="ie-stand"> //默认IE标准模式
  12. <meta name="renderer" content="webkit|ie-comp|ie-stand">浏览器适配
复制代码
优先使用 IE 最新版本和 Chrome
  1. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  2. <!-- 关于X-UA-Compatible -->
  3. <meta http-equiv="X-UA-Compatible" content="IE=6" ><!-- 使用IE6 -->
  4. <meta http-equiv="X-UA-Compatible" content="IE=7" ><!-- 使用IE7 -->
  5. <meta http-equiv="X-UA-Compatible" content="IE=8" ><!-- 使用IE8 -->
  6. <meta charset="utf-8"> //html5设定网页字符集的方式,推荐使用UTF-8
复制代码
  1. <meta http-equiv="Content-Language" content="zh-CN">用以说明主页制作所使用的文字以及语言
  2. <meta http-equiv="Refresh" content="5;Url=https://www.tuyuanma.com/">其中的5是指停留5秒钟后自动刷新到URL网址
  3. <meta http-equiv="Page-Enter" Content="blendTrans(Duration=0.5)">页面被载入时的一些特效
  4. <meta http-equiv="Page-Enter" content="revealTrans(duration=10,transtion=50)">页面被载入时的一些特效
  5. <meta http-equiv="Page-Exit" Content="blendTrans(Duration=0.5)">页面被调出时的一些特效
  6. <meta http-equiv="Page-Exit" content="revealTrans(duration=20,transtion=6)">页面被调出时的一些特效
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>指定IE和Chrome使用最新版本渲染当前页面
  8. <meta http-equiv="cache-control" content="no-cache">
复制代码
no-cache: 先发送请求,与服务器确认该资源是否被更改,如果未被更改,则使用缓存。
no-store: 不允许缓存,每次都要去服务器上,下载完整的响应。(安全措施)
public : 缓存所有响应,但并非必须。因为max-age也可以做到相同效果
private : 只为单个用户缓存,因此不允许任何中继进行缓存。(比如说CDN就不允许缓存private的响应)
maxage : 表示当前请求开始,该响应在多久内能被缓存和重用,而不去服务器重新请求。例如:max-age=60表示响应可以再缓存和重用 60 秒。
<meta http-equiv="Cache-Control" content="no-siteapp" />用于禁止当前页面在移动端浏览时,被百度自动转码。虽然百度的本意是好的,但是转码效果很多时候却不尽人意。所以可以在head中加入例子中的那句话,就可以避免百度自动转码了。
  1. <meta name="mobile-agent"content="format=[wml|xhtml|html5]; url=url">[wml|xhtml|html5]根据手机页的协议语言,选择其中一种;url=”url” 后者代表当前PC页所对应的手机页URL,两者必须是一一对应关系。
  2. <meta http-equiv="mobile-agent" content="format=wml; url=https://www.tuyuanma.com" />
  3. <meta http-equiv="mobile-agent" content="format=xhtml; url=https://www.tuyuanma.com" />
  4. <meta http-equiv="mobile-agent" content="format=html5; url=https://www.tuyuanma.com" />
  5. <meta http-equiv="Cache-Control" content="no-transform " />禁止百度转码
  6. <meta http-equiv="Cache-Control" content="no-siteapp" />禁止百度转码
  7. <meta property="og:author" contect="作者名称">
  8. <meta property="og:url" contect="页面链接地址">
  9. <meta property="og:title" contect="内容标题">
  10. <meta property="og:image" contect="略缩图地址">
  11. <meta property="og:release_date" contect="发布时间">
  12. <meta property="og:description" contect="内容描述">
  13. <meta property="og:site_name" contect="页面所在栏目名">
  14. <meta property="og:video" contect="视频或者Flash地址">
  15. <meta property="og:audiosrc" contect="音频地址">
复制代码
设定为all:文件将被检索,且页面上的链接可以被查询;
设定为none:文件将不被检索,且页面上的链接不可以被查询;
设定为index:文件将被检索;
设定为follow:页面上的链接可以被查询;
设定为noindex:文件将不被检索,但页面上的链接可以被查询;
设定为nofollow:文件将不被检索,页面上的链接可以被查询。

applicable-device标注
帮助百度提交校验识别结果的正确性,减少百度蜘蛛把PC站当成M站,或者把M站当成PC站进行抓取。
  1. <!-- PC站 -->
  2. <meta name="applicable-device"content="pc">
  3. <!-- M站 -->
  4. <meta name="applicable-device"content="mobile">
  5. <!-- 自适应或代码适配 -->
  6. <meta name="applicable-device"content="pc,mobile">
  7. <!-- 自适应站点在使用百度站长平台链接提交工具的sitemp进行提交时,要做mobile type标记,具体取值: -->
  8. <mobile:mobile type="pc,mobile"/>
  9. <!-- 其他网页取值如下: -->
  10. <mobile:mobile/> :移动网页
  11. <mobile:mobile type="mobile"/> :移动网页
  12. <mobile:mobile type="htmladapt"/>:代码适配
复制代码
无该上述TAG.html" target="_blank" class="relatedlink">标签表示为PC网页
  1. <meta name="msapplication-tooltip" content="源码" />"msapplication-tooltip" 元数据提供其他工具提示文本,当光标悬停在 Windows 的“开始”菜单中或桌面上的固定网站快捷方式上时,将会出现这些文本。
  2. <meta name="application-name" content="兔源码" />当前应用程序名字
  3. <meta name="msapplication-starturl" content="https://www.tuyuanma.com/" />当前内容链接
  4. <meta name="msapplication-task" content="name=兔源码;action-uri=https://www.tuyuanma.com/;icon-uri=https://www.tuyuanma.com/favicon.ico" />
复制代码
适合Discuz网站的实例:
亲爱的游客您好,请 登录 后进行 回复
注明:<!--{eval $article_url = fetch_article_url($article);}--> 这个函数必须增加,否则无法成功调用文章链接,且需放在判断函数内,否则造成登录页错误


特别更新:结合教程提高 Discuz 门户文章被百度收录的方法。可实现将
亲爱的游客您好,请 登录 后进行 回复
中$article_url直接替换修改为
  1. {$_G['siteurl']}$canonical
复制代码

全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部