Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to create a feed aggregation page #4

Merged
merged 1 commit into from
Apr 24, 2020

Conversation

davidag
Copy link
Collaborator

@davidag davidag commented Apr 8, 2020

After reviewing the plugin pelican-planet mentioned in issue #3 I've concluded that a similar feed aggregation page can be created using Webring without further modifications. Thus, I've decided to document how it could be done in the README.

Comments are more than welcomed!

@ashwinvis This was a first step in improving webring to match pelican-planet and your asyncio implementation.

@ashwinvis
Copy link

Nice... Should we include Indieweb stuff in the documentation, or keep things simple? I can share my template just for reference. Some enhancements that I used:

  • Do not let images in feeds exceed max-width
  • Open links in new tabs
  • h-cite instead of h-entry
  • Deal with feeds with no title
---
Title: Planet Avium
Author: Various
Slug: planet
Status: published
---

> A [river of news](https://indieweb.org/planet) from a [selection of
> feeds](https://github.com/ashwinvis/ashwinvis.github.io/blob/develop/planet.opml)
> I follow. *Disclaimer: This is not an endorsement*.

<style>
#planet img{
    max-width: 100%;
    height: auto;
}
</style>

<div id="planet">
{% for article in articles %}
<article class="h-cite">
<header>
  <h1>
    <a href="{{ article.link }}" rel="bookmark" class="u-url"
       title="{{ article.title}}" target="_blank">
      <time class="m-date" datetime="{{ article.updated }}">
        {{ article.updated.strftime("%b") }}
        <span class="m-date-day">
          {{ article.updated.strftime("%d") }}
        </span>
        {{ article.updated.strftime("%Y") }}
      </time>
      <div class="p-name">
      {{ article.title or "💬" }}
      </div>
    </a>
  </h1>
  <div class="p-summary">
  {{ article.summary }}
  </div>
</header>
<footer>
  <p>Posted by
  <span class="p-author"><b>{{ article.author or "Anonymous" }}</b></span>
  on <time datetime="{{ article.updated }}" class="dt-published"></time>
  {{ article.updated.strftime("%a %d %b %Y")}}
  in {{ article.feed_name }}.
</footer>
<div class="m-clearfix-l"></div>

</article>
{% endfor %}
</div>

@davidag
Copy link
Collaborator Author

davidag commented Apr 9, 2020

Thanks for sharing @ashwinvis !

Let's keep things simple. As you can see, the proposed examples are as simple as possible and I'm using the notmyidea theme which is currently Pelican's default.

Besides that, using the Webring plugin to generate an aggregation page requires only a template file (.html) in your theme's template directory. This means you wouldn't need the metadata on the top of your file.

@ashwinvis
Copy link

I understand. Can you extract {{article.author}} too?

@ashwinvis
Copy link

Hey, I tried your how-to as is, but all I get is a blank page (ashwinvis/ashwinvis.github.io#23). I think I will revert to pelican-planet until I figure out how to use webring.

Do you have a full example of a feed aggregation page somewhere?

@davidag
Copy link
Collaborator Author

davidag commented Apr 24, 2020

Hi @ashwinvis! Your website looks really nice 😉

I've taken a look at your code and it seems quite complex to me, maybe using the official repos instead of your own forked ones would be a first step... just my 2 cents 😉.

But let's get into matter. After dealing with setting it up, I've figured out why it wasn't working: you're using m.css which in its base.html uses main as the block content to inherit in subtemplates. This means planet.html should use {% block main %} instead of {% block content %}.

I hope this helps! Thank you for trying this out! 👏

@ashwinvis
Copy link

I've taken a look at your code and it seems quite complex to me, maybe using the official repos instead of your own forked ones would be a first step.

I haven't made any modifications to pelican / webring... yet and it is up to date with upstream

This means planet.html should use {% block main %} instead of {% block content%}.

I will give it a try.

@davidag davidag merged commit a1fb2bd into master Apr 24, 2020
@davidag davidag deleted the feed-aggregation-page-creation branch April 24, 2020 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants