MCPcopy
hub / github.com/getpelican/pelican / _update_content

Method _update_content

pelican/contents.py:383–397  ·  view source on GitHub ↗

Update the content attribute. Change all the relative paths of the content to relative paths suitable for the output content. :param content: content resource that will be passed to the templates. :param siteurl: siteurl which is locally generated by the writer in

(self, content: str, siteurl: str)

Source from the content-addressed store, hash-verified

381 return re.compile(regex, re.X)
382
383 def _update_content(self, content: str, siteurl: str) -> str:
384 """Update the content attribute.
385
386 Change all the relative paths of the content to relative paths
387 suitable for the output content.
388
389 :param content: content resource that will be passed to the templates.
390 :param siteurl: siteurl which is locally generated by the writer in
391 case of RELATIVE_URLS.
392 """
393 if not content:
394 return content
395
396 hrefs = self._get_intrasite_link_regex()
397 return hrefs.sub(lambda m: self._link_replacer(siteurl, m), content)
398
399 def get_static_links(self) -> set[str]:
400 static_links = set()

Callers 2

get_contentMethod · 0.95

Calls 2

_link_replacerMethod · 0.95

Tested by

no test coverage detected