New write post function
This commit is contained in:
		
							parent
							
								
									73f53896ed
								
							
						
					
					
						commit
						c796ab1896
					
				
							
								
								
									
										24
									
								
								make.sh
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								make.sh
									
									
									
									
									
								
							@ -1,5 +1,4 @@
 | 
				
			|||||||
# not only updates the post but inserts the description found in desc.md into the index.md then recompiles
 | 
					# compiles new post into target directory
 | 
				
			||||||
# only gets called if 
 | 
					 | 
				
			||||||
post() {
 | 
					post() {
 | 
				
			||||||
	# check directory existence
 | 
						# check directory existence
 | 
				
			||||||
	if [ -f markdown/post/$1 ] 
 | 
						if [ -f markdown/post/$1 ] 
 | 
				
			||||||
@ -12,6 +11,17 @@ post() {
 | 
				
			|||||||
	fi
 | 
						fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# mainly to create new post files
 | 
				
			||||||
 | 
					writep() {
 | 
				
			||||||
 | 
						if [ -z $1 ]
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							echo 'No filename given' 
 | 
				
			||||||
 | 
							exit 0
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
						cp ./markdown/template.md ./markdown/post/$1
 | 
				
			||||||
 | 
						vim -c "Goyo" ./markdown/post/$1
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
page() {
 | 
					page() {
 | 
				
			||||||
	# we want to enforce maintainence of directory structure
 | 
						# we want to enforce maintainence of directory structure
 | 
				
			||||||
	if [ -f markdown/pages/$1 ] 
 | 
						if [ -f markdown/pages/$1 ] 
 | 
				
			||||||
@ -22,16 +32,9 @@ page() {
 | 
				
			|||||||
	fi
 | 
						fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# TODO: update the func so that it injects a description into the markdown file and then compiles
 | 
					 | 
				
			||||||
# Using this function to update the index 
 | 
					 | 
				
			||||||
function updateindex() {
 | 
					 | 
				
			||||||
	arg1 = $1 
 | 
					 | 
				
			||||||
	arg2 = $2
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# literally just updates the index file nothing else
 | 
					# literally just updates the index file nothing else
 | 
				
			||||||
index() {
 | 
					index() {
 | 
				
			||||||
	pandoc index.md --css style.css -s -o index.html # typing succs
 | 
						pandoc ./markdown/index.md --css style.css -s -o index.html # typing succs
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
help() {
 | 
					help() {
 | 
				
			||||||
@ -52,4 +55,5 @@ help() {
 | 
				
			|||||||
	esac
 | 
						esac
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# taking function names as para
 | 
				
			||||||
"$@"
 | 
					"$@"
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user