From 5c0c7dfd32b2fc3a75085e36502ae5f1b2b34807 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sun, 12 May 2024 09:22:47 -0700 Subject: [PATCH] getting some basic pages for testing --- .gitignore | 3 ++- go.mod | 5 ++--- go.sum | 6 ++++-- internal/handlers/home.go | 4 ++++ internal/views/home/about.templ | 15 +++++++++++++++ internal/views/home/index.templ | 6 +++++- 6 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 internal/views/home/about.templ diff --git a/.gitignore b/.gitignore index 88ebc56..facf30f 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,5 @@ go.work .vscode *_templ.go -server \ No newline at end of file +server +.env \ No newline at end of file diff --git a/go.mod b/go.mod index 64fa1ac..4899d3b 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,14 @@ module git.jamestombleson.com/jtom38/newsbot-portal go 1.22.1 require ( - git.jamestombleson.com/jtom38/newsbot-api v0.0.0-20240508052157-5b8cf6dfa6cc + git.jamestombleson.com/jtom38/newsbot-api v0.0.0-20240510021003-4e9a17209f02 + github.com/a-h/templ v0.2.680 github.com/joho/godotenv v1.5.1 github.com/labstack/echo/v4 v4.12.0 ) require ( github.com/KyleBanks/depth v1.2.1 // indirect - github.com/a-h/templ v0.2.680 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/spec v0.20.6 // indirect @@ -25,7 +25,6 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect golang.org/x/crypto v0.22.0 // indirect - golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/go.sum b/go.sum index eb0ceb8..0e9c6a2 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -git.jamestombleson.com/jtom38/newsbot-api v0.0.0-20240508052157-5b8cf6dfa6cc h1:QhuOntLiCv/kn+ymg/Qw7yKwXX+lPGRjgw8/saqfAeE= -git.jamestombleson.com/jtom38/newsbot-api v0.0.0-20240508052157-5b8cf6dfa6cc/go.mod h1:A3UdJyQ/IEy3utEwJiC4nbi0ohfgrUNRLTei2iZhLLA= +git.jamestombleson.com/jtom38/newsbot-api v0.0.0-20240510021003-4e9a17209f02 h1:yvu0Fnpw19YUH+AXvMQxJV8mUyEXkvpZqd8HctpwMrI= +git.jamestombleson.com/jtom38/newsbot-api v0.0.0-20240510021003-4e9a17209f02/go.mod h1:A3UdJyQ/IEy3utEwJiC4nbi0ohfgrUNRLTei2iZhLLA= github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/a-h/templ v0.2.680 h1:TflYFucxp5rmOxAXB9Xy3+QHTk8s8xG9+nCT/cLzjeE= @@ -21,6 +21,8 @@ github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrK github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= diff --git a/internal/handlers/home.go b/internal/handlers/home.go index 3909431..b47879f 100644 --- a/internal/handlers/home.go +++ b/internal/handlers/home.go @@ -9,4 +9,8 @@ import ( func (h *Handler) HomeIndex(c echo.Context) error { return Render(c, http.StatusOK, home.Index()) +} + +func (h *Handler) HomeAbout(c echo.Context) error { + return Render(c, http.StatusOK, home.About()) } \ No newline at end of file diff --git a/internal/views/home/about.templ b/internal/views/home/about.templ new file mode 100644 index 0000000..306ee41 --- /dev/null +++ b/internal/views/home/about.templ @@ -0,0 +1,15 @@ +package home + +import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout" + +templ About() { + @layout.WithTemplate(){ +

About this project

+ +
+ Newsbot started a small project to send out notifications to discord servers. + I wanted to be able to keep the small communitiy aware of new posts about a game we all played. + That feature still exists because I think that keeping a communitiy aware and engaged is important and not everyone follows the same news. +
+ } +} \ No newline at end of file diff --git a/internal/views/home/index.templ b/internal/views/home/index.templ index 6f2ffda..2e3b282 100644 --- a/internal/views/home/index.templ +++ b/internal/views/home/index.templ @@ -9,15 +9,19 @@ templ Index() {

News bot is a self hostable solution to aggregating your news. - You can run `Newsbot` as an API + You can run `Newsbot` as an API or interact with it with this site.

+

Why Newsbot

I started to build this tool to help me avoid sitting on the big platform websites. I wanted a tool that would work for me, not them. + This tool started as a notification system that would let me redirect RSS posts over to Discord servers. + It still has those roots but now its starting to scale up to a full Aggregation platform. +

This project is a passion project of mine as I