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))
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/"
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'])
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 ()))
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)
def url_path(self): return build_url([self.parent.url_path, 'poster', 'lived'])
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'])
def url_path(self): # return build_url([self.record.url_path, 'slides']) return build_url([self.record.url_path])
def url_path(self): return build_url([self.parent.url_path, 'data.json'])
def url_path(self): return build_url([OUTPUT_PATH, 'pictures'])
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'])
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'])
def path(self): return build_url([self.parent.path, '@tag', self.tag])
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])
def url_path(self): return build_url([self.parent.url_path, 'letter-%s' % self.letter])
def produce_artifacts(self): self.declare_artifact( build_url([self.source.parent.url_path, self.source.filename]), sources=list(self.source.iter_source_filenames()))
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])
def url_path(self): return build_url([self.parent.url_path, 'chronological'])
def url_path(self): return build_url([OUTPUT_PATH])
def url_path(self): return build_url([self.record.url_path, slugify(self.item_name)])
def path(self): return build_url([self.parent.path, '@%s' % VIRTUAL_SOURCE_ID])
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])
def path(self): return build_url([self.parent.path, '@tipue', 'tipuesearch'])