An HTML render engine concept that brings frontend-like components experience to the server side with native html/template
on steroids. Supports any serving basis (net/http
/gin
/etc), that provides io.Writer
in response.
Disclaimer
This project in early development, don't use in production! In case of any issues/proposals, feel free to open an issue
As simple as go get github.com/yuriizinets/kyoto
Check documentation page for quick start: https://kyoto.codes/docs/get-started.html
Kyoto project setup may seem complicated and unusual at first sight.
It's highly recommended to follow documentation while using library: https://kyoto.codes/docs/get-started.html
This example is not completely independent and just shows what the code looks like when using kyoto:
package main
import (
"html/template"
"github.com/yuriizinets/kyoto"
"github.com/yuriizinets/kyoto-uikit/twui"
)
type PageIndex struct {
Navbar kyoto.Component
}
func (p *PageIndex) Template() *template.Template {
return mktemplate("page.index.html")
}
func (p *PageIndex) Init() {
p.Navbar = kyoto.RegC(p, &twui.AppUINavNavbar{
Logo: `<img src="/static/img/kyoto.svg" class="h-8 w-8 scale-150" />`,
Links: []twui.AppUINavNavbarLink{
{Text: "Kyoto", Href: "https://github.com/yuriizinets/kyoto"},
{Text: "UIKit", Href: "https://github.com/yuriizinets/kyoto-uikit"},
{Text: "Charts", Href: "https://github.com/yuriizinets/kyoto-charts"},
{Text: "Starter", Href: "https://github.com/yuriizinets/kyoto-starter"},
},
Profile: twui.AppUINavNavbarProfile{
Enabled: true,
Avatar: `
<svg class="w-6 h-6 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path></svg>
`,
Links: []twui.AppUINavNavbarLink{
{Text: "GitHub", Href: "https://github.com/yuriizinets/kyoto/discussions/40"},
{Text: "Telegram", Href: "https://t.me/yuriizinets"},
{Text: "Email", Href: "mailto:[email protected]"},
},
},
})
}
Project main page: https://kyoto.codes/
Documentation: https://kyoto.codes/docs/
UIKit: https://github.com/yuriizinets/kyoto-uikit
Demo project, Hacker News client made with kyoto: https://hn.kyoto.codes/
Demo project, features overview: https://github.com/yuriizinets/kyoto/tree/master/.demo
Or directly with Bitcoin: bc1qgxe4u799f8pdyzk65sqpq28xj0yc6g05ckhvkk