The new Ripple frontend.
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.
Giuseppe Guerra 9ccfd3f08d Fix snow responsive view 1 day ago
data rss2 tl;dr connection guide 1 day ago
modules unhardcode ripple IPs on guides 7 months ago
routers osin schemas are handled by bdzr 1 year ago
scripts Update locales 9 months ago
semantic Fix placeholder color being completely white 1 year ago
services Finish token creation pages 1 year ago
static Fix snow responsive view 1 day ago
templates rss2 tl;dr connection guide 1 day ago
vendor require license to be agreed before starting hanayo 10 months ago
website-docs @ f27addac6a Update website-docs 1 week ago
.drone.yml add drone 7 months ago
.editorconfig add drone 7 months ago
.eslintrc eslint config 11 months ago
.gitignore Add basic oauth flow 1 year ago
.gitmodules Add submodule website-docs 1 year ago
2fa.go append query to redir URL in 2fa 1 year ago
Gopkg.lock require license to be agreed before starting hanayo 10 months ago
Gopkg.toml require license to be agreed before starting hanayo 10 months ago
LICENSE Forgetting we are using GNU AGPL: check 2 years ago
README.md Explain why you shouldn't write code like hanayo in the README 6 months ago
avatar.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 1 year ago
beatmap.go merge appends and remove shiet 11 months ago
context.go fix breaking changes 11 months ago
dev.go Ha! I'm dumb. 1 year ago
doc.go ⬆️ v1.8.6 ⬆️ 7 months ago
errors.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 1 year ago
funcmap.go Remove japanese thing 10 months ago
gulpfile.js make dark site a real setting instead of an easter egg 11 months ago
helpers.go pass valid context to Exchange code 10 months ago
irc.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 1 year ago
loadchangelog.go fix changelog freaking out 2 years ago
localisation.go Make website show localised text 1 year ago
login.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 1 year ago
main.go require license to be agreed before starting hanayo 10 months ago
messages.go Add messages system (for {error,success,info,...} messages) 2 years ago
oauth.go Revert "Use relative addresses for working with local modules." 11 months ago
package.json Start implementing localisation in JavaScript 1 year ago
profbackground.go Slight increase of 13% of profile background quality 1 year ago
profile.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 1 year ago
pw.go Create token revocation page 1 year ago
rate_limiter.go use getContext instead of MustGet("context").(context) 2 years ago
recovery.go Update vendor 1 year ago
register.go Don't add user to leaderboard when they register 1 year ago
semantic.json Display achievements on user profiles 10 months ago
sessions.go Make Language set in the Context, not by the template 1 year ago
simple.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 1 year ago
startuato_linux.go deploy a specific branch 1 year ago
startuato_windows.go When refreshing templates, restart the entire webserver 2 years ago
templates.go ignore non-html files while loading templates 10 months ago
tracking.go Move from git.zxq.co to zxq.co 1 year ago
yarn.lock Start implementing localisation in JavaScript 1 year 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!