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.
 
 

45 lines
1.4 KiB

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/slugify-package.R, R/slugify.R
\docType{package}
\name{slugify}
\alias{slugify}
\alias{slugify-package}
\title{Create Slug Strings for SEO}
\usage{
slugify(x, replacement = "-", remove = NULL, lower = TRUE, strict = TRUE)
}
\arguments{
\item{x}{string}
\item{replacement}{replace spaces with replacement character, defaults to \code{-}}
\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}.}
\item{lower}{convert to lower case, defaults to \code{TRUE}}
\item{strict}{strip special characters except replacement, defaults to \code{TRUE}}
}
\description{
Most blogging platforms turn title phrases into slugs
for better SEO. Tools are provided to turn phrases into slugs.
}
\examples{
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}