script updates

This commit is contained in:
2019-09-11 08:55:32 -05:00
parent 9808b1ebdf
commit 4879369001
5 changed files with 60 additions and 14 deletions

View File

@@ -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
---

Binary file not shown.

View File

@@ -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
---

66
images/news_md/user_input.sh Executable file
View File

@@ -0,0 +1,66 @@
#!/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}"
# 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
article_dir="${news_dir}/${p}"
#echo "${article_dir}"
if [ -d "${article_dir}" ]; then
echo -e "${p} already exists - please enter a different name."
else
mkdir "${article_dir}"
#echo -e "Made your folder. Go check it out."
fi
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() {
if [ ! -z "$p" ]; then
cp "${template_dir}/news_template.md" "${article_dir}/${p}.md"
cp "${template_dir}/template.psd" "${article_dir}/${p}_template.psd"
else
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"
fi
}
mk_news
mk_folder
cp_templates