Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go/blog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
12 changes: 9 additions & 3 deletions go/blog/function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package function
import (
"net/http"
"net/http/httptest"
"strings"
"testing"
)

// TestHandle ensures that Handle executes without error and returns the
// HTTP 200 status code indicating no errors.
// TestHandle verifies that the blog is built and served correctly.
// Requires 'make' to be run first to generate the dist/ directory.
func TestHandle(t *testing.T) {
var (
f = New()
w = httptest.NewRecorder()
req = httptest.NewRequest("GET", "http://example.com/test", nil)
req = httptest.NewRequest("GET", "http://example.com/", nil)
res *http.Response
)
f.Handle(w, req)
Expand All @@ -22,4 +23,9 @@ func TestHandle(t *testing.T) {
if res.StatusCode != 200 {
t.Fatalf("unexpected response code: %v", res.StatusCode)
}

body := w.Body.String()
if !strings.Contains(body, "Functions Go Blog") {
t.Fatalf("response body does not contain blog title, got: %s", body[:200])
}
}
5 changes: 5 additions & 0 deletions go/blog/hugo/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/functions-dev/templates/go/blog/hugo

go 1.25.7

require github.com/gauron99/hugo-theme-minimal-dark v0.0.0-20260324081819-be0e014f9cdb // indirect
2 changes: 2 additions & 0 deletions go/blog/hugo/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/gauron99/hugo-theme-minimal-dark v0.0.0-20260324081819-be0e014f9cdb h1:I6iAx1Q8C7gn7NerxqxM/Xea4ZFTk43orUVOmt87x1Q=
github.com/gauron99/hugo-theme-minimal-dark v0.0.0-20260324081819-be0e014f9cdb/go.mod h1:87aJ7j4j88ej45sl/8GRgeozGBS4PvKx6d7hcAK78N0=
5 changes: 4 additions & 1 deletion go/blog/hugo/hugo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
title = "Functions Go Blog"
theme = "not-much"
languageCode = "en-us"
baseURL = "https://example.org/"
copyright = "Sample custom notice © {year}"

[module]
[[module.imports]]
path = "github.com/gauron99/hugo-theme-minimal-dark"

[markup]
[markup.highlight]
style = 'dracula'
Expand Down
Loading