Slug is an extension for qor.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
views
.babelrc
.gitignore
LICENSE.txt
README.md
package.json
slug.go

README.md

Slug

Slug provides an easy way to create a pretty URL, a.k.a. Search Engine Friendly (SEF) URL, for your model.

GoDoc

Usage

Use slug.Slug as your field type with the same name as the benefactor field, from which the slug's value should be dynamically derived, and prepended with WithSlug, for example:

import (
  "github.com/jinzhu/gorm"
  "github.com/qor/slug"
)

type User struct {
  gorm.Model
  Name            string
  NameWithSlug    slug.Slug
}

Then in the QOR Admin interface, you will see a slug field.

License

Released under the MIT License.