mirror of
https://github.com/c0de-archive/pelican-mg.git
synced 2024-12-22 08:22:40 +00:00
Adding MG_DISABLE_SUMMARY + ensuring W3C validator-compliant
This commit is contained in:
parent
33d690f035
commit
1f204bb2d9
@ -1,5 +1,9 @@
|
||||
html, h1 {
|
||||
font-family: "Oswald", "Helvetica Neue",Helvetica,Arial,sans-serif; }
|
||||
html {
|
||||
font: 400 14px / 20px "Oswald", "Helvetica Neue",Helvetica,Arial,sans-serif; }
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 20px; }
|
||||
|
||||
a {
|
||||
color: #33b5e5; }
|
||||
|
@ -4,7 +4,7 @@ $(document).ready(function() {
|
||||
$('.mg-container-social').height($('article').height());
|
||||
$('#mg-panel-social').stick_in_parent({offset_top: 35});
|
||||
|
||||
$('#tipue_search_input').tipuesearch({
|
||||
$('.tipue_search').tipuesearch({
|
||||
'show': 10,
|
||||
'mode': 'json',
|
||||
'showURL': false,
|
||||
|
@ -97,7 +97,7 @@ http://www.tipue.com/search
|
||||
}
|
||||
if (getURLP('q'))
|
||||
{
|
||||
$('#tipue_search_input').val(getURLP('q'));
|
||||
$('.tipue_search')[0].val(getURLP('q'));
|
||||
getTipueSearch(0, true);
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ http://www.tipue.com/search
|
||||
var c = 0;
|
||||
found = new Array();
|
||||
|
||||
var d = $('#tipue_search_input').val().toLowerCase();
|
||||
var d = $('.tipue_search')[0].val().toLowerCase();
|
||||
d = $.trim(d);
|
||||
|
||||
if ((d.match("^\"") && d.match("\"$")) || (d.match("^'") && d.match("'$")))
|
||||
|
@ -72,7 +72,7 @@
|
||||
<a href="https://plus.google.com/share?url={{ SITEURL }}/{{ article.url }}" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" target="_blank" class="uk-button uk-visible-small"><i class="uk-icon-google-plus-square"></i> Share</a>
|
||||
{% endif %}
|
||||
|
||||
<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags }}</p>
|
||||
{% if not MG_DISABLE_SUMMARY %}<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags }}</p>{% endif %}
|
||||
<section class="uk-article-content" itemprop="articleBody">{{ article.content }}</section>
|
||||
<hr class="uk-article-divider">
|
||||
</article>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<title>{% block title %}{{ SITENAME }}{% endblock %}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="{% block description %}{{ DESCRIPTION }}{% endblock %}">
|
||||
<link rel="shortcut icon" href="{{ SITEURL }}/{{ FAVICON }}" type="{{ FAVICON_TYPE }}">
|
||||
{% if FAVICON %}<link rel="shortcut icon" href="{{ SITEURL }}/{{ FAVICON }}" type="{{ FAVICON_TYPE|default('image/x-icon') }}">{% endif %}
|
||||
<meta name="author" content="{{ AUTHOR }}">
|
||||
<meta name="copyright" content="{{ AUTHOR }}">
|
||||
<meta name="twitter:card" content="summary" />
|
||||
@ -90,17 +90,19 @@
|
||||
{% if not DISABLE_SEARCH %}
|
||||
<div class="uk-panel uk-panel-box">
|
||||
<form class="uk-search" action="{{ SITEURL }}/search.html" data-uk-search>
|
||||
<input class="uk-search-field tipue_search" type="search" name="q" id="tipue_search_input" autocomplete="off" placeholder="Search...">
|
||||
<input class="uk-search-field tipue_search" type="search" name="q" autocomplete="off" placeholder="Search...">
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="uk-panel uk-panel-box">
|
||||
<ul class="uk-nav uk-nav-side">
|
||||
{% if CATEGORY_SAVE_AS %}
|
||||
<li class="uk-nav-header">Categories</li>
|
||||
{% for cat, _ in categories %}
|
||||
<li {% if cat == category %}class="uk-active"{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat }}</a></li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if DISPLAY_PAGES_ON_MENU != False %}
|
||||
<li class="uk-nav-header">Pages</li>
|
||||
|
||||
@ -112,8 +114,10 @@
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if ARCHIVE_SAVE_AS %}
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li {% if page_name == 'archives' %}class="uk-active"{% endif %}><a href="{{ SITEURL }}/archives.html">Archives</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -144,7 +148,7 @@
|
||||
<footer class="mg-footer">
|
||||
<div class="uk-container uk-container-center uk-text-center">
|
||||
|
||||
<div class="mg-icons-small uk-subnav uk-visible-small">
|
||||
<ul class="mg-icons-small uk-subnav uk-visible-small">
|
||||
<li><a rel="alternate" type="application/atom+xml" href="{{ SITEURL }}/{{ FEED_ALL_ATOM }}" class="uk-icon-button uk-icon-rss"></a></li>
|
||||
{% if SOCIAL %}
|
||||
{% for icon, link in SOCIAL %}
|
||||
@ -153,7 +157,7 @@
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<div class="mg-author uk-panel">
|
||||
<p>{{ FOOTER }}</p>
|
||||
@ -168,7 +172,7 @@
|
||||
|
||||
{% if not DISABLE_SEARCH %}
|
||||
<form class="uk-search" action="{{ SITEURL }}/search.html" data-uk-search>
|
||||
<input class="uk-search-field" type="search" name="q" id="tipue_search_input" autocomplete="off" placeholder="Search...">
|
||||
<input class="uk-search-field tipue_search" type="search" name="q" autocomplete="off" placeholder="Search...">
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
|
@ -7,23 +7,9 @@
|
||||
{% for article in (articles_page.object_list if articles_page else articles) %}
|
||||
|
||||
{% if loop.index == 1 %}
|
||||
<article class="uk-article" itemtype="http://schema.org/BlogPosting" itemscope="itemscope" itemprop="blogPost">
|
||||
<a href="{{ SITEURL }}/{{ article.url }}" class="uk-article-title uk-link-muted" itemprop="name">{{ article.title }}</a>
|
||||
<p class="uk-article-meta"><time datetime="{{ article.date.strftime('%Y-%m-%d') }}" itemprop="datePublished">{{ article.locale_date }}</time> • <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>{% if DISQUS_SITENAME %} • <br class="uk-visible-small"><i class="uk-icon-comment"></i> <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" itemprop="discussionUrl"></a>{% endif %}</p>
|
||||
</p>
|
||||
<section class="uk-article-content" itemprop="articleBody">{{ article.content }}</section>
|
||||
<a href="{{ SITEURL }}/{{ article.url }}#disqus_thread"></a>
|
||||
<hr class="uk-article-divider">
|
||||
</article>
|
||||
{% include "partials/article-excerpt.html" %}
|
||||
{% else %}
|
||||
<article class="uk-article" itemtype="http://schema.org/BlogPosting" itemscope="itemscope" itemprop="blogPost">
|
||||
<a href="{{ SITEURL }}/{{ article.url }}" class="uk-article-title uk-link-muted" itemprop="name">{{ article.title }}</a>
|
||||
<p class="uk-article-meta"><time datetime="{{ article.date.strftime('%Y-%m-%d') }}" itemprop="datePublished">{{ article.locale_date }}</time> • <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>{% if DISQUS_SITENAME %} • <br class="uk-visible-small"><i class="uk-icon-comment"></i> <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" itemprop="discussionUrl"></a>{% endif %}</p>
|
||||
</p>
|
||||
<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags }}</p>
|
||||
<a href="{{ SITEURL }}/{{ article.url }}">Read More</a>
|
||||
<hr class="uk-article-divider">
|
||||
</article>
|
||||
{% include "partials/article-short.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
9
templates/partials/article-excerpt.html
Normal file
9
templates/partials/article-excerpt.html
Normal file
@ -0,0 +1,9 @@
|
||||
<article class="uk-article" itemtype="http://schema.org/BlogPosting" itemscope="itemscope" itemprop="blogPost">
|
||||
<a href="{{ SITEURL }}/{{ article.url }}" class="uk-link-muted"><h1 class="uk-article-title" itemprop="name">{{ article.title|e }}</h1></a>
|
||||
<p class="uk-article-meta"><time datetime="{{ article.date.strftime('%Y-%m-%d') }}" itemprop="datePublished">{{ article.locale_date }}</time> • <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>{% if DISQUS_SITENAME %} • <br class="uk-visible-small"><i class="uk-icon-comment"></i> <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" itemprop="discussionUrl"></a>{% endif %}</p>
|
||||
{% if not MG_DISABLE_SUMMARY %}<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags|striptags }}</p>{% endif %}
|
||||
<section class="uk-article-content" itemprop="articleBody">{{ article.content }}</section>
|
||||
<a href="{{ SITEURL }}/{{ article.url }}#disqus_thread"></a>
|
||||
<hr class="uk-article-divider">
|
||||
</article>
|
||||
|
10
templates/partials/article-short.html
Normal file
10
templates/partials/article-short.html
Normal file
@ -0,0 +1,10 @@
|
||||
<article class="uk-article" itemtype="http://schema.org/BlogPosting" itemscope="itemscope" itemprop="blogPost">
|
||||
<a href="{{ SITEURL }}/{{ article.url }}" class="uk-link-muted"><h1 class="uk-article-title" itemprop="name">{{ article.title|e }}</h1></a>
|
||||
<p class="uk-article-meta"><time datetime="{{ article.date.strftime('%Y-%m-%d') }}" itemprop="datePublished">{{ article.locale_date }}</time> • <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>{% if DISQUS_SITENAME %} • <br class="uk-visible-small"><i class="uk-icon-comment"></i> <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread" itemprop="discussionUrl"></a>{% endif %}</p>
|
||||
<!--{{ article.summary }}-->
|
||||
<p class="uk-article-lead" itemprop="description">{{ article.summary|striptags|striptags }}</p>
|
||||
{% if not MG_DISABLE_SUMMARY %}<p>{{ ' '.join(article.content.split(' ')[:SUMMARY_MAX_LENGTH ])|striptags|striptags }}...</p>{% endif %}
|
||||
<a href="{{ SITEURL }}/{{ article.url }}">Read More</a>
|
||||
<hr class="uk-article-divider">
|
||||
</article>
|
||||
|
Loading…
Reference in New Issue
Block a user