You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4 KiB

% Generated by roxygen2: do not edit by hand
2 years ago
% Please edit documentation in R/slugify-package.R, R/slugify.R
\docType{package}
\name{slugify}
\alias{slugify}
\alias{slugify-package}
2 years ago
\title{Create Slug Strings for SEO}
2 years ago
\usage{
slugify(x, replacement = "-", remove = NULL, lower = TRUE, strict = TRUE)
}
\arguments{
\item{x}{string}
\item{replacement}{replace spaces with replacement character, defaults to \code{-}}
2 years ago
\item{remove}{remove characters that match this JavaScript regex, defaults to \code{NULL} (no deleting).
This should be a \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions}{JavaScript bare regex}
including the \verb{//} and any modifiers. e.g. to remove all R's (upper and lower) from a slug you should
specify \verb{remove = "/[rR]/g}.}
2 years ago
\item{lower}{convert to lower case, defaults to \code{TRUE}}
\item{strict}{strip special characters except replacement, defaults to \code{TRUE}}
}
\description{
2 years ago
Most blogging platforms turn title phrases into slugs
for better SEO. Tools are provided to turn phrases into slugs.
}
\examples{
2 years ago
slugify("R is great!") # "r-is-great"
slugify("R is great!", replacement = "@") # "r@is@great"
slugify("R is great!", remove = "/[Rr]/g") # "is-geat"
}
\seealso{
Useful links:
\itemize{
\item \url{https://git.rud.is/hrbrmstr/slugify}
\item Report bugs at \url{https://git.rud.is/hrbrmstr/slugify/issues}
}
}
\author{
Bob Rudis (bob@rud.is)
}
\keyword{internal}