Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/blog/rust-supply-chain-security/cisa.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
343 changes: 343 additions & 0 deletions content/blog/rust-supply-chain-security/index.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
230 changes: 80 additions & 150 deletions content/services/_index.md

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions sass/_faq.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
margin-bottom: 1rem;
box-shadow: 0 2px 5px rgba($darkBgrd, 0.1);
overflow: hidden;
transition: all 0.3s ease;
}

.faq-item:hover {
box-shadow: 0 5px 15px rgba($darkBgrd, 0.2);
}

.faq-item summary {
Expand Down
84 changes: 84 additions & 0 deletions templates/shortcodes/faq.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{# FAQ shortcode: renders a styled FAQ section with Google-compliant FAQPage JSON-LD.

Usage in markdown:

{% faq() %}
[
{
"q": "Your question here?",
"a": "Your answer here."
},
{
"q": "Another question?",
"a": "Another answer with <a href='/link'>HTML</a> supported."
}
]
{% end %}

The body must be a valid JSON array of objects with "q" and "a" keys.
HTML is allowed in answers for links and formatting.
#}

<div class="faq-section" id="faq-root">
<noscript>
<p>Please enable JavaScript to view the FAQ section.</p>
</noscript>
</div>

<script>
(function() {
var items = {{ body | safe }};
var root = document.currentScript.previousElementSibling;
while (root && !root.classList.contains('faq-section')) {
root = root.previousElementSibling;
}
if (!root) return;

// Clear noscript fallback
root.innerHTML = '';

// Build visible FAQ items
items.forEach(function(item) {
var details = document.createElement('details');
details.className = 'faq-item';

var summary = document.createElement('summary');
summary.textContent = item.q;
details.appendChild(summary);

var answer = document.createElement('div');
answer.className = 'faq-answer';
// Split on double newlines to create paragraphs, single content gets one <p>
var paragraphs = item.a.split('\n\n');
paragraphs.forEach(function(text) {
var p = document.createElement('p');
p.innerHTML = text.trim();
answer.appendChild(p);
});
details.appendChild(answer);

root.appendChild(details);
});

// Build FAQPage JSON-LD structured data
var ld = {
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": items.map(function(item) {
return {
"@type": "Question",
"name": item.q,
"acceptedAnswer": {
"@type": "Answer",
"text": item.a
}
};
})
};

var script = document.createElement('script');
script.type = 'application/ld+json';
script.textContent = JSON.stringify(ld);
document.head.appendChild(script);
})();
</script>