Added in the 'latest' command and display latest post in terminal boot

This commit is contained in:
Dan 2025-12-08 14:52:34 +00:00
parent 99e89f7e84
commit e58896cc52
5 changed files with 40 additions and 2 deletions

View file

@ -46,12 +46,29 @@ class TerminalShell {
this.scrollToBottom();
}
this.printHTML(" ");
// Get latest post info
let latestPostTitle = document.getElementById("latest-post-title");
let latestPostDate = document.getElementById("latest-post-date");
this.printHTML(
"<span class='info'>Latest Post: </span>" +
latestPostTitle.innerText +
" (" +
latestPostDate.innerText +
")",
);
this.printHTML(
"<span class='info'>&nbsp;- Type \"latest\" to view it.</span>",
);
this.printHTML("&nbsp;");
this.printHTML(
'<span class="info">Type "help" for available commands.</span>',
);
this.printHTML(
'<span class="warning">This site is under contstruction. There\'s nothing of interest here yet.</span>',
'<span class="warning">This site is under construction. There\'s nothing of interest here yet.</span>',
);
this.inputContainer.classList.remove("hidden");