1. bootstrap download කරලා ඒ assets ටික අපේ project folder එකට දාගන්න එක.
Twitter Bootstrap. එය එක්තරා ආකාරයක කලින් සාදන ලද Styles සහ Plugins එකතුන්ය එනම් Bootstrap යනු කලින් ලියන ලද CSS හා JS කේත සමූහයක් කියා හැඳින්වීමක්ද සිදුකල හැකියි. මෙන්න මේ කියන CSS හා JS කේත ඇතුලත් වූ දත්ත එනම් .css , .js යන Extension වලින් යුක්ත දත්ත ඇතුලත් assets ටික අඩංගු වන ෆෝල්ඩරය අපට ඔවුන්ගේ ප්රධාන වෙබ් පිටු වලට පිවිස බාගත කර ගත හැකිය. ඒ සඳහා විස්තරාත්මක උපදෙස් මාලාවක් ද සපයා ඇත. තවද මුලික වශයෙන් ඔබට Bootstrap සමග වැඩ කිරීමට හැකි දැනුමක්ද මෙම වෙබ් අඩවිය මගින් ලබාගන්නත් පුළුවන්. මුලින් අපි බලමු මේ දත්ත භාගත කර ගන්නේ කොහොමද සහ ඒ Files අපේ පිටුවට Link කර ගන්නේ කෙසේද යනවග.
Bootstrap 3
මුලින්ම http://getbootstrap.com/ කියන web page එකට යන්න.
හරි main page එකට ගියට පස්සෙ එකෙ තියෙන Download Bootstrap button එක click කරල download කරගන්න. Download කරම අපිට ලැබෙන්නෙ zip file එකක්, තවදෙයක් තියෙනවා අපි use කරන්නෙ full version එක. ඔයාට ඔනි නම් customize version එකක් download කරගන්නත් පුලුවන්. දැන් ඔයා භාගත කර ගත්ත Zip එක Extract කරලා බැලුවම ඔයාට මේ වගේ Folder Tree එකක් තියෙන්න ඕනි.
bootstrap/
├── css/
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ ├── bootstrap.min.css
│ ├── bootstrap-theme.css
│ ├── bootstrap-theme.css.map
│ └── bootstrap-theme.min.css
├── js/
│ ├── bootstrap.js
│ └── bootstrap.min.js
└── fonts/
├── glyphicons-halflings-regular.eot
├── glyphicons-halflings-regular.svg
├── glyphicons-halflings-regular.ttf
├── glyphicons-halflings-regular.woff
└── glyphicons-halflings-regular.woff2
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Template - chandaregura.blogspot.com blog</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<h1>Hello, world!</h1>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
JQuery – අනිවාර්යයෙන්ම ඕන කරනවා. මෙතනින් ගන්න පුළුවන්. මේකෙදි bootstrap.min.js file එක Jquery.min.js එකට යටින් තියෙන්න ඕන අනිවාර්යයෙන්ම. මොකද නැත්නම් Bootstrap transitions වලදී ඒ ක්රියාකාරකම් නිසි පරිදි සිදු නොවීමට ඉඩ තිබෙන නිසා.
Bootstrap 2
මුලින්ම http://getbootstrap.com/2.3.2/ කියන web page එකට යන්න.
හරි කලින් කිව්වා වගේම main page එකට ගියට පස්සෙ එකේ තියෙන Download Bootstrap button එක click කරල තමයි download කරගන්න ඕනි. Download කරහම අපිට කලින් වගේම ලැබෙන්නෙ zip file එකක්, මේකෙදිත් අපි භාගත කර ගන්නේ Full version එක. දැන් ඔයා භාගත කර ගත්ත Zip එක Extract කරලා බැලුවම ඔයාට පහල රුපයේ වගේ Folder Tree එකක් තියෙන්න ඕනි.
app/
layouts/
templates/
public/
css/
bootstrap.min.css
js/
bootstrap.min.js
img/
glyphicons-halflings.png
glyphicons-halflings-white.png
දැන් කරන්න තියෙන්නෙ ඔය CSS, JS සහ font files ටික ඔයාගෙ project එකෙ CSS, JS, font folders වලට කලින් කියපු විදියටම දාගෙන link කර ගන්න එක. ඔන්න ඔහොම තමයි bootstrap download කරල ඒ assets ටික අපේ project folder එකට දාගන්නේ. හරි ඊට පස්සේ අපි බලමු කොහොමද Bootstrap වලදී CDN (Content Delivery Network) use කරන්නේ කියලා.
2. bootstrap CDN (Content Delivery Network) use කරන එක.
CDN කියන්නේ මොකක්ද ?
හොඳයි අපි සේරටම කලින් බලමු මොකක්ද මේ CDN කියන්නේ කියලා, මොකද සතා මොකාද කියල දන්නේ නැතුව Chicken කාලා වැඩක් නැනේ යාලුවනේ පුර්ණ දැනුමක් ලබා ගන්න ගමන් අපි මේ පාඩම් මාලාව ඉස්සරහට ගෙනියමු. CDN කියන වචනේ Web එක්ක බැඳිලා ඉන්න අයට නිතර අහන්න ලැබෙන දෙයක්. CDN කියන එකේ තේරුම Content Delivery Network කියන එක. ඒ කියන්නේ මේකෙන් කරන්නේ contents deliver කරන එක. user කෙලින්ම origin server එකත් එක්ක, නැත්තම් parent server එකත් එක්ක connect වෙන්නේ නැතුව ඒ වෙනුවට node එකක් එක්ක connect වෙනවා. අදාළ server එකත් එක්ක connection එක තියාගන්නේ එකිනෙක බැඳුනු ජාල විසින්.
- CDN වල වාසි
- CDN වල අවාසි
Bootstrap 3
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
Bootstrap 2
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter bootstrap/2.3.1/css/bootstrap-responsive.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter bootstrap/2.3.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="http://netdna.bootstrapcdn.com/twitter bootstrap/2.3.1/js/bootstrap.min.js"></script>
මම මෙච්චර වෙලා කතා කරපු CDN ඔයාගේ web page එකට link කරන්නේ ඉහත රුපයේ සඳහන් ආකාරයට තමයි. මේ තියෙන්නේ sample code එකක්. coding structure එක අඳුරගන්න පුළුවන් මේකෙන්. මේකෙදිත් කලින් කිව්වා වගේ bootstrap.min.js file එක Jquery.min.js එකට යටින් තියෙන්න ඕන.
Written by
චන්දරේ…

