{% extends "base.html" %}

{% block head_title %}
{%- if postView.Post -%}
  @{{ postView.Post.Author.Handle }} on Bluesky
{%- else -%}
  Bluesky
{%- endif -%}
{% endblock %}

{% block sidebar_title %}
{%- if postView.Post -%}
  {{ postView.Post.Author.Handle }}
{%- else -%}
  Bluesky
{%- endif -%}
{% endblock %}

{% block html_head_extra -%}
{%- if postView.Post -%}
  <meta property="og:type" content="website">
  <meta property="og:site_name" content="Bluesky Social">
  {%- if requestURI %}
  <meta property="og:url" content="{{ requestURI }}">
  {% endif -%}
  {%- if postView.Post.Author.DisplayName %}
  <meta property="og:title" content="{{ postView.Post.Author.DisplayName }} (@{{ postView.Post.Author.Handle }})">
  {% else %}
  <meta property="og:title" content="@{{ postView.Post.Author.Handle }}">
  {% endif -%}
  {%- if postView.Post.Record.Val.Text %}
  <meta name="description" content="{{ postView.Post.Record.Val.Text }}">
  <meta property="og:description" content="{{ postView.Post.Record.Val.Text }}">
  {% endif -%}
  {%- if imgThumbUrl %}
  <meta property="og:image" content="{{ imgThumbUrl }}">
  <meta name="twitter:card" content="summary_large_image">
  {%- elif postView.Post.Author.Avatar %}
  {# Don't use avatar image in cards; usually looks bad #}
  <meta name="twitter:card" content="summary">
  {% endif %}
  <meta name="twitter:label1" content="Posted At">
  <meta name="twitter:value1" content="{{ postView.Post.CreatedAt }}">
  <meta name="twitter:site" content="@bluesky">
{% endif -%}
{%- endblock %}

{% block main_content %}
  {% import "feed_macros.html" feed_post, thread_parents, thread_children %}
  <div class="ui divider"></div>
  <div class="ui large feed">
  {{ thread_parents(postView, did, true) }}
  {{ thread_children(postView) }}
  </div>
{%- endblock %}
