//- chappe
//-
//- Copyright 2021, Crisp IM SAS
//- Author: Valerian Saliou <valerian@valeriansaliou.name>

include _mixins

block vars
  - var page  = null;
  - var panes = 1;

mixin head-stylesheet(href)
  link(
    rel="stylesheet",
    href="#{href}.css?#{REVISION}",
    type="text/css"
  )

mixin head-javascript(src)
  script(
    src="#{src}.js?#{REVISION}"
  )

doctype html

html(
  lang="#{LOCALE.CODE}",
  dir="#{LOCALE.DIRECTION}",
  data-environment="#{ENVIRONMENT}"
)
  head
    include _head_http
    include _head_screen
    include _head_theme
    include _head_includes
    include _head_favicon
    include _head_metas

    block head_metas

    title
      block title
        | #{(SITE.identity.title || $_.COMMON.METAS.SITE_NAME)}

    block alternates

    block stylesheets
      +head-stylesheet("/static/stylesheets/common/libs")
      +head-stylesheet("/static/stylesheets/common/common")

    block javascripts
      +head-javascript("/static/javascripts/common/libs")
      +head-javascript("/static/javascripts/common/common")

  body.viewer.appearance(
    data-viewer-panes="#{(panes || 1)}",
    data-appearance="light"
  )
    include _body_header
    include _body_search

    #content
      block body_content

    include _body_footer
