你好,好人。
我正在尝试创建一个自定义的Ghost主题,该主题支持Google的Accelerated Mobile Pages,即Google AMP,但是我面临一个用于图像的特定自定义标签的问题。
<amp-img src="welcome.jpg" alt="Welcome" height="400" width="800"></amp-img>
注意amp-img HTML标签。
我相信,为了为Ghost创建自定义HTML标记,我需要修改核心“服务器” Ghost文件吗?
到目前为止的进展在我的GitHub项目Ampsper v0.0上
最后,Ghost版本0.10.0在系统中内置了AMP(Google加速移动页面)支持。
摘自Ghost的AMP文档:
该
{{image}}
助手需要被包裹在一个<amp-img>
标签,并且必须提供宽度和高度财产,只为发表图片作品。{{author.image}}
在amp上下文中不支持,但是{{image}}
仍可以在{{#author}}{{/author}}
块表达式中使用该辅助器。
下面的例子:
{{#post}}
<amp-img src={{image absolute="true"}} width="600" height="400" layout="responsive"></amp-img>
{{/post}}
{{#post}}
{{#author}}
<amp-img src={{image absolute="true"}} width="50" height="50"></amp-img>
{{/author"}}
{{/post}}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句