restructure project following best practices

https://go.dev/doc/modules/layout
This also enables us to later import just the db interaction part
say to the gemini capsule backend go project.
This commit is contained in:
Travis Shears 2025-10-04 19:40:27 +02:00
parent 928c82536f
commit 360fedbebe
11 changed files with 202 additions and 169 deletions

View file

@ -1,45 +0,0 @@
package main
import (
"gemini_site/gemlog"
tea "github.com/charmbracelet/bubbletea"
)
type EntryPageModel struct {
entry gemlog.GemlogEntry
}
func initialEntryPageModel() EntryPageModel {
return EntryPageModel{}
}
func (m EntryPageModel) Update(msg tea.Msg, active bool, ctx *context) (EntryPageModel, tea.Cmd) {
switch msg := msg.(type) {
case gemlog.GemLogLoaded:
m.entry = msg.Log
case tea.KeyMsg:
if !active {
return m, nil
}
switch msg.String() {
case "left", "h":
cmd := func() tea.Msg {
return SwitchPages{Page: EntryList}
}
return m, cmd
}
}
return m, nil
}
func (m EntryPageModel) View() string {
s := m.entry.Slug
s += "\n\n"
s += m.entry.Gemtxt
s += "\n\n-------------------------\n"
s += "\n\nPress h or left arrow to go back"
return s
}