Skip to content

Write a script to update site.time and add TRAVIS CI #1

Open
@Malwine

Description

@Malwine

Jekyll would usually show old posts(=workshops) and no posts that have a future date. We turned the behavior around with these code lines:

{% assign curDate = site.time | date: '%s' %}
    {% for post in site.posts %}
        {% assign postStartDate = post.date | date: '%s' %}
        {% if postStartDate >= curDate %}
          <li>
            <span class="post-meta">{{ post.date | date: "%b %-d, %Y" }}</span>

            <h2>
              <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
            </h2>
          </li>
        {% endif %}
    {% endfor %}

This works fine. The only problem is that site.time only gets updated once we deploy. And we might not deploy everyday. (A deploy happens everytime we push to gh-pages branch.)

💡 The idea is to write a script that updates site.time everyday.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions