Coder Social home page Coder Social logo

pelican-coming-soon-plugin's Introduction

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 %}

pelican-coming-soon-plugin's People

Contributors

chiragjn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.