Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imports topics from valkey-doc, adds docs menu, and taxonomy for tech blog #87

Closed
Closed
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
9 changes: 8 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ compile_sass = true

build_search_index = true

taxonomies = [
{ name = "Tutorials", feed = true}
]

[markdown]
highlight_code = true

Expand Down Expand Up @@ -53,4 +57,7 @@ publish_hold = [
"/docs/topics/internals/",
"/docs/topics/protocol/",
"/docs/topics/rdd/"
]
]

[extra.taxonomies.tutorials]
heading = "Documentation"
2 changes: 2 additions & 0 deletions content/blog/2024-04-26-modules-101.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ aliases= [
"/blog/update/2024/04/valkey-7-2-5-out/"
]
description= "The idea of modules is to allow adding extra features (such as new commands and data types) to Valkey without making changes to the core code."
[taxonomies]
Tutorials = [ "Modules" ]
[extra]
authors= ["dmitrypol"]
categories= "modules"
Expand Down
5 changes: 3 additions & 2 deletions content/commands/_index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
+++
title = "Commands"
title = "Documentation: Commands"
template = "commands.html"
page_template = "command-page.html"
aliases= [
"/docs/topics/commands/"
"/docs/topics/commands/",
"/docs/commands/"
]
+++
11 changes: 3 additions & 8 deletions content/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
+++
title = "Docs"
title = "Documentation"
template = "fullwidth.html"
page_template = "docs-page.html"
+++

* [Command Reference](../commands/)
* [All Documentation Topics](./topics/)
* Management
* [Persistence](/docs/topics/persistence/)
* Security
* [ACL](/docs/topics/acl/)
* Valkey Manual
* [Keyspace Notifications](/docs/topics/keyspace/)
* [Documentation by Topic](./topics/)
* [Tutorials](/tutorials/)
10 changes: 10 additions & 0 deletions sass/_valkey.scss
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,16 @@ pre table {
border-collapse: collapse;
}

.index-entry {
border: 1px solid $line;
border-radius: 3px;
padding: 0.5em 1em;
margin-bottom: 0.5em;
a {
display: block;
}
}

.command-entry {
border-bottom: 1px dotted $line;
margin-top: 0.5rem;
Expand Down
10 changes: 8 additions & 2 deletions templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
</a>
<nav role="navigation" aria-label="Main">
<a role="menuitem" href="/download/">Download</a>
<a role="menuitem" href="/docs/">Documentation</a>
<a role="menuitem" href="/commands/">Commands</a>
<div class="has-submenu">
<a role="menuitem" href="/docs/">Documentation</a>
<div class="submenu">
<a role="menuitem" href="/commands/">Command Reference</a>
<a role="menuitem" href="/docs/topics/">Documentation by Topic</a>
<a role="menuitem" href="/tutorials/">Tutorials</a>
</div>
</div>
<div class="has-submenu">
<span>Community</span>
<div class="submenu">
Expand Down
2 changes: 1 addition & 1 deletion templates/docs-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

{% block subhead_content %}
{% if has_frontmatter and frontmatter_title %}
<h1 class="page-title">{{ frontmatter_title }}</h1>
<h1 class="page-title">Documentation: {{ frontmatter_title }}</h1>
{% endif %}
{% endblock subhead_content %}

Expand Down
27 changes: 24 additions & 3 deletions templates/docs.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
{% extends "fullwidth.html" %}
{% extends "right-aside.html" %}

{% import "macros/docs.html" as docs %}

{% block subhead_content %}
<h1 class="page-title">Documentation</h1>
{% endblock subhead_content %}

{% block main_content %}
<h1>{{ section.title }}</h1>


{% set list = [] %}
{% if section.pages | length == 0 %}
<strong>No docs pages found.</strong> You likely need to build the documentation pages. See "Building additional content" in README.md file.
{% endif %}

{% set docs_file_contents = docs::load(slug= "index") %}
{% set frontmatter = docs::extract_frontmatter(content= docs_file_contents) %}
{% set page_contents = docs::extract_markdown(content= docs_file_contents) %}
{%- set content_with_fixed_links = docs::fix_links(content= page_contents) -%}


{{ content_with_fixed_links | markdown | safe }}
{% endblock main_content %}

{% block related_content %}
<h2>Alphabetical Index</h2>
{% for page in section.pages %}
{% set docs_file_contents = docs::load(slug= page.slug) %}
{% set frontmatter = docs::extract_frontmatter(content= docs_file_contents) %}
Expand All @@ -26,7 +45,9 @@
{% set topic_list = load_data(literal= "[" ~ joined_list ~ "]", format="json") | sort(attribute="title") %}

{% for topic in topic_list %}
<a href="{{ topic.path }}">{{ topic.title }}</a> {{ topic.description | safe }} <br />
<div class="index-entry">
<a href="{{ topic.path }}">{{ topic.title }}</a> {{ topic.description | safe }} <br />
</div>
{% endfor %}

{% endblock main_content %}
{% endblock related_content %}
9 changes: 9 additions & 0 deletions templates/taxonomy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% extends "right-aside.html" %}


{% block subhead_content %}
{% if config.extra.taxonomies and config.extra.taxonomies[taxonomy.slug] and config.extra.taxonomies[taxonomy.slug].heading %}
<h1 class="page-title">{{ config.extra.taxonomies[taxonomy.slug].heading }}</h1>
{% endif %}
{% endblock subhead_content %}

17 changes: 17 additions & 0 deletions templates/taxonomy_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends "taxonomy.html" %}

{% block main_content %}
<h1>{{ taxonomy.name }}</h1>
<ul>
{% for term in terms %}
<li><a href="{{ term.path }}">{{ term.name }}</a>
<ul>
{% for page in term.pages %}
<li><a href="{{ page.path }}">{{ page.title }}</a></li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>

{% endblock main_content %}
13 changes: 13 additions & 0 deletions templates/taxonomy_single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% extends "taxonomy.html" %}

{% block main_content %}

<h1><a href="/{{ taxonomy.slug }}">{{ taxonomy.name }}</a>: {{ term.name }}</h1>
<ul>
{% for page in term.pages %}
<li><a href="{{ page.path }}">{{ page.title }}</a> {{ page.description | markdown | safe }}</li>
{% endfor %}

</ul>

{% endblock main_content %}