|
|
|
@ -301,7 +301,13 @@ class Index extends CI_Controller
|
|
|
|
|
$img_alt = $image->alt;
|
|
|
|
|
$img_class = $image->class;
|
|
|
|
|
if (!empty($img_size)) {
|
|
|
|
|
$image->outertext = " <amp-img layout=\"responsive\" class=\"{$img_class}\" alt=\"{$img_alt}\" src=\"{$img_src}\" width=\"{$img_size->width}\" height=\"{$img_size->height}\"></amp-img>";
|
|
|
|
|
//添加webp图片支持
|
|
|
|
|
$img_src_webp='';
|
|
|
|
|
if(substr($img_src, -4) == '.jpg'){
|
|
|
|
|
$img_src_webp=substr($img_src, 0, strlen($img_src) - 4).'.webp';
|
|
|
|
|
$img_src_webp = " <amp-img fallback layout=\"responsive\" class=\"{$img_class}\" alt=\"{$img_alt}\" src=\"{$img_src_webp}\" width=\"{$img_size->width}\" height=\"{$img_size->height}\"></amp-img>";
|
|
|
|
|
}
|
|
|
|
|
$image->outertext = " <amp-img layout=\"responsive\" class=\"{$img_class}\" alt=\"{$img_alt}\" src=\"{$img_src}\" width=\"{$img_size->width}\" height=\"{$img_size->height}\" {$img_src_webp}></amp-img>";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
foreach ($html_object->find('#content_main') as $content_main) {
|
|
|
|
|