GamendWeb.ContentPages (gamend_web v1.0.1216)

Copy Markdown View Source

The changelog and roadmap pages: one markup, two rendering styles.

Why components rather than one LiveView

gamend serves these as LiveViews; Polyglot Pirates serves them from a plain controller, because a changelog has nothing live on it and a dead render is one less socket. Both are defensible, and neither host should have to change to share the page — so what is shared is the markup, which a LiveView's render/1 and a .html.heex template can both call.

The three copies that existed before this said the same thing in three slightly different ways, and the differences were all accidents: gamend's page_title was an untranslated string and its empty-state body was an English literal, while Polyglot's had a card around the article and a reusable empty state. Nothing chose any of that; one was written after the other.

href, not navigate

The cross-links between the two pages are plain anchors. navigate needs a LiveView root to push into, and on a controller-rendered page there is none — it would render an <a> that the client script treats as live and the server has nowhere to route. These are static documents where a full navigation is what happens anyway.

Summary

Functions

The changelog page, with a link across to the roadmap when there is one.

The roadmap page, with a link across to the changelog when there is one.

Functions

changelog(assigns)

The changelog page, with a link across to the roadmap when there is one.

Attributes

  • flash (:map) (required)
  • current_scope (:any) - Defaults to nil.
  • current_path (:string) - Defaults to nil.
  • html (:string) - Defaults to nil.
  • roadmap_available? (:boolean) - Defaults to false.

roadmap(assigns)

The roadmap page, with a link across to the changelog when there is one.

Attributes

  • flash (:map) (required)
  • current_scope (:any) - Defaults to nil.
  • current_path (:string) - Defaults to nil.
  • html (:string) - Defaults to nil.
  • changelog_available? (:boolean) - Defaults to false.