66IGNORE_DIRS = {"stylesheets" , "__pycache__" , "images" }
77IGNORE_FILES = {"_Sidebar.md" , "index.md" }
88
9- # Custom top-level order
9+ # Priority nav order (custom)
1010PRIORITY_ORDER = [
1111 "Defender for Endpoint" ,
1212 "Support Tips and Tools" ,
@@ -56,26 +56,24 @@ def build_mkdocs_config(nav):
5656 with open (config_path , "w" , encoding = "utf-8" ) as f :
5757 yaml .dump (config , f , sort_keys = False , allow_unicode = True )
5858
59- print ("✅ Navigation updated in mkdocs.yml" )
59+ print ("✅ mkdocs.yml navigation updated. " )
6060
6161def git_commit_and_push ():
62- # Check for any changes (staged or not)
62+ # Check if anything changed
6363 result = subprocess .run (["git" , "status" , "--porcelain" ], capture_output = True , text = True )
6464 if result .stdout .strip () == "" :
6565 print ("⚠️ No changes to commit." )
6666 return
6767
68- print ("📦 Staging and committing changes..." )
68+ print ("📦 Committing and pushing changes..." )
6969 subprocess .run (["git" , "add" , "." ], check = True )
70- subprocess .run (["git" , "commit" , "-m" , "Auto-update nav and content" ], check = False )
70+ subprocess .run (["git" , "commit" , "-m" , "Auto-update: nav, content, or metadata " ], check = False )
7171 subprocess .run (["git" , "push" , "origin" , "main" ], check = True )
72- print ("✅ Git commit and push completed ." )
72+ print ("✅ Changes pushed to main. GitHub Pages will redeploy shortly ." )
7373
7474if __name__ == "__main__" :
75- print ("📁 Collecting docs..." )
75+ print ("📁 Collecting docs and rebuilding nav ..." )
7676 nav = collect_docs (DOCS_DIR )
7777
78- print ("🧭 Building mkdocs.yml..." )
7978 build_mkdocs_config (nav )
80-
8179 git_commit_and_push ()
0 commit comments