December 08, 2023

ประสบการณ์การ Custom Blogger Template

การเขียน blog ใน blogger.com เราสามารถ custom template เองโดยให้เข้าไปเมนู Theme ที่ CUSTOMIZE Option เลือก Edit HTML
เราจะเจอกับส่วนที่เราสามารถแก้ไข code ที่เป็น html ได้ ภาษาที่ใช้ก็จะเป็น html, css, javascript
เมื่อเปิดขึ้นมาแล้วสิ่งแรกที่ผมจะทำคือการ clear html ทั้งหมดตามนี้ และเราจะได้หน้าเปล่า ๆ แล้วค่อยเริ่มทำการ custom template

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:layoutsVersion='3' lang='en' 
	xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' 
    xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
  <head>
    <meta charset='UTF-8'/>
    <meta content='width=device-width, initial-scale=1, minimun-scale=1, maximum-scale=1' name='view-port'/>
    
    <title>
    	<data:blog.title/>
    </title>
    
    <b:if cond='!data:view.isLayoutMode'>
    <b:skin><![CDATA[
    
	* {
	  margin: 0;
	  padding: 0;
	  box-sizing:border-box;
	  font-family: 'Noto Serif Thai', serif;
	}

	html {
	  overflow-x: hidden;
	  -ms-text-size-adjust: 100%;
	  -webkit-text-size-adjust: 100%;
	}

	a {
	  color: inherit;
	  text-decoration: none;
	}

	img {
	  max-width: 100%;
	}

	.section {
	  margin: 0;
	  padding: 0;
	}

	.widget {
	  margin: 0;
	  padding: 0;
	  line-height: unset;
	}

	.widget ul, li {
	  margin: 0;
	  padding: 0;
	  text-indent: 0;
	}
	
    ]]></b:skin>
    </b:if>
    
    <b:if cond='data:view.isLayoutMode'>
    <b:template-skin><![CDATA[

	]]></b:template-skin>
    </b:if>
  
  </head>
  <body>

    <style/>
    <b:section id='section'/>
    
  </body>
</html>