chore: update module definition with new domain
This commit is contained in:
51
xhtml/ast/metadata.go
Normal file
51
xhtml/ast/metadata.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package ast
|
||||
|
||||
import (
|
||||
"net/url"
|
||||
"slices"
|
||||
|
||||
"code.capytal.cc/loreddev/x/xhtml/ast/attributes"
|
||||
)
|
||||
|
||||
type Base struct {
|
||||
BaseNode
|
||||
attributes.HRef
|
||||
attributes.Target
|
||||
attributes.Global
|
||||
}
|
||||
|
||||
func (n Base) Kind() NodeKind {
|
||||
return KindBase
|
||||
}
|
||||
|
||||
var KindBase = NewNodeKind("base", &Base{})
|
||||
|
||||
type Head struct {
|
||||
BaseNode
|
||||
profile []*url.URL
|
||||
attributes.Global
|
||||
}
|
||||
|
||||
func (n Head) Kind() NodeKind {
|
||||
return KindHead
|
||||
}
|
||||
|
||||
var KindHead = NewNodeKind("head", &Head{})
|
||||
|
||||
func (n Head) Profile() []*url.URL {
|
||||
return n.profile
|
||||
}
|
||||
|
||||
func (n *Head) SetProfile(uri []*url.URL) {
|
||||
n.profile = uri
|
||||
}
|
||||
|
||||
func (n *Head) AddProfile(uri *url.URL) {
|
||||
n.profile = append(n.profile, uri)
|
||||
}
|
||||
|
||||
func (n *Head) DelProfile(uri *url.URL) {
|
||||
n.profile = slices.DeleteFunc(n.profile, func(u *url.URL) bool {
|
||||
return u.String() == uri.String()
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user