Skip to content

Commit e21d1ee

Browse files
committed
fix(templates) loading bootstrap files from static, discarded tailwind css load and unused card-group, #276
1 parent cbaa073 commit e21d1ee

File tree

9 files changed

+23
-100
lines changed

9 files changed

+23
-100
lines changed

djangocms_frontend/static/djangocms_frontend/css/bootstrap.css

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

djangocms_frontend/static/djangocms_frontend/js/bundle.bootstrap.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

djangocms_frontend/templates/bootstrap5/base.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{% extends "djangocms_frontend.html" %}{% load cms_tags menu_tags %}
1+
{% extends "djangocms_frontend.html" %}{% load cms_tags menu_tags static %}
22
{% block base_css %}
3-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
3+
<link href="{% static 'djangocms_frontend/css/bootstrap.css' %}" rel="stylesheet">
44
{% endblock %}
55
{% block base_js %}
6-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
6+
<script src="{% static 'djangocms_frontend/js/bundle.bootstrap.js' %}"></script>
77
{% endblock %}
88
{% block navbar %}
99
<nav class="navbar {% block navbar_options %}navbar-expand-lg navbar-dark bg-dark{% endblock %}">

djangocms_frontend/templates/tailwind/base.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{% extends "djangocms_frontend.html" %}{% load cms_tags menu_tags %}
22
{% block base_css %}
3-
<script src="https://cdn.tailwindcss.com"></script>
43
<style>
54
nav a:hover + .dropdown, nav .dropdown:hover {
65
display: block;

docs/source/tutorial/builtin_components.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,12 @@ You need to manually add them to your templates.
121121
{% extends "bootstrap5/base.html" %}
122122
{% block brand %}<a href="/">My Site</a>{% endblock %}
123123
124-
This will load Bootstrap 5 CSS and JS from a CDN.
124+
This will load Bootstrap 5 CSS and JS.
125125

126126
.. note::
127127

128-
We recommend developing your own ``base.html`` for your projects. The
129-
example templates load CSS and JS files from a CDN. Good reasons to do so
130-
are
128+
We recommend developing your own ``base.html`` for your projects.
131129

132-
* ``djangocms-frontend`` does not contain CSS or JS files from Bootstrap
133-
or any other framework for that matter. The example templates load
134-
CSS and JS from a CDN.
135-
* It is considered safer to host CSS and JS files yourself. Otherwise you
136-
do not have control over the CSS and/or JS that is delivered.
137130
* It is a common practice to customize at least the CSS part, e.g. with
138131
brand colors.
139132
* You might have a totally different build process for your styling assets,

private/js/bootstrap.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import * as bootstrap from 'bootstrap';

private/js/components/card-group.js

Lines changed: 0 additions & 87 deletions
This file was deleted.

private/js/webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ module.exports = {
6161
base: path.join(__dirname, 'base.js'),
6262
link: path.join(__dirname, 'link.js'),
6363
grid: path.join(__dirname, 'grid.js'),
64+
bootstrap: path.join(__dirname, 'bootstrap.js'),
6465
},
6566
output: {
6667
path: path.join(__dirname, '..', '..', 'djangocms_frontend', 'static', 'djangocms_frontend', 'js'),

private/sass/bootstrap.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@charset "utf-8";
2+
3+
@import "node_modules/bootstrap/scss/bootstrap";

0 commit comments

Comments
 (0)