refactor: use .nav.yml to define page order instead of nav weights (#1000)

This commit is contained in:
Juro Oravec 2025-02-23 22:44:12 +01:00 committed by GitHub
parent f36581ed86
commit d5e45125dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 95 additions and 231 deletions

View file

@ -0,0 +1,7 @@
# `.nav.yml` is provided by https://lukasgeiter.github.io/mkdocs-awesome-nav
nav:
- Create your first component: your_first_component.md
- Adding JS and CSS: adding_js_and_css.md
- Components in templates: components_in_templates.md
- Parametrising components: parametrising_components.md
- Adding slots: adding_slots.md

View file

@ -1,8 +1,3 @@
---
title: Adding JS and CSS
weight: 2
---
Next we will add CSS and JavaScript to our template.
!!! info

View file

@ -1,8 +1,3 @@
---
title: Adding slots
weight: 5
---
Our calendar component's looking great! But we just got a new assignment from
our colleague - The calendar date needs to be shown on 3 different pages:

View file

@ -1,8 +1,3 @@
---
title: Components in templates
weight: 3
---
By the end of this section, we want to be able to use our components in Django templates like so:
```htmldjango

View file

@ -1,8 +1,3 @@
---
title: Parametrising components
weight: 4
---
So far, our Calendar component will always render the date `1970-01-01`. Let's make it more useful and flexible
by being able to pass in custom date.

View file

@ -1,8 +1,3 @@
---
title: Create your first component
weight: 1
---
A component in django-components can be as simple as a Django template and Python code to declare the component:
```htmldjango title="calendar.html"