//includes and post setting
-if(isset($post_id) == false && isset($page) == false)
	-$post_id = sanitize_text_field($_GET['post_id'])
	-$post = get_post($post_id)

-if(isset($post) == false)
	-$post = get_post($post_id)

-$post_type = get_post_type($post->ID)
-$post_content = $post->post_content
-$eager_loading = sanitize_text_field($_GET['eager'])

%head
	//meta tags
	%meta{:name => 'viewport', :content => 'width=device-width, minimum-scale=1.0, maximum-scale=1.0'}

	//css and javascript includes
	%script{:type=>"text/javascript", :src=>"#{MOBILOUD_POST_ASSETS_URL}/js/jquery.min.js"}

	%link{:rel=>"StyleSheet", :href=>"#{MOBILOUD_POST_ASSETS_URL}/css/mobile.css", :type => "text/css", :media => 'all'}
	//body
	%script{:type=>"text/javascript", :src=>"#{MOBILOUD_POST_ASSETS_URL}/js/spinner.js"}
	%script{:type=>"text/javascript", :src=>"#{MOBILOUD_POST_ASSETS_URL}/js/jquery.spin.js"}

	%script{:type=>"text/javascript", :src=>"#{MOBILOUD_POST_ASSETS_URL}/js/mobile.js"}

	=get_option('ml_post_head')

%body
	-if(get_option('ml_eager_loading_enable') == 'true' || $eager_loading == "true" || $post_type == 'page')
		-include(dirname(__FILE__)."/body_content.php")
	-else
		#lazy_body
			#post_header
				%h1.post-title 
					=$post->post_title
			#lazy_content_spinner

		%div{:id => 'mobiloud_lazy_load', :data-url => "#{MOBILOUD_PLUGIN_RELATIVE_URL}/post/body_content.php", :data-post_id => "#{$post->ID}"}
		%script{:type=>"text/javascript", :src=>"#{MOBILOUD_POST_ASSETS_URL}/js/lazy_load.js"}


-eval(stripslashes(get_option('ml_post_footer')))
