Now we’re going to create our foundation datatype. We need to give it one
field: the GitRepo value containing our parsed content. Our content will
simply be the text inside README.md, wrapped up in a Markdown newtype for
easy rendering. This gives us:

data App = App
{ getGitRepo :: GitRepo Markdown
}
instance Yesod App

And now let’s set up our routes. We need just two: a homepage, and the subsite.
Our subsite type is GitRepo Markdown (as given above). We replace the space
with a hyphen as an escaping mechanism inside Yesod’s route syntax:

And finally, our main function. We pass in the repo URL and branch name, plus
a function that, given the filepath containing the cloned repo, processes it
and generates a Markdown value. Finally, we provide the generated repo
value to our App constructor and run it: