From d7dae42de71400e1cb97b6ce6a675abf4b810858 Mon Sep 17 00:00:00 2001 From: Will Abbott Date: Thu, 4 Jul 2024 22:56:40 +0100 Subject: [PATCH 1/3] wip --- .../templates/cotton/feature_tile.html | 8 + .../templates/cotton/feature_tiles.html | 3 + .../docs_project/templates/cotton/navbar.html | 4 +- .../templates/cotton/sidebar_link.html | 5 +- .../docs_project/templates/home.html | 148 ++++++------------ 5 files changed, 67 insertions(+), 101 deletions(-) create mode 100644 docs/docs_project/docs_project/templates/cotton/feature_tile.html create mode 100644 docs/docs_project/docs_project/templates/cotton/feature_tiles.html diff --git a/docs/docs_project/docs_project/templates/cotton/feature_tile.html b/docs/docs_project/docs_project/templates/cotton/feature_tile.html new file mode 100644 index 0000000..67091e5 --- /dev/null +++ b/docs/docs_project/docs_project/templates/cotton/feature_tile.html @@ -0,0 +1,8 @@ +
+ {{ icon }} + +
+
{{ title }}
+
{{ slot }}
+
+
\ No newline at end of file diff --git a/docs/docs_project/docs_project/templates/cotton/feature_tiles.html b/docs/docs_project/docs_project/templates/cotton/feature_tiles.html new file mode 100644 index 0000000..899ee28 --- /dev/null +++ b/docs/docs_project/docs_project/templates/cotton/feature_tiles.html @@ -0,0 +1,3 @@ +
+ {{ slot }} +
\ No newline at end of file diff --git a/docs/docs_project/docs_project/templates/cotton/navbar.html b/docs/docs_project/docs_project/templates/cotton/navbar.html index 3699a61..2f50e58 100644 --- a/docs/docs_project/docs_project/templates/cotton/navbar.html +++ b/docs/docs_project/docs_project/templates/cotton/navbar.html @@ -1,6 +1,6 @@ -
{ if (window.matchMedia('(min-width: 640px)').matches) { isOpen = false; diff --git a/docs/docs_project/docs_project/templates/cotton/sidebar_link.html b/docs/docs_project/docs_project/templates/cotton/sidebar_link.html index 6ba2e7b..fc38daa 100644 --- a/docs/docs_project/docs_project/templates/cotton/sidebar_link.html +++ b/docs/docs_project/docs_project/templates/cotton/sidebar_link.html @@ -3,11 +3,12 @@
{% endif %} {{ slot }} diff --git a/docs/docs_project/docs_project/templates/home.html b/docs/docs_project/docs_project/templates/home.html index 4b7853d..7c74f7c 100644 --- a/docs/docs_project/docs_project/templates/home.html +++ b/docs/docs_project/docs_project/templates/home.html @@ -24,7 +24,9 @@

Bringing component-based design to django templates

+

+ Bringing component-based design to django templates +

@@ -92,7 +94,11 @@

{% cotton_verbatim %}{% verbatim %} - + Description of the product {% endverbatim %}{% endcotton_verbatim %} @@ -125,104 +131,52 @@

{{ title }}

- - {% comment %} - - - - - - -
- {% cotton_verbatim %}{% verbatim %} - - -Description of the product -{% endverbatim %}{% endcotton_verbatim %} -
- -
- {% cotton_verbatim %}{% verbatim %} -
- - -
- {% if slot %} - {{ slot }} - {% else %} - This product has no description - {% endif %} - - {% if price %} -
- {{ price }} -
- {% endif %} -
-
{% endverbatim %}{% endcotton_verbatim %}
-
-
-
- - - {% endcomment %} - -
-

Why cotton?

- -
-
- {% heroicon_outline 'fire' class="shrink-0 text-teal-600 w-16 h-16 mr-5 mt-1" stroke_width="1.8" %} -
-
Rapid UI composition
-
Efficiently compose and reuse UI components. Adopting a modular design system streamlines workflow and boosts productivity.
-
-
-
- -
-
Harmonious with Tailwind CSS
-
Tailwind's utility-first approach compliments component based design - isolating style in re-usable components, enhancing maintainability.
-
-
-
-
- {% -
-
-
Interoperable with Django Templates
-
Cotton enhances Django templates without replacing them, allowing progressive enhancement while maintaining full use of existing template features.
-
-
-
- {% heroicon_outline 'code-bracket' class="shrink-0 text-teal-600 w-16 h-16 mr-5 mt-1" stroke_width="1.8" %} -
-
Enhanced Productivity
-
Cotton's HTML tag-like syntax allows code editors to recognize its components as HTML elements, enabling features like syntax highlighting and automatic tag completion.
-
-
-
- {% heroicon_outline 'presentation-chart-line' class="shrink-0 text-teal-600 w-16 h-16 mr-5 mt-1" stroke_width="1.8" %} -
-
Minimal Overhead
-
Cotton compiles to native django components and the compilation step is automatically cached and dynamically managed.
-
-
+
+

Why cotton?

+ + + + + {% heroicon_outline 'fire' class="shrink-0 text-teal-600 size-16 mr-5 mt-1" stroke_width="1.8" %} + + Efficiently compose and reuse UI components. Adopting a modular design system streamlines workflow and boosts productivity. + + + + + + Tailwind's utility-first approach compliments component based design - isolating style in re-usable components, enhancing maintainability. + + + +
{%
+
+ Cotton enhances Django templates without replacing them, allowing progressive enhancement while maintaining full use of existing template features. +
+ + + {% heroicon_outline 'code-bracket' class="shrink-0 text-teal-600 size-16 mr-5 mt-1" stroke_width="1.8" %} + + Cotton's HTML tag-like syntax allows code editors to recognize its components as HTML elements, enabling features like syntax highlighting and automatic tag completion. + + + + {% heroicon_outline 'presentation-chart-line' class="shrink-0 text-teal-600 size-16 mr-5 mt-1" stroke_width="1.8" %} + + Cotton compiles to native django components and the compilation step is automatically cached and dynamically managed. + +
-
-
- - next - - Quickstart +
+ + next + + Quickstart + - - -
+ +
From aaf9d37428e9bc50748e23a897826a3d8a698459 Mon Sep 17 00:00:00 2001 From: Will Abbott Date: Fri, 5 Jul 2024 21:50:19 +0100 Subject: [PATCH 2/3] docs updates --- docs/docs_project/docs_project/templates/home.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/docs_project/docs_project/templates/home.html b/docs/docs_project/docs_project/templates/home.html index 7c74f7c..bf0d4d1 100644 --- a/docs/docs_project/docs_project/templates/home.html +++ b/docs/docs_project/docs_project/templates/home.html @@ -94,11 +94,9 @@

{% cotton_verbatim %}{% verbatim %} - + price="$10"> Description of the product {% endverbatim %}{% endcotton_verbatim %} From bd0a6e34f6838bc0671113567f65584feab64e8b Mon Sep 17 00:00:00 2001 From: Will Abbott Date: Sat, 6 Jul 2024 01:16:53 +0100 Subject: [PATCH 3/3] with gzip --- docs/docs_project/docs_project/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/docs_project/docs_project/settings.py b/docs/docs_project/docs_project/settings.py index 947a821..2783d3d 100644 --- a/docs/docs_project/docs_project/settings.py +++ b/docs/docs_project/docs_project/settings.py @@ -46,6 +46,7 @@ ] MIDDLEWARE = [ + "django.middleware.gzip.GZipMiddleware", "django.middleware.security.SecurityMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware",