Also link to the source
Fix alignment
Uncat the final product
html-readme
- A demo of deploying a custom HTML README
By default, {git,hg,hub}.sr.ht use README or README.md as the README;
however, by PUTting some text/html at /api/repos/repo-name/readme
, any source format can be used –
this README is written in ronn(1) and additionally preprocessed.
html-readme.md: the ronn(1) source for this README.
image: debian/bullseye
packages:
- ronn
- curl
secrets:
- 8d4dfb87-e056-4f68-abae-0da7ba5d4398
tasks:
- build: |
cd html-readme
awk '/BUILD_YML_PLACEHOLDER/ {print "_PRE"; while(getline < ".build.yml") print; print "__PRE"; next} //' html-readme.md | \
ronn -f | \
sed -e 's;^__PRE$;</pre>;' -e 's;^_PRE$;<pre>;' > ~/README.html
- readme: |
set +x # Avoid echoing the token
curl -H "Content-Type: text/html" \
-H "Authorization: Bearer $(cat ~/.readme-token)" \
-XPUT \
--data-binary @README.html \
'https://git.sr.ht/api/repos/html-readme/readme' &&
echo "README set"
Of note:
~/.readme-token
,Written by наб <nabijaczleweli@nabijaczleweli.xyz>
<nabijaczleweli@nabijaczleweli.xyz>