mirror of
https://github.com/ivabus/www
synced 2024-11-10 05:35:14 +03:00
Merge pull request #216 from teaxyz/lowercased-pages
#215 lowercase all package links
This commit is contained in:
commit
0dfbfc6b21
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() {
|
||||
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" == *\\* ]]
|
||||
then
|
||||
mkdir -p "$2/+$full_name"
|
||||
# remove last folder
|
||||
rm -rf "$2/+$full_name"
|
||||
fi
|
||||
touch "$2"/"+$(_jq '.full_name')".md
|
||||
|
||||
touch "$2"/"+$full_name".md
|
||||
content="---
|
||||
type: page
|
||||
title: \"$(_jq '.name')\"
|
||||
|
@ -21,5 +23,5 @@ maintainer: \"$(_jq '.maintainer')\"
|
|||
Description: \"$(_jq '.desc' | tr '\"' "'")\"
|
||||
layout: \"package-detail\"
|
||||
---"
|
||||
echo "$content" > "$2"/"+$(_jq '.full_name')".md
|
||||
echo "$content" > "$2"/"+$full_name".md
|
||||
done
|
|
@ -19,12 +19,12 @@
|
|||
<span class="package-install-no">>{{- .installs -}} installs</span> -->
|
||||
</p>
|
||||
</div>
|
||||
<a href="/+{{- .full_name -}}/">
|
||||
<a href="/+{{- lower .full_name -}}/">
|
||||
{{- partial "detail-btn.html" . -}}
|
||||
</a>
|
||||
</div>
|
||||
<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>
|
||||
</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue