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 748497b86e Merge pull request 'More translations for Thai language' (#71) from Aoba/hanayo:master into master 3 months ago
.vscode vscode config 5 months ago
data More translations for Thai language 3 months ago
modules Update hardcoded ip 9 months ago
routers Bancho API privs, Bancho OAuth, update api vendor 1 year ago
scripts Update locales 2 years ago
semantic Fix placeholder color being completely white 3 years ago
services Finish token creation pages 3 years ago
static Responsive ach list, padded load more ach button 3 months ago
templates Responsive ach list, padded load more ach button 3 months ago
vendor Bancho API privs, Bancho OAuth, update api vendor 1 year ago
website-docs @ ed0e60feba Updated submodule website-docs 4 months ago
.drone.yml add drone 2 years 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
Gopkg.lock Bancho API privs, Bancho OAuth, update api vendor 1 year ago
Gopkg.toml require license to be agreed before starting hanayo 2 years ago
LICENSE Forgetting we are using GNU AGPL: check 3 years ago
README.md Explain why you shouldn't write code like hanayo in the README 2 years 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 1 year ago
doc.go v1.10.1 3 months ago
errors.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 3 years ago
funcmap.go Add Thai translation by Aoba 3 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 Round avatar, add glow in navbar on profile, priv/pub bancho api base 10 months 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.json Start implementing localisation in JavaScript 3 years 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 Populate users_stats_relax when registering 4 months ago
semantic.json Install semantic in non interactive mode 8 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 deploy a specific branch 3 years 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!