Bootstrap Alerts

Yusef Aslam - 03 Apr 2024

Tags: bootstrap

Demoing bootstrap alerts.

Primary alert

Warning alert

Dark alert

How to use the alerts

The alerts are in the _includes directory of this blog:

1
2
3
4
5
6
7
8
9
10
11
12
 ~/G/yaslamblog / gh-pages / _includes $ tree
.
├── alert-dark.html
├── alert-primary.html
├── alert-warning.html
├── comments.html
├── footer.html
├── links.html
├── navigation.html
└── post-data.html

1 directory, 8 files

You choose the alert you want and use it in a post with the capture functionality of Jekyll like this:

1
2
3
\{\% capture alert-dark \%\}
Something here.
\{\% endcapture \%\}

Then include the file from _includes:

1
\{\% include alert-dark.html heading="" content=alert-dark \%\}

Which will produce an alert like this:

If the heading is unset, the default heading is Note: for the alert-dark alert.

Regenerated at : November 20, 2024 - 13:38:24 GMT