wagtail-tw-blocks 0.3.0__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wagtail_tw_blocks-1.0.0/PKG-INFO +451 -0
- wagtail_tw_blocks-1.0.0/README.md +428 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/pyproject.toml +4 -5
- wagtail_tw_blocks-1.0.0/wagtail_blocks/__init__.py +6 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/blocks.py +310 -0
- wagtail_tw_blocks-0.3.0/wagtail_blocks/__init__.py → wagtail_tw_blocks-1.0.0/wagtail_blocks/constants.py +1 -11
- wagtail_tw_blocks-1.0.0/wagtail_blocks/static/wagtail_blocks/css/app.css +20 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/static/wagtail_blocks/css/styles.css +2 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/static/wagtail_blocks/package-lock.json +251 -420
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/static/wagtail_blocks/package.json +3 -3
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/blocks/accordion.html +21 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/blocks/alert.html +12 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/blocks/carousel.html +19 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/blocks/code.html +32 -0
- {wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks → wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail}/blocks/diff.html +3 -3
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/blocks/document.html +65 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/blocks/hover_gallery.html +11 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/blocks/tabs.html +20 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/breadcrumbs.html +12 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/form.html +116 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/languages.html +77 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/messages.html +56 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/next.html +22 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/pagination.html +59 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/prev.html +25 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/prev_next.html +5 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/themes.html +366 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/components/tree.html +28 -0
- wagtail_tw_blocks-1.0.0/wagtail_blocks/templates/wagtail/styles.html +29 -0
- wagtail_tw_blocks-0.3.0/PKG-INFO +0 -239
- wagtail_tw_blocks-0.3.0/README.md +0 -215
- wagtail_tw_blocks-0.3.0/wagtail_blocks/blocks.py +0 -689
- wagtail_tw_blocks-0.3.0/wagtail_blocks/static/wagtail_blocks/css/app.css +0 -4
- wagtail_tw_blocks-0.3.0/wagtail_blocks/static/wagtail_blocks/css/styles.css +0 -2
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/accordion.html +0 -49
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/alert.html +0 -24
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/browser.html +0 -15
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/carousel.html +0 -64
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/code.html +0 -66
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/code_mockup.html +0 -20
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/fab.html +0 -43
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/hover_gallery.html +0 -18
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/image.html +0 -19
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/list.html +0 -56
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/phone.html +0 -11
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/steps.html +0 -12
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/tabs.html +0 -24
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/timeline.html +0 -30
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/toast.html +0 -9
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/blocks/window.html +0 -9
- wagtail_tw_blocks-0.3.0/wagtail_blocks/templates/wagtail_blocks/styles.html +0 -92
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/LICENSE +0 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/apps.py +0 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/locale/ar/LC_MESSAGES/django.po +0 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/locale/cn/LC_MESSAGES/django.po +0 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/locale/de/LC_MESSAGES/django.po +0 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/locale/es/LC_MESSAGES/django.po +0 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/locale/fr/LC_MESSAGES/django.po +0 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/locale/tr/LC_MESSAGES/django.po +0 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/static/wagtail_blocks/.prettierrc +0 -0
- {wagtail_tw_blocks-0.3.0 → wagtail_tw_blocks-1.0.0}/wagtail_blocks/static/wagtail_blocks/README.md +0 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wagtail-tw-blocks
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: a comprehensive library of production-ready `StreamField` components and UI elements designed for Wagtail CMS.
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Author: Yousef Abu Shanab
|
|
8
|
+
Author-email: josephyousef249@gmail.com
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Dist: django (>=5.2.1)
|
|
17
|
+
Requires-Dist: wagtail (>=7.2)
|
|
18
|
+
Project-URL: Documentation, https://github.com/youzarsiph/wagtail-tw-blocks
|
|
19
|
+
Project-URL: Homepage, https://github.com/youzarsiph/wagtail-tw-blocks
|
|
20
|
+
Project-URL: Repository, https://github.com/youzarsiph/wagtail-tw-blocks
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# wagtail-tw-blocks
|
|
24
|
+
|
|
25
|
+
[](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/ci.yml)
|
|
26
|
+
[](https://github.com/youzarsiph/wagtail-tw-blocks/actions/workflows/cd.yml)
|
|
27
|
+
[](https://pypi.org/project/wagtail-tw-blocks/)
|
|
28
|
+
[](https://pypi.org/project/wagtail-tw-blocks/)
|
|
29
|
+
[](https://pypi.org/project/wagtail-tw-blocks/)
|
|
30
|
+
|
|
31
|
+
## Overview
|
|
32
|
+
|
|
33
|
+
**wagtail-tw-blocks** is a comprehensive library of production-ready `StreamField` components and UI elements designed for Wagtail CMS. Built on the foundation of **Tailwind CSS** and **daisyUI**, this package enables developers to rapidly deploy modern, accessible, and highly customizable layouts without the overhead of building foundational UI components from scratch.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Core Features
|
|
38
|
+
|
|
39
|
+
- **Design-First Architecture:** Leverages Tailwind CSS and daisyUI for clean, responsive, and professional aesthetics.
|
|
40
|
+
- **Thematic Flexibility:** Full support for all daisyUI themes, allowing for effortless brand alignment.
|
|
41
|
+
- **Enterprise Ready:** Includes automated testing and deployment pipelines via GitHub Actions (CI/CD).
|
|
42
|
+
- **Extensibility:** Architected for easy subclassing and template overriding to meet specific project requirements.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
### 1. Install via Pip
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install wagtail-tw-blocks
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. Configure Django Settings
|
|
56
|
+
|
|
57
|
+
Add `wagtail_blocks` to your `INSTALLED_APPS`. Ensure it is placed after your core Wagtail configuration to ensure proper template loading.
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
# settings.py
|
|
61
|
+
|
|
62
|
+
INSTALLED_APPS = [
|
|
63
|
+
# ...
|
|
64
|
+
"wagtail_blocks",
|
|
65
|
+
# ...
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Available blocks & components
|
|
73
|
+
|
|
74
|
+
### Blocks
|
|
75
|
+
|
|
76
|
+
- **Accordion (Collapse):** Interactive, collapsible sections ideal for FAQs and structured data.
|
|
77
|
+
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+
- **Alert:** Visual indicators for status updates, warnings, or informational highlights.
|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+
- **Carousel:** A responsive content and image slider with intuitive navigation.
|
|
85
|
+
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+
- **Code:** Syntax-highlighted code blocks with integrated "copy-to-clipboard" functionality.
|
|
89
|
+
(**Note:** Requires `highlight.js` and `clipboard.js`).
|
|
90
|
+
|
|
91
|
+

|
|
92
|
+
|
|
93
|
+
- **Document:** Displays document info inside a card with download button.
|
|
94
|
+
|
|
95
|
+

|
|
96
|
+
|
|
97
|
+
- **Diff:** Side-by-side visual comparison tools for images.
|
|
98
|
+
|
|
99
|
+

|
|
100
|
+
|
|
101
|
+
- **Hover Gallery:** An immersive image gallery featuring sophisticated hover interactions.
|
|
102
|
+
|
|
103
|
+

|
|
104
|
+
|
|
105
|
+
- **Tabs:** Efficient organization of content into navigable tabbed interfaces.
|
|
106
|
+
|
|
107
|
+

|
|
108
|
+
|
|
109
|
+
#### Implementation Example
|
|
110
|
+
|
|
111
|
+
To integrate these blocks into your page models, import the block library into your `models.py`:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from wagtail_blocks import blocks
|
|
115
|
+
from wagtail.fields import StreamField
|
|
116
|
+
from wagtail.models import Page
|
|
117
|
+
|
|
118
|
+
class Article(Page):
|
|
119
|
+
content = StreamField([
|
|
120
|
+
("accordion", blocks.AccordionBlock()),
|
|
121
|
+
("alert", blocks.AlertBlock()),
|
|
122
|
+
("carousel", blocks.CarouselBlock()),
|
|
123
|
+
("code", blocks.CodeBlock()),
|
|
124
|
+
])
|
|
125
|
+
|
|
126
|
+
content_panels = Page.content_panels + [
|
|
127
|
+
FieldPanel("content"),
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
To ensure full functionality (specifically for the **Code Block**), include the following assets in your base template:
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<link rel="stylesheet" href="{% static 'wagtail_blocks/css/styles.css' %}" />
|
|
136
|
+
<link
|
|
137
|
+
rel="stylesheet"
|
|
138
|
+
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/github.min.css"
|
|
139
|
+
/>
|
|
140
|
+
|
|
141
|
+
<script src="https://unpkg.com/lucide@latest"></script>
|
|
142
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"></script>
|
|
143
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.11/clipboard.min.js"></script>
|
|
144
|
+
|
|
145
|
+
<script>
|
|
146
|
+
// Initialization
|
|
147
|
+
lucide.createIcons();
|
|
148
|
+
hljs.highlightAll();
|
|
149
|
+
new ClipboardJS(".btn-copy");
|
|
150
|
+
</script>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
#### Extending
|
|
154
|
+
|
|
155
|
+
You can easily extend or customize the provided blocks by sub-classing them.
|
|
156
|
+
For example, to create a custom alert block with additional styles:
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
from wagtail_blocks.blocks import AlertBlock
|
|
160
|
+
|
|
161
|
+
class CustomAlertBlock(AlertBlock):
|
|
162
|
+
class Meta:
|
|
163
|
+
icon = "warning"
|
|
164
|
+
label = "Custom Alert"
|
|
165
|
+
template = "path/to/your/custom_alert_template.html"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### Components
|
|
171
|
+
|
|
172
|
+
Beyond `StreamField` blocks, this package includes reusable template components to enhance global site functionality.
|
|
173
|
+
|
|
174
|
+
#### Breadcrumbs
|
|
175
|
+
|
|
176
|
+
Automatic breadcrumb generation following the Wagtail page hierarchy.
|
|
177
|
+
|
|
178
|
+
- **Context:** a Wagtail `page`.
|
|
179
|
+
- **Usage:**
|
|
180
|
+
|
|
181
|
+
```html
|
|
182
|
+
{% extends 'app/base.html' %}
|
|
183
|
+
|
|
184
|
+
<!---->
|
|
185
|
+
{% block content %}
|
|
186
|
+
<section class="container-prose">
|
|
187
|
+
{% include 'wagtail/components/breadcrumbs.html' %}
|
|
188
|
+
|
|
189
|
+
<h1>{{ page.title }}</h1>
|
|
190
|
+
</section>
|
|
191
|
+
{% endblock %}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
- **Demo:**
|
|
195
|
+
|
|
196
|
+

|
|
197
|
+
|
|
198
|
+
#### Forms
|
|
199
|
+
|
|
200
|
+
Accessible, daisyUI-styled wrappers for standard Django forms.
|
|
201
|
+
|
|
202
|
+
- **Context:** A Django `form`.
|
|
203
|
+
- **Options:**
|
|
204
|
+
- `method`: Form `method` attribute (Defaults to `post`).
|
|
205
|
+
- `csrf`: A boolean that indicates whether to include Django `{% csrf_token %}` in the form (Defaults to `True`).
|
|
206
|
+
- **Usage:**
|
|
207
|
+
|
|
208
|
+
```html
|
|
209
|
+
{% extends 'app/base.html' %}
|
|
210
|
+
|
|
211
|
+
<!---->
|
|
212
|
+
{% block content %}
|
|
213
|
+
<section class="container-prose">
|
|
214
|
+
<h1>New User</h1>
|
|
215
|
+
|
|
216
|
+
{% include 'wagtail/components/form.html' %}
|
|
217
|
+
|
|
218
|
+
<!-- Pass the options using `with` keyword: -->
|
|
219
|
+
{% include 'wagtail/components/form.html' with method="get" csrf=False %}
|
|
220
|
+
</section>
|
|
221
|
+
{% endblock %}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
- **Demo:**
|
|
225
|
+
|
|
226
|
+

|
|
227
|
+
|
|
228
|
+
#### Language switch
|
|
229
|
+
|
|
230
|
+
Seamless integration with Django/Wagtail `i18n` for multi-lingual sites.
|
|
231
|
+
|
|
232
|
+
- **Context:** `LANGUAGES` from `django.template.context_processors.i18n` or a Wagtail `page`.
|
|
233
|
+
- **Usage:**
|
|
234
|
+
|
|
235
|
+
```html
|
|
236
|
+
{% extends 'app/base.html' %}{% load static %}
|
|
237
|
+
|
|
238
|
+
<!---->
|
|
239
|
+
{% block content %}
|
|
240
|
+
<header class="absolute inset-x-0 top-0 z-10 backdrop-blur-3xl">
|
|
241
|
+
<nav class="navbar p-4">
|
|
242
|
+
<ul class="navbar-start gap-4">
|
|
243
|
+
<li
|
|
244
|
+
class="tooltip tooltip-bottom tooltip-primary"
|
|
245
|
+
data-tip="Your Brand"
|
|
246
|
+
>
|
|
247
|
+
<h1>
|
|
248
|
+
<a href="https://your.domain.com">
|
|
249
|
+
<img
|
|
250
|
+
alt="Your Brand"
|
|
251
|
+
class="lg:size-8 2xl:size-10"
|
|
252
|
+
src="{% static 'path/to/logo.png' %}"
|
|
253
|
+
/>
|
|
254
|
+
</a>
|
|
255
|
+
</h1>
|
|
256
|
+
</li>
|
|
257
|
+
</ul>
|
|
258
|
+
|
|
259
|
+
<ul class="navbar-end gap-4">
|
|
260
|
+
{% include 'wagtail/components/languages.html' %}
|
|
261
|
+
</ul>
|
|
262
|
+
</nav>
|
|
263
|
+
</header>
|
|
264
|
+
{% endblock %}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
- **Demo:**
|
|
268
|
+
|
|
269
|
+

|
|
270
|
+
|
|
271
|
+
#### Messages
|
|
272
|
+
|
|
273
|
+
Integrated support for the Django messages framework.
|
|
274
|
+
|
|
275
|
+
- **Context:** `messages` from `django.contrib.messages.context_processors.messages`.
|
|
276
|
+
- **Usage:**
|
|
277
|
+
|
|
278
|
+
```html
|
|
279
|
+
{% extends 'app/base.html' %}
|
|
280
|
+
|
|
281
|
+
<!---->
|
|
282
|
+
{% block content %}
|
|
283
|
+
<section class="container-prose">
|
|
284
|
+
{% include 'wagtail/components/messages.html' %}
|
|
285
|
+
|
|
286
|
+
<h1>Messages</h1>
|
|
287
|
+
|
|
288
|
+
...
|
|
289
|
+
</section>
|
|
290
|
+
{% endblock %}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
- **Demo:**
|
|
294
|
+
|
|
295
|
+

|
|
296
|
+
|
|
297
|
+
#### Pagination
|
|
298
|
+
|
|
299
|
+
Professional pagination controls for `ListView` and QuerySets.
|
|
300
|
+
|
|
301
|
+
- **Context:**
|
|
302
|
+
- `paginator`: Django paginator instance.
|
|
303
|
+
- `page_obj`: Page instance.
|
|
304
|
+
- `is_paginated`: Boolean that indicates whether the content is paginated or not.
|
|
305
|
+
- `object_list`: Paginated QuerySet.
|
|
306
|
+
- **Usage:**
|
|
307
|
+
|
|
308
|
+
```html
|
|
309
|
+
{% extends 'app/base.html' %}
|
|
310
|
+
|
|
311
|
+
<!---->
|
|
312
|
+
{% block content %}
|
|
313
|
+
<section class="container-prose">
|
|
314
|
+
<h1>Items</h1>
|
|
315
|
+
|
|
316
|
+
<ol>
|
|
317
|
+
{% for item in object_list %}
|
|
318
|
+
<li>{{ item }}</li>
|
|
319
|
+
{% endfor %}
|
|
320
|
+
</ol>
|
|
321
|
+
|
|
322
|
+
{% include 'wagtail/components/pagination.html' %}
|
|
323
|
+
</section>
|
|
324
|
+
{% endblock %}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
- **Demo:**
|
|
328
|
+
|
|
329
|
+

|
|
330
|
+
|
|
331
|
+
#### Prev/Next
|
|
332
|
+
|
|
333
|
+
Smart pagination between sibling pages, with recursive fallback to parent pages.
|
|
334
|
+
|
|
335
|
+
- **Context:** A Wagtail `page`.
|
|
336
|
+
- **Usage:**
|
|
337
|
+
|
|
338
|
+
```html
|
|
339
|
+
{% extends 'app/base.html' %}
|
|
340
|
+
|
|
341
|
+
<!---->
|
|
342
|
+
{% block content %}
|
|
343
|
+
<section class="container-prose">
|
|
344
|
+
<h1>{{ page.title }}</h1>
|
|
345
|
+
|
|
346
|
+
{% include 'wagtail/components/prev_next.html' %}
|
|
347
|
+
</section>
|
|
348
|
+
{% endblock %}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
- **Demo:**
|
|
352
|
+
|
|
353
|
+

|
|
354
|
+
|
|
355
|
+
#### Tree
|
|
356
|
+
|
|
357
|
+
Recursive, tree-like navigation structures for documentation or complex sitemaps.
|
|
358
|
+
|
|
359
|
+
- **Context:** A Wagtail `page`.
|
|
360
|
+
- **Usage:**
|
|
361
|
+
|
|
362
|
+
```html
|
|
363
|
+
{% extends 'app/base.html' %}
|
|
364
|
+
|
|
365
|
+
<!---->
|
|
366
|
+
{% block content %}
|
|
367
|
+
<div class="drawer lg:drawer-open">
|
|
368
|
+
<input id="drawer" type="checkbox" class="drawer-toggle" />
|
|
369
|
+
|
|
370
|
+
<section class="drawer-content">
|
|
371
|
+
<main class="container-prose">
|
|
372
|
+
<h1>{{ page.title }}</h1>
|
|
373
|
+
|
|
374
|
+
<label
|
|
375
|
+
for="drawer"
|
|
376
|
+
aria-label="open drawer"
|
|
377
|
+
class="btn btn-sm btn-primary lg:btn-md 2xl:btn-lg"
|
|
378
|
+
>
|
|
379
|
+
<i data-lucide="menu" class="size-4 lg:size-6"></i>
|
|
380
|
+
Menu
|
|
381
|
+
</label>
|
|
382
|
+
|
|
383
|
+
...
|
|
384
|
+
</main>
|
|
385
|
+
</section>
|
|
386
|
+
|
|
387
|
+
<section class="drawer-side z-50">
|
|
388
|
+
<label
|
|
389
|
+
for="drawer"
|
|
390
|
+
aria-label="close drawer"
|
|
391
|
+
class="drawer-overlay"
|
|
392
|
+
></label>
|
|
393
|
+
|
|
394
|
+
<div
|
|
395
|
+
class="relative flex size-full flex-col overflow-hidden lg:min-w-sm lg:max-w-sm 2xl:min-w-md 2xl:max-w-md"
|
|
396
|
+
>
|
|
397
|
+
<header
|
|
398
|
+
class="absolute inset-x-0 top-0 z-10 p-4 backdrop-blur-3xl lg:p-6"
|
|
399
|
+
>
|
|
400
|
+
<div class="flex items-center justify-between gap-4">
|
|
401
|
+
<h1>Docs</h1>
|
|
402
|
+
|
|
403
|
+
<div
|
|
404
|
+
class="tooltip tooltip-left rtl:tooltip-right lg:hidden"
|
|
405
|
+
data-tip="Close"
|
|
406
|
+
>
|
|
407
|
+
<label
|
|
408
|
+
for="sidebar"
|
|
409
|
+
aria-label="close sidebar"
|
|
410
|
+
class="btn btn-sm btn-square btn-ghost lg:btn-md 2xl:btn-lg"
|
|
411
|
+
>
|
|
412
|
+
<i data-lucide="x" class="size-4 lg:size-6"></i>
|
|
413
|
+
<span class="sr-only">Close</span>
|
|
414
|
+
</label>
|
|
415
|
+
</div>
|
|
416
|
+
</div>
|
|
417
|
+
</header>
|
|
418
|
+
|
|
419
|
+
<div class="max-h-dvh overflow-y-auto py-16 lg:py-20">
|
|
420
|
+
<ul class="menu menu-sm w-full grow lg:menu-md 2xl:menu-lg">
|
|
421
|
+
{% include 'wagtail/components/tree.html' %}
|
|
422
|
+
</ul>
|
|
423
|
+
</div>
|
|
424
|
+
</div>
|
|
425
|
+
</section>
|
|
426
|
+
</div>
|
|
427
|
+
{% endblock %}
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
- **Demo:**
|
|
431
|
+
|
|
432
|
+

|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Contributing
|
|
437
|
+
|
|
438
|
+
We value community involvement. If you wish to contribute,
|
|
439
|
+
please review our [CONTRIBUTING.md](CONTRIBUTING.md) for coding standards and setup procedures.
|
|
440
|
+
For significant architectural changes, please open an issue first to discuss your proposed implementation.
|
|
441
|
+
|
|
442
|
+
## Technical Support
|
|
443
|
+
|
|
444
|
+
- **Bug Reports & Feature Requests:** Please utilize the [GitHub Issues](https://github.com/youzarsiph/wagtail-tw-blocks/issues) tracker.
|
|
445
|
+
- **General Inquiry:** Join the community in [GitHub Discussions](https://github.com/youzarsiph/wagtail-tw-blocks/discussions).
|
|
446
|
+
|
|
447
|
+
## License
|
|
448
|
+
|
|
449
|
+
This project is open-source software licensed under the **MIT License**.
|
|
450
|
+
See the [LICENSE](LICENSE) file for further details.
|
|
451
|
+
|