elixirschool / school_house

The new era of Elixir School now powered by @phoenixframework
https://elixirschool.com/
Apache License 2.0
155 stars 49 forks source link

Add Elixir Version Metadata to Posts #220

Open kinson opened 1 year ago

kinson commented 1 year ago

Also, what are your thoughts on updating the elixirschool readme section Posting an Article to nudge authors to specify the versions of Elixir, Phoenix, LiveView, etc. used in their code examples.

Another approach could be to extend the article metadata with an optional :versions field e.g.

%{
  author: "Author Name",
  author_link: "https://github.com/author_github_account",
  tags: ["phoenix", "liveview"],
  versions: [{:phoenix, "~> 1.7.6"}, {:phoenix_live_view, "~> 0.19.0"}]
  date: ~D[YYYY-MM-DD],
  title: "Full Article Title",
  excerpt: """
  Article short preview text
  """
}
--- 

_Originally posted by @codeanpeace in https://github.com/elixirschool/school_house/issues/216#issuecomment-1648718817_

kinson commented 1 year ago

@codeanpeace I think that's a valuable suggestion. I think as long as it's optional (though encouraged that would be good metadata to have and display). Maybe we could add a more specific key though to not be confused with lesson or blog version? Something like elixir_and_deps_versions? What do you think?

codeanpeace commented 1 year ago

Yeah, agreed that it should be optional but encouraged.

That's a good point regarding naming confusion. The other potentially confusing thing for authors is that elixir and dependencies are specified separately in a standard mix.exs. For simplicity's sake, combining them as elixir_and_deps_versions or even just elixir_and_deps makes sense but we should definitely highlight that in the readme.

It also occurs to me that this metadata could make it possible to incorporate LiveBook functionality one day, which would be very cool.