Skip to content

Commit

Permalink
chore: seo, templ and readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
msyavuz committed Feb 17, 2024
1 parent 46f83cd commit 9444fd4
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 87 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ As minimal as it can be:
- Frontend with [htmx](https://htmx.org/)
- Backend with Go and templating with [templ](https://github.com/a-h/templ)
- Styling with [picocss](https://picocss.com/)

> [!NOTE]
> It takes a while for Render to start the app for the first time each day. After that load is much faster.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module msyavuz/peth
go 1.21.3

require (
github.com/a-h/templ v0.2.432 // indirect
github.com/a-h/templ v0.2.543 // indirect
github.com/yuin/gopher-lua v1.1.0 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
github.com/a-h/templ v0.2.432 h1:/8sSs0janzx/DvXlYi+3KUkZABvm7s3lejbvhPZ1rSg=
github.com/a-h/templ v0.2.432/go.mod h1:6Lfhsl3Z4/vXl7jjEjkJRCqoWDGjDnuKgzjYMDSddas=
github.com/a-h/templ v0.2.543 h1:8YyLvyUtf0/IE2nIwZ62Z/m2o2NqwhnMynzOL78Lzbk=
github.com/a-h/templ v0.2.543/go.mod h1:jP908DQCwI08IrnTalhzSEH9WJqG/Q94+EODQcJGFUA=
github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE=
github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package main

import (
"fmt"
"msyavuz/peth/views"
"net/http"

"github.com/a-h/templ"

lua "msyavuz/peth/lua"
view "msyavuz/peth/views"
)

func main() {
Expand All @@ -16,7 +16,6 @@ func main() {
http.Handle("/", templ.Handler(index))

http.HandleFunc("/lua", func(w http.ResponseWriter, r *http.Request) {

switch r.Method {
case "POST":
r.ParseForm()
Expand Down
8 changes: 6 additions & 2 deletions views/captured-list_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 2 additions & 24 deletions views/error_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion views/footer_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion views/header_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 23 additions & 18 deletions views/index.templ
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
package view

templ Index() {
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css"/>
<script src="https://unpkg.com/htmx.org@1.9.6"></script>
</head>
<body>
<main class="container">
<form hx-post="/lua" hx-target="#results">
<label for="pattern">Capture Pattern</label>
<input type="text" id="pattern" name="pattern" placeholder="(.+)" required/>
<label for="test">Test String</label>
<input type="text" id="test" name="test" required/>
<button type="submit">Submit</button>
</form>
<div id="results" readonly></div>
</main>
</body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content="Test lua captures online"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"/>
<script src="https://unpkg.com/htmx.org@1.9.6"></script>
<title>Lua Capture</title>
</head>
<body>
<main class="container">
<form hx-post="/lua" hx-target="#results">
<label for="pattern">Capture Pattern</label>
<input type="text" id="pattern" name="pattern" placeholder="(.+)" required/>
<label for="test">Test String</label>
<input type="text" id="test" name="test" required/>
<button type="submit">Submit</button>
</form>
<div id="results" readonly></div>
</main>
</body>
</html>
}
40 changes: 2 additions & 38 deletions views/index_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9444fd4

Please sign in to comment.