HomeEntrypoint.vala 618 B

1234567891011121314151617181920
  1. using Statum;
  2. namespace {{NS}} {
  3. public class HomePagePublic : Object {
  4. public string message { get; set; default = ""; }
  5. }
  6. /**
  7. * Entrypoint for /: hydrates the page slot with a typed public model.
  8. */
  9. public class HomeEntrypoint : StatumEntrypoint {
  10. public override async DirectiveBuilder handle() throws GLib.Error {
  11. var page = new HomePagePublic();
  12. page.message = "It works — edit src/pages/home.html and this entrypoint to make it yours.";
  13. return directives().set_typed<HomePagePublic>("page", Scope.PAGE, page);
  14. }
  15. }
  16. }