mip端head代码标准
约 584 字大约 2 分钟
2025-07-31
一、mip端首页head代码规范
\<head>
\<meta charset="UTF-8"> \<!--页面编码声明-->
\<title>{dede:global.cfg_webname/}_{dede:global.cfg_indexname/}\</title>
\<meta name="description" content="{dede:global.cfg_description/}" />
\<meta name="keywords" content="{dede:global.cfg_keywords/}" />
\<link rel="canonical" href="{dede:global.cfg_basehost function='replacewww(@me)'/}/"/> \<!--集权标签-->
{dede:include filename='meta.htm' /}
\<script type="application/ld+json">
{
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": "{dede:global.cfg_basehost function="replacemip(@me)"/}/",
"appid": "你自己的",
"title": "{dede:global.cfg_webname/}_{dede:global.cfg_indexname/}",
"description": "{dede:global.cfg_description/}",
"upDate": "{dede:php runphp='yes'}$ntime = time();@me=strftime('%Y-%m-%d',$ntime)."T".@me=strftime('%H:%M:%S',$ntime);{/dede:php}",
}
\</script>
\</head>
二、mip端栏目页head代码规范
\<head>
\<meta charset="utf-8">
\<title>{dede:field.seotitle/}_{dede:global.cfg_indexname/}\</title>
\<meta name="description" content="{dede:field.description function='html2text(@me)'/}"/>
\<meta name="keywords" content="{dede:field.keywords/}" />
{dede:include filename='meta.htm' /}
\<link rel="canonical" href="{dede:global.cfg_basehost function='replacewww(@me)'/}{dede:field name='typedir'/}/">
\<script type="application/ld+json">
{
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": "{dede:global.cfg_basehost function="replacemip(@me)"/}{dede:field name='typedir'/}/",
"appid": "你自己的",
"title": "{dede:field.seotitle/}_{dede:global.cfg_indexname/}",
"description": "{dede:field.description function='html2text(@me)'/}",
"upDate": "{dede:php runphp='yes'}$ntime = time();@me=strftime('%Y-%m-%d',$ntime)."T".@me=strftime('%H:%M:%S',$ntime);{/dede:php}",
}
\</script>
\</head>
三、mip端文章页head代码规范
\<head>
\<meta charset="utf-8">
\<title>{dede:field.title/}_{dede:global.cfg_indexname/}\</title>
\<meta name="description" content="{dede:field.description function='html2text(@me)'/}">
\<meta name="keywords" content="{dede:field.keywords/}">
{dede:include filename='meta.htm' /}
\<link rel="canonical" href="{dede:field name='arcurl' function='replacewww(@me)'/}">
\<script type="application/ld+json">
{
"@context": "https://ziyuan.baidu.com/contexts/cambrian.jsonld",
"@id": "{dede:field name='arcurl' function='replacemip(@me)'/}",
"appid": "你自己的",
"title": "{dede:field.title/}_{dede:global.cfg_indexname/}",
"description": "{dede:field.description function='html2text(@me)'/}",
"pubDate": "{dede:field.senddate function="MyDate('Y-m-d',@me)"/}T{dede:field.senddate function="MyDate('H:i:s',@me)"/}",
"upDate": "{dede:php runphp='yes'}$ntime = time();@me=strftime('%Y-%m-%d',$ntime)."T".@me=strftime('%H:%M:%S',$ntime);{/dede:php}",
}
\</script>
\</head>
四、mip通用meta代码规范
\<meta name="applicable-device" content="mobile"> \<!--页面端口声明-->
\<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"> \<!--页面初始缩放比例、是否可手动缩放说明-->
\<meta http-equiv="Cache-Control" content="no-transform"> \<!--禁止转码-->
\<meta http-equiv="Cache-Control" content="no-siteapp"> \<!--禁止转码-->
\<meta name="robots" content="all"> \<!--可以抓取本页,而且可以顺着本页继续索引别的链接-->
\<meta name="format-detection" content="telephone=no">
\<meta name="format-detection" content="email=no">
\<meta name="author" content="{dede:global.cfg_indexname/}">
\<meta name="copyright" content="本网站版权归{dede:global.cfg_indexname/}所有">
\<meta content="yes" name="apple-mobile-web-app-capable">
\<link rel="shortcut icon" href="{dede:global.cfg_basehost/}/favicon.ico" type="image/x-icon"> \<!--网站ico图标说明-->
更新: 2019-12-20 14:45:42
原文: <https://www.yuque.com/seoers/uyyd4f/xg60y9>