-
-
Save metaory/3eb295310ff7c38cef6dbeef3f47fa68 to your computer and use it in GitHub Desktop.
MARKUP.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set -Eeuo pipefail | |
:>README.md | |
declare ASSETS=https://raw.githubusercontent.com/metaory/metaory/master/.github/assets | |
declare STAT_HOST=https://github-readme-stats.vercel.app | |
declare USR=metaory | |
declare THEME=dark-minimalist | |
declare -A ICON_GROUPS=( | |
[EULOGIZE]='stuff I occasionally use and aspire' | |
[PERSONAL]='stuff I regularly use' | |
[TOLERATE]='stuff I moderately tolerate' | |
[RENOUNCE]='stuff I actively avoid' | |
) | |
declare -a ICON_EULOGIZE=( adventofcode c cmake cplusplus creativecommons crunchbase elixir erlang framework7 gnu houdini htmx hyperland k3s kubernetes leptos libuv linuxfoundation llvm mapbox nasa nim ocaml opel opencollective opencollective openfaas opengl openid openjsfoundation openlayers openssl opentofu pocketbase prometheus rabbitmq redis remix rust sennheiser snowflake spacex spacex stackshare steam steamdb temporal trivy turso v8 valve webassembly webgl zedindustries zig ) | |
declare -a ICON_TOLERATE=( amazon amazonapigateway amazoncloudwatch amazoncognito amazondocumentdb amazondynamodb amazonec2 amazonecs amazoneks amazonelasticache amazoniam amazonroute53 amazons3 amazonsimpleemailservice amazonsqs amazonwebservices awslambda awsorganizations awssecretsmanager auth0 awsamplify axios backbonedotjs buildkite circleci clerk clickup cloudflare codesandbox crowdin datadog debian discord esbuild express genius google googlechrome googlecloud grafana graphql hcl html5 hubspot icon jetbrains less logstash mailchimp mozilla nestjs nextdotjs nuxtdotjs openvpn owasp perl postman pug pwa railway react rollupdotjs sass sequelize snyk socketdotio stripe supabase swagger swc tailwindcss terraform testinglibrary trpc twilio twitch typescript upstash vercel vue webrtc xo ) | |
declare -a ICON_RENOUNCE=( angular ansible atlassian bitbucket bitcoin chef django dotnet dynatrace eclipseide facebook firebase githubcopilot grunt gulp heroku hibernate instagram jenkins jest jira jirasoftware jquery lodash meta mobx mocha modx mongodb mongoosedotws mui newrelic php postcss prisma python qt reddit relay ruby sap sonarcloud splunk springboot storybook underscoredotjs vuedotjs webpack zoom) | |
declare -a SHADES=('000000,110022,110033' '110033,110022,110022,110033' '110033,110022,000000') | |
function put_breaker { | |
cat <<- EOF >> README.md | |
<div align="center"> | |
<img width=""${1:-50}"%" src=""$ASSETS/hr$((RANDOM%4))".png?raw=true" /> | |
</div> | |
EOF | |
} | |
function put_image { | |
printf '<img src="%s" %s />\n' """${1:?NO_FILE}" """${2:-}" >> README.md | |
} | |
function put_section { | |
local fn=""${1:?NO_FN} | |
cat <<< '<div align="center">' >> README.md | |
"""$fn" """${@:2}" | |
cat <<< $'\n</div>' >> README.md | |
} | |
printf '%s/api?' "$STAT_HOST" | |
sed \ | |
's/\/\/.*$//g;s/\/\*.*\*\///g;/^[[:space:]]*$/d' \ | |
.github/scripts/github-readme-stats.jsonc \ | |
| jq -r '[to_entries[] | (@uri "\(.key)" + "=" + @uri "\(.value)")] | join("&")' | |
function put_stats { | |
declare -a STAT_TYPES=(current_streak longest_streak total_contributions) | |
{ tr -d '\r\n' | sed 's/[ ]\{2,\}//g'; } <<- EOF >> README.md | |
<img height="150" src="${STAT_HOST}/api?username=${USR} | |
&ring_color=${C05}&bg_color=${C01}&border_radius=30&show_icons=true | |
&disable_animations=false&locale=en&hide_title=true&hide_rank=false | |
&show=reviews,discussions_started,discussions_answered,prs_merged,prs_merged_percentage | |
&include_all_commits=true&count_private=true&hide_border=true&text_color=${C04} | |
" | |
/> | |
EOF | |
C=0 | |
for ST in "${STAT_TYPES[@]}"; do | |
# printf '<img\talt="%s"\n' "$ST" >> README.md | |
{ tr -d '\r\n' | sed 's/[ ]\{2,\}//g'; } <<- EOF >> README.md | |
<img height=110 src="https://streak-stats.demolab.com? | |
border_radius=30&hide_border=true&card_width=200&mode=weekly& | |
theme=${THEME}&dates=${C13}&fire=${C04}&stroke=${C05}& | |
currStreakLabel=${CX4}&ring=${C05}&sideNums=${C12}&user=${USR}& | |
currStreakNum=${C01}&excludeDaysLabel=${C03}&sideLabels=${C04}& | |
background=45,000000,110022,110033,110033,110022,110022,110033,110033,110022,000000& | |
EOF | |
for STT in "${STAT_TYPES[@]}"; do | |
[ "$ST" != "$STT" ] && \ | |
printf 'hide_%s=true&' "$STT" >> README.md | |
done | |
echo | |
printf '"\n\t/>\n' >> README.md | |
(( C++ )) | |
done | |
} | |
function put_icons { | |
cat <<< "<h3>${1:?NO_TITLE}</h3>" >> README.md | |
shift | |
while [ "$1" ]; do | |
put_image "https://cdn.simpleicons.org/${1}?viewbox=auto" 'height="20"' | |
shift | |
done | |
} | |
function put_footer { | |
put_image "${ASSETS}/home.webp?raw=true" | |
cat <<- EOF >> README.md | |
<img height="280" | |
alt="activity-graph graph" | |
src="https://github-readme-activity-graph.vercel.app/graph?username=metaory&bg_color=00000000&color=4411FF&title_color=000000&line=4411FF&point=5522CC&area_color=5522CC&hide_border=true&hide_title=true&area=true&radius=20" | |
/> | |
EOF | |
put_breaker 40 | |
} | |
put_section put_image "$ASSETS"/mxc.png | |
put_breaker 60 | |
put_section put_stats | |
put_image "$ASSETS"/home.webp | |
# vim: ft=bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment