summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-12-14 08:40:35 -0800
committerSteve Manuel <nilslice@gmail.com>2016-12-14 08:40:35 -0800
commit6808d3bf58e19e9230e7966798a70406f6d306e0 (patch)
tree5935a919b7f5f1710895a5f7609e908d491af345 /content
parent8e1269385b2ea6bb8a115030a4a6f4c12fa24868 (diff)
adding __contentIndex to map item slug to semi foreign-key, and implementing add/delete features
Diffstat (limited to 'content')
-rw-r--r--content/item.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/content/item.go b/content/item.go
index e6c8243..eb79aa0 100644
--- a/content/item.go
+++ b/content/item.go
@@ -13,6 +13,7 @@ import (
// and it will override the slug created by Item's SetSlug with your struct's
type Sluggable interface {
SetSlug(string)
+ ItemSlug() string
}
// Identifiable enables a struct to have its ID set/get. Typically this is done
@@ -67,6 +68,11 @@ func (i *Item) SetSlug(slug string) {
i.Slug = slug
}
+// ItemSlug sets the item's slug for its URL
+func (i *Item) ItemSlug() string {
+ return i.Slug
+}
+
// ItemID gets the Item's ID field
// partially implements the Identifiable interface
func (i Item) ItemID() int {