matplotlib / mpl-brochure-site

Source for the top-level landing page.
Other
3 stars 13 forks source link

MNT: try and embed discourse #17

Open jklymak opened 3 years ago

jklymak commented 3 years ago

Not 100% sure this is working, because you need to allow discourse to embed only certain websites. But this should allow us to embed the discourse Announces in the News section.

References:

jklymak commented 3 years ago

This does seem to work (by disabling the CSP protection temporarily). However, pinned topics always appear at the top, and despite asking for 5 topics I only get 3. I somewhat suspect it is giving me five lines. Anyhow, still better than manually inputing this.

tacaswell commented 3 years ago

This in very interesting, embedding discourse had not occurred to me as even a possibility!

story645 commented 3 years ago

However, pinned topics always appear at the top, and despite asking for 5 topics I only get 3.

There's a setting in discourse that probably has nothing to do w/ this limit but you can experiment?

Screenshot_20211022-115459__01.jpg

jklymak commented 3 years ago

Oh, that may indeed be it! OTOH, we can monkey with that when its live as seeing it in production means leaving a big security hole open....

tacaswell commented 3 years ago

Given that in the long run this will all be hosted on matplotlib.org so the cross-site stuff will be ok.

If we go down this route we will probably want to have a dedicated (and very moderated) (sub-)topic on discourse.

jklymak commented 3 years ago

you can also filter on author, status, tags and a couple other things. So we should be able to find something reasonable. I just thought having something easier than editing the html, preferably tied to one of the other communication channels, would be helpful.

story645 commented 3 years ago

If we go down this route we will probably want to have a dedicated (and very moderated) (sub-)topic on discourse.

So I double checked this & currently announcement posts need to be approved by a mod, and we can either prune the mod team or maybe create a new team that owns the announcements and can control whats' posted there (that's how the cartopy & seaborn sections work). Or going on the tag idea, create a tag that's auto/only put on announcement posts made by core devs/limited to a sub team.

tacaswell commented 3 years ago

I am not yet sold that this is actually less work in the short to mid term than just editing the html. Lets keep this idea around, but make it a low priority?

jklymak commented 3 years ago

That's not a problem. You and @QuLogic have to do the bulk of announcements, so whatever is most convenient.

story645 commented 3 years ago

I am not yet sold that this is actually less work in the short to mid term than just editing the htm

Alternatively, would it be too much work to make that section feed off a news folder (the way static site blogs work) and it takes the top 5/most recent snippets from there? That'd create a record for news, mean less moderation overhead than discourse (even though I agree w/ @jklymak) and mean not having to edit the html?

jklymak commented 3 years ago

.... though note that someone needs to edit the manual one before this goes up because it is just placeholders...

jklymak commented 3 years ago

CI now works. I'll move to draft until a decision about the is made...

QuLogic commented 3 years ago

The trouble with this is that I don't make any release announcements there. They're written into an email and sent to the 3 mailing lists, which get mirrored to Discourse. And then I'm not sure it gets good formatting, but I can't see the result here with the CSP. If the formatting is fine, then I guess it doesn't matter.

I can post to Discourse too, but then how does it get to the mailing lists?

jklymak commented 3 years ago

Yeah I can disable cps later and take some screen shots. All that gets shown is the subject line so I think it is formatted ok. I am not sure, but I think one can edit the discourse post if the mailing list relay messes up the formatting.

If you make these news items by hand, what were you planning to do? Where would they link to? I guess I still think using discourse as a content backend would be preferable to coming in here, editing the landing page, and creating a news item text somewhere in the main site.

story645 commented 3 years ago

I can post to Discourse too, but then how does it get to the mailing lists?

apparently you can create a dummy user that gets everything they're subscribed to forwarded to lists https://meta.discourse.org/t/webhook-to-forward-posts-to-a-mailinglist-best-practice/63609/15 and making an mpl-announce user to test wouldn't be hard.

I'm also gonna reup my alternative suggestion that even if this isn't a discourse feed, it should maybe be a template (not much javascript altogether) that reads & formats entries off a folder (or even a spreadsheet).

jklymak commented 3 years ago

I'm also gonna reup my alternative suggestion that even if this isn't a discourse feed, it should maybe be a template (not much javascript altogether) that reads & formats entries off a folder (or even a spreadsheet).

If we don't use discourse we should do something like this. I'm sure there are super light markdown javascript interpreters. Or we could do in sphinx somehow (e.g. https://pypi.org/project/sphinxcontrib-newsfeed/), the only issue being that all the content on the page is currently pure html. There needs to be some sort of backend, versus just editing these by hand.

story645 commented 3 years ago

There needs to be some sort of backend, versus just editing these by hand.

Totally, and would make it infinitely easier to scrape together content for the newsletter & annual report.

jklymak commented 3 years ago

This looks as follows: I'm pretty sure there is a way to change the css so the column is not so narrow.

Feed

If we just use the matplotlib-annoucne category (mailing list relay):

Feed2