From 5396af296d600be718ac5f0d68db5ffcbb08e549 Mon Sep 17 00:00:00 2001 From: andwati Date: Wed, 11 Mar 2026 22:37:33 +0300 Subject: [PATCH] feat: Add callout and YouTube shortcodes, implement related posts, enable view transitions, and update profile with YouTube link. --- TODO.md | 30 ------ content/about.md | 2 + sass/_article.scss | 140 ++++++++++++++++++++++++++ sass/_transitions.scss | 55 ++++++++++ sass/main.scss | 1 + templates/base.html | 6 +- templates/page.html | 2 + templates/partials/head.html | 5 +- templates/partials/profile.html | 5 + templates/partials/related-posts.html | 37 +++++++ templates/shortcodes/danger.html | 9 ++ templates/shortcodes/note.html | 9 ++ templates/shortcodes/tip.html | 9 ++ templates/shortcodes/warning.html | 9 ++ templates/shortcodes/youtube.html | 8 ++ zola.toml | 1 + 16 files changed, 294 insertions(+), 34 deletions(-) create mode 100644 sass/_transitions.scss create mode 100644 templates/partials/related-posts.html create mode 100644 templates/shortcodes/danger.html create mode 100644 templates/shortcodes/note.html create mode 100644 templates/shortcodes/tip.html create mode 100644 templates/shortcodes/warning.html create mode 100644 templates/shortcodes/youtube.html diff --git a/TODO.md b/TODO.md index 8f206d2..e69de29 100644 --- a/TODO.md +++ b/TODO.md @@ -1,30 +0,0 @@ -# TODO — pwnforfunandprofit.xyz - -Feature backlog for the blog. Check off items as they're implemented. - ---- - -## Discovery & Navigation - -- [ ] **Related posts** — show 2–3 posts with overlapping tags at the bottom of each post -- [ ] **Post series support** — `series` front-matter field; render a "Part N of X" callout with links to all parts in the series - ---- - -## Content Enhancements - -- [ ] **Callout / admonition shortcodes** — `{% note %}`, `{% warning %}`, `{% tip %}`, `{% danger %}` Tera shortcodes styled as terminal callout boxes - ---- - -## Post List & Filtering - ---- - -## UI / UX Polish - -- [ ] **Smooth page transitions** — CSS View Transitions API for navigation between pages - -## Distribution & Reach - -- [ ] **Newsletter / email subscription** — integrate Buttondown or self-hosted Listmonk with a subscribe form diff --git a/content/about.md b/content/about.md index 124d2a4..5d36b39 100644 --- a/content/about.md +++ b/content/about.md @@ -10,3 +10,5 @@ Welcome to **pwnforfunandprofit**, your home for all things binary exploitation, In a world increasingly built on code, understanding its vulnerabilities is not just a niche skill; it's a superpower. Here, we're not just reading about exploits; we're _crafting_ them. We're not just looking at binaries; we're _disassembling_ them. And we're not just talking about offensive security; we're _doing_ it. My mission is simple yet ambitious: to transform the daunting landscapes of low-level security into accessible, engaging, and ultimately, empowering knowledge. Whether you're aiming to land that dream cybersecurity role, dominate CTF leaderboards, uncover critical bugs, or satisfy a deep intellectual curiosity, I'm here to guide you. + +You can also find video versions of my teardowns and explorations on my **[YouTube Channel](https://www.youtube.com/@pwnforfunandprofit)**. diff --git a/sass/_article.scss b/sass/_article.scss index 90f68a7..f3f05c7 100644 --- a/sass/_article.scss +++ b/sass/_article.scss @@ -260,3 +260,143 @@ text-align: right; } } + +// ────────────────────────────────────────── +// Media Wrappers (YouTube, etc) +// ────────────────────────────────────────── +.youtube-wrapper { + position: relative; + width: 100%; + aspect-ratio: 16 / 9; + border-radius: 8px; + overflow: hidden; + border: 1px solid var(--border-color); + margin: 2rem 0; + background: #000; + + iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; + } +} + +// ────────────────────────────────────────── +// Callouts / Admonitions +// ────────────────────────────────────────── +.callout { + margin: 2rem 0; + padding: 1.25rem 1.5rem; + border-radius: 6px; + border-left: 4px solid var(--callout-color, var(--border-color)); + background: var(--surface-color); + color: var(--text-color); + font-size: 0.95rem; + line-height: 1.6; + + .callout-header { + display: flex; + align-items: center; + gap: 0.5rem; + margin-bottom: 0.5rem; + font-weight: 600; + color: var(--callout-color, var(--heading-color)); + } + + .callout-icon { + width: 1.25rem; + height: 1.25rem; + flex-shrink: 0; + } + + .callout-title { + font-family: var(--font-mono); + text-transform: uppercase; + letter-spacing: 0.05em; + font-size: 0.85rem; + } + + .callout-content { + > :first-child { + margin-top: 0; + } + > :last-child { + margin-bottom: 0; + } + } + + // Variants + &.callout-note { + --callout-color: #3b82f6; // Blue + background: rgba(59, 130, 246, 0.05); + } + + &.callout-warning { + --callout-color: #f59e0b; // Amber + background: rgba(245, 158, 11, 0.05); + } + + &.callout-tip { + --callout-color: #10b981; // Emerald + background: rgba(16, 185, 129, 0.05); + } + + &.callout-danger { + --callout-color: #ef4444; // Red + background: rgba(239, 68, 68, 0.05); + } +} + +// ────────────────────────────────────────── +// Related Posts +// ────────────────────────────────────────── +.related-posts-section { + margin-top: 4rem; + padding-top: 2rem; + border-top: 1px dashed var(--border-color); + + h3 { + margin-bottom: 2rem; + font-size: 1.5rem; + color: var(--heading-color); + letter-spacing: -0.02em; + } + + .related-posts-grid { + display: grid; + grid-template-columns: 1fr; + gap: 2rem; + + @media (min-width: 768px) { + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 2.5rem; + } + + // Override some constraints from feed-page cards when inside the grid + .feed-item { + border-bottom: none !important; + padding-bottom: 0 !important; + background: var(--surface-color); + border: 1px solid var(--border-color); + border-radius: 8px; + padding: 1.5rem !important; + height: 100%; + display: flex; + flex-direction: column; + transition: var(--transition-smooth); + + &:hover { + border-color: var(--accent-color); + transform: translateY(-4px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); + } + + .item-snippet { + flex: 1; + } + } + } +} diff --git a/sass/_transitions.scss b/sass/_transitions.scss new file mode 100644 index 0000000..dd8a08c --- /dev/null +++ b/sass/_transitions.scss @@ -0,0 +1,55 @@ +/* + * Cross-Document View Transitions + * Enabled via + */ + +// Disable default CSS transitions on the whole page during a view transition +// so they don't fight with the View Transition API animation. +html::view-transition-group(*) { + animation-duration: 0.3s; + animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); +} + +// Custom animation for the old page leaving +@keyframes fade-out-scale { + from { + opacity: 1; + transform: scale(1); + } + to { + opacity: 0; + transform: scale(0.98); + } +} + +// Custom animation for the new page entering +@keyframes fade-in-scale { + from { + opacity: 0; + transform: scale(1.02); + } + to { + opacity: 1; + transform: scale(1); + } +} + +// Apply the custom animations to the root view transition pseudo-elements +html::view-transition-old(root) { + animation: fade-out-scale 0.25s cubic-bezier(0.4, 0, 1, 1) both; +} + +html::view-transition-new(root) { + animation: fade-in-scale 0.35s cubic-bezier(0, 0, 0.2, 1) both; + // Delay slightly so the old page fades down first before the new one pops over + animation-delay: 0.05s; +} + +// Respect user preference for reduced motion +@media (prefers-reduced-motion: reduce) { + html::view-transition-group(*), + html::view-transition-old(*), + html::view-transition-new(*) { + animation: none !important; + } +} diff --git a/sass/main.scss b/sass/main.scss index 7085875..d4f611b 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -12,5 +12,6 @@ @import 'article'; @import 'footer'; @import 'search'; +@import 'transitions'; @import 'utilities'; @import 'scroll-top'; diff --git a/templates/base.html b/templates/base.html index f3b46bb..c346cdf 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,6 +5,7 @@ {% block title %}{{ config.title }}{% endblock title %} + @@ -67,8 +68,9 @@ "name": "{{ config.extra.author | default(value="mockingspectre") }}", "url": "{{ config.base_url }}/about/", "sameAs": [ - {% if config.extra.github_url %}"{{ config.extra.github_url }}"{% if config.extra.twitter_url %},{% endif %}{% endif %} - {% if config.extra.twitter_url %}"{{ config.extra.twitter_url }}"{% endif %} + {% if config.extra.github_url %}"{{ config.extra.github_url }}"{% if config.extra.twitter_url or config.extra.youtube_url %},{% endif %}{% endif %} + {% if config.extra.twitter_url %}"{{ config.extra.twitter_url }}"{% if config.extra.youtube_url %},{% endif %}{% endif %} + {% if config.extra.youtube_url %}"{{ config.extra.youtube_url }}"{% endif %} ] } ] diff --git a/templates/page.html b/templates/page.html index 3b43c7f..50da690 100644 --- a/templates/page.html +++ b/templates/page.html @@ -124,6 +124,8 @@ {% include "partials/post-nav.html" %} + {% include "partials/related-posts.html" %} +