{"id":15023109,"url":"https://github.com/honzajavorek/rtd-redirects","last_synced_at":"2025-08-01T06:19:44.231Z","repository":{"id":48688224,"uuid":"95895688","full_name":"honzajavorek/rtd-redirects","owner":"honzajavorek","description":"Manage redirects in the ReadTheDocs admin, programmatically","archived":false,"fork":false,"pushed_at":"2021-07-14T06:23:44.000Z","size":115,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T08:05:21.983Z","etag":null,"topics":["documentation","documentation-tool","mkdocs","readthedocs","sphinx-doc"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/honzajavorek.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2017-06-30T14:23:44.000Z","updated_at":"2024-12-09T03:49:25.000Z","dependencies_parsed_at":"2022-07-25T01:16:04.128Z","dependency_job_id":null,"html_url":"https://github.com/honzajavorek/rtd-redirects","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzajavorek%2Frtd-redirects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzajavorek%2Frtd-redirects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzajavorek%2Frtd-redirects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzajavorek%2Frtd-redirects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/honzajavorek","download_url":"https://codeload.github.com/honzajavorek/rtd-redirects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238174139,"owners_count":19428631,"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":["documentation","documentation-tool","mkdocs","readthedocs","sphinx-doc"],"created_at":"2024-09-24T19:58:44.480Z","updated_at":"2025-02-10T19:30:54.131Z","avatar_url":"https://github.com/honzajavorek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"rtd-redirects\n=============\n\nManage redirects in the `ReadTheDocs \u003chttp://readthedocs.org/\u003e`__ admin, programmatically. Addressing the `rtfd/readthedocs.org#2904 \u003chttps://github.com/rtfd/readthedocs.org/issues/2904\u003e`__ issue.\n\nInstallation\n------------\n\nRequires **Python 3.6** and higher.\n\n.. code:: sh\n\n    $ pip install rtd-redirects\n\nUsage\n-----\n\n.. code:: sh\n\n    $ rtd-redirects project-name ./redirects.yml --username=honzajavorek\n\nUploads redirects defined in the ``redirects.yml`` file to ReadTheDocs redirects administration of the ``project-name`` project.\n\nThe tool uses ReadTheDocs' HTML interface (there's no official API for redirects), so you need to provide your username and password. HTTPS is used to transfer the credentials to ReadTheDocs.\n\n``rtd-redirects`` tries to be idempotent, i.e. you can run it several times in row and it should always end with the same results. If there are any redirects with the same source path, the tool will replace them with whatever is defined in the ``redirects.yml`` file. Existing redirects which do not collide with contents of ``redirects.yml`` won't be affected.\n\nredirects.yml\n-------------\n\nOnly **page redirects** are supported at the moment. The format of the file is as follows:\n\n.. code:: yaml\n\n    redirects:\n      # we've migrated from MkDocs to Sphinx\n      \"/example/\": \"/example.html\"\n      \"/python/\": \"/python.html\"\n\n      # page removed in favor of section\n      \"/green.html\": \"/colors.html#green\"\n\n      # only for convenience\n      \"/praha.html\": \"/prague.html\"\n\nWhy `YAML \u003chttps://en.wikipedia.org/wiki/YAML\u003e`__? Because it's easy to read by humans, easy to write by humans, and above all, it has support for comments. Redirects are *corrections* and you should document why they're necessary.\n\n\nUsage with ReadTheDocs PRO\n--------------------------\n\nIf you are using a commercial edition of the RTD (from ``readthedocs.com`` instead of ``readthedocs.org``), please specify ``--pro`` flag in the command, like this\n\n.. code:: sh\n\n    $ rtd-redirects project-name ./redirects.yml --username=honzajavorek --pro\n\nThere is also an opposite flag ``--free`` which is added by default, so can be omitted\n\n\nLicense: MIT\n------------\n\n© 2017-? Honza Javorek mail@honzajavorek.cz\n\nThis work is licensed under `MIT\nlicense \u003chttps://en.wikipedia.org/wiki/MIT_License\u003e`__.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonzajavorek%2Frtd-redirects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonzajavorek%2Frtd-redirects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonzajavorek%2Frtd-redirects/lists"}