school_house icon indicating copy to clipboard operation
school_house copied to clipboard

Add Elixir Version Metadata to Posts

Open kinson opened this issue 1 year ago • 2 comments

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 avatar Jul 24 '23 22:07 kinson

@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?

kinson avatar Jul 24 '23 22:07 kinson

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.

codeanpeace avatar Jul 25 '23 00:07 codeanpeace