···11+{% extends "base.html.j2" %}
22+{% import "try-it-macros.html.j2" as try_it %}
33+44+{% block title %}Link Count{% endblock %}
55+{% block description %}Count of {{ query.source }} records linking to {{ query.subject }}{% endblock %}
66+77+{% block content %}
88+99+ {% call try_it::get_backlinks_count(
1010+ query.subject,
1111+ query.source,
1212+ ) %}
1313+1414+ <h2>
1515+ Total links to <code>{{ query.subject }}</code>
1616+ {% if let Some(browseable_uri) = query.subject|to_browseable %}
1717+ <small style="font-weight: normal; font-size: 1rem"><a href="{{ browseable_uri }}">browse record</a></small>
1818+ {% endif %}
1919+ </h2>
2020+2121+ <p><strong><code>{{ total|human_number }}</code></strong> total links from <code>{{ query.source }}</code> to <code>{{ query.subject }}</code></p>
2222+2323+ <ul>
2424+ <li>
2525+ See direct backlinks at <code>/xrpc/blue.microcosm.links.getBacklinks</code>:
2626+ <a href="/xrpc/blue.microcosm.links.getBacklinks?subject={{ query.subject|urlencode }}&source={{ query.source|urlencode }}">
2727+ /xrpc/blue.microcosm.links.getBacklinks?subject={{ query.subject }}&source={{ query.source }}
2828+ </a>
2929+ </li>
3030+ <li>See all links to this target at <code>/links/all</code>: <a href="/links/all?target={{ query.subject|urlencode }}">/links/all?target={{ query.subject }}</a></li>
3131+ </ul>
3232+3333+ <details>
3434+ <summary>Raw JSON response</summary>
3535+ <pre class="code">{{ self|tojson }}</pre>
3636+ </details>
3737+3838+{% endblock %}
+14-1
constellation/templates/hello.html.j2
···121121 {% call try_it::dids("at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lgwdn7vd722r", "app.bsky.feed.like", ".subject.uri") %}
122122123123124124- <h3 class="route"><code>GET /links/count</code></h3>
124124+ <h3 class="route deprecated"><code>[deprecated] GET /links/count</code></h3>
125125126126 <p>The total number of links pointing at a given target.</p>
127127···137137 <p style="margin-bottom: 0"><strong>Try it:</strong></p>
138138 {% call try_it::links_count("did:plc:vc7f4oafdgxsihk4cry2xpze", "app.bsky.graph.block", ".subject") %}
139139140140+ <h3 class="route"><code>GET /xrpc/blue.microcosm.links.getBacklinksCount</code></h3>
141141+142142+ <p>The total number of links pointing at a given target.</p>
143143+144144+ <h4>Query parameters:</h4>
145145+146146+ <ul>
147147+ <li><code>subject</code>: required, must url-encode. The target being linked to. Example: <code>did:plc:vc7f4oafdgxsihk4cry2xpze</code> or <code>at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lgwdn7vd722r</code></li>
148148+ <li><code>source</code>: required. Collection and path specification for the primary link. Example: <code>app.bsky.feed.like:subject.uri</code></li>
149149+ </ul>
150150+151151+ <p style="margin-bottom: 0"><strong>Try it:</strong></p>
152152+ {% call try_it::get_backlinks_count("did:plc:vc7f4oafdgxsihk4cry2xpze", "app.bsky.graph.block:subject") %}
140153141154 <h3 class="route"><code>GET /links/count/distinct-dids</code></h3>
142155