diff --git a/README.md b/README.md index 80a2a9a..d5b823e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![logo](static/img/icon.svg) +![logo](static/logo.svg) # Ficurinia @@ -36,8 +36,13 @@ summaryLength = 70 # number of words for article summaries author = "Gabriele Musco" description = "A description for my website" # this will be added as metadata - logo = "/images/mylogo.png" - favicon = "/images/myfavicon.png" + # It's best to put these icons in the "static" folder of your site + logo = "/logo.svg" + favicon = "/favicon.png" + faviconIco = "/favicon.ico" + appletouch = "/apple-touch-icon.png" + svgicon = "/logo.svg" + showTags = true # show the Tags menu item; default true showRss = true # show the link for the RSS feed; default true @@ -178,6 +183,27 @@ Following is an example configuration: | `featured` | Boolean, indicate if the post should be shown as featured | | `image` | The main image representing the post | +## Generate icons + +It's best to use the provided `generate_icons.sh` script to generate all necessary icons for your website. This script requires ImageMagick, that you will need to install separately. + +For the best results, place your logo in svg format inside the `static` directory of your website, rename it to `logo.svg` and then call `./themes/hugo-ficurinia/generate_icons.sh static/logo.svg`. + +The script will take care of generating all the icons you need. + +Finally, make sure to edit your config.toml to include the following: + +```toml +# ... +[params] + logo = "/logo.svg" + favicon = "/favicon.png" + faviconIco = "/favicon.ico" + appletouch = "/apple-touch-icon.png" + svgicon = "/logo.svg" + # ... +``` + ## Inject custom content Ficurinia supports injecting custom content into the theme. There are several files you can create in `layouts/partials/inject` that will be included inside the theme in different places. diff --git a/generate_icons.sh b/generate_icons.sh new file mode 100755 index 0000000..7ed5a39 --- /dev/null +++ b/generate_icons.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Usage: $0 path/to/icon.svg" + exit 1 +fi +FNAME=$1 +if [ ! -f "$FNAME" ]; then + echo "Error: file $FNAME doesn't exist" + exit 1 +fi + +DESTDIR="$(dirname "$FNAME")" +convert -density 1200 -background none -resize 32x32 "$FNAME" "$DESTDIR/favicon.ico" +convert -density 1200 -background none -resize 32x32 "$FNAME" "$DESTDIR/favicon.png" +convert -density 1200 -background none -resize 180x180 "$FNAME" "$DESTDIR/apple-touch-icon.png" +convert -density 1200 -background none -resize 192x192 "$FNAME" "$DESTDIR/android-chrome-192x192.png" +convert -density 1200 -background none -resize 512x512 "$FNAME" "$DESTDIR/android-chrome-512x512.png" diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 04e5450..374c2fb 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -15,7 +15,7 @@ {{ end }} {{ end }} - + {{- partial "head_icons.html" . -}}