Generate tag overview, add file action
This commit is contained in:
@ -26,12 +26,19 @@ final class Tag: Item {
|
||||
super.init(content: content, id: id)
|
||||
}
|
||||
|
||||
var linkName: String {
|
||||
id.lowercased().replacingOccurrences(of: " ", with: "-")
|
||||
func isValid(id: String) -> Bool {
|
||||
content.isValidIdForTagOrPageOrPost(id) &&
|
||||
content.isNewIdForTag(id)
|
||||
}
|
||||
|
||||
var url: String {
|
||||
"/tags/\(linkName).html"
|
||||
@discardableResult
|
||||
func update(id newId: String) -> Bool {
|
||||
guard content.storage.move(tag: id, to: newId) else {
|
||||
print("Failed to move files of tag \(id)")
|
||||
return false
|
||||
}
|
||||
id = newId
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: Paths
|
||||
|
Reference in New Issue
Block a user