{% set canonical = page.canonical_url | string %} {% set is_zh = "/zh/" in canonical %} {% set home_url = "zh/" if is_zh else "en/" %} {% set is_docs = "/docs/" in canonical or "/development/" in canonical or "/modules/" in canonical %} {% set is_rfcs = "/rfcs/" in canonical %} {% set previous_url = (page.previous_page.url | string) if page.previous_page else "" %} {% set next_url = (page.next_page.url | string) if page.next_page else "" %} {% set language_path = "/zh/" if is_zh else "/en/" %} {% set previous_same_language = language_path in "/" ~ previous_url %} {% set next_same_language = language_path in "/" ~ next_url %} {% set previous_is_docs = "/docs/" in "/" ~ previous_url or "/development/" in "/" ~ previous_url or "/modules/" in "/" ~ previous_url %} {% set next_is_docs = "/docs/" in "/" ~ next_url or "/development/" in "/" ~ next_url or "/modules/" in "/" ~ next_url %} {% set previous_is_rfcs = "/rfcs/" in "/" ~ previous_url %} {% set next_is_rfcs = "/rfcs/" in "/" ~ next_url %} {% set show_previous = page.previous_page and previous_same_language and ((is_docs and previous_is_docs) or (is_rfcs and previous_is_rfcs) or (not is_docs and not is_rfcs)) %} {% set show_next = page.next_page and next_same_language and ((is_docs and next_is_docs) or (is_rfcs and next_is_rfcs) or (not is_docs and not is_rfcs)) %}