diff --git a/.gitignore b/.gitignore index 1d40616..e32f34a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,4 @@ css bash posts *.conf -index.html -README.html +index.html \ No newline at end of file diff --git a/Makefile b/Makefile index a6c5959..4e749a2 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,14 @@ install: @echo "Installing bob" cp bob /usr/local/bin cp bob2 /usr/local/bin - cp -r lib /usr/local/lib/bob + cp -r lib/template /usr/local/lib/bob/template + cp lib/*.awk /usr/local/lib/bob uninstall: @echo "Uninstalling bob" rm /usr/local/bin/bob rm /usr/local/bin/bob2 - rm -r /usr/local/lib/bob + rm -rf /usr/local/lib/bob .PHONY: test # Declare 'test' as a phony target diff --git a/bob2 b/bob2 index 8fa31ed..982ad3c 100755 --- a/bob2 +++ b/bob2 @@ -16,7 +16,7 @@ usage() echo echo "bob commands :" echo " help display this help" - echo " init initiate the blog" + echo " init initiate a blog" echo " publish publish the blog" } @@ -25,31 +25,60 @@ init() { echo Name of the author of the blog : read author - echo "author:$author" > .blog.conf + echo "author=$author" > .blog.conf echo Name of the blog : read blog - echo "blog:$blog" >> .blog.conf - echo "Language of the blog : (en)" + echo "blog=$blog" >> .blog.conf + echo "Language of the blog : [en]" read lang if [ -z $lang ]; then lang=en fi - echo "lang:$lang" >> .blog.conf + echo "lang=$lang" >> .blog.conf echo "Activate dark mode : (y/N)" read dark if [ -z $dark ]; then dark=n fi - echo "dark:$dark" >> .blog.conf + echo "dark=$dark" >> .blog.conf mkdir drafts - mkdir bases + # mkdir templates mkdir posts - mkdir css - _init_css - _index "$blog" "$lang" "$dark" + # mkdir css + # _init_css + # _index "$blog" "$lang" "$dark" } +update_index() +{ + ls -t ./posts | awk ' + BEGIN { + print "