I ended up creating a simple helper that iterate over specific path storing the Resource Link. Additionally it iterate over the subfolder of the same name as the file emulating a one level tree. As for the ordering I will prefix the files names with a number but will remove it later on hooking in to the sitemap.
I used the navtree extension as reference and code example, the result is:
module SidebarHelpers
def sidebar_menu(path)
data = {}
Dir.foreach(path) do |filename|
# skip hidden files
next if (filename[0] == '.')
next if (filename == '..' || filename == '.')
full_path = File.join(path, filename)
# skip folders
next if File.directory?(full_path)
resource = sitemap.find_resource_by_path(sitemap.file_to_path(full_path))
childs = false
if File.directory?(full_path[/(.*?)(?=\.)/])
childs = sidebar_menu(full_path[/(.*?)(?=\.)/])
end
data.store(resource, childs)
end
data
end
def discover_title(page = current_page)
page.data.title || page.render({layout: false}).match(/<h1.+>(.*?)<\/h1>/) do |m|
m ? m[1] : page.url.split(/\//).last.titleize
end
end
end
Requires some coding in the template as well, ERB in this case:
<% sidebar_menu(sitemap.app.root+'/'+sitemap.app.settings.source).each do |page, childs| %>
<li>
<%= link_to(discover_title(page), page) %>
<% if (current_page == page || current_page.parent == page) && childs %>
<ul class="uk-list">
<% childs.each do |subpage| %>
<li><%= link_to(discover_title(subpage[0]), subpage[0]) %></li>
<% end %>
</ul>
<% end %>
</li>
<% end %>