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

MNT: try and embed discourse #17

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Oct 22, 2021

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
Copy link
Member Author

jklymak commented Oct 22, 2021

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
Copy link
Member

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

@story645
Copy link
Member

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
Copy link
Member Author

jklymak commented Oct 22, 2021

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
Copy link
Member

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
Copy link
Member Author

jklymak commented Oct 22, 2021

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

jklymak commented Oct 22, 2021

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

@story645
Copy link
Member

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
Copy link
Member Author

jklymak commented Oct 22, 2021

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

@jklymak jklymak force-pushed the mnt-news-discourse branch 2 times, most recently from 6c47c21 to 60bcc25 Compare October 23, 2021 09:36
@jklymak
Copy link
Member Author

jklymak commented Oct 23, 2021

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

@jklymak jklymak marked this pull request as draft October 23, 2021 09:51
@jklymak jklymak linked an issue Oct 27, 2021 that may be closed by this pull request
@QuLogic
Copy link
Member

QuLogic commented Oct 28, 2021

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
Copy link
Member Author

jklymak commented Oct 28, 2021

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
Copy link
Member

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
Copy link
Member Author

jklymak commented Oct 28, 2021

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
Copy link
Member

story645 commented Oct 28, 2021

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
Copy link
Member Author

jklymak commented Oct 28, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

News could be an automatic feed
4 participants