#215 lowercase all package links

This commit is contained in:
neil 2022-12-07 12:18:33 +08:00
parent 059069eaf0
commit f4149d16cd
2 changed files with 4 additions and 3 deletions

View file

@ -6,14 +6,15 @@ for row in $(jq -r '.[] | @base64' < "$1"); do
_jq() { _jq() {
echo "${row}" | base64 --decode | jq -r "${1}" echo "${row}" | base64 --decode | jq -r "${1}"
} }
full_name=$(_jq '.full_name') full_name=$(_jq '.full_name' | tr '[:upper:]' '[:lower:]')
if [[ "$full_name" == *\/* ]] || [[ "$full_name" == *\\* ]] if [[ "$full_name" == *\/* ]] || [[ "$full_name" == *\\* ]]
then then
mkdir -p "$2/+$full_name" mkdir -p "$2/+$full_name"
rm -rf "$2/+$full_name" rm -rf "$2/+$full_name"
fi fi
touch "$2"/"+$(_jq '.full_name')".md echo $full_name
touch "$2"/"+$full_name".md
content="--- content="---
type: page type: page
title: \"$(_jq '.name')\" title: \"$(_jq '.name')\"

View file

@ -19,7 +19,7 @@
<span class="package-install-no">>{{- .installs -}}&nbsp;installs</span> --> <span class="package-install-no">>{{- .installs -}}&nbsp;installs</span> -->
</p> </p>
</div> </div>
<a href="/+{{- .full_name -}}/"> <a href="/+{{- lower .full_name -}}/">
{{- partial "detail-btn.html" . -}} {{- partial "detail-btn.html" . -}}
</a> </a>
</div> </div>