SpongePowered / SpongeHome

A brand new homepage for SpongePowered
https://spongepowered.org/
Other
14 stars 13 forks source link

Automatically pull latest two announcement pages from Forums #15

Closed Zidane closed 8 years ago

Zidane commented 8 years ago

@MichaelHillcox

Unsure if you've got experience with this but ideally the Announcements section would also pull from the latest two announcement posts from the forums and render a snippet of the text here. Definitely don't want to make it a long term goal of having @Owexz or whoever have to hand edit to do this.

MichaelHillcox commented 8 years ago

@Zidane I can do this. You are using Discourse for your forums right. If so then that makes it slightly more tricky. Just because its all ruby. I could hook into the postgres database and just pull the data from that using php or some other backend language. In logic it should be easy ( famous last words ). I may need to privately talk to you guys at Sponge to talk more about doing this :)

jamierocks commented 8 years ago

Why would you go about doing it that way? Discourse has an API (albeit a shitty one).

It needs to be decided whether we will pull the data client or server side

MichaelHillcox commented 8 years ago

Hmm, Oh yeah. Just remembered. It does have an api. I will take a look now. I run a local version of Discourse. I will see if I can get something to work out. I will write some javascript to see if I can work with it. If it is a shitty one I may stuggle. If I was to pull from the database then it would be serverside but if we can get the api to work then we can do it client side.

progwml6 commented 8 years ago

@MichaelHillcox the current site is using restler from NPM to gather this json https://forums.spongepowered.org/c/announcements.json?order=created

jamierocks commented 8 years ago

I might do this tonight ;)

jamierocks commented 8 years ago

We're probably best doing this server side - Golang anyone?

progwml6 commented 8 years ago

Why not just keep the entire project in node?

On Apr 14, 2016, at 11:49 AM, Jamie Mansfield notifications@github.com wrote:

We're probably best doing this server side - Golang anyone?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

jamierocks commented 8 years ago

It's not in Node at the moment? :P

progwml6 commented 8 years ago

We are using npm to handle Dev dependencies for gulp @jamierocks

Additionally, I'm not sure how much internal experience we have with golang.

jamierocks commented 8 years ago

I know about Gulp - I set it up :p

What I meant was we weren't using it for the site.

progwml6 commented 8 years ago

If we went with JavaScript some of the old sites active logic could be used if we were interested.

On Apr 14, 2016, at 2:04 PM, Jamie Mansfield notifications@github.com wrote:

I know about Gulp - I set it up :p

What I meant was we weren't using it for the site.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

jamierocks commented 8 years ago

I'm not that big of a fan of using nodejs for web myself, not that it'd be hard to remake the logic either.

progwml6 commented 8 years ago

My main concern with go is supporting it as less people know it. What other options do we have that people are comfortable with?

On Apr 14, 2016, at 3:04 PM, Jamie Mansfield notifications@github.com wrote:

I'm not that big of a fan of using nodejs for web myself, not that it'd be hard to remake the logic either.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

jamierocks commented 8 years ago

Hmm, I'd say the big options are:

progwml6 commented 8 years ago

Not a fan of php though I can use it a little bit, and I don't know go/scala. I'd be able to work with the other options if we went for them.

On Apr 14, 2016, at 3:13 PM, Jamie Mansfield notifications@github.com wrote:

Hmm, I'd say the big options are:

go-macaron (Golang) Express (Node) Laravel (PHP) Django or Flask (Python) Play Framework (Scala / Java) — You are receiving this because you commented. Reply to this email directly or view it on GitHub

jamierocks commented 8 years ago

Yeah, not sure if anyone is a fan of PHP :P Don't like the Play Framework (and Scala) either.

To be honest Go is a really easy language to pick up and has a lot of very well designed libraries (example: go-macaron) - perhaps we should find out how many developers know Go? (I know myself and lukegb know)

And also most of the site's development is going to be for the content, do whatever language is chosen will need little maintenance.

progwml6 commented 8 years ago

I don't object to learning go if needed it's a language high on my list of things to play with.

On Apr 14, 2016, at 3:57 PM, Jamie Mansfield notifications@github.com wrote:

Yeah, not sure if anyone is a fan of PHP :P Don't like the Play Framework (and Scala) either.

To be honest Go is a really easy language to pick up and has a lot of very well designed libraries (example: go-macaron) - perhaps we should find out how many developers know Go? (I know myself and lukegb know)

And also most of the site's development is going to be for the content, do whatever language is chosen will need little maintenance.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

Tzky commented 8 years ago

Just for reference: the current landing page relies on npm/node.js.

EDIT: Oh, and Express.

progwml6 commented 8 years ago

In case this is useful: it's also using ejs, and less for css

@Tzky do you have any language preferences/ opinions?

jamierocks commented 8 years ago

My ideal solutions would be:

Tzky commented 8 years ago

I have no preference as i'm not a webdev in the first place. I don't know js, go or php, so it's difficult for me to pick one out of this list.

The docs theme uses stylus instead of less or sass, too.

MichaelHillcox commented 8 years ago

If it was me. Just reading from the for mentioned json output from the API. I would load it in client side with javascript or I would load it in with PHP. No one like PHP but it works and its simple and the majority if people can support it or run a local development server. PHP has much better support for json than pure Javascript does although Node.js does include a good amount of support for Json.

To just load the announcements I would not suggest anything heavy. Something like Node.js is a bit unneeded. We will not be using 99% of what is being offered. I would opt for PHP here. Personally of course.

progwml6 commented 8 years ago

simple php can be done but i'd rather just use a real framework and templating to make this easier to maintain long run

MichaelHillcox commented 8 years ago

@progwml6 I understand all of that. How much are you meaning to maintain?

Tzky commented 8 years ago

I'd rather keep the footprint of the site small. So if we're using Node.js, why introduce PHP if there are good Node options available? I'm thinking about something like:

The old (private) site repo has a good amount of code one could probably recycle to get the announcements working.


Current setup of the Docs:

I'm not sure about Ore, @windy1 is Ore currently using a templating engine? And if yes, which one?

windy1 commented 8 years ago

There's a template engine included in Play out of the box. (Twirl)

MichaelHillcox commented 8 years ago

@Tzky the Node.js we are running at the moment isn't server side. It's just a complier for the sass code. So we are not really using Node.js. As the moment we are only using pure html and css to do all the cool things with some Js to power some animations and page flow. I am still suggesting php just because its light and its easy to use. Attaching something like Node.js to power the loading of Announcements is a little to much. Unless you are planning on having more things be updated more regally?

windy1 commented 8 years ago

If you don't want to use a template engine you can use Ajax on the client to pull the posts from the forums using the Discourse API.

MichaelHillcox commented 8 years ago

@windy1 This is likely one of the best options. We don't really need a template engine. It's only 3 html pages and only one part of one of the html pages needs to have updating content.

progwml6 commented 8 years ago

We do update the sponsors from time to time which is why I'd prefer some more logic and templating to simplify controlling them. Adding new sponsors on this site involves going to different places where the current one is a single line in the main js file.

On Apr 15, 2016, at 9:56 AM, Michael Hillcox notifications@github.com wrote:

@windy1 This is likely one of the best options. We don't really need a template engine. It's only 3 html pages and only one part of one of the html pages needs to have updating content.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

Tzky commented 8 years ago

Michael: The current site is using js, which is why i suggested to stick to js for the new site.

Also regarding the templating: we can unify parts of the Docs theme and this page (specifically the topbar) plus the css.

progwml6 commented 8 years ago

Unifying templating w/ ore likely won't work but I'm all for investigating unifying css and bootstrap stuff between ore/home if possible as well

On Apr 15, 2016, at 10:17 AM, Oliver notifications@github.com wrote:

Michael: The current site is using js, which is why i suggested to stick to js for the new site.

Also regarding the templating: we can unify parts of the Docs theme and this page (specifically the topbar) plus the css.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

jamierocks commented 8 years ago

@windy1 can't do that because of the cross site forging bullshit.

@Tzky just because the current sites uses node.js isn't that great of an argument

Language Framework Good points
Golang go-macaron Extremely fast. Unified package solution. On a whole the packages are very good - has some of the best designed packages of any of these languages.
Node Express Most developers have knowledge with js. Well used (by the likes of Netflix, etc) A shittonne of packages
PHP Laravel PHP is perhaps the most well known language for the web, but without proper configuration, can have many security issues.
Scala / Java Play Many of the people involved with the Sponge community have used Java or Scala.
Speed # of packages best designed packages # of developers
Go Node Go Java

One of the reasons I am so keen to use Go is not because of the language (although it is great), but because of the fantastic libraries (go-macaron in particular).

windy1 commented 8 years ago

@progwml6 You can use Twirl without Play if you are so inclined.

progwml6 commented 8 years ago

It's probably best to use templates that work with the language being used for the backend.

If we went Java/scala using play itself would be the best option.

For this project I would personally prefer using node. Most of the code that would need to be written exists already for the current site. Following that I'd be fine w/ go or using play in Java.

On Apr 15, 2016, at 11:58 AM, Walker Crouse notifications@github.com wrote:

@progwml6 You can use Twirl without Play if you are so inclined.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

jamierocks commented 8 years ago

I started a pr using Golang ;)

jamierocks commented 8 years ago

https://github.com/SpongePowered/SpongeHome/commit/6a237724e7e782b6220811473f6708ee55bd301c