gosimple / slug

URL-friendly slugify with multiple languages support.
Mozilla Public License 2.0
1.15k stars 108 forks source link

Add AppendTimestamp option to make slug unique #81

Closed phihungtf closed 7 months ago

phihungtf commented 1 year ago

Slugs may need to be unique.

Add AppendTimestamp option to ensure a slug is unique.

When AppendTimestamp is set to true, the final slug will be added a dash (-) and ten-digit numbers represent the current timestamp.

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (4a8e359) to head (f6824ea).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #81 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 2 2 Lines 121 125 +4 ========================================= + Hits 121 125 +4 ``` | [Files](https://app.codecov.io/gh/gosimple/slug/pull/81?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gosimple) | Coverage Δ | | |---|---|---| | [slug.go](https://app.codecov.io/gh/gosimple/slug/pull/81?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gosimple#diff-c2x1Zy5nbw==) | `100.00% <100.00%> (ø)` | |
matrixik commented 7 months ago

Thank you for this feature and sorry it took me so long to review.