{% extends "base.html" %}

{% block title %}StarPunk - Home{% endblock %}

{% block content %}
<div class="h-feed">
  <h2 class="p-name">Recent Notes</h2>

  {% if notes %}
    {% for note in notes %}
    <article class="h-entry note-preview">
      <div class="e-content">
        {{ note.html[:300]|safe }}{% if note.html|length > 300 %}...{% endif %}
      </div>
      <footer class="note-meta">
        <a class="u-url" href="{{ url_for('public.note', slug=note.slug) }}">
          <time class="dt-published" datetime="{{ note.created_at.isoformat() }}">
            {{ note.created_at.strftime('%B %d, %Y') }}
          </time>
        </a>
      </footer>
    </article>
    {% endfor %}
  {% else %}
    <p class="empty-state">No notes published yet. Check back soon!</p>
  {% endif %}
</div>
{% endblock %}
