<div class='sitemap-wrap'><div class='sitemap-top'><select id='mainDropdown'><option value='all'>All posts</option></select><select id='sortSelect'><option value='published'>Published</option><option value='updated'>Updated</option></select><button id='orderBtn'>↓</button></div><div id='postsContainer'><div class='loading'>Loading...</div></div></div><style>.sitemap-wrap{max-width:800px;margin:auto;padding:15px}.sitemap-top{display:flex;gap:8px;margin-bottom:15px}.sitemap-top select,.sitemap-top button{flex:1;padding:7px 8px;border:1px solid var(--contentL);background:none;color:var(--bodyC);font-size:13px;border-radius:6px}.sitemap-top button{max-width:55px}.post-item{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid var(--contentL)}.post-thumb{width:70px;height:70px;flex-shrink:0;overflow:hidden;border-radius:6px}.post-thumb img{width:100%;height:100%;object-fit:cover}.post-title{font-size:.9rem;font-weight:500}.post-title a{text-decoration:none;color:var(--bodyC)}.post-title a:hover{color:var(--linkC)}.post-date{font-size:.65rem;opacity:.7;margin-top:3px}.loading{text-align:center;padding:15px;opacity:.7}.sitemap-wrap select{background:var(--contentB);color:var(--bodyC);font-family:'Inter' sans-serif}</style><script>!function(){var S={posts:[],labels:[],pages:[],mode:'all',value:'',sort:'published',orderDesc:!0};function t(e){if(e.media$thumbnail)return e.media$thumbnail.url.replace(/\/s[0-9]+(-c)?/,'/s160-c');var t=e.content?e.content.$t:'',a=t.match(/<img[^>]+src="([^">]+)"/);return a?a[1]:''}function e(e,t){var a=document.createElement('script');a.src=e+'&alt=json-in-script&callback=cb',window.cb=function(e){delete window.cb,document.body.removeChild(a),t(e)},document.body.appendChild(a)}function load(){e(location.origin+'/feeds/posts/default?max-results=500',function(e){if(e.feed&&e.feed.entry){S.posts=e.feed.entry.map(function(e){var a=e.link.find(function(e){return'alternate'===e.rel}).href;return{title:e.title.$t,url:a,published:new Date(e.published.$t),updated:new Date(e.updated.$t),labels:e.category?e.category.map(function(e){return e.term}):[],thumbnail:t(e)}});var a=new Map;S.posts.forEach(function(e){e.labels.forEach(function(t){a.has(t)?a.get(t).push(e):a.set(t,[e])})}),S.labels=Array.from(a.keys()).sort().map(function(e){return{name:e,count:a.get(e).length}}),loadPages(),renderDropdown(),render()}else document.getElementById('postsContainer').innerHTML='<div class="loading">No posts</div>'})}function loadPages(){e(location.origin+'/feeds/pages/default?max-results=50',function(e){if(e.feed&&e.feed.entry){S.pages=e.feed.entry.map(function(e){return{title:e.title.$t,url:e.link.find(function(e){return'alternate'===e.rel}).href,published:new Date(e.published.$t)}})}renderDropdown()})}function renderDropdown(){var d=document.getElementById('mainDropdown');if(!d)return;var h='<option value="all">All posts ('+S.posts.length+')</option>';if(S.labels.length){h+='<optgroup label="Labels">';S.labels.forEach(function(e){h+='<option value="label:'+e.name+'">'+e.name+' ('+e.count+')</option>'});h+='</optgroup>'}if(S.pages.length){h+='<optgroup label="Other"><option value="pages">Pages ('+S.pages.length+')</option></optgroup>'}d.innerHTML=h;d.onchange=function(){var v=this.value;if(v==='all'){S.mode='all'}else if(v.startsWith('label:')){S.mode='label';S.value=v.replace('label:','')}else if(v==='pages'){S.mode='page'}render()}}function sortPosts(e){var t=e.slice();return t.sort(function(e,t){var a='published'===S.sort?e.published:e.updated,n='published'===S.sort?t.published:t.updated;return S.orderDesc?n-a:a-n}),t}function render(){var e=[];if(S.mode==='label')e=S.posts.filter(function(e){return e.labels.indexOf(S.value)!==-1});else if(S.mode==='page'){e=S.pages}else e=S.posts;var t=sortPosts(e);if(!t.length)return void(document.getElementById('postsContainer').innerHTML='<div class="loading">No items</div>');var a='';t.forEach(function(e){var t=e.thumbnail||'data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=',n=e.published,o=n.toLocaleDateString(void 0,{year:'numeric',month:'short',day:'numeric'});a+='<div class="post-item"><div class="post-thumb">'+(S.mode!=='page'?'<img src="'+t+'">':'')+'</div><div><div class="post-title"><a href="'+e.url+'">'+e.title+'</a></div><div class="post-date">'+o+'</div></div></div>'}),document.getElementById('postsContainer').innerHTML=a}document.getElementById('sortSelect').onchange=function(e){S.sort=e.target.value,render()},document.getElementById('orderBtn').onclick=function(){S.orderDesc=!S.orderDesc,this.innerHTML=S.orderDesc?'↓':'↑',render()},load()}();</script>