diff --git a/images/dupe_test_images_append_ext/news_articles/_templates/news_template.md b/images/dupe_test_images_append_ext/news_articles/_templates/news_template.md new file mode 100644 index 0000000..cc1071e --- /dev/null +++ b/images/dupe_test_images_append_ext/news_articles/_templates/news_template.md @@ -0,0 +1,38 @@ +--- +layout: news-post + +title: "" +header: "" + +date: +categories: [] + +is_external_link: false +publication: "" +externallink: "" + +background_color: "" # Hex color - ex: #fc4c02 + +featured: false +featured_sm: false +highlighted: false + +featured_image: /assets/images/posts/zzz/processed/zzz-image_feature +featured_sm_image: /assets/images/posts/zzz/processed/zzz-image_feature_sm +highlighted_image: /assets/images/posts/zzz/processed/zzz-image_highlight +neu_image_extension: 'jpg' + +jumbotron_image: /assets/images/posts/zzz/processed/zzz-jumbotron +background_image: /assets/images/posts/zzz/processed/zzz-background +thumbnail_image: /assets/images/posts/zzz/processed/zzz-thumbnail +image_extension: 'jpg' + +image: # Facebook feature image + path: /assets/images/posts/zzz/processed/zzz-featured-facebook.jpg + width: 960 + height: 540 + +blurb: "" + +published: true +--- \ No newline at end of file diff --git a/images/dupe_test_images_append_ext/news_articles/_templates/template.psd b/images/dupe_test_images_append_ext/news_articles/_templates/template.psd new file mode 100644 index 0000000..e69de29 diff --git a/images/dupe_test_images_append_ext/user_input.sh b/images/dupe_test_images_append_ext/user_input.sh new file mode 100755 index 0000000..db5b80f --- /dev/null +++ b/images/dupe_test_images_append_ext/user_input.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +base_dir="./news_articles" +news_dir="${base_dir}/news" +template_dir="${base_dir}/_templates" + +user_parameter="$1" +p="${user_parameter}" + +if [ ! -z "$p" ]; then + article_dir="${news_dir}/${p}" + echo "${article_dir}" +else + article_dir="${news_dir}/zzz" #${article_dir_cli}" + echo "${article_dir}" +fi + +mk_news() { + if [ ! -d "${base_dir}" ]; then + mkdir "${base_dir}" + fi + if [ ! -d "${news_dir}" ]; then + mkdir "${news_dir}" + fi + if [ ! -d "${template_dir}" ]; then + echo -e "Something is seriously wrong." + echo -e "The template directory is missing." + echo -e "It should be here: ${template_dir}" + echo -e "You probably want to check and make sure you didn't delete the dir and try running this script again." + exit 0 + fi +} + +mk_folder() { + if [ ! -z "$p" ]; then + mkdir "${news_dir}/${p}" + #echo "$p" + else + while read -ep "Enter the name of the article to create: " file_dir; do + if [ -d "${news_dir}/${file_dir}" ]; then + echo -e "${file_dir} already exists - please enter a different name." + else + mkdir "${news_dir}/${file_dir}" + #echo -e "Made your folder. Go check it out." + break + fi + done + fi +} + +cp_templates() { + cp "${template_dir}/news_template.md" "${news_dir}/${file_dir}/${file_dir}.md" + cp "${template_dir}/template.psd" "${news_dir}/${file_dir}/${file_dir}_template.psd" +} + +#mk_news +#mk_folder +#cp_templates