Skip to content

Commit 76ad65f

Browse files
committed
feat(faq): migrate FAQ page to local repository domain
- Move FAQ content from external source to local repository - Update FAQ styling and layout for better readability Signed-off-by: Daniel Phillips <[email protected]>
1 parent f452fc8 commit 76ad65f

File tree

3 files changed

+117
-68
lines changed

3 files changed

+117
-68
lines changed

build/init-topics-and-clients.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ do
4040
base=${fname##*/}
4141
topic=${base%.*}
4242

43+
# Skip faq.md so it is never overwritten
44+
if [[ "$topic" == "faq" ]]; then
45+
continue
46+
fi
47+
4348
if [[ "$topic" != "index" ]]; then
4449
if [ -f "./build/custom-frontmatter/topics/$topic.toml" ]; then
4550
echo "+++" >> "./content/topics/$topic.md"

sass/_valkey.scss

Lines changed: 92 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,95 +1924,120 @@ pre table {
19241924
}
19251925
}
19261926

1927-
1928-
19291927
.faq-container {
19301928
max-width: 100%;
19311929
background-color: #fff;
19321930
padding: 2rem 2rem 0.1rem;
19331931
}
19341932

1935-
/* FAQ Section Containers */
1936-
.faq-section {
1937-
background: rgba(104, 147, 255, 0.1);
1938-
margin-bottom: 2rem;
1939-
padding: 2rem;
1940-
}
1941-
1942-
.faq-section h2 {
1933+
.faq-container h2 {
19431934
font-size: 16px;
19441935
font-weight: 700;
19451936
color: #30176E;
1946-
margin: 0 0 -1rem;
1937+
margin: 0 0 0.25rem;
19471938
}
19481939

1949-
.faq-section h3 {
1950-
font-size: 16px;
1951-
background:rgba(104, 147, 255, 0.1);
1952-
font-weight: 600;
1953-
cursor: pointer;
1954-
margin: 2rem 0 0;
1955-
padding: 1.25rem;
1956-
position: relative;
1957-
transition: all 0.2s ease;
1958-
color: #1A2026;
1959-
}
19601940

1961-
.faq-section p,
1962-
.faq-section ul {
1963-
font-size: 16px;
1964-
background-color: #fff;
1965-
padding: 1rem 2rem;
1966-
margin: 0;
1941+
/* FAQ Section Containers */
1942+
.faq-section {
1943+
background: rgba(104, 147, 255, 0.1);
1944+
margin-bottom: 2rem;
1945+
padding: 2rem;
19671946
}
19681947

1969-
.faq-section ul, .faq-section ol {
1970-
margin: 0;
1971-
padding-left: 3.5rem;
1972-
}
1948+
.faq-item {
1949+
margin: 0 0 1rem;
19731950

1974-
.faq-section li {
1975-
margin-bottom: 0.8rem;
1976-
line-height: 1.6;
1977-
}
1951+
&:last-child {
1952+
margin: 0;
1953+
}
19781954

1979-
.faq-section code {
1980-
background-color: #f1f3f4;
1981-
padding: 0.2rem 0.4rem;
1982-
border-radius: 4px;
1983-
font-family: 'Fira Mono', monospace;
1984-
font-size: 1.4rem;
1985-
color: #d63384;
1986-
}
1955+
h3 {
1956+
font-size: 16px;
1957+
background:rgba(104, 147, 255, 0.1);
1958+
font-weight: 600;
1959+
cursor: pointer;
1960+
margin: 0 0 1px;
1961+
padding: 1.25rem;
1962+
position: relative;
1963+
transition: all 0.2s ease;
1964+
color: #1A2026;
19871965

1988-
.faq-section pre {
1989-
background-color: #f8f9fa;
1990-
padding: 1.6rem;
1991-
border-radius: 4px;
1992-
overflow-x: auto;
1993-
margin: 1.6rem 0;
1994-
border: 1px solid #e1e5e9;
1995-
}
1966+
&:hover {
1967+
background:rgba(58, 67, 88, 0.1);
19961968

1997-
.faq-section pre code {
1998-
background: none;
1999-
padding: 0;
2000-
color: #333;
2001-
}
1969+
}
1970+
}
20021971

2003-
.faq-section a {
2004-
color: #30176E;
2005-
text-decoration: underline;
2006-
}
1972+
.faq-answer {
1973+
padding: 1rem;
1974+
font-size: 16px;
1975+
}
20071976

2008-
.faq-section a:hover {
2009-
text-decoration: underline;
2010-
}
1977+
&.open {
1978+
1979+
h3,
1980+
.faq-answer {
1981+
background: #fff;
1982+
}
1983+
}
20111984

2012-
.faq-section p + ul,
2013-
.faq-section p + ol,
2014-
.faq-section p + p {
1985+
p,
1986+
ul {
1987+
font-size: 16px;
1988+
background-color: #fff;
1989+
padding: 1rem 2rem;
1990+
margin: 0;
1991+
}
1992+
1993+
ul, ol {
1994+
margin: 0;
1995+
padding-left: 3.5rem;
1996+
}
1997+
1998+
li {
1999+
margin-bottom: 0.8rem;
2000+
line-height: 1.6;
2001+
}
2002+
2003+
code {
2004+
background-color: #f1f3f4;
2005+
padding: 0.2rem 0.4rem;
2006+
border-radius: 4px;
2007+
font-family: 'Fira Mono', monospace;
2008+
font-size: 1.4rem;
2009+
color: #d63384;
2010+
}
2011+
2012+
pre {
2013+
background-color: #f8f9fa;
2014+
padding: 1.6rem;
2015+
border-radius: 4px;
2016+
overflow-x: auto;
2017+
margin: 1.6rem 0;
2018+
border: 1px solid #e1e5e9;
2019+
}
2020+
2021+
pre code {
2022+
background: none;
2023+
padding: 0;
2024+
color: #fff;
2025+
}
2026+
2027+
a {
2028+
color: #30176E;
2029+
text-decoration: underline;
2030+
}
2031+
2032+
a:hover {
2033+
text-decoration: underline;
2034+
}
2035+
2036+
ul,
2037+
ol,
2038+
p {
20152039
padding-top: 0;
2040+
}
20162041
}
20172042

20182043
/* Category navigation */

templates/faq.html

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,23 @@ <h2>CATEGORIES</h2>
4545
</div>
4646
</main>
4747
</div>
48-
{% endblock content %}
48+
<script>
49+
document.addEventListener('DOMContentLoaded', function() {
50+
document.querySelectorAll('.faq-question').forEach(function(question) {
51+
question.style.cursor = 'pointer';
52+
question.addEventListener('click', function() {
53+
var answer = question.nextElementSibling;
54+
if (answer && answer.classList.contains('faq-answer')) {
55+
answer.style.display = (answer.style.display === 'none' || !answer.style.display) ? 'block' : 'none';
56+
question.parentElement.classList.toggle('open');
57+
}
58+
});
59+
// Optionally start collapsed:
60+
var answer = question.nextElementSibling;
61+
if (answer && answer.classList.contains('faq-answer')) {
62+
answer.style.display = 'none';
63+
}
64+
});
65+
});
66+
</script>
67+
{% endblock content %}

0 commit comments

Comments
 (0)