Sitemap là gì ?
Sitemap (còn được gọi là sơ đồ của một trang web) là một tập tin văn bản có chứa tất cả các URL (đường dẫn) của một trang web. Sitemap còn có thể chứa các siêu dữ liệu về mỗi URL thông báo sẽ được gửi đến cho bạn khi nó mới được cập nhật.
Vì sao cần tạo sitemap
Site map là sự cần thiết cho trang web của bạn để đạt được một vị trí cao trong các hệ thống tìm kiếm, bởi vì các hệ thống tìm kiếm đánh giá rất cao cho các trang web có một sơ đồ điều hướng truy cập website.
Lời khuyên trước khi tạo sitemap
-Một site map nên tương ứng với thiết kế của trang web. Hãy xuất phát từ khái niệm thông thường, như được đề cập trong bất cứ tài liệu tương tự khác nào, một site map không mang lại cho trang web của bạn sự đánh giá đầy đủ về mức độ thu hút mà thậm chí ngược lại còn có thể làm những người dùng hoảng sợ.
- Không nên sử dụng những yếu tố đồ hoạ trong khi tạo một site map. Thời gian gần đây, hầu hết người sử dụng lướt Web vào những trang trên Internet ở chế độ ngăn chặn đồ họa. Vì lý do này nên sự xuất hiện của đồ hoạ như là những yếu tố điều hướng truy cập trên site map của bạn sẽ không được xem là có ích lắm, vì chúng sẽ không hoạt động cho tất cả người dùng, và sơ đồ sẽ chỉ là sự thể hiện chưa được thành công cho sáng tạo của bạn. Bởi thế, lý tưởng là một site map nên nhìn giống nhau trong tất cả các trình duyệt khi mọi người truy cập web.
-Cấu trúc của sơ đồ nên có tương quan với chính hệ thống có tính phân cấp của web. Vì cấu trúc của một sơ đồ trang web nên cần được sử dụng các tiêu đề và danh sách. Không nên sử dụng các bảng cho cấu trúc sơ đồ vì nó khiến cho quy trình này nhiều khó khăn hơn.
-Nên đặt đường liên kết tới sơ đồ website trên trang chính hoặc trang đầu của trang web hoặc theo một cách nào đó tương tự để người dùng có thể sử dụng được dễ dàng khi cần thiết. Sao cho người sử dụng sẽ không ngừng một giây nào để nghĩ về điều họ nên làm gì, khi họ không biết làm gì hơn nữa sau khi truy cập vào website của bạn.
Demo hình ảnh
Hướng dẫn cài sitemap cho blogspot
Đầu tiên vào Blog bạn cần thêm sitemap > Vào tab trang > Thêm trang mới và đặt tên trang đó là Sitemaps .
Sau đó click vào nút html bên dưới chỗ đặt tên trang và thêm đoạn code dưới đây:
<style type="text/css">
#table-outer td{min-width:150px;color:#fff;}
#table-outer select,
#table-outer select,
#table-outer input{width:250px;border:1px solid #766469;color:#000;font-size:11px;padding:4px;}
#feedContainer li{border-top:#fff;border-bottom:1px solid #DADADA;margin-bottom:10px;float:left;width:100%;padding:5px 0;}
#feedContainer,
#feedContainer li{list-style:none;overflow:hidden;margin:0;}
#feedNav{text-align:center;line-height:30px;background-color:#fff;border-radius:3px;border:1px solid #fff;margin:10px 0 0;}
</style>
<div class="archiver"><div id="box_left" style="padding: 10px;"><div id="table-outer"><table border="0"><tbody>
<tr><td><label><span class="text">Sắp xếp:</span></label></td><td><select class="input" id="orderFeedBy"><option selected="" value="published">Phim Mới</option><option value="updated">Phim Cũ</option></select></td></tr>
<tr><td><label><span class="text">Danh sách nhãn:</span></label></td><td><span id="labelSorter"><select class="input" disabled=""><option selected="">Đợi Xíu...</option></select></span></td></tr>
<tr><td><label><span class="text">Từ khóa tìm kiếm (gõ có dấu):</span></label></td><td><form id="postSearcher"><input class="input" type="text" /></form></td></tr>
</tbody></table></div><header id="resultDesc"></header><br />
<ul id="feedContainer"></ul><div id="feedNav">Loading...</div>
<script type="text/javascript">
//<![CDATA[
var tocConfig = {
url: 'http://DJ78.TK',
feedNum: 30,
labelName: (window['location']['hash'] && window['location']['hash'] != '#0' && window['location']['hash'] != '#search') ? encodeURIComponent(window['location']['hash']['substr'](1)) : false,
numChars: 300,
thumbWidth: 80,
navText: 'Xem thêm',
frontText: 'Bay lên đầu',
noImage: 'http://1.bp.blogspot.com/-htG7vy9vIAA/Tp0KrMUdoWI/AAAAAAAABAU/e7XkFtErqsU/s1600/grey.gif',
loading: '<span>Loading...</span>',
searching: '<span>Đang Tìm Kiếm...</span>',
MonthNames: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
noResult: 'No Result'
};
function getID(_0x444ex3) {
return document['getElementById'](_0x444ex3);
};
var head = document['getElementsByTagName']('head')[0],
tocContainer = getID('feedContainer'),
feedNav = getID('feedNav'),
orderByer = getID('orderFeedBy'),
labelSorter = getID('labelSorter'),
input = getID('postSearcher')['getElementsByTagName']('input')[0],
resultDesc = getID('resultDesc'),
nextPage, feedArchive, startPage = 0;
function cropFeed(_0x444exf, _0x444ex10) {
var _0x444ex11 = _0x444exf['split']('<');
for (var _0x444ex12 = 0; _0x444ex12 < _0x444ex11['length']; _0x444ex12++) {
if (_0x444ex11[_0x444ex12]['indexOf']('>') != -1) {
_0x444ex11[_0x444ex12] = _0x444ex11[_0x444ex12]['substring'](_0x444ex11[_0x444ex12]['indexOf']('>') + 1, _0x444ex11[_0x444ex12]['length']);
};
};
_0x444ex11 = _0x444ex11['join'](' ');
_0x444ex11 = _0x444ex11['substring'](0, _0x444ex10 - 1);
return _0x444ex11;
};
function showLabels(_0x444ex10) {
var _0x444ex14 = _0x444ex10['feed']['category'],
_0x444exf = '';
_0x444exf = '<select id=\'labelSorter\' onchange=\'changeSort(this.value);\'>';
_0x444exf += '<option value=\'\' selected>Thể Loại</option>';
for (var _0x444ex3 = 0; _0x444ex3 < _0x444ex14['length']; _0x444ex3++) {
_0x444exf += '<option value=\'' + decodeURIComponent(_0x444ex14[_0x444ex3]['term']) + '\'>' + _0x444ex14[_0x444ex3]['term']['toUpperCase']() + '</option>';
};
_0x444exf += '</select>';
labelSorter['innerHTML'] = _0x444exf;
};
function showFeedList(_0x444ex16) {
var _0x444ex17 = _0x444ex16['feed']['entry'],
_0x444ex18, _0x444ex19, _0x444ex1a, _0x444ex1b, _0x444ex12, _0x444ex1c, _0x444ex1d, _0x444ex1e, _0x444ex1f, _0x444ex20, _0x444ex10 = '';
if (typeof (_0x444ex16['feed']['entry']) !== 'undefined') {
for (var _0x444ex11 = 0; _0x444ex11 < tocConfig['feedNum']; _0x444ex11++) {
_0x444ex18 = (_0x444ex17) ? _0x444ex17[_0x444ex11] : '';
nextPage = '';
if (_0x444ex11 == _0x444ex16['feed']['entry']['length']) {
break;
};
_0x444ex19 = _0x444ex18['title']['$t'];
for (var _0x444exf = 0; _0x444exf < _0x444ex18['link']['length']; _0x444exf++) {
if (_0x444ex18['link'][_0x444exf]['rel'] == 'alternate') {
_0x444ex1a = _0x444ex18['link'][_0x444exf]['href'];
break;
};
};
for (var _0x444ex3 = 0; _0x444ex3 < _0x444ex16['feed']['link']['length']; _0x444ex3++) {
if (_0x444ex16['feed']['link'][_0x444ex3]['rel'] == 'next') {
nextPage = _0x444ex16['feed']['link'][_0x444ex3]['href'];
};
};
for (var _0x444ex14 = 0; _0x444ex14 < _0x444ex18['link']['length']; _0x444ex14++) {
if (_0x444ex18['link'][_0x444ex14]['rel'] == 'replies' && _0x444ex18['link'][_0x444ex14]['type'] == 'text/html') {
_0x444ex20 = _0x444ex18['link'][_0x444ex14]['title'];
break;
};
};
if ('content' in _0x444ex18) {
_0x444ex12 = _0x444ex18['content']['$t'];
} else {
if ('summary' in _0x444ex18) {
_0x444ex12 = _0x444ex18['summary']['$t'];
} else {
_0x444ex12 = '';
};
}; if ('media$thumbnail' in _0x444ex18) {
_0x444ex1b = _0x444ex18['media$thumbnail']['url']['replace'](/\/s[0-9]+\-c/, '/s' + tocConfig['thumbWidth'] + '-c');
} else {
_0x444ex1b = tocConfig['noImage']['replace'](/\/s[0-9]+\-c/, '/s' + tocConfig['thumbWidth'] + '-c');
};
postdate = _0x444ex18['published']['$t']['substring'](0, 10);
_0x444ex1c = postdate['substring'](0, 4);
_0x444ex1d = postdate['substring'](5, 7);
_0x444ex1e = postdate['substring'](8, 10);
_0x444ex1f = tocConfig['MonthNames'][parseInt(_0x444ex1d, 10) - 1];
_0x444ex10 += '<li><div>';
_0x444ex10 += '<a href=\'' + _0x444ex1a + '\' target=\'_blank\'><img style=\'float:left;width:' + tocConfig['thumbWidth'] + 'px;height:' + tocConfig['thumbWidth'] + 'px;margin-right:10px;\' src=\'' + _0x444ex1b + '\' alt=\'' + _0x444ex19 + '\' /></a>';
_0x444ex10 += '<h2 style=\'font-size:14px;\'><a href=\'' + _0x444ex1a + '\' target=\'_blank\'>' + _0x444ex19 + '</a></div>';
_0x444ex10 += '<div style=\'margin-top:5px;\'>' + cropFeed(_0x444ex12, tocConfig['numChars']) + '…<br style=\'clear:both;\'/></h2>';
_0x444ex10 += 'on: <span>' + _0x444ex1e + '</span>/<span>' + _0x444ex1f + '</span>/<span>' + _0x444ex1c + '</span></div></div></li>';
};
if (input['value'] !== '' && window['location']['hash'] == '#search') {
resultDesc['innerHTML'] = '<span>Search Result for Keyword <strong>"' + input['value'] + '"</strong></span>';
} else {
resultDesc['innerHTML'] = '';
};
feedContainer['innerHTML'] += _0x444ex10;
if (nextPage) {
if (window['location']['hash'] && window['location']['hash'] !== '#0') {
_0x444ex10 = '<a href=\'javascript:initResult(2);\' class=\'next\'>' + tocConfig['navText'] + '</a>';
} else {
_0x444ex10 = '<a href=\'javascript:initResult(1);\' class=\'next\'>' + tocConfig['navText'] + '</a>';
};
} else {
_0x444ex10 = '<a href=\'#table-outer\' onclick=\'jQuery('html, body').animate({scrollTop: jQuery('#table-outer').offset().top}, 1500); return false\' class=\'front\'>' + tocConfig['frontText'] + '</a>';
};
feedNav['innerHTML'] = _0x444ex10;
input['value'] = '';
labelSorter['getElementsByTagName']('select')[0]['removeAttribute']('disabled');
orderByer['removeAttribute']('disabled');
} else {
feedContainer['innerHTML'] = '';
alert(tocConfig['noResult']);
feedNav['innerHTML'] = '<a href=\'?reload=true\'>' + tocConfig['frontText'] + '</a>';
searchDesc['innerHTML'] = '';
};
};
function initResult(_0x444ex14) {
var _0x444ex3, _0x444ex10;
if (_0x444ex14 == 1) {
_0x444ex3 = nextPage['indexOf']('?');
_0x444ex10 = nextPage['substring'](_0x444ex3);
} else {
if (_0x444ex14 == 2) {
_0x444ex3 = nextPage['indexOf']('?');
_0x444ex10 = nextPage['substring'](_0x444ex3)['replace'](/\?/, '/-/' + window['location']['hash']['substr'](1) + '?');
} else {
_0x444ex10 = '?start-index=1&max-results=' + tocConfig['feedNum'] + '&orderby=' + orderByer['value'] + '&alt=json-in-script';
};
};
_0x444ex10 += '&callback=showFeedList';
updateScript(_0x444ex10);
};
function removeScript() {
var _0x444ex14 = getID('temporer-script');
_0x444ex14['parentNode']['removeChild'](_0x444ex14);
};
function buildLabels() {
var _0x444ex14 = document['createElement']('script');
_0x444ex14['type'] = 'text/javascript';
_0x444ex14['src'] = (tocConfig['url'] === '' ? window['location']['protocol'] + '//' + window['location']['host'] : tocConfig['url']) + '/feeds/posts/summary?max-results=0&alt=json-in-script&callback=showLabels';
head['appendChild'](_0x444ex14);
};
function updateScript(_0x444ex3) {
if (startPage == 1) {
removeScript();
};
feedNav['innerHTML'] = tocConfig['loading'];
if (tocConfig['labelName'] !== false) {
feedArchive = (tocConfig['url'] === '' ? window['location']['protocol'] + '//' + window['location']['host'] : tocConfig['url']) + '/feeds/posts/summary/-/' + tocConfig['labelName'] + _0x444ex3;
} else {
feedArchive = (tocConfig['url'] === '' ? window['location']['protocol'] + '//' + window['location']['host'] : tocConfig['url']) + '/feeds/posts/summary' + _0x444ex3;
};
var _0x444ex14 = document['createElement']('script');
_0x444ex14['type'] = 'text/javascript';
_0x444ex14['src'] = feedArchive;
_0x444ex14['id'] = 'temporer-script';
head['appendChild'](_0x444ex14);
startPage = 1;
};
function changeSort(_0x444ex10) {
removeScript();
tocContainer['innerHTML'] = '';
feedNav['innerHTML'] = tocConfig['loading'];
var _0x444ex3 = document['createElement']('script'),
_0x444exf = labelSorter['getElementsByTagName']('select')[0],
_0x444ex14 = (_0x444ex10 !== 0) ? '/-/' + _0x444ex10 : '';
_0x444ex3['type'] = 'text/javascript';
_0x444ex3['id'] = 'temporer-script';
_0x444ex3['src'] = (tocConfig['url'] === '' ? window['location']['protocol'] + '//' + window['location']['host'] : tocConfig['url']) + '/feeds/posts/summary' + _0x444ex14 + '?alt=json-in-script&max-results=' + tocConfig['feedNum'] + '&orderby=' + orderByer['value'] + '&callback=showFeedList';
head['appendChild'](_0x444ex3);
_0x444exf['disabled'] = true;
orderByer['disabled'] = true;
window['location']['hash'] = _0x444ex10;
};
function searchPost() {
removeScript();
tocContainer['innerHTML'] = '';
resultDesc['innerHTML'] = '';
feedNav['innerHTML'] = tocConfig['searching'];
var _0x444ex14 = document['createElement']('script');
_0x444ex14['type'] = 'text/javascript';
_0x444ex14['id'] = 'temporer-script';
_0x444ex14['src'] = (tocConfig['url'] === '' ? window['location']['protocol'] + '//' + window['location']['host'] : tocConfig['url']) + '/feeds/posts/summary?alt=json-in-script&orderby=published&q=' + input['value'] + '&max-results=9999&callback=showFeedList';
head['appendChild'](_0x444ex14);
window['location']['hash'] = '#search';
return false;
};
getID('postSearcher')['onsubmit'] = function () {
return searchPost();
};
orderByer['onchange'] = function () {
changeSort(0);
};
labelSorter['getElementsByTagName']('select')[0]['onchange'] = function () {
changeSort(this['value']);
};
window['onload'] = function () {
initResult(0);
buildLabels();
window['location']['hash'] = '#0';
};
//]]>
</script>
<div class="clear"></div></div></div>
Lưu ý : thay đổi http://DJ78.TK/ thành link blog của bạn nhé.
