File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed 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 138138./_regenerate_json.sh || exit 4
139139
140140# Preprocess Documentation with custom macros
141- ./_scripts/cfdoc_preprocess.py " $BRANCH " || exit 5
141+ ./_scripts/cfdoc_preprocess.py " $BRANCH " " $LTS_VERSION " || exit 5
142142
143143# rvm commands are insane scripts which pollut output
144144# so instead of set -x we just echo each command ourselves
You can’t perform that action at this time.
0 commit comments