Esempio n. 1
0
    def generate_tags(self):
        g = PageGenerator(self.config, self.target_path)

        for root, dirs, files in os.walk(self.config["source"]):
            files = [f for f in files if not f.startswith(".")]
            dirs[:] = [d for d in dirs if not d.startswith(".")]
            for filename in files:
                if not filename.endswith(self.config["default_ext"]):
                    continue
                md_file = os.path.join(root, filename)

                g.src_file = md_file
                meta, _ = g.get_meta_and_content(do_render=False)
                _tags = meta.get('tag') or []  # if None
                for t in _tags:
                    self.tags.setdefault(t, []).append(meta)
Esempio n. 2
0
    def generate_tags(self):
        g = PageGenerator(self.config, self.target_path)

        for root, dirs, files in os.walk(self.config["source"]):
            files = [f for f in files if not f.startswith(".")]
            dirs[:] = [d for d in dirs if not d.startswith(".")]
            for filename in files:
                if not filename.endswith(self.config["default_ext"]):
                    continue
                md_file = os.path.join(root, filename)

                g.src_file = md_file
                meta, _ = g.get_meta_and_content(do_render=False)
                _tags = meta.get('tag') or []  # if None
                for t in _tags:
                    self.tags.setdefault(t, []).append(meta)
Esempio n. 3
0
    def generate_catalog():
        pg = PageGenerator(_site_config, _base_path)
        pages = {}

        for root, dirs, files in os.walk(_site_config["source"]):
            files = [f for f in files if not f.startswith(".")]
            dirs[:] = [d for d in dirs if not d.startswith(".")]
            for filename in files:
                if not filename.endswith(_site_config["default_ext"]):
                    continue
                md_file = os.path.join(root, filename)
                pg.src_file = md_file
                meta, _ = pg.get_meta_and_content(do_render=False)
                pages[md_file] = meta

        cg = CatalogGenerator(_site_config, _base_path, pages)
        html = cg.generate_catalog_html()
        ofile = os.path.join(_base_path, _site_config['destination'],
                             "index.html")
        write_file(ofile, html)
        logging.debug('Regenerating catalog')
Esempio n. 4
0
    def generate_catalog():
        pg = PageGenerator(_site_config, _base_path)
        pages = {}

        for root, dirs, files in os.walk(_site_config["source"]):
            files = [f for f in files if not f.startswith(".")]
            dirs[:] = [d for d in dirs if not d.startswith(".")]
            for filename in files:
                if not filename.endswith(_site_config["default_ext"]):
                    continue
                md_file = os.path.join(root, filename)
                pg.src_file = md_file
                meta, _ = pg.get_meta_and_content(do_render=False)
                pages[md_file] = meta

        cg = CatalogGenerator(_site_config, _base_path, pages)
        html = cg.generate_catalog_html()
        ofile = os.path.join(
            _base_path,
            _site_config['destination'],
            "index.html"
        )
        write_file(ofile, html)
        logging.debug('Regenerating catalog')