-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- This doesn't change the listing layout, **but** improves the sidebar category labels - Tweaks example generation script to include labels for categories instead of using folder name - Tweak single example page layout <img width="209" alt="image" src="https://user-images.githubusercontent.com/188612/163731632-3abf4e78-31a3-4288-a5f3-24363c62b3bd.png"> <img width="843" alt="image" src="https://user-images.githubusercontent.com/188612/163731643-012820a0-377b-4bc3-a7e4-567081b807be.png"> <img width="354" alt="image" src="https://user-images.githubusercontent.com/188612/163731664-9b7d9cac-4e35-4aa0-92ef-17bf7b0f32fc.png">
- Loading branch information
Showing
6 changed files
with
105 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.example { | ||
padding: 0 16px; | ||
|
||
&__header { | ||
display: grid; | ||
gap: 8px; | ||
margin: 16px 0 8px; | ||
align-items: baseline; | ||
grid-template-columns: 1fr 1fr; | ||
grid-template-areas: | ||
'title title' | ||
'back github' | ||
; | ||
|
||
@media #{$bp-tablet-portrait-up} { | ||
margin: 24px 0 8px; | ||
grid-template-areas: 'back title github'; | ||
grid-template-columns: 150px 1fr 150px; | ||
} | ||
} | ||
|
||
&__title { | ||
grid-area: title; | ||
margin: 0; | ||
font-size: 1.75rem; | ||
text-align: center; | ||
} | ||
|
||
&__back, | ||
&__github { | ||
font-size: 1rem; | ||
|
||
@include override-anchor { | ||
color: #aaa; | ||
} | ||
|
||
&:hover { | ||
color: $color-white; | ||
} | ||
} | ||
|
||
&__back { | ||
grid-area: back; | ||
} | ||
|
||
&__github { | ||
grid-area: github; | ||
text-align: right; | ||
} | ||
|
||
&__canvas { | ||
width: 100% !important; | ||
height: auto !important; | ||
border-radius: $border-radius; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
{% extends "layouts/base.html" %} | ||
|
||
{% block content %} | ||
<div class="book-content"> | ||
<div class="media-content"> | ||
<script type="module"> | ||
import init from './{{ page.title }}.js'; | ||
init() | ||
</script> | ||
<div><a href="/examples">Back to examples</a></div> | ||
<canvas id="bevy" width="1024" height="720"></canvas> | ||
<div> | ||
{{ page.components[1] }} / {{ page.title }} - | ||
<a href="https://github.com/bevyengine/bevy/blob/latest/examples/{{ page.components[1] }}/{{ page.title }}.rs"> | ||
See this example in Bevy github repo | ||
</a> | ||
</div> | ||
<div class="example"> | ||
<div class="example__header"> | ||
{% set total_ancestors = page.ancestors | length %} | ||
{% set parent_idx = total_ancestors - 1 %} | ||
{% set category = get_section(path=page.ancestors | nth(n=parent_idx)) %} | ||
<h2 class="example__title">{{ category.title }} / {{ page.title }}</h2> | ||
<a class="example__back" href="/examples"><i class="icon icon--chevron-left"></i> Back to examples</a> | ||
<a class="example__github" href="https://github.com/bevyengine/bevy/blob/latest/examples/{{ page.components[1] }}/{{ page.title }}.rs"> | ||
<i class="icon icon--github"></i> View in GitHub | ||
</a> | ||
</div> | ||
<canvas class="example__canvas" id="bevy"></canvas> | ||
<div class="example__code media-content"> | ||
{% set code = load_data(path="content/examples/" ~ page.components[1] ~ "/" ~ page.title ~ "/" ~ page.title ~ ".rs") %} | ||
{% set data = "```rust | ||
" ~ code ~ "```" %} | ||
|
||
{{data | markdown(inline=true) | safe}} | ||
</div> | ||
</div> | ||
<script type="module"> | ||
import init from './{{ page.title }}.js'; | ||
init(); | ||
</script> | ||
{% endblock content %} |