Beispiel #1
0
 def _get_content_url(self, url, slug, date, frontmatter):
     subs = {
         '<year>': '%Y',
         '<month>': '%m',
         '<day>': '%d',
         '<i_month>': unicode(date.month),
         '<i_day>': unicode(date.day),
         '<slug>': slug
     }
     
     url = url.replace('%', '%%')
     
     for match, replace in subs.iteritems():
         url = url.replace(match, replace)
     
     for attribute, value in frontmatter.iteritems():
         if isinstance(value, basestring):
             url = url.replace('<{0}>'.format(attribute), slugify(value))
     
     url = date.strftime(url).decode('utf-8')
     
     return format_url(url, url.endswith('/'))
Beispiel #2
0
    def _get_content_url(self, url, slug, date, frontmatter):
        subs = {
            '<year>': '%Y',
            '<month>': '%m',
            '<day>': '%d',
            '<i_month>': unicode(date.month),
            '<i_day>': unicode(date.day),
            '<slug>': slug
        }

        url = url.replace('%', '%%')

        for match, replace in subs.iteritems():
            url = url.replace(match, replace)

        for attribute, value in frontmatter.iteritems():
            if isinstance(value, basestring):
                url = url.replace('<{0}>'.format(attribute), slugify(value))

        url = date.strftime(url).decode('utf-8')

        return format_url(url, url.endswith('/'))
Beispiel #3
0
    def _get_page_url(self, url, text):
        slug = slugify(text)

        return format_url(absurl(url, slug), url.endswith('/'))
Beispiel #4
0
 def _get_page_url(self, url, text):
     slug = slugify(text)
     
     return format_url(absurl(url, slug), url.endswith('/'))