Skip to content

mkdocs_nype.plugins.canonical_merge.ci.prepare_structure

Synopsis

Small CI script to shift docs files around and to adjust mkdocs.yml

That's the second iteration of "How to change directories around and not lose SEO ranking" strategy. It works in unison with the canonical_merge plugin. It should be run in the root of the project.

MIT Licence 2024 Kamil Krzyśków (HRY) for Nype (npe.cm) and Fiori Tracker (fioritracker.org)

NEW_DOCS

NEW_DOCS = 'docs_for_deploy'

Name of the new docs directory

NEW_SITE

NEW_SITE = 'site_for_deploy'

Name of the new site directory

NEW_CONFIG

NEW_CONFIG = 'mkdocs_for_deploy.yml'

Name of the new config file

PREFIX_DIR

PREFIX_DIR = 'V2020'

Name of the directory that is the new root

main

main()

Entry point

clear_path_and_copy_structure

clear_path_and_copy_structure(old_docs: Path, new_docs: Path)

Move files to the new structure

process_config_and_save_new

process_config_and_save_new(config: Path)

Adjust config for the new structure and save it in another file