{"id":16220703,"url":"https://github.com/elc/shortener","last_synced_at":"2025-04-08T00:40:01.299Z","repository":{"id":98145290,"uuid":"155021284","full_name":"ELC/shortener","owner":"ELC","description":"A shortener plugin for Pelican","archived":false,"fork":false,"pushed_at":"2018-10-28T14:17:46.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-14T01:23:10.162Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/ELC.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":"2018-10-28T00:20:22.000Z","updated_at":"2021-12-05T09:20:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"89ed2905-31cf-4812-b7bd-0d21cab3cc1b","html_url":"https://github.com/ELC/shortener","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ELC%2Fshortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ELC%2Fshortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ELC%2Fshortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ELC%2Fshortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ELC","download_url":"https://codeload.github.com/ELC/shortener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755560,"owners_count":20990620,"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":[],"created_at":"2024-10-10T11:59:23.300Z","updated_at":"2025-04-08T00:40:01.216Z","avatar_url":"https://github.com/ELC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Static Shortener for Pelican\n\nThis plugin creates HTML files with a `redirects meta tag` to provide shortener similar feature. It also works with Google analytics when the `GOOGLE_ANALYTICS` is set in the conf file. \n\nIt works with no no dependencies apart from pelican itself.\n\n## Installation\n\nSet up like any other plugin, making sure to set `PLUGIN_PATH` and add `shortener` to the `PLUGINS` list.\n\n## Configuration\n\n- `SHORTENER_LINKS`: Is a dict where the key represents the shortened part and the value the url it redirects to. It will use `http://` if it isn't part of the url.\n- `SHORTENER_FILE` (Optional): A path to a json file to all the redirects, it should be a simple dictionary. This is a way to keep the configuration file of pelican cleaner and have the redirects in a separate file. Can be used with the SHORTENER_FOLDER.\n- `SHORTENER_FOLDER` (Optional): A constant that defines where the directory structure will be created. If not set it will create the directories in the root of the ouput_path.\n\n### Examples\n\n#### SHORTENER_FOLDER not set or None\n\n```python\nSHORTENER_LINKS = {'hello':'www.google.com'}\n```\n\nWill produce:\n\n    output_path/hello/index.html\n\n#### SHORTENER_FOLDER set\n\n```python\nSHORTENER_LINKS = {'hello':'www.google.com'}\n\nSHORTENER_FOLDER = 'short'\n```\n\nWill produce:\n\n    output_path/short/hello/index.html\n\n#### SHORTENER_FOLDER set with nested dirs\n\n```python\nSHORTENER_LINKS = {'hello':'www.google.com'}\n\nSHORTENER_FOLDER = 'short/goto'\n```\n\nWill produce:\n\n    output_path/short/goto/hello/index.html\n\n#### SHORTENER_FILE set\n\n```python\nSHORTENER_FILE = \"shortener.json\"\n```\n\nshortener.json:\n\n    {\n        \"github\": \"https://github.com/ELC\"\n    }\n\nWill produce:\n\n    output_path/short/goto/hello/index.html\n\n## Usage\n\nYou can create links directly to the path of the shortened url, as with articles and pages you can omit the `index.html` at the end. Example: `output_path/short/goto/hello/`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felc%2Fshortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felc%2Fshortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felc%2Fshortener/lists"}