google-amp

Google AMP: Sticky header possible?

Deadly 提交于 2020-03-18 12:09:05
问题 So far I haven't found a solid way to create a sticky header on AMP pages. I know there are css workaround/hacks, but nothing I can use in a production environment. A simple "position:fixed;" unfortunately won't work in my case. Out of all the components, I thought there would be one that toggles a body class on scroll, but I haven't found anything yet. Also don't think "amp-position-observer" will be of any use. Am I missing something? Ideally I'd like to be able to toggle an element's

Update Google AMP cache URL signature verification error

[亡魂溺海] 提交于 2020-01-04 05:48:18
问题 I'm trying to update my Google AMP pages in the Google AMP Cache, but get an URL signature verification error. My code: Dim tStamp As String = GetUnixTimeStampFromDateTime(DateTime.Now).ToString Dim ampBaseUrl As String = "https://www-example-com.cdn.ampproject.org" Dim signatureUrl As String = "/update-cache/c/s/www.example.com/articles/278/myarticle/amp?amp_action=flush&amp_ts=" + tStamp Dim rsa As RSA = certificate.GetRSAPrivateKey() Dim data() As Byte = System.Text.Encoding.Unicode

Automatically switching views for AMP in ASP.NET MVC

ε祈祈猫儿з 提交于 2019-12-14 00:36:04
问题 I want to create and AMP version of my website in ASP.NET MVC using .NET Core 2.0. Previously I had done some work with DisplayModeProvider instances in tha past on .Net framework, but that does not seem to be an option in .NET Core. What I want to be able to do is alter the view names to be index.amp.cshtml rather than index.cshtml when my URL starts iwth /amp . What's the best way to achieve this in .NET Core? 回答1: You can do something like this using IViewLocationExpander . As it happens,

ASP.NET: Sign URL with public and private keys from files

北战南征 提交于 2019-12-06 19:48:00
问题 I want to update Google AMP cache, so I need to sign an URL as described here. My main issue: I'm struggling massively with how I should get my certificates/keys and how to include them in my code below. I just can't find any all covering instructions for Windows and IIS. I have been reading these posts: Using /update-cache requests to update AMP pages How can I sign a file using RSA and SHA256 with .NET? I don't want to use my computer's certificate store as described in the second post. I'd

ASP.NET: Sign URL with public and private keys from files

丶灬走出姿态 提交于 2019-12-04 23:46:26
I want to update Google AMP cache, so I need to sign an URL as described here . My main issue: I'm struggling massively with how I should get my certificates/keys and how to include them in my code below. I just can't find any all covering instructions for Windows and IIS. I have been reading these posts: Using /update-cache requests to update AMP pages How can I sign a file using RSA and SHA256 with .NET? I don't want to use my computer's certificate store as described in the second post. I'd rather use files on disk for both public and private keys. From my production server IIS, I exported