slug

package
v0.0.0-...-7635d6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package slug provides functions for translating page titles into a representation that is safe to use in URLs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slugifier

type Slugifier struct {
	// contains filtered or unexported fields
}

Slugifyer provides a method to clean strings for the use in URLs.

func NewSlugifier

func NewSlugifier(replacement rune) *Slugifier

NewSlugifyer returns a initialized Slugifyer instance.

func (*Slugifier) Slugify

func (sl *Slugifier) Slugify(s string) string

Slugify takes a string and returns a SEO friendly normalized version of that string. Normalization applies a set of transformations to the string, e.g. lower-casing, trimming whitespace and replacing certain unicode characters/symbols. See the test cases for some examples.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL