Functions
href_for
2
str
▼
Get href for any object. Prefer obj.href directly.
This is the recommended way…
href_for
2
str
▼
def href_for(obj: PageLike | Any, site: Any = None) -> str
Get href for any object. Prefer obj.href directly.
This is the recommended way to get URLs in template functions and filters. The returned URL includes baseurl and is ready for use in href attributes.
Parameters
| Name | Type | Description |
|---|---|---|
obj |
PageLike | Any |
Page, Section, Asset, NavNodeProxy, or dict-like object with href/_path |
site |
Any |
Unused, kept for backward compatibility Default:None
|
Returns
str
filter_dateformat
2
str
▼
Format a date using strftime.
filter_dateformat
2
str
▼
def filter_dateformat(date: datetime | str | None, format: str = '%Y-%m-%d') -> str
Parameters
| Name | Type | Description |
|---|---|---|
date |
datetime | str | None |
Date to format |
format |
str |
strftime format string Default:'%Y-%m-%d'
|
Returns
str