The new Ripple frontend. Still a pretty bad frontend code-wise, but at least it's not PHP.
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 f432356a56 🔼 1.11.0 🔼 1 month ago
.vscode vscode config 5 months ago
data Settings: Change "order by" to "display and order by" 1 month ago
modules Update hardcoded ip 8 months ago
routers Bancho API privs, Bancho OAuth, update api vendor 11 months ago
scripts apply fixes to chinese translation 1 month ago
semantic Fix placeholder color being completely white 3 years ago
services Finish token creation pages 3 years ago
static Update dist.min.js, update templates 1 month ago
templates Settings: Change "order by" to "display and order by" 1 month ago
website-docs @ ed0e60feba Updated submodule website-docs 4 months ago
.dockerignore Add .dockerignore 2 months ago
.drone.yml Fix drone not cloning submodules 1 month ago
.editorconfig add drone 2 years ago
.eslintrc eslint config 2 years ago
.gitignore Add basic oauth flow 3 years ago
.gitmodules Add submodule website-docs 3 years ago
2fa.go append query to redir URL in 2fa 2 years ago
LICENSE Forgetting we are using GNU AGPL: check 3 years ago
README.md Update drone badge 1 month ago
avatar.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 3 years ago
beatmap.go merge appends and remove shiet 2 years ago
context.go fix breaking changes 2 years ago
dev.go Bancho API privs, Bancho OAuth, update api vendor 11 months ago
doc.go 🔼 1.11.0 🔼 1 month ago
errors.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 3 years ago
funcmap.go Merge branch 'master' into scoreow 1 month ago
go.mod move to go modules 2 months ago
go.sum move to go modules 2 months ago
gulpfile.js make dark site a real setting instead of an easter egg 2 years ago
helpers.go pass valid context to Exchange code 2 years ago
irc.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 3 years ago
loadchangelog.go Support for new changelog format 1 year ago
localisation.go Make website show localised text 3 years ago
login.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 3 years ago
main.go In-game preferences 1 month ago
messages.go Add messages system (for {error,success,info,...} messages) 4 years ago
oauth.go Add X-Frame-Options: deny to OAuth token requests 3 years ago
package-lock.json apply fixes to chinese translation 1 month ago
package.json apply fixes to chinese translation 1 month ago
profbackground.go Slight increase of 13% of profile background quality 3 years ago
profile.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 3 years ago
pw.go Create token revocation page 3 years ago
rate_limiter.go use getContext instead of MustGet("context").(context) 3 years ago
recovery.go Update vendor 3 years ago
register.go In-game preferences 1 month ago
semantic.json Install semantic in non interactive mode 7 months ago
sessions.go Make Language set in the Context, not by the template 3 years ago
simple.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 3 years ago
startuato_linux.go move to go modules 2 months ago
startuato_windows.go When refreshing templates, restart the entire webserver 3 years ago
templates.go ignore non-html files while loading templates 2 years ago
tracking.go Move from git.zxq.co to zxq.co 3 years ago
yarn.lock Start implementing localisation in JavaScript 3 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!