Add post update_date plugin
This commit is contained in:
		
							parent
							
								
									b3ad796173
								
							
						
					
					
						commit
						16115be468
					
				
							
								
								
									
										4
									
								
								_plugins/add-posts-update-date.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								_plugins/add-posts-update-date.rb
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,4 @@
 | 
			
		||||
Jekyll::Hooks.register :posts, :pre_render do |post|
 | 
			
		||||
  mtime = File.mtime post.path
 | 
			
		||||
  post.data['update_date'] = mtime unless post.data['date'].to_date == mtime.to_date
 | 
			
		||||
end
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user