Revert "fix(head): meta generator tag should be after <title>"

This reverts commit 710b9b25a1.
This commit is contained in:
curben 2019-08-30 05:50:10 +01:00
parent 9740be51ae
commit 63a8fccc48
2 changed files with 18 additions and 17 deletions

View File

@ -10,7 +10,7 @@
hexo.extend.tag.register('cloudinary', (args) => {
const user = 'curben'
const fileName = args[0]
let fileName = args[0]
const alt = args[1] || ''
let modern = ''
let legacy = ''
@ -26,36 +26,37 @@ hexo.extend.tag.register('cloudinary', (args) => {
legacy = fileName
}
const modernLink = link + '/' + modern + '?auto_format=false'
const legacyLink = link + '/' + legacy + '?auto_format=false'
fileName += '?auto_format=false'
modern += '?auto_format=false'
legacy += '?auto_format=false'
const img = `<img
srcset="${legacyLink}&w=320 320w,
${legacyLink}&w=468 468w,
${legacyLink}&w=768 768w,
${legacyLink} 800w"
srcset="${link}/${legacy}&w=320 320w,
${link}/${legacy}&w=468 468w,
${link}/${legacy}&w=768 768w,
${link}/${legacy} 800w"
sizes="(max-width: 320px) 320px,
(max-width: 468px) 468px,
(max-width: 768px) 768px,
800px"
src="${legacyLink}"
src="${link}/${legacy}"
alt="${alt}" loading="lazy">`
if (fileName.endsWith('.png') || fileName.endsWith('.webp')) {
return `<a href="${legacyLink}">
<picture>
return `<a href="${link}/${fileName}">
<picture><noscript>
<source type="image/webp"
srcset="${modernLink}&w=320 320w,
${modernLink}&w=468 468w,
${modernLink}&w=768 768w,
${modernLink} 800w"
srcset="${link}/${modern}&w=320 320w,
${link}/${modern}&w=468 468w,
${link}/${modern}&w=768 768w,
${link}/${modern} 800w"
sizes="(max-width: 320px) 320px,
(max-width: 468px) 468px,
(max-width: 768px) 768px,
800px">
${img}
</picture></a>`
</noscript></picture></a>`
} else {
return `<a href="${legacyLink}">${img}</a>`
return `<a href="${link}/${fileName}"><noscript>${img}</noscript></a>`
}
})

View File

@ -1,5 +1,6 @@
<head>
<meta charset="utf-8">
<%- metaGenerator() %>
<%
let title = page.title
@ -22,7 +23,6 @@
%>
<title><% if (title) { %><%= title %> | <% } %><%= config.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<%- metaGenerator() %>
<%/* Add Open Graph meta tags for easier sharing on social networking sites */%>
<%/* Modified from original source for compatibility with my blog */%>
<%- openGraph() %>