Refactor html templates
This commit entirely refactors the use of html templates. Instead of inheriting from a shared template, we insert the results into a base template.
This commit is contained in:
parent
6ede99d7c6
commit
d235ee4e5c
59 changed files with 869 additions and 777 deletions
22
internal/dis/component/server/templating/assets.go
Normal file
22
internal/dis/component/server/templating/assets.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package templating
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
|
||||
)
|
||||
|
||||
// CustomAssetsPath is the path custom assets are stored at
|
||||
func (tpl *Templating) CustomAssetsPath() string {
|
||||
return filepath.Join(tpl.Config.DeployRoot, "core", "assets")
|
||||
}
|
||||
|
||||
func (tpl *Templating) CustomAssetPath(name string) string {
|
||||
return filepath.Join(tpl.CustomAssetsPath(), name)
|
||||
}
|
||||
|
||||
func (tpl *Templating) BackupName() string { return "custom" }
|
||||
|
||||
func (tpl *Templating) Backup(context component.StagingContext) error {
|
||||
return context.CopyDirectory("", tpl.CustomAssetsPath())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue