![dependabot[bot]](/assets/img/avatar_default.png) 3996bdac33
			
		
	
	3996bdac33
	
	
	
		
			
			* website: Bump prettier from 3.3.3 to 3.4.1 in /website Bumps [prettier](https://github.com/prettier/prettier) from 3.3.3 to 3.4.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.3.3...3.4.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * update formatting Signed-off-by: Jens Langhammer <jens@goauthentik.io> * sigh Signed-off-by: Jens Langhammer <jens@goauthentik.io> * disable flaky test Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
		
			
				
	
	
	
		
			3.3 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	Docsmg
This CLI tool is used to generate a mapping file (migratefile) that is then used by the tool to migrate .md, .mdx, and images file from their current structure into a new structure.
Use this migration tool to:
- generate the mapping file with the current structure
- read the completed (manual process to define target structure) and create the directories and move the files.
- modify the internal, cross-reference links to point to new location
- write to the netlify.tomlfile to add redirect entries for all migrated files.
Steps to install
- Verify that you have the latest version of rust installed
- Install rust or update rust to the latest version with rustup update
- If installing rust from scratch, you may need to run . $HOME/.cargo/env
 
- Install rust or update rust to the latest version with 
- Install the cli tool with cargo install --git https://github.com/goauthentik/authentik --bin docsmg
- In the /websitedirectory, create a file nameddocsmg.envwith the entry ofMIGRATE_PATH=./docs.
Steps to use
- Generate a migratefile with docsmg generate >> migratefile
- Find the files you want to move in migratefileand insert the path you want to move them to after the arrow; expath/to/move/from/file.md -> path/to/move/to/file.mdNote: make sure to put spaces on either side of the arrow or that line won't be recognized
- Once you have entered all the paths you want to move, migrate the files with docsmg migrate
- To revert the migration, use docsmg unmigrate; Note: DO NOT edit the migrate file in between steps 3 and 4
- Repeat steps 2-4 until you are satisfied with the result
Create the mapping file (migratefile)
- 
Navigate to the authentik/websitedir.
- 
Generate a migratefile with docsmg generate | sort >> migratefile. You can also just rundocsmg generate | sortto see the output in the terminal, before writing it to a file.:::info The new migratefilewill be created in the/websitedir. :::
- 
Edit the migratefileto add the target directory paths in the new structure for each entry. For each file listed inmigratefileinsert the path you want to move them to. EXAMPLE:path/to/move/from/file.md -> path/to/move/to/file.mdNote: make sure to put spaces on either side of the arrow or that line won't be recognized. 
Migrate the docs
- After you have entered all the paths you want to move, migrate the files with the command docsmg migrate.
:::info
After you have run migrate, you cannot run it again or you will get a panic error... because the files have already been moved.
:::
- To revert the migration, use docsmg unmigrate. Note: DO NOT edit themigratefilefile before runningunmigrate.
- Continue modifying the migratefilefile and then using thedocsmg migratecommand until you are satisfied with the result.
Update the sidebar.js file
Because the structure is completely changed, you will need to modify/reconstruct the navigation bar.
Test the results
To test the internal links, navigate up a level to authentik and then run make website-watch.
Troubleshooting
- If the docsmg generatecommand pulls all of the files in the repo (even non-docs files), then check that:- the docsmg.envexists
- that it is in /website
- the content is MIGRATE_PATH=./docs
 
- the