mixin description(type)
  meta(name=type, content="\
Clean, simple, easy to read, fast ski resort lift status. Liftie monitors lifts of \
#{(resorts && title.indexOf('Stars') === -1 && title.split(' | ')[1]) || 'selected'} ski resort#{(!resorts || resorts.length !== 1) ? 's' : ''}\
#{(single && resorts[0].lifts) ? ': ' + Object.keys(resorts[0].lifts.status).join(', ') : ''}. \
When the ski lift status changes, so will the display. No need to hit browser's Refresh button. Liftie remembers which \
resorts you are interested in and will show their lift status when you come back. Liftie can even help you find the latest \
ski resort deals and score discount lift tickets.")

mixin liftie-script(name)
  - var c = cachify(name + min + '.js', true);

  script(
    src=staticHost + c.path,
    nonce=cspNonce,
    integrity=staticHost ? c.integrity : undefined,
    crossorigin=staticHost ? 'anonymous' : undefined,
    defer
  )


mixin liftie-stylesheet(name)
  - var c = cachify(name + min + '.css', true);

  link(
    rel='stylesheet',
    href=staticHost + c.path,
    integrity=staticHost ?  c.integrity : undefined,
    crossorigin=staticHost ? 'anonymous' : undefined,
  )

doctype html
html(
  lang='en-US'
  data-service-worker=serviceWorker
)
  head
    title= title
    +description('description')
    meta(name='apple-mobile-web-app-capable', content='yes')
    meta(name='application-name', content='Liftie')
    meta(name='theme-color', content='#f5f8ff')
    meta(name='viewport', content='width=device-width, initial-scale=1')
    meta(property='og:type', content='website')
    meta(property='og:image', content=og.image)
    meta(property='og:title', content=title)
    +description('og:description')

    link(rel='preconnect', href='https://pbs.twimg.com')
    if staticHost
      link(rel='preconnect', href=staticHost)

    link(rel='icon', href=staticHost + cachify('/favicon.svg'))
    link(rel='mask-icon', href= href=staticHost + cachify('/mask-icon.svg'), color='#009ddb')
    link(rel='apple-touch-icon', href= href=staticHost + cachify('/apple-touch-icon.png'))

    link(rel='manifest', href='/manifest.json')
    +liftie-stylesheet('/stylesheets/style')
    link(rel='publisher', href='https://plus.google.com/107555641794612264233')
  body()
    block content
    block footer
      footer
        a.icon-alone(href='/about', title='About Liftie.')
          span.ls-liftie
          span.text About
        a.icon-alone(href='http://furkot.com', title='Plan your ski trip with Furkot.', target='_blank', rel='nofollow noopener')
          span.ls-furkot
          span.text Plan your trip
        a.icon-alone(href='https://github.com/pirxpilot/liftie', title='Fork Liftie.', target='_blank', rel='nofollow noopener')
          span.ls-github
          span.text Add your resort
        a.icon-alone(href='http://codepen.io/pirxpilot/pen/EwdLc', title='Embed Liftie.', target='_blank', rel='nofollow noopener')
          span.ls-html
          span.text Embed Liftie
        a.icon-alone(href='mailto:contact@liftie.info' title='E-mail us')
          span.ls-email
        - var slug = tag ? '/' + tag : ''
        a.icon-alone(href='/stats#{slug}', title='Check statistics')
          span.ls-pie

    +liftie-script('/scripts/liftie')
