~xenrox/custom-readme

9bb825588c7edfdd4f3b3e7dd2551b0a55b735f2 — Thorben Günther 1 year, 6 months ago
Initial commit
1 files changed, 28 insertions(+), 0 deletions(-)

A readme.html
A  => readme.html +28 -0
@@ 1,28 @@
<p>
    This repository demonstrates how to set a
    <a href="https://man.sr.ht/git.sr.ht/#setting-a-custom-readme"
        >custom README</a
    >
    with the development version of
    <a href="https://sr.ht/~emersion/hut/">hut</a>.
</p>
<h2 id="setting-the-custom-readme">Setting the custom README</h2>
<p>
    <code
        >hut git update --readme readme.html --repo
        https://git.xenrox.net/~xenrox/custom-readme</code
    >
</p>
<h2 id="removing-the-custom-readme">Removing the custom README</h2>
<p>
    If you want to go back to sourcehut&#39;s default way of rendering the
    README from markdown, you can do this by manually executing a GraphQL
    mutation. <code>hut</code> does not yet support this functionality.
</p>
<pre><code class="lang-bash"><span class="hljs-comment"># enter your own OAuth2 token</span>
<span class="hljs-built_in">export</span> TOKEN=<span class="hljs-string">"YourOAuth2Token"</span>
<span class="hljs-comment"># find out the ID of your repository</span>
curl --oauth2-bearer <span class="hljs-variable">$TOKEN</span> https://git.sr.ht/query <span class="hljs-_">-d</span> <span class="hljs-string">'{"query": "query { me { repository(name: \"custom-readme\"){ id } }  }"}'</span>
<span class="hljs-comment"># remove custom README</span>
curl --oauth2-bearer <span class="hljs-variable">$TOKEN</span> https://git.sr.ht/query <span class="hljs-_">-d</span> <span class="hljs-string">'{"query": "mutation{ updateRepository(id: 70332, input: { readme: null }) { id }  }"}'</span>
</code></pre>