diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..4072230 Binary files /dev/null and b/.DS_Store differ diff --git a/.html b/.html new file mode 100644 index 0000000..e69de29 diff --git a/generate.sh b/generate.sh index 51652b1..53885f3 100755 --- a/generate.sh +++ b/generate.sh @@ -2,4 +2,32 @@ set -ex -# YOUR CODE HERE +# Declaring arguments. The script takes two arguments: +# The input directory +# The output directory +inputDir="$1" +outputDir="$2" + + +template="$( "$outputDir/""$filename.html" + + #Replacing title and body + sed -i -e "s/{{title}}/$( head -n 1 "$file")/g" "$outputDir/$filename.html" + sed -i -e "s/{{body}}/$( tail -n +3 "$file")/g" "$outputDir/$filename.html" #line 2 is empty +done \ No newline at end of file diff --git a/outputDirpostone.html b/outputDirpostone.html new file mode 100644 index 0000000..e69de29 diff --git a/outputDirsome-other-post.html b/outputDirsome-other-post.html new file mode 100644 index 0000000..e69de29 diff --git a/postone.html b/postone.html new file mode 100644 index 0000000..e69de29 diff --git a/some-other-post.html b/some-other-post.html new file mode 100644 index 0000000..e69de29 diff --git a/tests/.DS_Store b/tests/.DS_Store new file mode 100644 index 0000000..e4e5e1b Binary files /dev/null and b/tests/.DS_Store differ