diff --git a/assets/js/commands/navigation.js b/assets/js/commands/navigation.js index 5efd761..aa98e5d 100644 --- a/assets/js/commands/navigation.js +++ b/assets/js/commands/navigation.js @@ -46,6 +46,15 @@ window.terminal.registerCommand("reload", "Reload the current page", () => { // PAGE NAVIGATION +window.terminal.registerCommand( + "latest", + "View the latest post, regardles of section", + () => { + let latestPostLink = document.getElementById("latest-post-link"); + window.location.href = latestPostLink.textContent; + }, +); + // About command window.terminal.registerCommand("about", "About this site", () => { window.location.href = "/about/"; diff --git a/assets/js/terminal.js b/assets/js/terminal.js index 45ff5e8..aa96f63 100644 --- a/assets/js/terminal.js +++ b/assets/js/terminal.js @@ -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( + "Latest Post: " + + latestPostTitle.innerText + + " (" + + latestPostDate.innerText + + ")", + ); + this.printHTML( + " - Type \"latest\" to view it.", + ); + this.printHTML(" "); + this.printHTML( 'Type "help" for available commands.', ); this.printHTML( - 'This site is under contstruction. There\'s nothing of interest here yet.', + 'This site is under construction. There\'s nothing of interest here yet.', ); this.inputContainer.classList.remove("hidden"); diff --git a/assets/sass/partials/_music.scss b/assets/sass/partials/_music.scss index bb3bf60..8500d20 100644 --- a/assets/sass/partials/_music.scss +++ b/assets/sass/partials/_music.scss @@ -22,6 +22,7 @@ border-radius: 5px; background-color: black; opacity: 0; + transition: opacity 0.3s ease; } .music:hover .music-text { diff --git a/assets/sass/style.scss b/assets/sass/style.scss index 12863f0..f5d6983 100644 --- a/assets/sass/style.scss +++ b/assets/sass/style.scss @@ -23,6 +23,10 @@ body { position: relative; } +.latest-post { + display: none; +} + @keyframes flicker { 0% { opacity: 0.27861; diff --git a/layouts/index.html b/layouts/index.html index 3742e3c..92376c3 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -420,4 +420,11 @@ unix 3 [ ] STREAM CONNECTED 50896 /run/user/1000/bus -{{ end }} + +{{ range first 1 (where .Site.RegularPages "Type" "posts") }} +