Пример #1
0
 def run(self):
     """run the plugin"""
     for current in self.generate:
         co = ContentObject()
         title = self.generate[current][0]
         menu = self.generate[current][1]
         co.add_meta(title, current, menu)
         prepare(co, self.site)
         self.site.content.append(co)
Пример #2
0
    def run(self):
        """run the plugin"""
        files = fshelpers.filelist(self.content_directory, self.extension)

        # for every file: read, create ContentObject, parse yaml, store
        for current in files:
            raw = fshelpers.read(self.content_directory, current)

            co = ContentObject()
            (co.meta, co.content) = self.parse_yaml(raw)
            prepare(co, self.site)
            self.site.content.append(co)
Пример #3
0
    def run(self):
        """run the plugin"""
        for current in self.site.content:
            if "tags" in current.meta:
                for tag in current.meta['tags']:
                    if not tag in self.tags:
                        self.tags[tag] = []
                    self.tags[tag].append(current)

        for name in self.tags:
            cobj = ContentObject()
            title = name
            menu = False
            cobj.add_meta(title, 'tags', menu)
            cobj.tags = self.tags[name]
            prepare(cobj, self.site)
            self.site.content.append(cobj)
            self.site.tags[name] = cobj.url