Skip to content

Commit

Permalink
Merge pull request #644 from Avaiga/fix/persistent-page-title
Browse files Browse the repository at this point in the history
fix(header): Bring back dynamic site name and page title
  • Loading branch information
Jaufrey Lafuste authored Oct 10, 2023
2 parents d4928d3 + 2b53260 commit 88cfde2
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 12 deletions.
2 changes: 1 addition & 1 deletion mkdocs.yml_template
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ theme:
font:
text: Lato
icon:
logo: taipy-logo
logo: taipy-logo-icon
repo: fontawesome/brands/git-alt
palette:
- media: "(prefers-color-scheme: light)"
Expand Down
1 change: 1 addition & 0 deletions taipy_theme/.icons/taipy-logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 17 additions & 2 deletions taipy_theme/assets/stylesheets/avaiga.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,30 @@
}
}

.md-header__title-wrapper{
flex: 1;
display: flex;
align-items: center;
}

.md-header .md-logo img,
.md-header .md-logo svg{
height: 1.5rem;
}

.md-header__title-wrapper .md-header__title{
margin-left: 0;
}

.md-header__title .md-site-name{
font-size: 1.25rem;
font-weight: 400;
}

@media screen and (max-width: 76.1875em){
.md-header .md-logo {
display: block;
flex: 1;
flex: 0 0 auto;
}
}

Expand All @@ -151,7 +166,7 @@
}

.md-header .md-tabs{
flex: 1;
flex: 0 0 auto;
width: auto;
background-color: transparent;
color: currentColor;
Expand Down
47 changes: 38 additions & 9 deletions taipy_theme/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,44 @@
</label>

<!-- Link to home -->
<a
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
title="{{ config.site_name | e }}"
class="md-header__button md-logo"
aria-label="{{ config.site_name }}"
data-md-component="logo"
>
{% include "partials/logo.html" %}
</a>

<div class="md-header__title-wrapper">
<a
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
title="{{ config.site_name | e }}"
class="md-header__button md-logo"
aria-label="{{ config.site_name }}"
data-md-component="logo"
>
{% include "partials/logo.html" %}
</a>

<!-- Header title -->
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<a
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
title="{{ config.site_name | e }}"
class="md-ellipsis md-site-name"
aria-label="{{ config.site_name }}"
>
{{ config.site_name }}
</a>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
{% if page.meta and page.meta.title %}
{{ page.meta.title }}
{% else %}
{{ page.title }}
{% endif %}
</span>
</div>
</div>
</div>
</div>

<!-- Site language selector -->
{% if config.extra.alternate %}
<div class="md-header__option">
Expand Down

0 comments on commit 88cfde2

Please sign in to comment.