mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
* Fix head inject point * Switch `.link-grid-image` to `<img>` * Switch `.link-grid-image` back to `<object>` - Set `type` to `image/jpeg` for image without file extension
This commit is contained in:
parent
6b23d42930
commit
662dd80fc5
@ -3,8 +3,9 @@
|
||||
<head>
|
||||
{{ partial('_partials/head/head.njk', {}, {cache: theme.cache.enable}) }}
|
||||
{%- include '_partials/head/head-unique.njk' -%}
|
||||
{{- next_js('load-config.js', true) }}
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
{{- next_js('load-config.js', true) }}
|
||||
{{- next_inject('head') }}
|
||||
{{ partial('_third-party/analytics/index.njk', {}, {cache: theme.cache.enable}) }}
|
||||
<noscript>
|
||||
<link rel="stylesheet" href="{{ url_for(theme.css) }}/noscript.css">
|
||||
|
||||
@ -21,5 +21,3 @@
|
||||
theme.calendar | safedump | escape
|
||||
if page.type === 'schedule' and not page.title
|
||||
}}">
|
||||
|
||||
{{- next_inject('head') }}
|
||||
|
||||
@ -8,8 +8,10 @@ module.exports = function([image = '/images/avatar.gif', delimiter = '|', commen
|
||||
const links = content.split('\n').filter(line => line.trim() !== '').map(line => {
|
||||
const item = line.split(delimiter).map(arg => arg.trim());
|
||||
if (item[0][0] === comment) return '';
|
||||
const imageSource = item[3] || image;
|
||||
const hasExtension = /\.[^/]+$/.test(imageSource);
|
||||
return `<div class="link-grid-container">
|
||||
<object class="link-grid-image" data="${item[3] || image}"></object>
|
||||
<object class="link-grid-image" ${hasExtension ? '' : 'type="image/jpeg" '}data="${imageSource}"></object>
|
||||
<p>${item[0]}</p><p>${item[2] || item[1]}</p>
|
||||
<a href="${item[1]}"></a>
|
||||
</div>`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user