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
11 changes: 5 additions & 6 deletions admin/crud_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"net/http"
"testing"

"goblog/admin"
"goblog/auth"
"goblog/blog"
"github.com/goblogplatform/goblog/admin"
"github.com/goblogplatform/goblog/auth"
"github.com/goblogplatform/goblog/blog"
"github.com/goblogplatform/goblog/theme"

"github.com/gin-gonic/gin"
"github.com/stretchr/testify/mock"
Expand All @@ -34,9 +35,7 @@ func crudAPI(t *testing.T, isAdmin bool) *gin.Engine {
ad := admin.New(db, a, &b, "test")
gin.SetMode(gin.TestMode)
r := gin.New()
tmpl := template.Must(template.New("").Funcs(template.FuncMap{
"rawHTML": func(s string) template.HTML { return template.HTML(s) },
}).ParseGlob("../templates/shared/*.html"))
tmpl := template.Must(template.New("").Funcs(theme.FuncMap()).ParseGlob("../templates/shared/*.html"))
template.Must(tmpl.ParseGlob("../themes/default/templates/*.html"))
r.SetHTMLTemplate(tmpl)
r.POST("/api/v1/pages", ad.CreatePage)
Expand Down
2 changes: 1 addition & 1 deletion admin/login_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/gin-gonic/gin"

"goblog/datadir"
"github.com/goblogplatform/goblog/datadir"
)

// githubCredential matches a GitHub OAuth app's client id ("Ov23li…",
Expand Down
6 changes: 3 additions & 3 deletions admin/login_methods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"strings"
"testing"

"goblog/admin"
"goblog/blog"
"goblog/datadir"
"github.com/goblogplatform/goblog/admin"
"github.com/goblogplatform/goblog/blog"
"github.com/goblogplatform/goblog/datadir"

"github.com/gin-gonic/gin"
"github.com/stretchr/testify/mock"
Expand Down
8 changes: 4 additions & 4 deletions admin/settings_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strings"
"testing"

"goblog/admin"
"goblog/auth"
"goblog/blog"
"goblog/plugin"
"github.com/goblogplatform/goblog/admin"
"github.com/goblogplatform/goblog/auth"
"github.com/goblogplatform/goblog/blog"
"github.com/goblogplatform/goblog/plugin"

"github.com/gin-gonic/gin"
"github.com/stretchr/testify/mock"
Expand Down
9 changes: 4 additions & 5 deletions blog/post_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"strings"
"testing"

"goblog/auth"
"goblog/blog"
"github.com/goblogplatform/goblog/auth"
"github.com/goblogplatform/goblog/blog"
"github.com/goblogplatform/goblog/theme"

"github.com/gin-gonic/gin"
"github.com/stretchr/testify/mock"
Expand Down Expand Up @@ -37,9 +38,7 @@ func postTypeFixture(t *testing.T, user *auth.BlogUser, isAdmin bool) (*gin.Engi

gin.SetMode(gin.TestMode)
router := gin.New()
tmpl := template.Must(template.New("").Funcs(template.FuncMap{
"rawHTML": func(s string) template.HTML { return template.HTML(s) },
}).ParseGlob("../templates/shared/*.html"))
tmpl := template.Must(template.New("").Funcs(theme.FuncMap()).ParseGlob("../templates/shared/*.html"))
template.Must(tmpl.ParseGlob("../themes/default/templates/*.html"))
router.SetHTMLTemplate(tmpl)
router.NoRoute(b.NoRoute)
Expand Down
2 changes: 1 addition & 1 deletion plugin/posts.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"time"

"goblog/blog"
"github.com/goblogplatform/goblog/blog"
)

// Post is a published post as a plugin sees it through the posts_list host
Expand Down
4 changes: 2 additions & 2 deletions plugin/posts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"
"time"

"goblog/blog"
"goblog/plugin"
"github.com/goblogplatform/goblog/blog"
"github.com/goblogplatform/goblog/plugin"

"gorm.io/driver/sqlite"
"gorm.io/gorm"
Expand Down
2 changes: 1 addition & 1 deletion plugin/wasm/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"strings"

"goblog/plugin"
"github.com/goblogplatform/goblog/plugin"
)

// JSON shapes of the host contract (spec §1). Field names are the API: a
Expand Down
4 changes: 2 additions & 2 deletions tools/seed_backlinks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"
"time"

"goblog/blog"
"goblog/tools"
"github.com/goblogplatform/goblog/blog"
"github.com/goblogplatform/goblog/tools"

"gorm.io/driver/sqlite"
"gorm.io/gorm"
Expand Down
2 changes: 1 addition & 1 deletion wizard/handlers_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package wizard

import (
"goblog/datadir"
"github.com/goblogplatform/goblog/datadir"
"html/template"
"io"
"net/http"
Expand Down
Loading