Skip to content

Commit a8c5a3d

Browse files
committed
fix(templates) moved bootstrap files to static, removed tailwind templates and unused card-group, #276
1 parent cbaa073 commit a8c5a3d

File tree

11 files changed

+6342
-188
lines changed

11 files changed

+6342
-188
lines changed

djangocms_frontend/static/djangocms_frontend/css/bootstrap5.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.bootstrap5.js

Lines changed: 6311 additions & 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/bootstrap5.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.bootstrap5.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 & 57 deletions
This file was deleted.

djangocms_frontend/templates/tailwind/dropdown.html

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

djangocms_frontend/templates/tailwind/menu.html

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

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,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"stylelint-config-twbs-bootstrap": "^2.2.4",
3535
"uglify-js": "^3.17.4",
3636
"webpack": "^3.0.0",
37+
"copy-webpack-plugin": "^4.6.0",
3738
"webpack2-polyfill-plugin": "0.0.2"
3839
}
3940
}

private/js/components/card-group.js

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

private/js/webpack.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
const argv = require('minimist')(process.argv.slice(2));
22
const plugins = [];
33
const webpack = require('webpack');
4-
const path = require('path');
4+
const path = require('path');1
5+
const CopyPlugin = require("copy-webpack-plugin");
56

67

78
process.env.NODE_ENV = (argv.debug) ? 'development' : 'production';
@@ -12,6 +13,14 @@ plugins.push(
1213
chunks: ['base', 'grid', 'link'],
1314
})
1415
);
16+
plugins.push(
17+
new CopyPlugin([{
18+
from: path.join(
19+
__dirname, '..', '..', 'node_modules', 'bootstrap', 'dist', 'js', 'bootstrap.bundle.js'),
20+
to: path.join(
21+
__dirname, '..', '..', 'djangocms_frontend', 'static', 'djangocms_frontend', 'js', 'bundle.bootstrap5.js'),
22+
}])
23+
)
1524

1625
// add plugins depending on if we are debugging or not
1726
if (argv.debug) {

private/sass/bootstrap5.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)