File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525import sys
2626
2727
28- def patch (current_branch ):
28+ def patch (current_branch , lts_version ):
2929 url = "https://docs.cfengine.com/docs/branches.json"
3030 response = urllib .request .urlopen (url )
3131 data = json .loads (response .read ())
3232
3333 with open ("_includes/header_nav_options.html" , "w" ) as f :
34+ # Add Latest LTS entry if current branch is lts
35+ if current_branch == "lts" :
36+ print (
37+ '<a onclick="selectVersion(\' javascript:void(0);\' )" href="#" selected="selected">Latest LTS (%s)</a>'
38+ % lts_version ,
39+ file = f ,
40+ )
41+
3442 for branch in data ["docs" ]:
3543 if (
3644 "(LTS)" not in branch ["Title" ]
Original file line number Diff line number Diff line change 4545linkresolver .run (config )
4646# generate links to known targets
4747linkresolver .apply (config )
48- patch_header_nav .patch (sys .argv [1 ])
48+ patch_header_nav .patch (sys .argv [1 ], sys . argv [ 2 ] )
4949references_resolver .run (config )
5050shortcodes_resolver .run (config )
5151images_path_resolver .run (config )
Original file line number Diff line number Diff line change @@ -147,4 +147,4 @@ set +x
147147export LC_ALL=C.UTF-8
148148bash ./build/install_hugo.sh
149149echo " + bash -x ./_scripts/_run.sh $BRANCH || exit 6"
150- bash -x ./_scripts/_run.sh " $BRANCH " || exit 6
150+ bash -x ./_scripts/_run.sh " $BRANCH " " $LTS_VERSION " || exit 6
You can’t perform that action at this time.
0 commit comments