diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-12-14 09:07:50 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-12-14 09:07:50 -0800 |
commit | bd96fae14bc6201cb6e81b1cb2c51b00314810b6 (patch) | |
tree | f1fb77f72987c8020eaf54d56f213c3839c98586 /system/db/content.go | |
parent | 6808d3bf58e19e9230e7966798a70406f6d306e0 (diff) |
maintain original slug and append to it with single incremental value, not many
Diffstat (limited to 'system/db/content.go')
-rw-r--r-- | system/db/content.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/system/db/content.go b/system/db/content.go index 52fc8d5..0661556 100644 --- a/system/db/content.go +++ b/system/db/content.go @@ -494,6 +494,7 @@ func checkSlugForDuplicate(slug string) (string, error) { // check for existing slug in __contentIndex err := store.View(func(tx *bolt.Tx) error { b := tx.Bucket([]byte("__contentIndex")) + original := slug exists := true i := 0 for exists { @@ -504,7 +505,7 @@ func checkSlugForDuplicate(slug string) (string, error) { } i++ - slug = fmt.Sprintf("%s-%d", slug, i) + slug = fmt.Sprintf("%s-%d", original, i) } return nil |