Skip to content

Plugin which allows to add coming soon status to articles

Notifications You must be signed in to change notification settings

chiragjn/pelican-coming-soon-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pelican "Coming Soon" Plugin

Works with pelican==4.0.x

I have no plans to maintain this for pelican==4.0.x

Allows to list draft posts as "coming soon" on the articles list page without any links to them

![Screenshot] (https://raw.githubusercontent.com/chiragjn/pelican-coming-soon-plugin/master/screenshot.png)

Draft's metadata needs to have the "visible_draft" field with value "true"

:status: draft
:visible_draft: true

Then adapt your theme's index.html accordingly

Example:

{% for article in articles_page.object_list %}
<article>
  <div id="article_title">
    <h1 id="no_vertical_margin">
      {% if article.status.lower() == "draft" and article.metadata.visible_draft %}
        <a class="button_more" href="{{ SITEURL }}/">{{ article.title }}</a>
      {% else %}
        <a class="button_more" href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
      {% endif %}
  </div>
  <div id="article_text">
    {{ article.summary }}
  </div>
  <div id="article_more">
	{% if article.status.lower() == "draft" and article.metadata.visible_draft %}
		<a class="button_more" href="{{ SITEURL }}/">Coming Soon</a>
	{% else %}
		<a class="button_more" href="{{ SITEURL }}/{{ article.url }}">Read &rarr;</a>
	{% endif %}	
  </div>
</article>
{% if not loop.last %}
<hr />
{% endif %}
{% endfor %}

Also your archives.html

{% extends "base.html" %}
{% block title %}Archives{% endblock %}

{% block content %}
<article>
  <div id="article_text">
    <dl>
      {% for article in dates %}
      	{% if article.status.lower() == "published" %}
	      <dt>{{ article.locale_date }}</dt>
	      <dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
	    {% endif %}
      {% endfor %}
    </dl>
  </div>
</article>
{% endblock %}
{% block footer %}
<p><a href="{{ SITEURL }}/" class="button_accent">&larr; Back to Index</a></p>
{% endblock %}

About

Plugin which allows to add coming soon status to articles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages