mirror of
https://github.com/ivabus/www
synced 2024-11-14 07:25:06 +03:00
Merge pull request #216 from teaxyz/lowercased-pages
#215 lowercase all package links
This commit is contained in:
commit
0dfbfc6b21
2 changed files with 7 additions and 5 deletions
8
.github/build-package-pages.sh
vendored
8
.github/build-package-pages.sh
vendored
|
@ -6,14 +6,16 @@ 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' | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')
|
||||||
|
|
||||||
if [[ "$full_name" == *\/* ]] || [[ "$full_name" == *\\* ]]
|
if [[ "$full_name" == *\/* ]] || [[ "$full_name" == *\\* ]]
|
||||||
then
|
then
|
||||||
mkdir -p "$2/+$full_name"
|
mkdir -p "$2/+$full_name"
|
||||||
|
# remove last folder
|
||||||
rm -rf "$2/+$full_name"
|
rm -rf "$2/+$full_name"
|
||||||
fi
|
fi
|
||||||
touch "$2"/"+$(_jq '.full_name')".md
|
|
||||||
|
touch "$2"/"+$full_name".md
|
||||||
content="---
|
content="---
|
||||||
type: page
|
type: page
|
||||||
title: \"$(_jq '.name')\"
|
title: \"$(_jq '.name')\"
|
||||||
|
@ -21,5 +23,5 @@ maintainer: \"$(_jq '.maintainer')\"
|
||||||
Description: \"$(_jq '.desc' | tr '\"' "'")\"
|
Description: \"$(_jq '.desc' | tr '\"' "'")\"
|
||||||
layout: \"package-detail\"
|
layout: \"package-detail\"
|
||||||
---"
|
---"
|
||||||
echo "$content" > "$2"/"+$(_jq '.full_name')".md
|
echo "$content" > "$2"/"+$full_name".md
|
||||||
done
|
done
|
|
@ -19,12 +19,12 @@
|
||||||
<span class="package-install-no">>{{- .installs -}} installs</span> -->
|
<span class="package-install-no">>{{- .installs -}} 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>
|
||||||
<div class="card-body thumbnail-body-mobile">
|
<div class="card-body thumbnail-body-mobile">
|
||||||
<a href="/+{{- .full_name -}}/">
|
<a href="/+{{- lower .full_name -}}/">
|
||||||
<button class="detail-btn-mobile"><i class="icon-enter-arrow"></i>details</button>
|
<button class="detail-btn-mobile"><i class="icon-enter-arrow"></i>details</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue