Skip to content

Commit

Permalink
Disable search and drawer logo when using static template
Browse files Browse the repository at this point in the history
  • Loading branch information
limptwiglet committed Jan 12, 2024
1 parent 8f6bde3 commit 3776d15
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
39 changes: 21 additions & 18 deletions _docs_theme/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@

<header class="md-header" data-md-component="header">
<div class="masthead">

<nav class="masthead__nav md-header__inner md-grid">
{% if staticPage is not defined %}
<!-- Button to open drawer -->
<label class="md-header__button md-icon" for="__drawer">
{% set icon = config.theme.icon.menu or "material/menu" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</label>

<!-- Button to open drawer -->
<label class="md-header__button md-icon" for="__drawer">
{% set icon = config.theme.icon.menu or "material/menu" %}
{% include ".icons/" ~ icon ~ ".svg" %}
</label>

<!-- Logo -->
<label class="md-nav__title" for="__drawer">
<a
href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
title="{{ config.site_name | e }}"
class="md-nav__button md-logo"
aria-label="{{ config.site_name }}"
data-md-component="logo"
>
{% include "partials/logo.html" %}
</a>
</label>
{% endif %}

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

<a href="{{ config.site_url }}.." class="masthead__logo">
<svg xmlns="http://www.w3.org/2000/svg" width="254" height="30" viewBox="0 0 254 30" fill="none">
Expand Down Expand Up @@ -106,7 +109,7 @@
</ul>
</nav>

{% if ("material/search" in config.plugins) and (noSearch is not defined) %}
{% if ("material/search" in config.plugins) and (staticPage is not defined) %}
<label class="md-header__button md-icon" for="__search">
{% set icon = config.theme.icon.search or "material/magnify" %}
{% include ".icons/" ~ icon ~ ".svg" %}
Expand Down
3 changes: 1 addition & 2 deletions _docs_theme/static.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
<link href="https://fonts.googleapis.com/css?family=DM+Sans:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&amp;display=fallback" rel="stylesheet">
</head>
<body class="static">

{% set noSearch = true %}
{% set staticPage = true %}
{% include "partials/header.html" %}

{% block content %}
Expand Down

0 comments on commit 3776d15

Please sign in to comment.