The Revel controller provides many useful methods for generating Results. In
this example, it calls Render(),
which tells Revel to find and render a template as the response with http 200 OK.
Templates are in the app/views directory. When an explicit
template name is not specified, Revel looks for a template matching the action.
In this case, Revel finds the app/views/App/Index.html file, and
renders it as a Go template.
Beyond the functions provided by the Go templates package, Revel adds
a few helpful ones also.
The template above : -
Adds a new title variable to the render context with set.
Includes the header.html template, which uses the title variable.
Displays a welcome message.
Includes the flash.html template, which shows any flashed messages.
Includes the footer.html.
If you look at header.html, you can see some more template tags in action:
You can see the set.title being used, and also see that it accepts JS and CSS
files included from calling templates in the moreStyles and moreScripts
Revel has watchers that check for changes to files and recompiles as part of the development cycle.
To demonstrate this, change the welcome message. In Index.html, change
Refresh the browser, and you should see the change immediately! Revel noticed
that your template changed and reloaded it.