{"id":17089296,"url":"https://github.com/holdoffhunger/title-key-url-generator","last_synced_at":"2025-10-12T03:39:53.253Z","repository":{"id":174703253,"uuid":"317392692","full_name":"HoldOffHunger/title-key-url-generator","owner":"HoldOffHunger","description":"Generate a title, sort key, and URL from a given set of webpage information.","archived":false,"fork":false,"pushed_at":"2022-02-06T20:10:30.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-28T21:32:54.781Z","etag":null,"topics":["cms","cms-backend","cms-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HoldOffHunger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-01T01:36:05.000Z","updated_at":"2021-12-26T19:17:12.000Z","dependencies_parsed_at":"2023-07-30T12:00:47.394Z","dependency_job_id":null,"html_url":"https://github.com/HoldOffHunger/title-key-url-generator","commit_stats":null,"previous_names":["holdoffhunger/title-key-url-generator"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoldOffHunger%2Ftitle-key-url-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoldOffHunger%2Ftitle-key-url-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoldOffHunger%2Ftitle-key-url-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoldOffHunger%2Ftitle-key-url-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HoldOffHunger","download_url":"https://codeload.github.com/HoldOffHunger/title-key-url-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245120834,"owners_count":20563988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","cms-backend","cms-framework"],"created_at":"2024-10-14T13:46:40.484Z","updated_at":"2025-10-12T03:39:48.223Z","avatar_url":"https://github.com/HoldOffHunger.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Title-Key-URL Generator\nGenerate a title, sort key, and URL from a given set of webpage information, like Title, Subtitle, Description, and Tags.\n\n## What Problems Does This Solve?\n* **List Title Generation:** When an item is listed in a list, it should have this List Title, i.e., \"The World\" should be \"World, The\", so that all the \"The...\" titled items do not clump up together.\n* **Sort Key Generation:** When an item is listed in a list, it should be sorted by this value, i.e., '\"Hello World\": Your First Program', should not sort at the end or beginning of a list just because it starts with a quote, but with the other H-titled items.  This value is not intended for display, just for sorting.\n* **URL Generation:** Generate a perfectly encoded URL given input like Title, Subtitle, etc., so that '\"Hello World\": Your First Program' should become \"hello-world-your-first-program\", which you can then use to name your PHP/HTML/etc. file, or use as an internal code.\n\n(See more below in edge-cases handled.)\n\n## Example Usage\n\n\t$generator = new TitleKeyURLGenerator();\n\t\n\tprint_r($generator-\u003eGenerateAllValuesForEntry([\n\t\t'entry'=\u003e[\n\t\t\t'Title'=\u003e'The Best Blog In the World',\n\t\t\t'Subtitle'=\u003e'An \"Inside\" Look in 2000',\n\t\t\t'Description'=\u003e'',\n\t\t\t'tags'=\u003e[\n\t\t\t\t'awesome',\n\t\t\t\t'best',\n\t\t\t\t'viral',\n\t\t\t],\n\t\t],\n\t]));\n  \n  Output:\n  \n  \tArray\n\t(\n\t    [url] =\u003e the-best-blog-in-the-world-an-inside-look-in-2000-awesome-best-viral\n\t    [ListTitle] =\u003e Best Blog In the World, The: \"Inside\" Look in 2000, An\n\t    [ListTitleSortKey] =\u003e Best Blog In the World, The: Inside Look in 0000002000, An\n\t)\n\n## Sample Outputs\n\n  Input:\n\n\t'Title'=\u003e'The Best Blog In the World - Says ME!',\n\t'Subtitle'=\u003e'An \"Inside\" Look in 2000',\n\t'Description'=\u003e'',\n\t'tags'=\u003e[\n\t\t'awesome',\n\t\t'best',\n\t\t'viral',\n\t],\n    \n  Output:\n\n\tArray\n\t(\n\t    [url] =\u003e the-best-blog-in-the-world-says-me-an-inside-look-in-2000-awesome-best\n\t    [ListTitle] =\u003e Best Blog In the World, The - Says ME!: \"Inside\" Look in 2000, An\n\t    [ListTitleSortKey] =\u003e Best Blog In the World, The - Says ME!: Inside Look in 0000002000, An\n\t)\n\n## Demo\n\n***See a full working Demo Online Here:*** [Full Working Demo](https://3v4l.org/Eb8oO)\n\n## Edge Cases Handled\n\n* URL Generation\n\n  * Replace all white-space with a single dash.\n  * Strip commas.\n  * Do not repeat any dashes more than once.\n  * Do not allow dashes to begin or end the URL.\n  * Lowercase everything.\n  * Trans-Romanize text, i.e., \"Ōsugi Sakae\" becomes \"Osugi Sakae\".\n\n* List Title Generation\n\n  * Break up the title by the \":\", \"-\", and \"--\" characters, and if any piece begins with \"A\", \"An\", or \"The\", remove that piece and prepend it to the end with a comma.  I.E. \"A Way Cool Story: The Details\" becomes \"Way Cool Story, A: Details, The\".\n\n* List Title Key Generation\n\n  * Remove all apostrophes and quotes, so that quoted text and non-quoted text sort accordingly.\n  * Left string-pad all numbers with \"0\" up to ten characters, so that dates sort properly, i.e., 53 AD, 500 AD, and 1900 AD would sort incorrectly otherwise.\n  * Trans-Romanize text, i.e., \"Ōsugi Sakae\" becomes \"Osugi Sakae\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholdoffhunger%2Ftitle-key-url-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholdoffhunger%2Ftitle-key-url-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholdoffhunger%2Ftitle-key-url-generator/lists"}