No description
  • JavaScript 46.8%
  • CSS 39.6%
  • Less 8.3%
  • Go 3.1%
  • HTML 2.2%
Find a file
2020-08-30 18:18:12 +07:00
data Add report code file, homepage redesign and graph and more 2020-05-16 15:49:37 +03:00
modules move 2020-08-30 18:18:12 +07:00
routers move 2020-08-30 18:18:12 +07:00
scripts Fine, I give up on you GitHub. 2019-12-01 21:54:11 +07:00
semantic Fine, I give up on you GitHub. 2019-12-01 21:54:11 +07:00
services zxq.co/ripple > github.com/osuthailand 2020-01-04 14:30:41 +07:00
static Add report code file, homepage redesign and graph and more 2020-05-16 15:49:37 +03:00
templates sure 2020-08-28 10:21:36 +07:00
vendor Final Whoops 2020-01-04 14:43:27 +07:00
website-docs@1bd4238f62 Updated submodule website-docs 2019-08-23 11:42:28 +02:00
.drone.yml zxq.co/ripple > github.com/osuthailand 2020-01-04 14:30:41 +07:00
.editorconfig add drone 2018-04-28 21:57:44 +02:00
.eslintrc eslint config 2017-12-30 17:06:59 -06:00
.gitignore Update .gitignore 2020-06-06 15:17:17 +07:00
.gitmodules Add submodule website-docs 2017-05-02 15:11:02 +02:00
2fa.go Whoops 2 2020-01-04 14:39:36 +07:00
avatar.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
beatmap.go merge appends and remove shiet 2018-01-06 10:36:02 -06:00
ccreate.go *Angry Aoba noises* 2019-10-29 21:10:16 +07:00
clan.go bruh. 2019-10-29 20:57:36 +07:00
context.go Whoops 2 2020-01-04 14:39:36 +07:00
dev.go Whoops 2 2020-01-04 14:39:36 +07:00
doc.go ⬆️ 1.9.0 ⬆️ 2019-11-20 17:36:10 +01:00
errors.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
funcmap.go Add report code file, homepage redesign and graph and more 2020-05-16 15:49:37 +03:00
Gopkg.lock Whoops 2020-01-04 14:34:39 +07:00
Gopkg.toml Whoops 2 2020-01-04 14:39:36 +07:00
gulpfile.js make dark site a real setting instead of an easter egg 2018-01-01 20:32:40 +01:00
helpers.go Whoops 2 2020-01-04 14:39:36 +07:00
irc.go Whoops 2 2020-01-04 14:39:36 +07:00
LICENSE Forgetting we are using GNU AGPL: check 2016-12-08 14:24:07 +01:00
loadchangelog.go Support for new changelog format 2018-12-20 18:48:57 +01:00
localisation.go zxq.co/ripple > github.com/osuthailand 2020-01-04 14:30:41 +07:00
login.go Whoops 2 2020-01-04 14:39:36 +07:00
main.go Add report code file, homepage redesign and graph and more 2020-05-16 15:49:37 +03:00
messages.go Add messages system (for {error,success,info,...} messages) 2016-07-04 16:18:50 +02:00
oauth.go zxq.co/ripple > github.com/osuthailand 2020-01-04 14:30:41 +07:00
package.json Start implementing localisation in JavaScript 2017-04-02 17:45:29 +02:00
profbackground.go Slight increase of 13% of profile background quality 2017-04-11 18:55:49 +02:00
profile.go Add report code file, homepage redesign and graph and more 2020-05-16 15:49:37 +03:00
pw.go Whoops 2 2020-01-04 14:39:36 +07:00
rate_limiter.go use getContext instead of MustGet("context").(context) 2016-10-22 17:12:58 +02:00
README.md zxq.co/ripple > github.com/osuthailand 2020-01-04 14:30:41 +07:00
recovery.go zxq.co/ripple > github.com/osuthailand 2020-01-04 14:30:41 +07:00
register.go Damn it! 2020-06-24 12:59:59 +07:00
report.go Add report code file, homepage redesign and graph and more 2020-05-16 15:49:37 +03:00
semantic.json Now we can merge! 2019-12-01 22:19:31 +07:00
sessions.go Whoops 2 2020-01-04 14:39:36 +07:00
simple.go Add report code file, homepage redesign and graph and more 2020-05-16 15:49:37 +03:00
startuato_linux.go Final Whoops 2020-01-04 14:43:27 +07:00
startuato_windows.go When refreshing templates, restart the entire webserver 2016-11-03 17:52:37 +01:00
templates.go Add report code file, homepage redesign and graph and more 2020-05-16 15:49:37 +03:00
tracking.go let rx_stats hjave countries 2020-01-08 23:05:31 +01:00
yarn.lock Start implementing localisation in JavaScript 2017-04-02 17:45:29 +02:00

Hanayo build status

This repository has a mirror here. The original repo is still here.

To fellow developers: this is not how you do it!

The biggest flaw of hanayo are that when I set out to create it, I wanted to create a template system that:

  • Created a handler by simply having the file "be there"
  • Could fetch the data it needed on its own, often from the Ripple API
  • Had the actual Go code be as little as possible

This was not immediately evident to me, a Go beginner, but what I did there was basically make Go be PHP.

The biggest lesson I learned on how to properly do templates, was learning to use Vue. Yes, Vue can be used for the frontend and not really for server-rendered stuff, but even just learning how to do stuff with it can help you understand what a template is actually supposed to be in order to be maintainable.

The key concepts and insights for me where:

  • Separating clearly code and markup, making the template declarative and keeping as little code in the template
  • A template should be purely functional. Its mere creation should not generate side effects, nor should it be dependent on things that are not its precise inputs: for a given input there is a specific output.
  • The concept of component as a single self-contained entity which is the same wherever you use it is very powerful.
  • Once a template/component starts becoming too big, split it into more components.

But don't stop here. Actually making a project using Vue helps you to understand this much more easily than using mere words. Go ahead and build something, even if just to play around!