Closed mgax closed 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.
a) Just to confirm, with the new slug for the
Person
model, if "ghwood@staff.ietf.org" were set as theslug
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.
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.
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?
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.
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.
(I'm just pointing out the edges - I think we can work around this with the current proposal)
Ok, I can think of some options.
https://www.ietf.org/blog/author/13
.https://www.ietf.org/blog/author/ghwood@staff.ietf.org
– though perhaps some people would prefer to keep their email addresses private.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.
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.
If the
Person
snippet slug works the same way asPage
slug currently does—that is, a default value generated from theName
field that is then editable—we will be more than good.
Great! That's exactly how it's set up in this PR.
Fixes https://github.com/ietf-tools/wagtail_website/issues/195.
slug
field to thePerson
model, which is used in the URL for the new by-author listing page./blog/author/{slug}/
, borrows its design from the/blog/all/
page, without the topic filter sidebar.BlogIndexPage
model, so as not to mask the by-author feed route.I've noticed a couple of things while implementing; maybe they should become separate issues?
/blog/
page to respond with a 302 temporary redirect to the relevant article, instead of straight up rendering it.