Пример #1
0
 def url_path(self):
     datamodel = self.datamodel
     slug = self._slug
     path = [self.parent.url_path, slug]
     if self.page_num not in (None, 1):
         assert datamodel.pagination_config.enabled
         path.append(datamodel.pagination_config.url_suffix)
         path.append(self.page_num)
     _, _, slug_tail = slug.rstrip('/').rpartition('/')
     return build_url(path, trailing_slash=('.' not in slug_tail))
Пример #2
0
def test_url_builder():

    assert build_url([]) == "/"
    assert build_url(["a", "b/c"]) == "/a/b/c/"
    assert build_url(["a", "b/c"], trailing_slash=False) == "/a/b/c"
    assert build_url(["a", "b/c.html"]) == "/a/b/c.html"
    assert build_url(["a", "b/c.html"], trailing_slash=True) == "/a/b/c.html/"
    assert build_url(["a", None, "b", "", "c"]) == "/a/b/c/"
Пример #3
0
def test_url_builder():
    from lektor.utils import build_url

    assert build_url([]) == '/'
    assert build_url(['a', 'b/c']) == '/a/b/c/'
    assert build_url(['a', 'b/c'], trailing_slash=False) == '/a/b/c'
    assert build_url(['a', 'b/c.html']) == '/a/b/c.html'
    assert build_url(['a', 'b/c.html'], trailing_slash=True) == '/a/b/c.html/'
    assert build_url(['a', None, 'b', '', 'c']) == '/a/b/c/'
Пример #4
0
def test_url_builder():
    from lektor.utils import build_url

    assert build_url([]) == '/'
    assert build_url(['a', 'b/c']) == '/a/b/c/'
    assert build_url(['a', 'b/c'], trailing_slash=False) == '/a/b/c'
    assert build_url(['a', 'b/c.html']) == '/a/b/c.html'
    assert build_url(['a', 'b/c.html'], trailing_slash=True) == '/a/b/c.html/'
    assert build_url(['a', None, 'b', '', 'c']) == '/a/b/c/'
 def url_path(self):
     return build_url([OUTPUT_PATH, 'today'])
Пример #6
0
 def url_resolver(node, url_path):
     u = build_url([node.url_path] + url_path)
     return AtomPlugin.url_map.get(u)
 def url_path(self):
     return build_url(chain([self.record.url_path.strip('/')],
                            self.get_archive_url_path() or ()))
Пример #8
0
        def tag_resolver(node, url_path):
            if not self.has_config():
                return

            u = build_url([node.url_path] + url_path, trailing_slash=True)
            return TagsPlugin.url_map.get(u)
Пример #9
0
 def url_path(self):
     return build_url([self.parent.url_path, 'poster', 'lived'])
Пример #10
0
 def url_path(self):
     return build_url([self.parent.url_path, 'poster', self.type])
 def url_path(self):
     return build_url([OUTPUT_PATH, 'societies'])
 def url_path(self):
     return build_url([OUTPUT_PATH, 'quotations'])
 def url_path(self):
     return build_url([OUTPUT_PATH, 'histtopics'])
Пример #14
0
 def url_path(self):
     # return build_url([self.record.url_path, 'slides'])
     return build_url([self.record.url_path])
Пример #15
0
 def url_path(self):
     # return build_url([self.record.url_path, 'slides'])
     return build_url([self.record.url_path])
Пример #16
0
 def url_path(self):
     return build_url([self.parent.url_path, 'data.json'])
 def url_path(self):
     return build_url([OUTPUT_PATH, 'pictures'])
Пример #18
0
 def path(self):
     return build_url([self.parent.path, '@%s/' % VIRTUAL_SOURCE_ID, self.type])
 def url_path(self):
     return build_url([OUTPUT_PATH, 'gazmap'])
Пример #20
0
 def path(self):
     return build_url([self.parent.path, '@%s/' % VIRTUAL_SOURCE_ID, 'lived'])
 def url_path(self):
     return build_url([OUTPUT_PATH, 'gazmap', 'data.json'])
Пример #22
0
 def path(self):
     return build_url([self.parent.path, '@tag', self.tag])
Пример #23
0
    def url_path(self):
        _path = self.plugin.get_feed_support_config(self.prefix, 'url_path')
        if _path:
            return _path

        return build_url([self.parent.url_path, self.filename])
Пример #24
0
 def url_path(self):
     return build_url(chain([self.record.url_path.strip('/')],
                            self.get_archive_url_path() or ()))
Пример #25
0
 def url_path(self):
     return build_url([self.parent.url_path, 'letter-%s' % self.letter])
Пример #26
0
 def produce_artifacts(self):
     self.declare_artifact(
         build_url([self.source.parent.url_path, self.source.filename]),
         sources=list(self.source.iter_source_filenames()))
Пример #27
0
 def path(self):
     return build_url(
         [self.parent.path,
          '@%schronological' % VIRTUAL_SOURCE_ID])
 def url_path(self):
     return build_url([OUTPUT_PATH, 'oftheday-%s' % self.day])
Пример #29
0
 def url_path(self):
     return build_url([self.parent.url_path, 'chronological'])
 def url_path(self):
     return build_url([OUTPUT_PATH])
Пример #31
0
 def url_path(self):
     return build_url([self.record.url_path, slugify(self.item_name)])
Пример #32
0
 def path(self):
     return build_url([self.parent.path, '@%s' % VIRTUAL_SOURCE_ID])
Пример #33
0
    def url_path(self):
        p = self.plugin.get_atom_config(self.feed_id, 'url_path')
        if p:
            return p

        return build_url([self.parent.url_path, self.filename])
Пример #34
0
    def url_path(self):
        p = self.plugin.get_atom_config(self.feed_id, 'url_path')
        if p:
            return p

        return build_url([self.parent.url_path, self.filename])
Пример #35
0
 def path(self):
     return build_url([self.parent.path, '@tipue', 'tipuesearch'])