修复模板变量失效问题
This commit is contained in:
@@ -6,8 +6,6 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"code.d7z.net/d7z-project/gitea-pages/pkg/renders"
|
||||
|
||||
"code.d7z.net/d7z-project/gitea-pages/pkg/utils"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
@@ -45,17 +43,6 @@ func (m *PageDomainContent) CacheKey() string {
|
||||
return fmt.Sprintf("%s/%s/%s/%s", m.Owner, m.Repo, m.CommitID, m.Path)
|
||||
}
|
||||
|
||||
func (m *PageDomainContent) TryRender(path ...string) renders.Render {
|
||||
for _, s := range path {
|
||||
for _, compiler := range m.rendersL {
|
||||
if compiler.regex.Match(s) {
|
||||
return compiler.Render
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *PageDomain) ParseDomainMeta(domain, path, branch string) (*PageDomainContent, error) {
|
||||
if branch == "" {
|
||||
branch = p.defaultBranch
|
||||
@@ -105,6 +92,7 @@ func (p *PageDomain) ReturnMeta(owner string, repo string, branch string, path [
|
||||
zap.L().Warn("别名绑定失败", zap.Error(err))
|
||||
}
|
||||
}
|
||||
|
||||
return rel, nil
|
||||
} else {
|
||||
zap.L().Debug("查询错误", zap.Error(err))
|
||||
|
||||
Reference in New Issue
Block a user