将 Google AMP(加速移动页面)应用于 ASP.NET Core 站点 [英] Apply Google AMP (Accelerated Mobile Pages) to ASP.NET Core site
本文介绍了将 Google AMP(加速移动页面)应用于 ASP.NET Core 站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 ASPNET Core MVC 创建一个 AMP 页面.我找不到很多文件(如果有的话).对于 ASPNET,建议使用 DisplayModes
来创建 Google AMP 显示.但是,ASPNet Core 不支持 DisplayModes
,我正试图找到一种方法来解决它.任何建议将不胜感激!
@model Models.Article@{布局 = 空;}<!doctype html><html ><头><meta charset="utf-8"><link rel="canonical" href="/article.cshtml"><link rel="amphtml" href="/article.amp.cshtml"><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"><style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@keyframes -amp-start{from{visibility:hidden}到{visibility:visible}}</style><noscript><风格放大器样板>身体 {-webkit-animation:无;-moz-动画:无;-ms-动画:无;动画:无}</style></noscript><script async src="https://cdn.ampproject.org/v0.js"></script>头部><身体><文章><h2>@Html.DisplayFor(model =>model.Title)</h2><div>@Convert.ToDateTime(Model.PublishedDate).ToString("dddd, MMMM d, yyyy")
</文章>