update brand assets and the generator script (fix #670) (#712)

This commit is contained in:
edawine
2018-10-13 15:31:31 +07:00
committed by Shahidh K Muhammed
parent 777c599a33
commit 963d86464f
2 changed files with 27 additions and 14 deletions

View File

@@ -12,8 +12,8 @@ All assets are available on a Google Cloud Storage Bucket CDN at `https://graphq
| `hasura_logo_horizontal_white.svg` | <img src="hasura_logo_horizontal_white.svg" width="150px" style="background-color: black;" /> |
| `hasura_logo_vertical_black.svg` | <img src="hasura_logo_vertical_black.svg" width="150px" style="background-color: white;" /> |
| `hasura_logo_vertical_white.svg` | <img src="hasura_logo_vertical_white.svg" width="150px" style="background-color: black;" /> |
| `hasura_mascot_logo_horizontal.svg` | <img src="hasura_mascot_logo_horizontal.svg" width="150px" style="background-color: white;" /> |
| `hasura_mascot_logo_vertical.svg` | <img src="hasura_mascot_logo_vertical.svg" width="150px" style="background-color: white;" /> |
| `hasura_mascot.svg` | <img src="hasura_mascot.svg" width="150px" style="background-color: white;" /> |
| `powered_by_hasura_black.svg` | <img src="powered_by_hasura_black.svg" width="150px" style="background-color: white;" /> |
| `powered_by_hasura_white.svg` | <img src="powered_by_hasura_white.svg" width="150px" style="background-color: black;" /> |
| `hasura_mascot_logo_horizontal.svg` | <img src="hasura_mascot_logo_horizontal.svg" width="150px"/> |
| `hasura_mascot_logo_vertical.svg` | <img src="hasura_mascot_logo_vertical.svg" width="150px"/> |
| `hasura_mascot.svg` | <img src="hasura_mascot.svg" width="150px"/> |

View File

@@ -2,10 +2,10 @@
#
# update readme file in the assets/brand folder
# exit on error
set -e
# strict mode
set -Eeuo pipefail
IFS=$""
IFS=$'\n\t'
# get the repo root
ROOT="$(readlink -f ${BASH_SOURCE[0]%/*}/../)"
@@ -25,16 +25,29 @@ EOF
)
for svg in *.svg; do
if [[ "$svg" = *"white"* ]]; then
BG='style="background-color: black;"'
else
BG='style="background-color: white;"'
fi
README_CONTENT=$(cat <<EOF
if [[ "$svg" == *"white"* ]]; then
BG='style="background-color: black;"'
elif [[ "$svg" == *"black"* ]]; then
BG='style="background-color: white;"'
else
continue
fi
README_CONTENT="$(cat <<EOF
$README_CONTENT
| \`$svg\` | <img src="$svg" width="150px" $BG /> |
EOF
)
)"
done
echo $README_CONTENT > "$ROOT/assets/brand/README.md"
for svg in *.svg; do
if [[ "$svg" == *"white"* ]] || [[ "$svg" == *"black"* ]]; then
continue
fi
README_CONTENT="$(cat <<EOF
$README_CONTENT
| \`$svg\` | <img src="$svg" width="150px"/> |
EOF
)"
done
echo "$README_CONTENT" > "$ROOT/assets/brand/README.md"