diff --git a/dist/blogIndex.js b/dist/blogIndex.js index f950af3..316c370 100644 --- a/dist/blogIndex.js +++ b/dist/blogIndex.js @@ -1 +1 @@ -({481:function(){var t=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}a((r=r.apply(t,e||[])).next())}))},e=this&&this.__generator||function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]0&&i[i.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]BEAR.OOPS.WTF

Page created: January 26, 2024

-

Page last modified: January 26, 2024

+

Page last modified: March 4, 2024

Pages I think are cool:

diff --git a/dist/sitemap.xml b/dist/sitemap.xml index 6cac991..6e3e109 100644 --- a/dist/sitemap.xml +++ b/dist/sitemap.xml @@ -3,6 +3,7 @@ https://bear.oops.wtf/418.html https://bear.oops.wtf/blog/firstPost.html https://bear.oops.wtf/blog/index.html +https://bear.oops.wtf/blog/secondPost.html https://bear.oops.wtf/coolLinks.html https://bear.oops.wtf/git/index.html https://bear.oops.wtf/index.html diff --git a/js/blogIndex.ts b/js/blogIndex.ts index c8c595a..c3ef592 100644 --- a/js/blogIndex.ts +++ b/js/blogIndex.ts @@ -1,17 +1,18 @@ async function convertCamelCaseToReadable(text: string): Promise { - return await text + // i have no idea how this regex works + return await text .replace(/([a-z])([A-Z])/g, '$1 $2') .replace(/(\d{4}-\d{2}-\d{2})/g, ' $1') .replace(/\b\w/g, c => c.toUpperCase()); } async function blogIndex(): Promise { - if (!document.getElementById('blogIndex') || !document.getElementById('latestPost')) return; + if (!document.getElementById('blogIndex') || !document.getElementById('latestPost')) return; - document.getElementById('blogIndex')!.innerHTML = ""; - document.getElementById('latestPost')!.innerHTML = ""; + document.getElementById('blogIndex')!.innerHTML = ""; + document.getElementById('latestPost')!.innerHTML = ""; - fetch("/blogindex.txt") + fetch("/blogindex.txt") .then(response => response.text()) .then(data => { const uriList = data.split('\n'); @@ -24,19 +25,29 @@ async function blogIndex(): Promise { entries.sort((a, b) => b.timestamp - a.timestamp); const ulElement = document.createElement('ul'); - + entries.forEach(async entry => { if (entry.uri) { const fileName = entry.uri.split('/').pop()!.replace('.html', ''); - const readableName = await convertCamelCaseToReadable(fileName); - + const readableName = `${await convertCamelCaseToReadable(fileName)}`; + if (fileName.toLowerCase() !== 'index') { const liElement = document.createElement('li'); const aElement = document.createElement('a'); + const pElement = document.createElement('p'); + liElement.style.whiteSpace = "nowrap"; + pElement.style.gap = "10px"; + + pElement.textContent = `${new Intl.DateTimeFormat(navigator.language).format(new Date(entry.timestamp * 1000))}⠀`; aElement.href = entry.uri.substring(entry.uri.indexOf('/blog/')); aElement.textContent = readableName; + + aElement.style.display = "inline-block"; + pElement.style.display = "inline-block"; + + liElement.appendChild(pElement); liElement.appendChild(aElement); ulElement.appendChild(liElement); } diff --git a/src/coolLinks.md b/src/coolLinks.md index 74405ba..27050f5 100644 --- a/src/coolLinks.md +++ b/src/coolLinks.md @@ -2,7 +2,7 @@ title: Blog Index author: BearFM date: January 26, 2024 -modified: January 26, 2024 +modified: March 4, 2024 header: ---