try page embed
This commit is contained in:
parent
be89141c06
commit
513d0e57ce
10 changed files with 29 additions and 26 deletions
9
internal/gemlog/gemlog.gmi
Normal file
9
internal/gemlog/gemlog.gmi
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Gemlog
|
||||
|
||||
Welcome to my gemlog!
|
||||
|
||||
I'm still figureing out exactly what I'll be posting here as I already maintain a tech blog on my personal site. For now it will mostly be about my experience with the gemini protocal. Maybe some tutorials on how to self-host a capsule.
|
||||
|
||||
Abandoned capsules are a commmon sight here in gemspace. While this gemlog might go stale, the content on the micro-blog page is dynamic and as long as I'm posting to social media will have fresh content. Remember to check that page out as well.
|
||||
|
||||
=> /microblog Microblog
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package gemlog
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
|
|
@ -51,16 +52,14 @@ func (g *Gemlog) HandleRequest(w gemini.ResponseWriter, req *gemini.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
//go:embed gemlog.gmi
|
||||
var pageContnet string
|
||||
|
||||
func (g *Gemlog) serveIndex(w gemini.ResponseWriter, req *gemini.Request) {
|
||||
w.WriteStatusMsg(gemini.StatusSuccess, "text/gemini")
|
||||
|
||||
var content strings.Builder
|
||||
page, err := os.ReadFile("./pages/gemlog.gmi")
|
||||
if err != nil {
|
||||
slog.Error("Problem reading gemlog page", "error", err)
|
||||
return
|
||||
}
|
||||
content.Write(page)
|
||||
content.Write([]byte(pageContnet))
|
||||
content.WriteString("\n")
|
||||
|
||||
posts, err := gemlog.ListGemLogs(g.config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue