{% extends "base.html" %}

{% block head_title %}
{%- if profileView -%}
  @{{ profileView.Handle }} on Bluesky
{%- else -%}
  Bluesky
{%- endif -%}
{% endblock %}

{% block sidebar_title %}
{%- if profileView -%}
  {{ profileView.Handle }}
{%- else -%}
  Bluesky
{%- endif -%}
{% endblock %}

{% block html_head_extra -%}
{%- if profileView -%}
  <meta property="og:type" content="website">
  <meta property="og:site_name" content="Bluesky Social">
  {%- if requestURI %}
  <meta property="og:url" content="{{ requestURI }}">
  {% endif -%}
  {%- if profileView.DisplayName %}
  <meta property="og:title" content="{{ profileView.DisplayName }} (@{{ profileView.Handle }})">
  {% else %}
  <meta property="og:title" content="{{ profileView.Handle }}">
  {% endif -%}
  {%- if profileView.Description %}
  <meta name="description" content="{{ profileView.Description }}">
  <meta property="og:description" content="{{ profileView.Description }}">
  {% endif -%}
  {%- if profileView.Banner %}
  <meta property="og:image" content="{{ profileView.Banner }}">
  <meta name="twitter:card" content="summary_large_image">
  {%- elif profileView.Avatar -%}
  {# Don't use avatar image in cards; usually looks bad #}
  <meta name="twitter:card" content="summary">
  {% endif %}
  <meta name="twitter:label1" content="Account DID">
  <meta name="twitter:value1" content="{{ profileView.Did }}">
  <meta name="twitter:site" content="@bluesky">
{% endif -%}
{%- endblock %}

{% block main_content %}
  {% import "feed_macros.html" feed_post %}
  {% if profileView.Banner %}
  <img src="{{ profileView.Banner }}" style="width: 100%;">
  <br>
  {% endif %}
  {% if profileView.DisplayName %}
  <h2>{{ profileView.DisplayName }}</h2>
  {% else %}
  <h2>{{ profileView.Handle}}</h2>
  {% endif %}
  <h3>@{{ profileView.Handle }}</h3>
  <p><code>{{ profileView.Did }}</code></p>
  <p>
    {{ profileView.FollowersCount }} followers |
    {{ profileView.FollowsCount }} following |
    {{ profileView.PostsCount }} posts
  </p>
  <p>{{ profileView.Description }}</p>

  <div class="ui divider"></div>
  <div class="ui large feed">
  {% for feedItem in authorFeed %}
    {{ feed_post(feedItem, did) }}
    <div class="ui divider"></div>
  {% endfor %}
  </div>
{%- endblock %}
