-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from melissawm/add-banner
- Loading branch information
Showing
8 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.bd-header-announcement { | ||
align-items: center; | ||
background: theme('colors.hub-primary.200') !important; | ||
display: flex; | ||
font-weight: bold; | ||
justify-content: center; | ||
margin-top: 64px; | ||
padding: 16px; | ||
position: relative; | ||
text-align: center; | ||
width: 100%; | ||
|
||
font-size: 11px; | ||
@screen screen-495 { | ||
font-size: 14px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/napari_sphinx_theme/theme/napari_sphinx_theme/announcement.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{%- if theme_announcement -%} | ||
|
||
{% set is_remote=theme_announcement.startswith("http") %} | ||
|
||
{# If we are remote, add a script to make an HTTP request for the value on page load #} | ||
{%- if is_remote %} | ||
<script> | ||
$.get("{{ theme_announcement }}", success=(data)=>{ | ||
$("#header-announcement").html(`<div class="bd-header-announcement__content">${data}</div>`); | ||
}).fail(() => { | ||
console.log("[PST]: Failed to load announcement at: {{ theme_announcement }}") | ||
}); | ||
|
||
</script> | ||
{% endif %} | ||
|
||
<div class="bd-header-announcement container-fluid" id="header-announcement"> | ||
{#- if announcement text is not remote, populate announcement w/ local content -#} | ||
{%- if not is_remote %} | ||
<div class="bd-header-announcement__content">{{ theme_announcement }}</div> | ||
{%- endif -%} | ||
</div> | ||
|
||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters