hanayo

command module
v0.0.0-...-d14f6a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2020 License: AGPL-3.0 Imports: 72 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Hanayo - Debiki's frontend

This is the frontend of Debiki.

It is based on Ripple's version of hanayo.

Some design elements have been taken from osuAkatsuki.

(Debiki's Note) 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 Debiki! 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!

Documentation

Overview

Hanayo is the Debiki front-end web server.

Directories

Path Synopsis
modules
bbcode
Package bbcode implements BBCode compiling for Hanayo.
Package bbcode implements BBCode compiling for Hanayo.
btcaddress
Package btcaddress makes sure the Bitcoin address for the Debiki donations account on Keybase is up-to-date.
Package btcaddress makes sure the Bitcoin address for the Debiki donations account on Keybase is up-to-date.
doc
Package doc handles documentation.
Package doc handles documentation.
routers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL