{{ title | safe }}
{% if not hideMetadata %} diff --git a/_includes/layouts/quizzes.njk b/_includes/layouts/quizzes.njk new file mode 100644 index 0000000..7bfc0be --- /dev/null +++ b/_includes/layouts/quizzes.njk @@ -0,0 +1,53 @@ +--- +layout: layouts/post.njk +structuredData: none +--- +{{ content | safe }} +{{ picture.title }}
diff --git a/content/index.njk b/content/index.njk index 16bf6c1..f187486 100644 --- a/content/index.njk +++ b/content/index.njk @@ -6,59 +6,87 @@ eleventyNavigation: numberOfLatestPostsToShow: 3 numberOfNowPostsToShow: 1 numberOfGalleriesToShow: 1 +numberOfQuizzesToShow: 1 hideGalleryDescriptions: 1 --- -Latest gallery:
-{% set postsCount = galleries | length %} -{% set latestPostsCount = postsCount | min(numberOfNowPostsToShow) %} -{% set postslist = collections.now | head(-1 * numberOfNowPostsToShow) %} -{% set postslistCounter = postsCount %} -{% set showPostListHeader = false %} -{% include "gallerieslist.njk" %} +Latest gallery:
+ {% set postsCount = galleries | length %} + {% set latestPostsCount = postsCount | min(numberOfGalleriesToShow) %} + {% set postslist = galleries | head(-1 * numberOfGalleriesToShow) %} + {% set postslistCounter = postsCount %} + {% set showPostListHeader = false %} + {% include "gallerieslist.njk" %} -{% set morePosts = postsCount - numberOfNowPostsToShow %} -{% if morePosts > 0 %} - - - -{% endif %} - -Life updates:
-{% set postsCount = collections.now | length %} -{% set latestPostsCount = postsCount | min(numberOfNowPostsToShow) %} -{% set postslist = collections.now | head(-1 * numberOfNowPostsToShow) %} -{% set postslistCounter = postsCount %} -{% set showPostListHeader = false %} -{% include "postslist.njk" %} - -{% set morePosts = postsCount - numberOfNowPostsToShow %} -{% if morePosts > 0 %} - + {% set morePosts = postsCount - numberOfGalleriesToShow %} + {% if morePosts > 0 %} + -{% endif %} -Latest quiz:
+ {% set postsCount = collections.quiz | length %} + {% set latestPostsCount = postsCount | min(numberOfQuizzesToShow) %} + {% set postslist = collections.quiz | head(-1 * numberOfQuizzesToShow) %} + {% set postslistCounter = postsCount %} + {% set showPostListHeader = false %} + {% include "postslist.njk" %} -{% set morePosts = postsCount - numberOfLatestPostsToShow %} -{% if morePosts > 0 %} - - - -{% endif %} - - - + {% set morePosts = postsCount - numberOfQuizzesToShow %} + {% if morePosts > 0 %} + + + + {% endif %} +Life updates:
+ {% set postsCount = collections.now | length %} + {% set latestPostsCount = postsCount | min(numberOfNowPostsToShow) %} + {% set postslist = collections.now | head(-1 * numberOfNowPostsToShow) %} + {% set postslistCounter = postsCount %} + {% set showPostListHeader = false %} + {% include "postslist.njk" %} + + {% set morePosts = postsCount - numberOfNowPostsToShow %} + {% if morePosts > 0 %} + + + + {% endif %} +Quizzes
+Test your knowledge, learn about yourself, and waste your precious time, right here, right now, with a quiz!
+ +{% set postsCount = collections.quiz | length %} +Available Quizzes:
+{% set postslist = collections.quiz %} +{% set showPostListHeader = false %} +{% include "postslist.njk" %} diff --git a/content/quizzes/how-much-of-a-linux-nerd-are-you.md b/content/quizzes/how-much-of-a-linux-nerd-are-you.md new file mode 100644 index 0000000..741f007 --- /dev/null +++ b/content/quizzes/how-much-of-a-linux-nerd-are-you.md @@ -0,0 +1,302 @@ +--- +title: "How Much of a Linux Nerd are You?" +description: "A quiz to find out how much of a Linux (or should I say GNU/Linux) nerd you are." +date: 2025-02-02 +imageURL: "/img/Tux.svg" +imageAlt: "Tux the penguin." +consequences: + - title: "Why are you here?" + points: 0 + spiel: "Look, I don't know how you found yourself here, but I think your time might be better spent elsewhere!" + image: "/img/lost.gif" + imageAlt: "An animated GIF of Cookie Monster looking around in a confused manner and scratching his head." + - title: "You're a beginner" + points: 30 + spiel: "You know a couple things, but you're still just getting started on your Linux journey." + image: "/img/noob.gif" + imageAlt: "An animated GIF calling you a noob." + - title: "Linux user detected" + points: 60 + spiel: "You are a bona fide Linux user." + image: "/img/tuxfall.gif" + imageAlt: "An animated GIF of a gelatinous Tux falling from the sky and landing with a jiggle." + - title: "You're a Linux pro" + points: 90 + spiel: "You ain't scared of the terminal." + image: "/img/matrix.gif" + imageAlt: "An animated GIF of letters falling on a black screen, matrix style." + - title: "Certified Linux nerd" + points: 120 + spiel: "Fire up some tendies in celebration, because you are a certified Linux nerd. Frankly, I'm surprised you turned on JavaScript in your browser to complete this quiz!" + image: "/img/tendies.gif" + imageAlt: "An animated GIF of Post Malone eating tendies." + - title: "Linus… is that you?" + points: 150 + spiel: "Either you looked at the source code for this page, or you are a GNU/Linux god." + image: "/img/linus.gif" + imageAlt: "An animated GIF of Linus Torvalds speaking and flipping off the camera." +questions: + - title: "What is a kernel?" + image: + imageAlt: + imageCaption: + answers: + - name: "Some sort of seed or pit." + points: 0 + - name: "The part of an operating system that bridges software and hardware." + points: 5 + - name: "A piece of software that controls the desktop environment." + points: 0 + - name: "…another free component of a fully functioning GNU system…" + points: 10 + - title: "Which desktop environment is known for its unique workflow and consistent appearance?" + image: + imageAlt: + imageCaption: + answers: + - name: "GNOME" + points: 5 + - name: "KDE" + points: 0 + - name: "Cinnamon" + points: 0 + - name: "Xfce" + points: 0 + - title: "Which distro might someone use, BTW?" + image: + imageAlt: + imageCaption: + answers: + - name: "Debian" + points: 0 + - name: "openSUSE" + points: 0 + - name: "Fedora" + points: 0 + - name: "Arch" + points: 5 + - title: "Which utensil does :(){ :|:& };: bring to mind?" + image: + imageAlt: + imageCaption: + answers: + - name: "A Chopstick" + points: 0 + - name: "A Fork" + points: 5 + - name: "A Spoon" + points: 0 + - name: "A Knife" + points: 0 + - title: "Which of the following distros accidentally launched a DDOS attack on an upstream repo?" + image: + imageAlt: + imageCaption: + answers: + - name: "Garuda" + points: 0 + - name: "Nix" + points: 0 + - name: "Vanilla OS" + points: 0 + - name: "Manjaro" + points: 5 + - title: "Complete the sequence: sudo rm -rf" + image: + imageAlt: + imageCaption: + answers: + - name: "/" + points: 5 + - name: "*.jpg" + points: 0 + - name: "/dev/sda" + points: 0 + - name: "--no-preserve-root /" + points: 10 + - name: "*/." + points: 0 + - title: "What is your favorite package format?" + image: + imageAlt: + imageCaption: + answers: + - name: "Bubble wrap" + points: 0 + - name: "Snap" + points: -5 + - name: "Flatpak" + points: 5 + - name: "Native Packages" + points: 10 + - name: "AppImage" + points: 5 + - name: "Piping install scripts from GitHub to bash" + points: 0 + - title: "Desktop environment or window manager?" + image: + imageAlt: + imageCaption: + answers: + - name: "Desktop environment" + points: 0 + - name: "Window manager" + points: 5 + - name: "Both are bloat" + points: 10 + - title: "From memory, use the tar command to create a compressed tarball. Did you succeed?" + image: + imageAlt: + imageCaption: + answers: + - name: "Yes" + points: 5 + - name: "No" + points: 0 + - title: "Which command will make a train roll across your terminal?" + image: + imageAlt: + imageCaption: + answers: + - name: "sudo rm -rf /*" + points: 0 + - name: "dd if=/dev/zero bs=10G count=10000 | bzip2 -c > train.bz2" + points: 0 + - name: ":(){ :|:& };:" + points: 0 + - name: "sl" + points: 5 + - title: "Which of the following commands will successfully exit Vim?" + image: + imageAlt: + imageCaption: + answers: + - name: "ctrl+q" + points: 0 + - name: "exit" + points: 0 + - name: ":wq!" + points: 5 + - name: ":qv" + points: 0 + - title: "SystemD is…" + image: + imageAlt: + imageCaption: + answers: + - name: "A suite of basic building blocks for a Linux system" + points: 5 + - name: "A backup in case your Windows dual-boot eats your Linux install." + points: 0 + - name: "A utility to mount external drives." + points: 0 + - name: "Bloat" + points: 10 + - title: "Choose your favorite musical instrument:" + image: + imageAlt: + imageCaption: + answers: + - name: "🎸" + points: 0 + - name: "🎷" + points: 0 + - name: "GRUB" + points: 10 + - name: "🎻" + points: 0 + - title: "…won't be big and professional like…?" + image: + imageAlt: + imageCaption: + answers: + - name: "GNU" + points: 5 + - name: "Unix" + points: 0 + - name: "Windows Vista" + points: 0 + - name: "TempleOS" + points: 0 + - title: "Which would NOT be a fun surprise for Richard Stallman?" + image: + imageAlt: + imageCaption: + answers: + - name: "Buying a parrot" + points: 5 + - name: "A room temperature of 71℉" + points: 0 + - name: "Helping him cross the street" + points: 5 + - name: "A nice dinner with less than four people total" + points: 0 + - title: "What did Microsoft CEO Steve Ballmer call GNU/Linux?" + image: + imageAlt: + imageCaption: + answers: + - name: "A cancer" + points: 5 + - name: "An amateur effort" + points: 0 + - name: "Delightful" + points: 0 + - name: "Bloat" + points: 0 + - title: "What is your favorite animal?" + image: + imageAlt: + imageCaption: + answers: + - name: "🦊" + points: 10 + - name: "🐧" + points: 5 + - name: "🐢" + points: 0 + - name: "🪱" + points: 0 + - title: "Which distro is named after a husband and wife?" + image: + imageAlt: + imageCaption: + answers: + - name: "Trisquel" + points: 0 + - name: "Manjaro" + points: 0 + - name: "Ubuntu" + points: 0 + - name: "Debian" + points: 5 + - title: "Best package to install on a fresh Linux installation?" + image: + imageAlt: + imageCaption: + answers: + - name: "XZ 5.6.0" + points: 20 + - name: "Inkscape" + points: 5 + - name: "Timeshift" + points: 10 + - name: "Photoshop" + points: -5 + - title: "Which game console had an official Linux distro that users could buy and install?" + image: + imageAlt: + imageCaption: + answers: + - name: "PlayStation 2" + points: 5 + - name: "Nintendo 64" + points: 0 + - name: "Nintendo Wii" + points: 0 + - name: "Xbox 360" + points: 0 +--- +Are you *k*onfident in your KDE knowledge? Have you joined us now, shared the software, and spread the good *gn*ews about your newfound freedom? Do you find it *awk*ward when people use proprietary software? No more *Stall*ing; it's time to *find* out whether you're a true GNU/Linux nerd. + +*Note: please not type any of commands on this page into your terminal without first looking them up.* diff --git a/content/quizzes/quizzes.11tydata.js b/content/quizzes/quizzes.11tydata.js new file mode 100644 index 0000000..d1b7b5d --- /dev/null +++ b/content/quizzes/quizzes.11tydata.js @@ -0,0 +1,4 @@ +export default { + tags: ["quiz"], + layout: "layouts/quizzes.njk", +}; diff --git a/content/sitemap/index.njk b/content/sitemap/index.njk index 1ef0575..c5f542e 100644 --- a/content/sitemap/index.njk +++ b/content/sitemap/index.njk @@ -1,5 +1,5 @@ --- -layout: layouts/base_full_width_text.njk +layout: layouts/base.njk title: Nathan Upchurch | Sitemap structuredData: none --- @@ -25,5 +25,6 @@ structuredData: nonein section */ - > p:not(blockquote > p):last-child:after { - content: "\2766"; - display: inline; - font-size: var(--step-1); - } + p { + grid-column: var(--span-grid); + } + /* Add fleuron to last
in section */ + > p:not(blockquote > p):last-child:after { + content: "\2766"; + display: inline; + font-size: var(--step-1); } } ::selection { @@ -967,6 +968,7 @@ article.post { } } } + /* Add fleuron after
in article when footnotes are present */
p:has(+ hr.footnotes-sep):after {
content: "\2766";
@@ -974,6 +976,89 @@ p:has(+ hr.footnotes-sep):after {
font-size: var(--step-1);
}
+/* Quiz */
+.answerBox {
+ margin-bottom: var(--space-3xs);
+}
+.answersBox > input {
+ display: block;
+}
+details {
+ background-color: var(--card-color);
+ border: var(--border-details);
+ border-radius: var(--border-radius);
+ color: var(--text-color);
+ margin-top: var(--space-s);
+ padding: var(--space-xs);
+ width: 100%;
+ font-size: var(--step--2);
+ font-variation-settings: var(--font-variation-ui);
+ text-transform: uppercase;
+ letter-spacing: var(--ui-letter-spacing);
+ font-family: var(--font-family-ui);
+
+ ::marker {
+ content: "+ ";
+ }
+ &[open] p {
+ font-size: var(--step--2);
+ line-height: calc(var(--step--2) * 0.25 + var(--step--2));
+ }
+ &[open] summary::marker {
+ content: "- ";
+ }
+ &[open] summary {
+ border-bottom: var(--border-details);
+ margin-bottom: var(--space-xs);
+ padding-bottom: var(--space-xs);
+ }
+ summary {
+ font-size: var(--step--2);
+ font-variation-settings: var(--font-variation-ui);
+ text-transform: uppercase;
+ letter-spacing: var(--ui-letter-spacing);
+ font-family: var(--font-family-ui);
+ }
+}
+dialog {
+ background-color: var(--card-color);
+ border: none;
+ border-radius: var(--border-radius);
+ box-shadow: var(--box-shadow);
+ width: var(--grid-max-width);
+ h2 {
+ padding-top: 0;
+ }
+ p {
+ color: var(--text-color);
+ }
+ &::backdrop {
+ background-color: var(--contrast-color);
+ opacity: 0.5;
+ }
+ img {
+ max-width: 100%;
+ padding-top: var(--space-s);
+ }
+}
+.questionBox {
+ margin: var(--space-s) 0;
+ figure {
+ padding-top: 0;
+ padding-bottom: 0;
+ }
+}
+.quizQuestion {
+ font-size: var(--step-2);
+ font-variation-settings:
+ "opsz" 50,
+ "wght" 350,
+ "SOFT" 20,
+ "WONK" 1;
+ line-height: calc(var(--step-2) * 0.25 + var(--step-2));
+ padding-bottom: var(--space-s);
+ padding-top: var(--space-s);
+}
/* Utilities */
.grid-container {
max-width: var(--grid-max-width);
diff --git a/public/img/Tux.svg b/public/img/Tux.svg
new file mode 100644
index 0000000..7a74562
--- /dev/null
+++ b/public/img/Tux.svg
@@ -0,0 +1,1591 @@
+
+
+
+
diff --git a/public/img/linus.gif b/public/img/linus.gif
new file mode 100644
index 0000000..8889360
Binary files /dev/null and b/public/img/linus.gif differ
diff --git a/public/img/lost.gif b/public/img/lost.gif
new file mode 100644
index 0000000..c88b93a
Binary files /dev/null and b/public/img/lost.gif differ
diff --git a/public/img/lukasz-rawa-NL02eAwtkmM-unsplash.webp b/public/img/lukasz-rawa-NL02eAwtkmM-unsplash.webp
new file mode 100644
index 0000000..115c72a
Binary files /dev/null and b/public/img/lukasz-rawa-NL02eAwtkmM-unsplash.webp differ
diff --git a/public/img/matrix.gif b/public/img/matrix.gif
new file mode 100644
index 0000000..c34de69
Binary files /dev/null and b/public/img/matrix.gif differ
diff --git a/public/img/noob.gif b/public/img/noob.gif
new file mode 100644
index 0000000..1b9bb16
Binary files /dev/null and b/public/img/noob.gif differ
diff --git a/public/img/rammsteinShow_copy.webp b/public/img/rammsteinShow_copy.webp
new file mode 100644
index 0000000..e37cda6
Binary files /dev/null and b/public/img/rammsteinShow_copy.webp differ
diff --git a/public/img/rammstein_incense_cones.webp b/public/img/rammstein_incense_cones.webp
new file mode 100644
index 0000000..ebc1d85
Binary files /dev/null and b/public/img/rammstein_incense_cones.webp differ
diff --git a/public/img/tendies.gif b/public/img/tendies.gif
new file mode 100644
index 0000000..6e7cd38
Binary files /dev/null and b/public/img/tendies.gif differ
diff --git a/public/img/tuxfall.gif b/public/img/tuxfall.gif
new file mode 100644
index 0000000..3590f27
Binary files /dev/null and b/public/img/tuxfall.gif differ
diff --git a/public/js/quiz.js b/public/js/quiz.js
new file mode 100644
index 0000000..4e98954
--- /dev/null
+++ b/public/js/quiz.js
@@ -0,0 +1,43 @@
+const score = (answers) => {
+ let total = 0;
+ let scores = [];
+ for (let i = 0; i < answers.length; i++) {
+ const questionNumber = answers[i].name;
+ if (answers[i].checked) {
+ total += Number(answers[i].value);
+ scores.push({
+ questionNumber: questionNumber,
+ points: answers[i].value,
+ });
+ }
+ }
+ return { totalPoints: total, scores: scores };
+};
+
+const dishOutConsequences = (consequences, points) => {
+ for (let i = consequences.length - 1; i >= 0; i--) {
+ if (points >= Number(consequences[i].dataset.pointsThreshold)) {
+ consequences[i].showModal();
+ return;
+ }
+ }
+};
+
+const populateDetails = (detailsElement, scores, total) => {
+ detailsElement.innerHTML = `Total Score: ${total} points
`;
+ for (let i = 0; i < scores.length; i++) {
+ detailsElement.innerHTML += `
Question ${scores[i].questionNumber >= 10 ? scores[i].questionNumber : "0" + scores[i].questionNumber}: ${scores[i].points} points`;
+ }
+};
+
+const handleQuizSubmit = () => {
+ const answers = document.getElementsByClassName("answer");
+ const consequences = document.getElementsByClassName("consequence");
+ const details = document.getElementsByClassName("scoreDetails");
+ const totalPoints = score(answers).totalPoints;
+ const scoreDetails = score(answers).scores;
+ for (let i = 0; i < details.length; i++) {
+ populateDetails(details[i], scoreDetails, totalPoints);
+ }
+ dishOutConsequences(consequences, totalPoints);
+};