Skip to content

Commit

Permalink
Minimal changes to add hidden book
Browse files Browse the repository at this point in the history
This change introduces the minimal amount of changes to accomplish the
following:

- Old "book" is now Quick Start
- New book has a initial version (v0.11.0) with one page
- A link which defaults to being hidden has been added to the list of
  links on /learn
  • Loading branch information
Captain-Of-Coit committed Apr 18, 2023
1 parent ff852da commit b20d68e
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 8 deletions.
6 changes: 1 addition & 5 deletions content/learn/book/_index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
+++
title = "Book"
sort_by = "weight"
template = "docs-section.html"
page_template = "docs-section.html"
redirect_to = "learn/book/introduction"
redirect_to = "learn/book/v0.11.0/getting-started/why-bevy"
insert_anchor_links = "right"
+++
10 changes: 10 additions & 0 deletions content/learn/book/v0.11.0/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
+++
title = "Bevy Book v0.11.0"
sort_by = "weight"
template = "docs-section.html"
page_template = "docs-section.html"
redirect_to = "learn/book/v0.11.0/getting-started/why-bevy"
insert_anchor_links = "right"
[extra]
header_message = "v0.11.0"
+++
11 changes: 11 additions & 0 deletions content/learn/book/v0.11.0/getting-started/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
+++
title = "Getting Started"
weight = 1
sort_by = "weight"
template = "docs-section.html"
page_template = "docs-section.html"
redirect_to = "learn/book/v0.11.0/getting-started/why-bevy"
insert_anchor_links = "right"
[extra]
header_message = "Getting Started"
+++
12 changes: 12 additions & 0 deletions content/learn/book/v0.11.0/getting-started/why-bevy/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
+++
title = "Why Bevy?"
weight = 1
sort_by = "weight"
template = "docs-section.html"
page_template = "docs-section.html"
insert_anchor_links = "right"
[extra]
header_message = "Why Bevy?"
+++

TODO: Missing everything
14 changes: 11 additions & 3 deletions content/learn/links.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
[[links]]
title = "The Bevy Book"
url = "/learn/book/introduction"
title = "Quick Start"
url = "/learn/quick-start/introduction"
image = "/assets/book.svg"
image_alt = "Bevy book"
image_alt = "Bevy Book Icon"
description = "Learn how to use Bevy using this step-by-step guide. If you are new to Bevy, you should probably start here."

[[links]]
title = "Bevy Book"
url = "/learn/book/v0.11.0/getting-started/why-bevy"
image = "/assets/book.svg"
image_alt = "Bevy Book Icon"
hidden = true # TODO remove this line once book is ready to be published
description = "TODO to fill"

[[links]]
title = "Migration Guides"
url = "/learn/migration-guides/introduction"
Expand Down
9 changes: 9 additions & 0 deletions content/learn/quick-start/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
+++
title = "Book"
sort_by = "weight"
template = "docs-section.html"
page_template = "docs-section.html"
redirect_to = "learn/quick-start/introduction"
aliases = ["learn/book/introduction"]
insert_anchor_links = "right"
+++
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
{{section.extra.header_message}}
{% elif page and page.extra.header_message %}
{{page.extra.header_message}}
{% elif section and section.path is starting_with("/learn/quick-start/") %}
Quick Start
{% elif section and section.path is starting_with("/learn/book/") %}
The Book
{% elif section and section.path is starting_with("/learn/migration-guides/") %}
Expand Down
2 changes: 2 additions & 0 deletions templates/learn.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% set learn_links = load_data(path="content/learn/links.toml") %}
<div class="padded-content item-grid item-grid--two-cols">
{% for link in learn_links.links %}
{% if not link.hidden %}
<a class="link-card" href="{{ link.url }}">
<div class="link-card__img-wrapper">
<img class="link-card__img" src="{{ link.image }}" alt="{{ link.image_alt }}" />
Expand All @@ -16,6 +17,7 @@ <h2 class="link-card__title">{{ link.title }}</h2>
<p class="link-card__description">{{ link.description }}</p>
</div>
</a>
{% endif %}
{% endfor %}
</div>
{% endblock content %}

0 comments on commit b20d68e

Please sign in to comment.