The new Ripple frontend. Still a pretty bad frontend code-wise, but at least it's not PHP.
  • JavaScript 47.7%
  • CSS 39.3%
  • Less 8.4%
  • Go 3%
  • HTML 1.6%
Find a file
2022-03-11 19:09:02 +08:00
.vscode vscode config 2020-01-30 17:56:41 +01:00
data Typo 2022-03-11 19:09:02 +08:00
modules Update hardcoded fallback ip 2020-09-21 19:06:47 +02:00
routers Bancho API privs, Bancho OAuth, update api vendor 2019-07-20 13:20:19 +02:00
scripts apply fixes to chinese translation 2020-05-24 22:10:16 +01:00
semantic Fix placeholder color being completely white 2017-01-05 22:42:41 +01:00
services Revert "Use relative addresses for working with local modules." 2017-12-29 15:25:04 -06:00
static Fix weird word in timeago.zh.js 2021-12-17 23:57:36 +08:00
templates Merge remote-tracking branch 'origin/master' 2021-11-07 12:31:40 +01:00
website-docs@be54bdc364 Updated submodule website-docs 2021-11-07 12:30:55 +01:00
.dockerignore Add .dockerignore 2020-04-19 12:29:46 +02:00
.drone.yml Add missing drone volume 2021-07-11 10:21:42 +00:00
.editorconfig add drone 2018-04-28 21:57:44 +02:00
.eslintrc eslint config 2017-12-30 17:06:59 -06:00
.gitignore Add basic oauth flow 2017-06-10 09:06:05 +02:00
.gitmodules Add submodule website-docs 2017-05-02 15:11:02 +02:00
2fa.go append query to redir URL in 2fa 2017-07-31 15:41:52 +02:00
avatar.go Invalidate client-side avatars when changing avatar 2020-06-16 16:07:42 +00:00
beatmap.go merge appends and remove shiet 2018-01-06 10:36:02 -06:00
context.go Invalidate client-side avatars when changing avatar 2020-06-16 16:07:42 +00:00
dev.go Bancho API privs, Bancho OAuth, update api vendor 2019-07-20 13:20:19 +02:00
discord.go Add the ability to edit donor discord role from hanayo 2020-07-30 16:43:01 +00:00
doc.go v1.12.4 2021-11-07 12:31:19 +01:00
errors.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
funcmap.go New donor bot integration 2020-07-29 23:15:06 +00:00
go.mod move to go modules 2020-04-14 23:31:48 +02:00
go.sum move to go modules 2020-04-14 23:31:48 +02:00
gulpfile.js make dark site a real setting instead of an easter egg 2018-01-01 20:32:40 +01:00
helpers.go New donor bot integration 2020-07-29 23:15:06 +00:00
irc.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02: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 Revert "Use relative addresses for working with local modules." 2017-12-29 15:25:04 -06:00
login.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
main.go add fathom 2020-08-25 15:49:32 +01:00
messages.go Add messages system (for {error,success,info,...} messages) 2016-07-04 16:18:50 +02:00
oauth.go Revert "Use relative addresses for working with local modules." 2017-12-29 15:25:04 -06:00
package-lock.json apply fixes to chinese translation 2020-05-24 22:10:16 +01:00
package.json apply fixes to chinese translation 2020-05-24 22:10:16 +01:00
profbackground.go Slight increase of 13% of profile background quality 2017-04-11 18:55:49 +02:00
profile.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
pw.go Create token revocation page 2017-07-26 16:28:49 +02:00
rate_limiter.go use getContext instead of MustGet("context").(context) 2016-10-22 17:12:58 +02:00
README.md Update drone badge 2020-05-26 12:12:06 +02:00
recovery.go Update vendor 2017-02-12 12:05:00 +01:00
register.go In-game preferences 2020-06-09 18:15:18 +02:00
semantic.json Install semantic in non interactive mode 2019-11-16 20:01:56 +01:00
sessions.go Fix leaking sessions for guests 2020-07-19 23:50:36 +02:00
simple.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
startuato_linux.go move to go modules 2020-04-14 23:31:48 +02:00
startuato_windows.go When refreshing templates, restart the entire webserver 2016-11-03 17:52:37 +01:00
templates.go Highlight donor features 2020-07-30 19:53:18 +02:00
tracking.go Move from git.zxq.co to zxq.co 2017-01-14 19:15:25 +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!