You can modify my script any way you want, but just so you have a clear view of where to begin.
Here are the steps you’ll need to take in order to implement this process.
1. Read David Ensinger blog post about creating meta tag logic. Very helpful if you forget to add an image or leave something out. I like the idea that my pages all have default title/descriptions/images.
2. Have your head look something like mine.
3. Here is the bash script I made. Named my file social.sh and it is in the root of the project.
brew install imagemagick
npm install gulp-exec --save-dev be sure to be in the root of your project.
6. Edit your gulp.js and be sure to restart gulp after changes are made.
7. Since this is jekyll we need to edit the front matter so our default image is not used. Here is an example of my yaml front matter I have on this very article. As you can see I am only using the file name for the image data. The rest of the information is hidden away on the meta data.
8. Open terminal and cd into the root of your project then type
gulp share … BOOM! or if you have built a string of production commands to run once you’re ready to publish just add it and forget about it. Something like this.