You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
qewc 216e2405bd
Update register.html
3 years ago
data replace zxq.co/ripple/hanayo 4 years ago
modules replace zxq.co/ripple/hanayo 4 years ago
routers replace zxq.co/ripple/hanayo 4 years ago
scripts replace zxq.co/ripple/hanayo 4 years ago
semantic replace zxq.co/ripple/hanayo 4 years ago
services replace zxq.co/ripple/hanayo 4 years ago
static d 3 years ago
templates Update register.html 3 years ago
vendor replace zxq.co/ripple/hanayo 4 years ago
.drone.yml replace zxq.co/ripple/hanayo 4 years ago
.editorconfig replace zxq.co/ripple/hanayo 4 years ago
.eslintrc replace zxq.co/ripple/hanayo 4 years ago
.gitignore yea h 3 years ago
.gitmodules replace zxq.co/ripple/hanayo 4 years ago
2fa.go replace zxq.co/ripple/hanayo 4 years ago
Gopkg.lock replace zxq.co/ripple/hanayo 4 years ago
Gopkg.toml replace zxq.co/ripple/hanayo 4 years ago
LICENSE replace zxq.co/ripple/hanayo 4 years ago
README.md replace zxq.co/ripple/hanayo 4 years ago
avatar.go replace zxq.co/ripple/hanayo 4 years ago
beatmap.go replace zxq.co/ripple/hanayo 4 years ago
ccreate.go add clans 4 years ago
clan.go add clans 4 years ago
context.go replace zxq.co/ripple/hanayo 4 years ago
dev.go replace zxq.co/ripple/hanayo 4 years ago
doc.go replace zxq.co/ripple/hanayo 4 years ago
errors.go replace zxq.co/ripple/hanayo 4 years ago
funcmap.go replace zxq.co/ripple/hanayo 4 years ago
gulpfile.js replace zxq.co/ripple/hanayo 4 years ago
helpers.go Meme 4 years ago
irc.go replace zxq.co/ripple/hanayo 4 years ago
loadchangelog.go replace zxq.co/ripple/hanayo 4 years ago
localisation.go replace zxq.co/ripple/hanayo 4 years ago
login.go replace zxq.co/ripple/hanayo 4 years ago
main.go briuh 1 4 years ago
messages.go replace zxq.co/ripple/hanayo 4 years ago
oauth.go replace zxq.co/ripple/hanayo 4 years ago
package.json replace zxq.co/ripple/hanayo 4 years ago
profbackground.go my b 4 years ago
profile.go Add relax and autopilot profile 4 years ago
pw.go replace zxq.co/ripple/hanayo 4 years ago
rate_limiter.go replace zxq.co/ripple/hanayo 4 years ago
recovery.go replace zxq.co/ripple/hanayo 4 years ago
register.go remove keys 3 years ago
semantic.css Flip dark and light 4 years ago
semantic.js Flip dark and light 4 years ago
semantic.json replace zxq.co/ripple/hanayo 4 years ago
sessions.go replace zxq.co/ripple/hanayo 4 years ago
simple.go replace zxq.co/ripple/hanayo 4 years ago
startuato_linux.go replace zxq.co/ripple/hanayo 4 years ago
startuato_windows.go replace zxq.co/ripple/hanayo 4 years ago
team.json add her twitter 3 years ago
templates.go replace zxq.co/ripple/hanayo 4 years ago
tracking.go replace zxq.co/ripple/hanayo 4 years ago

README.md

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!