Ejemplo n.º 1
0
 def generate(self, site_path):
     self.content_path = 'content'
     self.site_path = os.path.expanduser(site_path)
     print self.site_path
     ensure_clear_dir(self.site_path)
             
     # copy static dir:
     self.static_dir = os.path.join(os.path.dirname(__file__), 'static')
     shutil.copytree(self.static_dir, os.path.join(self.site_path, 'static'))
     
     # copy vr:
     vr_dir = os.path.join(os.path.dirname(__file__), 'vr')
     shutil.copytree(vr_dir, os.path.join(self.site_path, 'vr'))
     
     # create assets dir:
     self.assets_dir = os.path.join(self.site_path, 'assets')
     os.mkdir(self.assets_dir)
     self.assets_map = {}
     
     self.sections = create_sections(self)
     
     self.create_index()
     self.create_data_js()
     create_detail_pages(self)
def create_detail_pages(gen):
    ensure_clear_dir(os.path.join(gen.site_path, 'projects'))
    projects_dir = os.path.join(gen.content_path, 'projects')
    for project_path in all_child_dir_paths(projects_dir):
        if os.path.isdir(project_path):
            create_detail_page(project_path, gen)