Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add default announcement #161

Merged
merged 25 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7d9aa30
Add announcent default
Revathyvenugopal162 Nov 25, 2022
77f7e2d
Add announcent input
Revathyvenugopal162 Nov 25, 2022
907e44c
Add js to dynamic insert of contents
Revathyvenugopal162 Nov 25, 2022
137120f
Remove text
Revathyvenugopal162 Nov 25, 2022
e123107
Rename announcement files
Revathyvenugopal162 Nov 28, 2022
bae9957
Rename announcement file
Revathyvenugopal162 Nov 28, 2022
119ba8c
Revert changes
Revathyvenugopal162 Nov 28, 2022
3f3c269
Read txt file
Revathyvenugopal162 Nov 28, 2022
c71598c
Merge branch 'main' into feat/modify-annoncement
Revathyvenugopal162 Nov 28, 2022
4dda749
Add styles
Revathyvenugopal162 Nov 28, 2022
6f4d5f3
Merge branch 'feat/modify-annoncement' of https://github.com/ansys/an…
Revathyvenugopal162 Nov 28, 2022
b57adde
Add path to the announcement
Revathyvenugopal162 Nov 28, 2022
cc1112b
Add error for testing
Revathyvenugopal162 Nov 28, 2022
a599d17
DBG: check file present
jorgepiloto Nov 28, 2022
c40e0c2
Add announcement message layout
Revathyvenugopal162 Nov 29, 2022
f074d8a
Revert the file name
Revathyvenugopal162 Nov 29, 2022
305c610
resolves the layout
Revathyvenugopal162 Nov 29, 2022
318b08d
remove background from announcemnet default
Revathyvenugopal162 Nov 29, 2022
9b3f6ad
Add new style for announcement
Revathyvenugopal162 Nov 29, 2022
f54d8ed
Merge branch 'main' into feat/modify-annoncement
Revathyvenugopal162 Nov 30, 2022
fbed219
Add version warning color
Revathyvenugopal162 Nov 30, 2022
30b27fe
Merge branch 'feat/modify-annoncement' of https://github.com/ansys/an…
Revathyvenugopal162 Nov 30, 2022
b7e51ce
Add version warning color to light red
Revathyvenugopal162 Nov 30, 2022
0dc4b05
Add opacity for the dark theme
Revathyvenugopal162 Nov 30, 2022
4f2f801
correcting the layout of css.
Revathyvenugopal162 Nov 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ __pycache__/
.Python
_build/
build/
_build/
develop-eggs/
dist/
downloads/
Expand Down
14 changes: 14 additions & 0 deletions src/ansys_sphinx_theme/announcement_layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% if theme_switcher %}
Revathyvenugopal162 marked this conversation as resolved.
Show resolved Hide resolved
<div id="announce"></div>
<script>
fetch("announcement.html")
.then((response) => {
if (!response.ok) {
throw new Error(`HTTP error: ${response.status}`);
}
return response.text();
})
.then(text => document.getElementById("announce").innerHTML = text)
.catch((error) => console.error(`Fetch problem: ${error.message}`));
</script>
{% endif %}
9 changes: 9 additions & 0 deletions src/ansys_sphinx_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
{% endif %}
{% endblock %}


{%- block content %}
<div class="bd-header-announcement container-fluid"
id="header-announcement">
{% include 'announcement_layout.html' %}
</div>
{{ super() }}
{% endblock %}

{% block docs_navbar %}
{{ super() }}
{% if theme_show_breadcrumbs %}
Expand Down
13 changes: 13 additions & 0 deletions src/ansys_sphinx_theme/static/css/breadcrumbs.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@ body {

*, :after, :before {
box-sizing: border-box;
}

#header-announcement{
background-color: var(--pst-color-background);
border: 1px solid black;
margin-left: 20px solid var(--pst-color-background);
margin-right: 20px solid var(--pst-color-background);
padding-left: 3rem;
color: brown;
}

#header-announcement-spacer {
padding-left: 10rem solid var(--pst-color-background);
}