The short version
-
Pagepairs a layout with a view model. -
Basepicks the right page for the URL, even under a sub-path. -
ViewModelholds the typed state your pages share. - Markdown rendering for pages written as text.
- Skip 0.0.1 and 0.0.2. Start at 0.0.4.
Hey everyone,
Today WebGo goes public. It's a small layer on top of go-app that takes care of the parts every app ends up writing by hand: the pages, the shell that switches between them, and the state they share.
What's in the box
-
Page: a screen made of a layout and a view model. The layout draws, the model holds the data. -
Base: the shell around your pages. It picks the right one for the URL. -
ViewModel: typed state under a key, read from any page and changed withLoad,ApplyandSet. - Markdown rendering, for pages that read better as text.
p
:=
page
.
NewPage
[
AppState
]
(
"/settings"
)
.
WithLayout
(
&
settingsLayout
{
}
)
.
WithModel
(
vm
)
Pages, view models and markdown for Go web apps. Four releases on day one, and the honest story of the first two.
Launch day, the honest version
Launch days are never clean, and ours wasn't either. 0.0.1 and 0.0.2 went out with a broken module setup, and Go's module proxy keeps every version exactly as it was first published, so those two will stay broken. Please skip them.
0.0.3 added
ViewModel.State()
, so you can read the current state without loading it again. 0.0.4 taught
Base
to work when your app lives under a sub-path, like a GitHub Pages project site. Four releases in one day, and 0.0.4 is the one to start with.
The docs eat their own cooking
This documentation site is itself a WebGo app. If something on it breaks, that's a WebGo bug, and we'd love to hear about it on GitHub .
Get it
go get github.com/Toms223/WebGo@v0.0.4
Thanks for being here on day one. There's plenty more coming.
End of issue 0.0.4
03