Skip to content
Snippets Groups Projects
Verified Commit dd2ed72f authored by Jake's avatar Jake :speech_balloon:
Browse files

added None as return value for *_by_slug() macros

parent 5d10216d
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,7 @@ Mit diesen Macros können Informationen abgefragt werden. ...@@ -69,7 +69,7 @@ Mit diesen Macros können Informationen abgefragt werden.
**Rückgabewerte:** **Rückgabewerte:**
1. ([Article](https://gaumi-fginfo.pages.gwdg.de/pelican/_build/html/themes.html#article)): Der Artikel. 1. ([Article](https://gaumi-fginfo.pages.gwdg.de/pelican/_build/html/themes.html#article) | None): Der Artikel, sofern er gefunden wurde. Sonst `None`.
### `page_by_slug(slug, lang)` ### `page_by_slug(slug, lang)`
...@@ -80,7 +80,7 @@ Mit diesen Macros können Informationen abgefragt werden. ...@@ -80,7 +80,7 @@ Mit diesen Macros können Informationen abgefragt werden.
**Rückgabewerte:** **Rückgabewerte:**
1. ([Page](https://gaumi-fginfo.pages.gwdg.de/pelican/_build/html/themes.html#page)): Die Seite. 1. ([Page](https://gaumi-fginfo.pages.gwdg.de/pelican/_build/html/themes.html#page) | None): Die Seite, sofern sie gefunden wurde. Sonst `None`.
### `article_or_page_by_slug(slug, lang)` ### `article_or_page_by_slug(slug, lang)`
...@@ -91,8 +91,8 @@ Mit diesen Macros können Informationen abgefragt werden. ...@@ -91,8 +91,8 @@ Mit diesen Macros können Informationen abgefragt werden.
**Rückgabewerte:** **Rückgabewerte:**
1. ([Article](https://gaumi-fginfo.pages.gwdg.de/pelican/_build/html/themes.html#article) | [Page](https://gaumi-fginfo.pages.gwdg.de/pelican/_build/html/themes.html#page)): Der Artikel oder die Seite. 1. ([Article](https://gaumi-fginfo.pages.gwdg.de/pelican/_build/html/themes.html#article) | [Page](https://gaumi-fginfo.pages.gwdg.de/pelican/_build/html/themes.html#page) | None): Der Artikel oder die Seite, sofern etwas gefunden wurde. Sonst `None`.
2. (String): "article" falls es ein Artikel ist. "page" falls es eine Seite ist. 2. (String): "article" falls es ein Artikel ist. "page" falls es eine Seite ist. Sonst "not found".
## [cards.html](cards.html) ## [cards.html](cards.html)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
{{- caller(a) -}} {{- caller(a) -}}
{%- endif -%} {%- endif -%}
{%- endfor -%} {%- endfor -%}
{{- caller(None) -}}
{%- endmacro -%} {%- endmacro -%}
{%- macro page_by_slug(slug, lang) -%} {%- macro page_by_slug(slug, lang) -%}
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
{{- caller(p) -}} {{- caller(p) -}}
{%- endif -%} {%- endif -%}
{%- endfor -%} {%- endfor -%}
{{- caller(None) -}}
{%- endmacro -%} {%- endmacro -%}
{%- macro article_or_page_by_slug(slug, lang) -%} {%- macro article_or_page_by_slug(slug, lang) -%}
...@@ -49,5 +51,6 @@ ...@@ -49,5 +51,6 @@
{{- caller(p, "page") -}} {{- caller(p, "page") -}}
{%- endif -%} {%- endif -%}
{%- endfor -%} {%- endfor -%}
{{- caller(None, "not found") -}}
{%- endmacro -%} {%- endmacro -%}
  • Jake :speech_balloon: @j.vondoemming

    mentioned in commit ae782fef

    ·

    mentioned in commit ae782fef

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment