From 1f0cffd5f5337b004792b583e2ccb1a5dd33e564 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 30 Jun 2018 20:54:39 +0900 Subject: [PATCH] Improved last step of contributor task --- docs/new-contributor-task.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/new-contributor-task.md b/docs/new-contributor-task.md index c8ceaca2..8914e8bf 100644 --- a/docs/new-contributor-task.md +++ b/docs/new-contributor-task.md @@ -60,4 +60,20 @@ SidebarButton("Foobar", "/foobar", "plus") Navigate to `beta.notify.moe` and you should see the button to access your newly made page! Yay! -Feel free to play around with the code now. You can utilize pixy components by using the `components` package inside your controller. \ No newline at end of file +Feel free to play around with the code now. You can utilize pixy components by using the `components` package inside your controller: + +```go +package foobar + +import ( + "github.com/aerogo/aero" + "github.com/animenotifier/notify.moe/components" +) + +// Get returns the contents of our amazing page. +func Get(ctx *aero.Context) string { + return ctx.HTML(components.FooBar()) +} +``` + +This would now return the contents of your pixy component instead of a hard-coded string. \ No newline at end of file