Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/slugigo.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Slugigo CI
name: CI

on:
pull_request:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Slugigo: Changelog

## v0.1.0 (2026-06-16)

### Features

- First Release
- Default compilance to <b>RFC-3986</b> URL generation rules
- Support custom configuration for slugs generation

### Fixes

None
79 changes: 78 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,82 @@
<h1 align="center">slugigo</h1>

<p align="center">Fast, low-alloc Go slug generator with an elegant Fluent API.</p>

<p align="center">
<a href="https://github.com/Ivanbyone/slugigo/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-orange.svg" alt="Slugigo License"></a>
<a href="https://github.com/ivanbyone/slugigo/releases"><img src="https://img.shields.io/github/v/release/ivanbyone/slugigo?logo=github&sort=semver)" alt="GH Release"></a>
<a href="https://github.com/ivanbyone/slugigo/actions/workflows/slugigo.yml"><img alt="Slugigo CI Status" src="https://img.shields.io/github/actions/workflow/status/ivanbyone/slugigo/slugigo.yml?label=CI&logo=GitHub"></a>
<a href="https://github.com/ivanbyone/slugigo/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-orange.svg" alt="Slugigo License"></a>
<a href="https://pkg.go.dev/github.com/ivanbyone/slugigo"><img src="https://pkg.go.dev/badge/github.com/ivanbyone/slugigo.svg" alt="Go documentation"></a>
</p>

## Quick Start

### Installation

```bash
go get -u github.com/ivanbyone/slugigo
```

### Usage example

```go
package main

import (
"fmt"
"github.com/ivanbyone/slugigo"
)

func main() {
// Basic usage (ASCII, default compliance RFC-3986)
slug := slugigo.Slug("Hello, Slugigo!").Build()
fmt.Println(slug)
// Output: hello-slugigo

// Advanced custom configuration
custom := slugigo.Slug("Hello, Fluent Slugigo").
NoLowercase().
MaxLength(12).
Separator("_").
SaveLeadingAndTrailingDash().
Build()
fmt.Println(custom)
// Output:
}
```

## Concept

Package `slugigo` provides functionality for generating URL-friendly slugs due to standard <b>[RFC-3986](https://datatracker.ietf.org/doc/html/rfc3986)</b>. So, <b>default</b> output complies with the following rules:

* Acceptable `ASCII` characters:
* <b>only</b> lowercase letters: `a-z`
* numbers: `0-9`
* dash: `-`
* underscore: `_`
* dot: `.`
* Default separator: `-`
* Unacceptable leading and trailing dashes.

You can set custom configuration for use due to your needs. See more in docs.

## Roadmap

<b>v0.2.0</b>

* Improve library code style
* Add Go benchmarks
* Compile comprehensive documentation
* <b>Key feature</b>: custom replacements with Fluent style

<b>Stable release</b>

* <b>Major</b>: Multiple languages transliteration support
* <b>Minor</b>:
* support `Prefix()` & `Suffix()`
* generating dates for slug (`UNIX`, `Datetime`)
* emoji replacements

## License

This project is licensed under the terms of the MIT license. See [LICENSE](./LICENSE) file for details.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/Ivanbyone/slugigo
module github.com/ivanbyone/slugigo

go 1.26.4
9 changes: 8 additions & 1 deletion slugigo.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
Copyright (c) 2026 Ivan Boyko.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/

package slugigo

import (
Expand Down Expand Up @@ -27,7 +34,7 @@ func Slug(text string) Slugigo {
return Slugigo{text: b, separator: "-"}
}

// Lowercase
// NoLowercase
func (s Slugigo) NoLowercase() Slugigo {
s.flags |= flagNoLowercase
return s
Expand Down
7 changes: 7 additions & 0 deletions slugigo_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
Copyright (c) 2026 Ivan Boyko.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/

package slugigo

import "testing"
Expand Down
Loading