{%- comment -%} # Whether the page is a post. {%- endcomment -%} {%- if page.layout == "post" -%} {%- assign is_post = true -%} {%- endif -%} {%- assign default_lang = "en" -%} {%- assign default_charset = "utf-8" -%} {%- assign default_color_scheme = "light dark" -%} {%- assign default_viewport = "width=device-width, initial-scale=1" -%} {%- assign default_title = "" -%} {%- assign default_canonical_url = page.url | absolute_url -%} {%- assign default_license_url = false -%} {%- assign default_stylesheets = "" | split: ", " -%} {%- comment -%} # Lang. {%- endcomment -%} {%- assign lang = page.lang -%} {%- if lang == nil -%}{%- assign lang = site.lang -%} {%- if lang == nil -%}{%- assign lang = default_lang -%}{%- endif -%}{%- endif -%} {%- comment -%} # Charset. {%- endcomment -%} {%- assign charset = page.charset -%} {%- if charset == nil -%}{%- assign charset = site.charset -%} {%- if charset == nil -%}{%- assign charset = default_charset -%}{%- endif -%}{%- endif -%} {%- comment -%} # Color scheme. {%- endcomment -%} {%- assign color_scheme = page.color_scheme -%} {%- if color_scheme == nil -%}{%- assign color_scheme = site.color_scheme -%} {%- if color_scheme == nil -%}{%- assign color_scheme = default_color_scheme -%}{%- endif -%}{%- endif -%} {%- comment -%} # Viewport. {%- endcomment -%} {%- assign viewport = page.viewport -%} {%- if viewport == nil -%}{%- assign viewport = site.viewport -%} {%- if viewport == nil -%}{%- assign viewport = default_viewport -%}{%- endif -%}{%- endif -%} {%- comment -%} # Canonical url. {%- endcomment -%} {%- assign canonical_url = page.canonical_url -%} {%- if canonical_url == nil -%}{%- assign canonical_url = site.canonical_url -%} {%- if canonical_url == nil -%}{%- assign canonical_url = default_canonical_url -%}{%- endif -%}{%- endif -%} {%- comment -%} # Title. {%- endcomment -%} {%- if is_post -%} {%- assign title = canonical_url | remove_first: "https://www." | remove_first: "http://www." | remove_first: "https://" | remove_first: "http://" -%} {%- else -%} {%- assign title = page.title -%} {%- if title == nil -%}{%- assign title = site.title -%} {%- if title == nil -%}{%- assign title = default_title -%}{%- endif -%}{%- endif -%} {%- endif -%} {%- comment -%} # License url. {%- endcomment -%} {%- assign license_url = page.license_url -%} {%- if license_url == nil -%}{%- assign license_url = site.license_url -%} {%- if license_url == nil -%}{%- assign license_url = default_license_url -%}{%- endif -%}{%- endif -%} {%- comment -%} # Stylesheets. {%- endcomment -%} {%- assign stylesheets = page.stylesheets -%} {%- if stylesheets == nil -%}{%- assign stylesheets = site.stylesheets -%} {%- if stylesheets == nil -%}{%- assign stylesheets = default_stylesheets -%}{%- endif -%}{%- endif -%}