Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
9841fc37
Commit
9841fc37
authored
1 month ago
by
Semyon Krestyaninov
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
223f3fee
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
template/builder.go
+7
-7
7 additions, 7 deletions
template/builder.go
with
7 additions
and
7 deletions
template/builder.go
+
7
−
7
View file @
9841fc37
...
@@ -3,9 +3,9 @@ package template
...
@@ -3,9 +3,9 @@ package template
import
(
import
(
"bytes"
"bytes"
"context"
"context"
templ
html
"html/template"
html
"html/template"
"io"
"io"
templ
text
"text/template"
text
"text/template"
"git.perx.ru/perxis/perxis-go/pkg/collections"
"git.perx.ru/perxis/perxis-go/pkg/collections"
"git.perx.ru/perxis/perxis-go/pkg/content"
"git.perx.ru/perxis/perxis-go/pkg/content"
...
@@ -18,7 +18,7 @@ type Template interface {
...
@@ -18,7 +18,7 @@ type Template interface {
}
}
type
Builder
struct
{
type
Builder
struct
{
parseFunc
func
(
text
string
)
(
Template
,
error
)
parseFunc
func
(
data
string
)
(
Template
,
error
)
ctx
context
.
Context
ctx
context
.
Context
cnt
*
content
.
Content
cnt
*
content
.
Content
...
@@ -41,8 +41,8 @@ func NewBuilder(cnt *content.Content, space, env, col string) Builder {
...
@@ -41,8 +41,8 @@ func NewBuilder(cnt *content.Content, space, env, col string) Builder {
EnvID
:
env
,
EnvID
:
env
,
CollID
:
col
,
CollID
:
col
,
}
}
b
.
parseFunc
=
func
(
text
string
)
(
Template
,
error
)
{
b
.
parseFunc
=
func
(
data
string
)
(
Template
,
error
)
{
return
templ
text
.
New
(
"main_text"
)
.
Funcs
(
b
.
getFuncs
())
.
Parse
(
text
)
return
text
.
New
(
"main_text"
)
.
Funcs
(
b
.
getFuncs
())
.
Parse
(
data
)
}
}
return
b
return
b
}
}
...
@@ -55,8 +55,8 @@ func NewHTMLBuilder(cnt *content.Content, space, env, col string) Builder {
...
@@ -55,8 +55,8 @@ func NewHTMLBuilder(cnt *content.Content, space, env, col string) Builder {
EnvID
:
env
,
EnvID
:
env
,
CollID
:
col
,
CollID
:
col
,
}
}
b
.
parseFunc
=
func
(
text
string
)
(
Template
,
error
)
{
b
.
parseFunc
=
func
(
data
string
)
(
Template
,
error
)
{
return
templ
html
.
New
(
"main_html"
)
.
Funcs
(
b
.
getFuncs
())
.
Parse
(
text
)
return
html
.
New
(
"main_html"
)
.
Funcs
(
b
.
getFuncs
())
.
Parse
(
data
)
}
}
return
b
return
b
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment