- [✅] Sidebar widgets redesign (no box, mono font "# Title")
- [ ] Footer redesign (3-column, social badges, fortune cookie, tech badges, etc.)
- [✅] related articles debug
-- [ ] shortcodes cleanup (remove duplicates)
+- [✅] shortcodes cleanup (remove duplicates)
- [ ] Search functionality
- [ ] Open Graph meta tags for social sharing
- [ ] Sitemap & robots.txt optimization
I'll leave you with a copy of the script here in case you want to have a look at it before downloading.
Enjoy!
-{{< highlight bash "linenos=true" >}}#! /bin/bash
+```bash
+#! /bin/bash
# Author: Danilo 'danix' Macri
# Author URI: https://danix.xyz
CONVERT=$(which convert)
# we need mogrify and convert from the imagemagik toolset for this script to work #
-if [[ ! -x $MOGRIFY || ! -x $CONVERT ]]; then
+if [[ ! -x $MOGRIFY || ! -x $CONVERT ]]; then
showerror missingdeps
exit $E_MISSINGDEPS
fi
{
case $1 in
resize )
- echo "USAGE: $(basename $0) -r | --resize [width] [extension]"
+ echo "USAGE: $(basename $0) -r | --resize [width] [extension]"
;;
gif )
- echo "USAGE: $(basename $0) -g | --gif [delay] [extension] [output file name]"
+ echo "USAGE: $(basename $0) -g | --gif [delay] [extension] [output file name]"
;;
* )
#|----------------------- TEXT MAX WIDTH - 80 CHARS ----------------------------|
echo -e "$(basename $0) - create animated gifs from images inside current directory"
- echo -e "USAGE: $(basename $0) <option> [arguments]"
- echo -e "\twhere <option> is one between:";echo
- echo -e "\t-r | --resize [width] [extension]"
+ echo -e "USAGE: $(basename $0) <option> [arguments]"
+ echo -e "\twhere <option> is one between:";echo
+ echo -e "\t-r | --resize [width] [extension]"
echo -e "\t\tresizes all the images matching the extension in the current folder to"
echo -e "\t\tthe width specified as argument.";echo
- echo -e "\tg | --gif [delay] [extension] [output file name]"
+ echo -e "\tg | --gif [delay] [extension] [output file name]"
echo -e "\t\tcreates the gif file using all the images in the current folder."
echo
echo -e "EXAMPLES:"
# showerror #
showerror ()
{
- if [ -z $1 ];then
+ if [ -z $1 ];then
echo "INTERNAL ERROR - ABORTING"; echo
exit $E_INTERROR
fi
}
##### MAIN #####
-if [ $# -eq 0 ];then
+if [ $# -eq 0 ];then
showerror noopts
showhelp
exit $E_NOOPTS
else
- while [ $# -gt 0 ];do
+ while [ $# -gt 0 ];do
case $1 in
-h|--help)
showhelp
WIDTH=$2
EXT=$3
shift
- if [[ -z $WIDTH || -z $EXT ]];then
+ if [[ -z $WIDTH || -z $EXT ]];then
showhelp resize
showerror noargs
exit $E_NOARGS
fi
IMAGES="$(ls -1 *.$EXT 2>/dev/null | wc -l)"
- if [[ $IMAGES == 0 ]]; then
+ if [[ $IMAGES == 0 ]]; then
showerror noimages
exit $E_NOIMAGES
fi
clear
COUNT="$(ls -1 *.$EXT 2>/dev/null | wc -l)"
echo "you're going to resize all $COUNT .$EXT images inside $PWD at a fixed width of ${WIDTH}px"
- read -p "do you wish to continue? [y/n] " -n 1 -r; echo
- if [[ ! $REPLY =~ ^[Yy]$ ]]
+ read -p "do you wish to continue? [y/n] " -n 1 -r; echo
+ if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit $USERABORTED
else
EXT=$3
OUTPUT=$4
shift
- if [[ -z $DELAY || -z $EXT || -z $OUTPUT ]];then
+ if [[ -z $DELAY || -z $EXT || -z $OUTPUT ]];then
showhelp gif
showerror noargs
exit $E_NOARGS
- elif [[ -f ${OUTPUT}.gif ]]; then
+ elif [[ -f ${OUTPUT}.gif ]]; then
showerror filexists
exit $E_FILEXISTS
fi
IMAGES="$(ls -1 *.$EXT 2>/dev/null | wc -l)"
- if [[ $IMAGES == 0 ]]; then
+ if [[ $IMAGES == 0 ]]; then
showerror noimages
exit $E_NOIMAGES
fi
echo "you're going to create a looping gif named ${OUTPUT}.gif"
echo "out of all the $COUNT $EXT files inside $PWD with a tick"
echo "delay of $DELAY/100 of a second"; echo
- read -p "do you wish to continue? [y/n] " -n 1 -r; echo
- if [[ ! $REPLY =~ ^[Yy]$ ]]
+ read -p "do you wish to continue? [y/n] " -n 1 -r; echo
+ if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit $USERABORTED
else
shift
done
fi
-
-{{< /highlight >}}
\ No newline at end of file
+```
\ No newline at end of file