Skip to content

Commit

Permalink
feat: content of about page now generated based on information from R…
Browse files Browse the repository at this point in the history
…EADME.md
  • Loading branch information
grigoriev committed Jun 24, 2024
1 parent 5edb728 commit 4c9f00f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .scripts/convert-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,26 @@
INPUT_FILE=$1
OUTPUT_FILE=$2

INPUT_FILE="${INPUT_FILE:-README.md}"
OUTPUT_FILE="${OUTPUT_FILE:-README.html}"

# Convert the markdown file to a JSON payload
jq -R -s '{"mode": "gfm", "text": .}' < "$INPUT_FILE" > payload.json

echo "GITHUB_TOKEN = $GITHUB_TOKEN"

# Check if GITHUB_TOKEN is set
if [[ -n "$GITHUB_TOKEN" ]]; then
AUTH_HEADER="Authorization: Bearer $GITHUB_TOKEN"
else
AUTH_HEADER=""
fi

# Send the JSON payload to the GitHub API
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
${AUTH_HEADER:+-H "$AUTH_HEADER"} \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/markdown \
-d @payload.json > "$OUTPUT_FILE"
Expand Down

0 comments on commit 4c9f00f

Please sign in to comment.