mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-19 18:42:34 +00:00
Add link posts feature
This reverts commit a24450d9cfc6a6f7e5f6ddfabd6167fb6c0857d9.
This commit is contained in:
parent
2507438cb5
commit
4cba2a3c44
@ -22,9 +22,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="post-title">
|
<div class="post-title">
|
||||||
<a class="post-title-link" href="{{ url_for(post.path) }}" itemprop="url">
|
{%- if post.link %}{# Link posts #}
|
||||||
<span itemprop="name">{{ post.title or __('post.untitled') }}</span>
|
{%- set postTitleIcon = '<i class="fa fa-external-link-alt"></i>' %}
|
||||||
</a>
|
{%- set postText = post.title or post.link %}
|
||||||
|
{{ next_url(post.link, postText + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url'}) }}
|
||||||
|
{% else %}
|
||||||
|
<a class="post-title-link" href="{{ url_for(post.path) }}" itemprop="url">
|
||||||
|
<span itemprop="name">{{ post.title or __('post.untitled') }}</span>
|
||||||
|
</a>
|
||||||
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ post_gallery(post.photos) }}
|
{{ post_gallery(post.photos) }}
|
||||||
|
|||||||
@ -26,7 +26,17 @@
|
|||||||
{%- if post.header !== false %}
|
{%- if post.header !== false %}
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
<{% if is_index %}h2{% else %}h1{% endif %} class="post-title{% if post.direction and post.direction.toLowerCase() === 'rtl' %} rtl{% endif %}" itemprop="name headline">
|
<{% if is_index %}h2{% else %}h1{% endif %} class="post-title{% if post.direction and post.direction.toLowerCase() === 'rtl' %} rtl{% endif %}" itemprop="name headline">
|
||||||
{% if is_index %}
|
{# Link posts #}
|
||||||
|
{%- if post.link %}
|
||||||
|
{%- if post.sticky > 0 %}
|
||||||
|
<span class="post-sticky-flag" title="{{ __('post.sticky') }}">
|
||||||
|
<i class="fa fa-thumbtack"></i>
|
||||||
|
</span>
|
||||||
|
{%- endif %}
|
||||||
|
{%- set postTitleIcon = '<i class="fa fa-external-link-alt"></i>' %}
|
||||||
|
{%- set postText = post.title or post.link %}
|
||||||
|
{{- next_url(post.link, postText + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url'}) }}
|
||||||
|
{% elif is_index %}
|
||||||
{%- if post.sticky > 0 %}
|
{%- if post.sticky > 0 %}
|
||||||
<span class="post-sticky-flag" title="{{ __('post.sticky') }}">
|
<span class="post-sticky-flag" title="{{ __('post.sticky') }}">
|
||||||
<i class="fa fa-thumbtack"></i>
|
<i class="fa fa-thumbtack"></i>
|
||||||
|
|||||||
@ -89,6 +89,11 @@
|
|||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fa {
|
||||||
|
font-size: $font-size-small;
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user