codecamp

MIP 让搜索发现你的页面-规范升级

说明

  • <link rel="standardhtml" href="xxx"> 将更改为 <link rel="canonical" href="xxx">

  • 过渡期:<link rel="canonical" href="xxx"><link rel="standardhtml" href="xxx">二者存在一个即可,2016.11.01开始,<link rel="canonical" href="xxx">必须存在

  • deadline:2016.10.30

示例

  • 正确:
<!DOCTYPE html>
<html mip>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
        <link rel="stylesheet" type="text/css" href="https://mipcache.bdstatic.com/static/mipmain-v1.1.1.css">
        <link rel="canonical" href="xxx">
        <!-- noscript 标签是为了在不支持script的环境下快速的展现 mip 页面,推荐使用 -->
        <noscript>
            <style mip-officialrelease>
                body {
                    -webkit-animation:none;
                       -moz-animation:none;
                        -ms-animation:none;
                            animation:none
                }
            </style>
        </noscript>
        <style mip-custom>
            p {
                color: #00f;
            }
        </style>
    </head>
    <body>
        <p>Hello World!</p>
    </body>
    <script src="https://mipcache.bdstatic.com/static/mipmain-v1.1.0.js"></script>   
</html>
  • 正确:
<!DOCTYPE html>
<html mip>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
        <link rel="stylesheet" type="text/css" href="https://mipcache.bdstatic.com/static/mipmain-v1.1.1.css">
        <link rel="canonical" href="xxx">
        <link rel="standardhtml" href="xxx">
        <!-- noscript 标签是为了在不支持script的环境下快速的展现 mip 页面,推荐使用 -->
        <noscript>
            <style mip-officialrelease>
                body {
                    -webkit-animation:none;
                       -moz-animation:none;
                        -ms-animation:none;
                            animation:none
                }
            </style>
        </noscript>
        <style mip-custom>
            p {
                color: #00f;
            }
        </style>
    </head>
    <body>
        <p>Hello World!</p>
    </body>
    <script src="https://mipcache.bdstatic.com/static/mipmain-v1.1.0.js"></script>   
</html>
  • 错误
<!DOCTYPE html>
<html mip>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
        <link rel="stylesheet" type="text/css" href="https://mipcache.bdstatic.com/static/mipmain-v1.1.1.css">
        <!-- noscript 标签是为了在不支持script的环境下快速的展现 mip 页面,推荐使用 -->
        <noscript>
            <style mip-officialrelease>
                body {
                    -webkit-animation:none;
                       -moz-animation:none;
                        -ms-animation:none;
                            animation:none
                }
            </style>
        </noscript>
        <style mip-custom>
            p {
                color: #00f;
            }
        </style>
    </head>
    <body>
        <p>Hello World!</p>
    </body>
    <script src="https://mipcache.bdstatic.com/static/mipmain-v1.1.0.js"></script>   
</html>
  • 错误
<!DOCTYPE html>
<html mip>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
        <link rel="stylesheet" type="text/css" href="https://mipcache.bdstatic.com/static/mipmain-v1.1.1.css">
        <link rel="standardhtml" href="xxx">
        <!-- noscript 标签是为了在不支持script的环境下快速的展现 mip 页面,推荐使用 -->
        <noscript>
            <style mip-officialrelease>
                body {
                    -webkit-animation:none;
                       -moz-animation:none;
                        -ms-animation:none;
                            animation:none
                }
            </style>
        </noscript>
        <style mip-custom>
            p {
                color: #00f;
            }
        </style>
    </head>
    <body>
        <p>Hello World!</p>
    </body>
    <script src="https://mipcache.bdstatic.com/static/mipmain-v1.1.0.js"></script>   
</html>
MIP 让搜索发现你的页面
MIP 组件概述
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

MIP 帮助

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }