mirror of
https://github.com/Icinga/icinga-docs-tools.git
synced 2025-07-21 04:44:22 +02:00
Sort 'From Source' installation steps explicitly to the end of ordering
This commit is contained in:
parent
fd977e14fd
commit
87bcc6d965
@ -91,8 +91,8 @@ def build_page_index(full_docs_dir, project_docs_dir)
|
|||||||
|
|
||||||
Dir.glob("#{file}/*.md", File::FNM_CASEFOLD).sort.each do |subfile|
|
Dir.glob("#{file}/*.md", File::FNM_CASEFOLD).sort.each do |subfile|
|
||||||
subfile_path = subfile.gsub(full_docs_dir + '/', project_docs_dir + '/')
|
subfile_path = subfile.gsub(full_docs_dir + '/', project_docs_dir + '/')
|
||||||
subfile_name = subfile.match(/.*(\d+)-(.*)$/)
|
# Get everything after last slash
|
||||||
|
subfile_name = subfile.match(/([^\/]+$)/)
|
||||||
if(is_template_dir)
|
if(is_template_dir)
|
||||||
%x(./parse_template.py -D icingaDocs true #{full_docs_dir} #{subfile_path.gsub(/^doc\//, '')})
|
%x(./parse_template.py -D icingaDocs true #{full_docs_dir} #{subfile_path.gsub(/^doc\//, '')})
|
||||||
|
|
||||||
@ -108,10 +108,19 @@ def build_page_index(full_docs_dir, project_docs_dir)
|
|||||||
subfile_path = subfile_path.gsub(subdir_name, subdir_name.gsub(/\.md.d$/, ''))
|
subfile_path = subfile_path.gsub(subdir_name, subdir_name.gsub(/\.md.d$/, ''))
|
||||||
end
|
end
|
||||||
|
|
||||||
header = titleize(subfile_name[2]) unless File.symlink?(subfile)
|
header = titleize(subfile_name[1]) unless File.symlink?(subfile)
|
||||||
subdirectory.push(header => subfile_path) if header
|
subdirectory.push(header => subfile_path) if header
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Sort the "From Source" installation guide explicitly to the end
|
||||||
|
subdirectory.each_with_index do |subdirectory_element, index|
|
||||||
|
if subdirectory_element.key?("From Source")
|
||||||
|
subdirectory.append(subdirectory_element)
|
||||||
|
subdirectory.delete_at(index)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if(is_template_dir)
|
if(is_template_dir)
|
||||||
template_path = filepath.gsub(/\.d$/, '')
|
template_path = filepath.gsub(/\.d$/, '')
|
||||||
if(pages.include?(nav_item => template_path))
|
if(pages.include?(nav_item => template_path))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user