Breakingnews communicates important project-related messages. By important, understand up-coming events, organizational changes, end-of-life notes, new releases, and similars. Once enabled and configured, breakingnews message is always visible, directly under navigation bar. The breakingnews message cannot be dismissed once configured, unless you remove the configuration that created it in first place.
Breakingnews is more relevant than announcement.
Presentation template
Breakingnews presentation template is defined in the _includes/base/breakingnews.html
file.
Breakingnews presentation template arranges a bullhorn icon () on the left side of the breakingnews and adds a message to it. On the right side, it presents a “Known more” button where you can set a URL expanding the message in more detail.
Breakingnews presentation template affects the page height. Having a message of more than two visible lines makes the breakingnews height value greater than the maximum value (38px) configured to calculate the scroll-margin-top
property. Consequently, during in-page navigation, headers may despair under the breakingnews message. To present breakingnews effectively, keep your message short, one-line if possible, and use the “Know more” button URL to link details.
Configuration file
Breakingnews presentation template reads configuration variables from configuration files described below:
-
Site’s configuration file:
_config.yml
Set default values for both site and page-specific configuration variables.
-
Page preamble section of markdown files:
**/*.md
Set custom values for page-specific configuration variables. Page configuration variables defined in page preamble section of markdown files override page configuration variables defined in site’s configuration file.
Configuration variables
Breakingnews configuration variables are described in the following table:
Name | Description |
---|---|
with_breakingnews |
The breakingnews presentation switcher. Possible values are true or false (default). When the value is true , you need to provide the with_breakingnews_data variable with the breakingnews information you want to present. |
with_breakingnews_data |
The breakingnews configuration. Here is where you write your message and customize its presentation. When more than one breakingnews message is provided, they are presented in the same order they were entered in the list, from top to bottom. |
The with_breakingnews_data
list items accept the properties described in the table below:
Name | Description |
---|---|
content |
The breakingnews content. This is, the message you want to communicate. |
color |
The breakingnews color. Possible options include primary (default), secondary , info , warning , danger , success , dark , light . |
icon |
The breakingnews icon class rendered on the left side. Possible options to use use here are limited to fontawesome freely distributed icons. When no icon class is provided, fa-solid fa-bullhurn is used by default. |
url |
The breakingnews URL pointing to details about the breakingnews content. |
Showing breakingnews at page level
---
title: This is a page with breakingnews enabled and configured
with_breakingnews: true
with_breakingnews_data:
- content: My breakingnews content.
---
Some content here.
To show breakingnews at page level, do the following:
-
Add
with_breakingnews
to page preamble in Markdown files with valuetrue
. -
Add
with_breakingnews_data
to page preamble in Markdown files withcontent
set to the message you want to communicate.
Showing breakingnews at site level
# site.defaults - Set global default values.
defaults:
- scope:
path: "" # an empty string here means all files in the project.
values:
with_breakingnews: true
with_breakingnews_data:
- content: My breakingnews content.
To show breakingnews at site level, edit site’s configuration file (e.g., _config.yml
) and do the following:
-
Add
with_breakingnews
configuration variable with valuetrue
under defaults values. -
Add
with_breakingnews_data
configuration variable withcontent
, and any other supported property, under defaults values.
Hiding breakingnews at page level
---
title: This is a page with breakingnews disabled
with_breakingnews: false
---
Some content here.
To hide breakingnews at page level, set with_breakingnews
configuration variable to false
in the page preamble of Markdown files.
Hiding breakingnews at site level
# site.defaults - Set global default values.
defaults:
- scope:
path: "" # an empty string here means all files in the project.
values:
with_breakingnews: false
To hide breakingnews at site level, set with_breakingnews
configuration variable to false
in the site configuration file _config.yml
, under defaults values.