lib/pattern_lab_functions.rb
# Get data about for the templates, pages and psuedo pages
Get data about for the templates, pages and psuedo pages
Get data about for the templates pages and psuedo pages
def pages_data
    config_data = get_config_data
    all_data_files = Dir.glob("../#{ROOT_DIR}/lib/views/source/#{config_data["templates_page"]}/**/*.json")
    pageData_files = []
    all_data_files.map { |data| 
      data_name = data.split("/")[-1]
      pageData_files.push(
        {
          "file_name": data_name,
          "link_name": data_name.sub("~", "__").chomp(".json"),
          "label": data_name.sub("~", " ").chomp(".json")
        }
      )
    }
    return pageData_files
  end
def pages_data config_data = get_config_data all_data_files = Dir . glob ( "../#{ROOT_DIR}/lib/views/source/#{config_data["templates_page"]}/**/*.json" ) pageData_files = [ ] all_data_files . map { | data | data_name = data . split ( "/" ) [ - 1 ] pageData_files . push ( { "file_name" : data_name , "link_name" : data_name . sub ( "~" , "__" ) . chomp ( ".json" ) , "label" : data_name . sub ( "~" , " " ) . chomp ( ".json" ) } ) } return pageData_files end
Get data about for the templates, pages and psuedo pages
Get data about for the templates pages and psuedo pages