Dokumen ini hanya untuk Plus UI v3 by Saifullah.id.
Untuk menambahkan peta situs ke halaman, ikuti langkah-langkah berikut:
- Di halaman Editor , klik icon at di kiri bawah judul.
- Akan muncul dua pilihan Tampilan HTML and Tampilan Menulis.
- Pilih 'HTML View'.
-
Copy dan paste kode berikut.
<!--[ Begin: Sitemap area ]--> <style> .sMap >.n, .sCnt > .n{padding:40px 15px;background:var(--contentB);font-size:14px;line-height:1.5rem;text-align:center;border:2px dashed var(--contentL);border-radius:5px} .sMap a{color:inherit} .sMap a:hover{color:var(--linkC);text-decoration:underline} .sMap ol li::marker{opacity:.8} @media screen and (min-width: 896px) { .sSel{display:flex;gap:12px;margin-bottom:20px} .sSel >*{flex:1;margin:0} } </style> <script> /*! Plus UI Javascript (sitemap.js) | Authors: Deo Kumar, Armaan Kumar (https://fineshopdesign.com) | License: Unlicensed | Copyright (c) 2024 Fineshop Design */ "use strict";((e,t,l,s,a)=>{let{df:i,lz:n,cEl:r,iAE:o,qSel:d,gId:u,aEL:p,ms:g,mc:c,bg:h,vw:b}=e,v=l.currentScript,m=r("div",{class:"sMap",innerHTML:`<div class='n'>${g.loading}</div>`});if(!v)return;o(v,"afterend",m);let f=v.getAttribute("data-blog")||h.cnHmU;b.iPrB?m.innerHTML="<div class='n'>Feature Sitemap is not available for Private Blogs.</div>":i.then((()=>n)).then((async()=>{let t=new(await e.iBF())(f,{jsonp:!0}),[l,i]=await Promise.all([{type:"posts",maxRequests:a.postMaxRequests},{type:"pages",maxRequests:a.pageMaxRequests}].map((async({type:e,maxRequests:l})=>{let s={sortBy:"published",maxResults:150,summary:!0},a=[],i=await t[e].list(s);for(a.push(...i);a.length<150*l&&i.nextUrl;)i=await t[e].list({...s,startIndex:a.length+1}),a.push(...i);return a}))),n=[],r={};for(let e=0;e<l.length;e++){let t=l[e];t.published=new Date(t.published),t.updated=new Date(t.updated);let s=t.labels;if(s.length)for(let e=0;e<s.length;e++){let l=s[e];r[l]||(r[l]=[]),r[l].push(t)}else n.push(t)}for(let e=0;e<i.length;e++){let t=i[e];t.published=new Date(t.published),t.updated=new Date(t.updated)}let o={};o.group_all=["All posts",l];for(let e in r)o[`label_${e}`]=[e,r[e]];n.length&&(o.group_unlabelled=[s.uncategorized,n]),o.group_pages=[s.pages,i];let h="";h+="<div class='sSel'><div class='inF'><select id='sm-category'>";for(let e in o)h+=`<option value='${e}'>${o[e][0]}</option>`;h+=`</select><label for='sm-category'>${s.category}</label></div><div class='inF'><select id='sm-sort-by'><option value='published'>${c.published}</option><option value='updated'>${c.updated}</option></select><label for='sm-sort-by'>${s.sortBy}</label></div></div><div class='sCnt'></div>`,m.innerHTML=h;let b=u("sm-category"),v=u("sm-sort-by"),y=d(".sCnt",m),w=()=>{let e=b.value,t=v.value,[l,s]=o[e];if(s.length){s.sort(((e,l)=>{if("updated"===t){if(e.updated>l.updated)return-1;if(e.updated<l.updated)return 1}else{if(e.published>l.published)return-1;if(e.published<l.published)return 1}return 0}));let e="<ol class='sPls'>";for(let t=0;t<s.length;t++){let l=s[t];e+=`<li><a href='${l.url}' target='_blank'>${l.title}</a></li>`}e+="</ol>",y.innerHTML=e}else y.innerHTML=`<div class='n'>${g.theresNothingHere}</div>`};p(b,"change",w),p(v,"change",w),w()})).catch((t=>{console.warn("Sitemap error:",t),e.iAdm().then((e=>{if(!e)throw new Error("Not admin");m.innerHTML="<div class='n'>Failed to load Sitemap page. Please make sure you are connected to internet and Blog Feed is not set to 'None' in blog settings.</div>"})).catch((()=>{m.innerHTML=`<div class='n'>${c.failedToLoad}</div>`}))}))})(PU,window,document,{sortBy:"Sort By",allPosts:"All posts",uncategorized:"Uncategorized",pages:"Pages",category:"Category"},{postMaxRequests:4,pageMaxRequests:4}); </script> <!--[ End: Sitemap area ]-->
- Disarankan untuk menambahkan paragraf deskripsi halaman di atas kode yang diberikan.
Why is it displaying only 150 posts?
This is because Blogger Feed API is limited to maximum 150 posts in a single request.