diff options
author | Steve <nilslice@gmail.com> | 2016-12-14 10:04:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-14 10:04:42 -0800 |
commit | 372bd05522a7730891778082c0e0875d47445d59 (patch) | |
tree | 8775b01a283c32dce3297dbddad1ddf14a114c33 /content/item.go | |
parent | 8e1269385b2ea6bb8a115030a4a6f4c12fa24868 (diff) | |
parent | b3aa9440f62db5a530397c525a42b4fca7b27bab (diff) |
Merge pull request #22 from bosssauce/ponzu-dev
[core] Add a index for content slugs allowing quicker lookup via slug
Diffstat (limited to 'content/item.go')
-rw-r--r-- | content/item.go | 6 |
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 { |