<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="description" content="Content-addressed {{.CodecName}} document hosted on IPFS.">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="shortcut icon" href="data:image/x-icon;base64, " />
  <title>{{ .Path }}</title>
  <link rel="stylesheet">
</head>
<body>
  <header></header>
  <main id="main">
    <header>
      <div>
        <strong>CID: <code translate="no">{{ .CID }}</code></strong>
      </div>
      <div>
        <strong>Codec</strong>: <code translate="no">{{ .CodecName }} ({{ .CodecHex }})</code>
      </div>
    </header>
    <section class="container">
      <p>You can download this block as:</p>

      <ul>
        <li><a href="?format=raw" rel="nofollow">Raw Block</a> (no conversion)</li>
        <li><a href="?format=dag-json" rel="nofollow">Valid DAG-JSON</a> (specs at <a href="https://ipld.io/specs/codecs/dag-json/spec/" target="_blank" rel="noopener noreferrer">IPLD</a> and <a href="https://www.iana.org/assignments/media-types/application/vnd.ipld.dag-json" target="_blank" rel="noopener noreferrer">IANA</a>)</li>
        <li><a href="?format=dag-cbor" rel="nofollow">Valid DAG-CBOR</a> (specs at <a href="https://ipld.io/specs/codecs/dag-cbor/spec/" target="_blank" rel="noopener noreferrer">IPLD</a> and <a href="https://www.iana.org/assignments/media-types/application/vnd.ipld.dag-cbor" target="_blank" rel="noopener noreferrer">IANA</a>)</li>
      </ul>
    </section>
    {{ with .Node }}
      <section class="full-width">
        <header>
          <strong><span translate="no" style="text-transform: uppercase;">{{ $.CodecName }}</span> Preview</strong>
        </header>
      {{ template "node" (args $ .) }}
      </section>
    {{ end }}
  </main>
</body>
</html>

{{ define "node" }}
  {{ $root := index . 0 }}
  {{ $node := index . 1 }}
  {{ if len $node.Values }}
    <div class="grid dag">
    {{ range $index, $key := $node.Keys }}
      {{ template "node" (args $root $key) }}
      {{ template "node" (args $root (index $node.Values $index)) }}
    {{ end }}
    </div>
  {{ else }}
    <div translate="no">
      {{ with $node.CID }}<a class="ipfs-hash" href={{ if $root.DNSLink }}"https://cid.ipfs.tech/#{{ . | urlEscape}}" target="_blank" rel="noreferrer noopener"{{ else }}"{{ $root.GatewayURL }}/ipfs/{{ . | urlEscape}}"{{ end }}>{{ end }}
        {{ if $node.Long }}
          <pre>{{- $node.Value -}}</pre>
        {{ else }}
          <code class="nowrap">{{- $node.Value -}}</code>
        {{ end }}
      {{ with $node.CID }}</a>{{ end }}
    </div>
  {{ end }}
{{ end }}
