Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove post type quote & picture #1099

Merged
merged 2 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions layout/_macro/post-collapse.swig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{%- endif %}
{# endshow #}

<article class="post post-type-{{ post.type | default('normal') }}" itemscope itemtype="http://schema.org/Article">
<article class="post" itemscope itemtype="http://schema.org/Article">
<header class="post-header">

<{%- if theme.seo %}h3{% else %}h2{%- endif %} class="post-title">
Expand All @@ -23,11 +23,7 @@
{{ 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">
{%- if post.type === 'picture' %}
{{ post.content }}
{% else %}
<span itemprop="name">{{ post.title | default(__('post.untitled')) }}</span>
{%- endif %}
<span itemprop="name">{{ post.title | default(__('post.untitled')) }}</span>
</a>
{%- endif %}
</{%- if theme.seo %}h3{% else %}h2{%- endif %}>
Expand Down
63 changes: 25 additions & 38 deletions layout/_macro/post.swig
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{%- set headlessPost = Array.prototype.indexOf.call(['quote', 'picture'], post.type) > -1 %}

{%- set post_class = 'post post-type-' + post.type | default('normal') %}
{%- if post_extra_class > 0 %}
{%- set post_class = post_class + ' ' + post_extra_class | default('') %}
{%- endif %}
{%- set post_class = 'post' %}
{%- if post.sticky > 0 %}
{%- set post_class = post_class + ' post-sticky' %}
{%- endif %}
Expand All @@ -29,35 +24,31 @@
<meta itemprop="name" content="{{ title }}">
</span>

{%- if not headlessPost %}
{%- if post.header !== false %}
<header class="post-header">

{# Not to show title for quote posts that do not have a title #}
{%- if not (is_index and post.type === 'quote' and not post.title) %}
<{%- if theme.seo %}h2{% else %}h1{%- endif %} class="post-title{%- if post.direction && post.direction.toLowerCase() === 'rtl' %} rtl{%- endif %}" itemprop="name headline">{#
#}{# Link posts #}{#
#}{%- if post.link %}
{%- if post.sticky > 0 %}
<span class="post-sticky-flag" title="{{ __('post.sticky') }}">
<i class="fa fa-thumb-tack"></i>
</span>
{%- endif %}
{%- set postTitleIcon = '<i class="fa fa-external-link"></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 %}
<span class="post-sticky-flag" title="{{ __('post.sticky') }}">
<i class="fa fa-thumb-tack"></i>
</span>
{%- endif %}
{{ next_url(post.path, post.title | default(__('post.untitled')), {class: 'post-title-link', itemprop: 'url' }) }}
{% else -%}
{{- post.title -}}
{% include '../_partials/post-edit.swig' %}
<{%- if theme.seo %}h2{% else %}h1{%- endif %} class="post-title{%- if post.direction &&post.direction.toLowerCase() === 'rtl' %} rtl{%- endif %}" itemprop="name headline">{#
#}{# Link posts #}{#
#}{%- if post.link %}
{%- if post.sticky > 0 %}
<span class="post-sticky-flag" title="{{ __('post.sticky') }}">
<i class="fa fa-thumb-tack"></i>
</span>
{%- endif %}
</{%- if theme.seo %}h2{% else %}h1{%- endif %}>
{%- endif %}
{%- set postTitleIcon = '<i class="fa fa-external-link"></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 %}
<span class="post-sticky-flag" title="{{ __('post.sticky') }}">
<i class="fa fa-thumb-tack"></i>
</span>
{%- endif %}
{{ next_url(post.path, post.title | default(__('post.untitled')), {class: 'post-title-link', itemprop: 'url' }) }}
{% else -%}
{{- post.title -}}
{% include '../_partials/post-edit.swig' %}
{%- endif %}
</{%- if theme.seo %}h2{% else %}h1{%- endif %}>

<div class="post-meta">

Expand Down Expand Up @@ -235,11 +226,7 @@
{%- endif %}
<!--/noindex-->
{% else %}
{%- if post.type === 'picture' %}
<a href="{{ url_for(post.path) }}">{{ post.content }}</a>
{% else %}
{{ post.content }}
{%- endif %}
{{ post.content }}
{%- endif %}
{% else %}
{{ post.content }}
Expand Down
12 changes: 0 additions & 12 deletions source/css/_common/components/post/post-type.styl

This file was deleted.

1 change: 0 additions & 1 deletion source/css/_common/components/post/post.styl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
@import 'post-rtl';
@import 'post-tags';
@import 'post-title';
@import 'post-type';

@import 'post-reward' if (hexo-config('reward_settings.enable'));

Expand Down