ietf-tools / www

A customized CMS for the IETF website
BSD 3-Clause "New" or "Revised" License
22 stars 45 forks source link

feat: Authors index page #356

Closed mgax closed 7 months ago

mgax commented 7 months ago

Fixes https://github.com/ietf-tools/wagtail_website/issues/195.


I've noticed a couple of things while implementing; maybe they should become separate issues?

  1. https://www.ietf.org/blog/ renders the content of the first article (right now it's https://www.ietf.org/blog/ietf-administration-llc-2024-draft-budget/). This is confusing, not least because it's not straightforward to get the permalink for that article. It's also duplicating content on two different URLs on the site. It seems more natural to show the content of https://www.ietf.org/blog/all/ here. However, if you wish to show the first article, it would be better for the /blog/ page to respond with a 302 temporary redirect to the relevant article, instead of straight up rendering it.
  2. The site provides Atom feeds for the whole blog, by-topic, and now by-author, but these feeds are not linked from anywhere, so users can't find them. I couldn't find better canonical documentation, but MDN has this useful example, which has the right type for Atom feeds:
    <link
      rel="alternate"
      type="application/atom+xml"
      href="posts.xml"
      title="Blog" />

Screenshot 2023-12-07 at 18 09 32 Screenshot 2023-12-07 at 18 09 45
ghwood commented 7 months ago

Hi @mgax,

Thanks for this.

a) Just to confirm, with the new slug for the Person model, if "ghwood@staff.ietf.org" were set as the slug for "Greg Wood", then https://www.ietf.org/blog/author/ghwood@staff.ietf.org return all the articles with "Greg Wood" as author.

b) Your suggestion about issue 1) makes sense to me but I'd like @rjsparks to weigh in.

c) I don't have a strong view on issue 2) or atom feeds in general as I don't have a good understanding about to what extent/how those are used these days. I would not make this a priority at the moment.

mgax commented 7 months ago

a) Just to confirm, with the new slug for the Person model, if "ghwood@staff.ietf.org" were set as the slug for "Greg Wood", then https://www.ietf.org/blog/author/ghwood@staff.ietf.org return all the articles with "Greg Wood" as author.

Yes, except that you would not use an email address as a slug. It's meant to be a URL-safe value, so Greg Wood would be converted to greg-wood. The process is automatic, just like any Page in the site generates its slug (the field "Promote" -> "For search engines" -> "Slug") from the page's Title, when it's first created.

ghwood commented 7 months ago

Thanks for the clarification. (I didn't realize the slug was autogenerated.) This works for me. Since the IETF Datatracker uses URLs like https://datatracker.ietf.org/person/ghwood@staff.ietf.org , I would be interested to hear whether @rjsparks has thoughts.

rjsparks commented 7 months ago

Depends on whether you need to distinguish between two people with the same name. @mgax what would that look like with where you are going?

mgax commented 7 months ago

Depends on whether you need to distinguish between two people with the same name. @mgax what would that look like with where you are going?

Whoops, I forgot to make the column unique! After I fix that bug, saving a 2nd person with the same name, resulting in the same slug, returns an error. The editor can then manually modify the slug to a unique value.

Screenshot 2023-12-12 at 20 49 48
rjsparks commented 7 months ago

Not very human friendly.

"Sorry guest blogger famous-person-name-here - we can't use your name because someone else already has".

Yeah, it's just the slug, but alissa-cooper-2 has connotations.

rjsparks commented 7 months ago

(I'm just pointing out the edges - I think we can work around this with the current proposal)

mgax commented 7 months ago

Ok, I can think of some options.

  1. Use the numeric primary key of the person: https://www.ietf.org/blog/author/13.
  2. Use the email: https://www.ietf.org/blog/author/ghwood@staff.ietf.org – though perhaps some people would prefer to keep their email addresses private.
  3. Use slugs, and find a better convention for the name, perhaps including the organisation name.

Or something else. Any URL-friendly string will do. In any case, the slug is editable, it's just the default value that is generated from the title, and it could be generated any way we like.

ghwood commented 7 months ago

I agree we might run into edges, but right now (and for the foreseeable future) I think we're fine. If the Person snippet slug works the same way as Page slug currently does—that is, a default value generated from the Name field that is then editable—we will be more than good.

mgax commented 7 months ago

If the Person snippet slug works the same way as Page slug currently does—that is, a default value generated from the Name field that is then editable—we will be more than good.

Great! That's exactly how it's set up in this PR.