Skip to content

Commit 1bb87b8

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 <phiro56@gmail.com>
1 parent 42b2133 commit 1bb87b8

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
@@ -1933,95 +1933,120 @@ pre table {
19331933
}
19341934
}
19351935

1936-
1937-
19381936
.faq-container {
19391937
max-width: 100%;
19401938
background-color: #fff;
19411939
padding: 2rem 2rem 0.1rem;
19421940
}
19431941

1944-
/* FAQ Section Containers */
1945-
.faq-section {
1946-
background: rgba(104, 147, 255, 0.1);
1947-
margin-bottom: 2rem;
1948-
padding: 2rem;
1949-
}
1950-
1951-
.faq-section h2 {
1942+
.faq-container h2 {
19521943
font-size: 16px;
19531944
font-weight: 700;
19541945
color: #30176E;
1955-
margin: 0 0 -1rem;
1946+
margin: 0 0 0.25rem;
19561947
}
19571948

1958-
.faq-section h3 {
1959-
font-size: 16px;
1960-
background:rgba(104, 147, 255, 0.1);
1961-
font-weight: 600;
1962-
cursor: pointer;
1963-
margin: 2rem 0 0;
1964-
padding: 1.25rem;
1965-
position: relative;
1966-
transition: all 0.2s ease;
1967-
color: #1A2026;
1968-
}
19691949

1970-
.faq-section p,
1971-
.faq-section ul {
1972-
font-size: 16px;
1973-
background-color: #fff;
1974-
padding: 1rem 2rem;
1975-
margin: 0;
1950+
/* FAQ Section Containers */
1951+
.faq-section {
1952+
background: rgba(104, 147, 255, 0.1);
1953+
margin-bottom: 2rem;
1954+
padding: 2rem;
19761955
}
19771956

1978-
.faq-section ul, .faq-section ol {
1979-
margin: 0;
1980-
padding-left: 3.5rem;
1981-
}
1957+
.faq-item {
1958+
margin: 0 0 1rem;
19821959

1983-
.faq-section li {
1984-
margin-bottom: 0.8rem;
1985-
line-height: 1.6;
1986-
}
1960+
&:last-child {
1961+
margin: 0;
1962+
}
19871963

1988-
.faq-section code {
1989-
background-color: #f1f3f4;
1990-
padding: 0.2rem 0.4rem;
1991-
border-radius: 4px;
1992-
font-family: 'Fira Mono', monospace;
1993-
font-size: 1.4rem;
1994-
color: #d63384;
1995-
}
1964+
h3 {
1965+
font-size: 16px;
1966+
background:rgba(104, 147, 255, 0.1);
1967+
font-weight: 600;
1968+
cursor: pointer;
1969+
margin: 0 0 1px;
1970+
padding: 1.25rem;
1971+
position: relative;
1972+
transition: all 0.2s ease;
1973+
color: #1A2026;
19961974

1997-
.faq-section pre {
1998-
background-color: #f8f9fa;
1999-
padding: 1.6rem;
2000-
border-radius: 4px;
2001-
overflow-x: auto;
2002-
margin: 1.6rem 0;
2003-
border: 1px solid #e1e5e9;
2004-
}
1975+
&:hover {
1976+
background:rgba(58, 67, 88, 0.1);
20051977

2006-
.faq-section pre code {
2007-
background: none;
2008-
padding: 0;
2009-
color: #333;
2010-
}
1978+
}
1979+
}
20111980

2012-
.faq-section a {
2013-
color: #30176E;
2014-
text-decoration: underline;
2015-
}
1981+
.faq-answer {
1982+
padding: 1rem;
1983+
font-size: 16px;
1984+
}
20161985

2017-
.faq-section a:hover {
2018-
text-decoration: underline;
2019-
}
1986+
&.open {
1987+
1988+
h3,
1989+
.faq-answer {
1990+
background: #fff;
1991+
}
1992+
}
20201993

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

20272052
/* 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)