blob: 55e809c4fb2a1ef69131f8b747e91f37ad58b2df [file] [edit]
{#-
psutil-sphinx-theme: page layout.
Skeleton: topbar / left sidebar / main column (article + right
sidebar) / prev-next / footer. Each chunk lives in its own include
to keep this file scan-able. Built on Sphinx's `basic` theme,
overriding only the blocks needed to assemble the grid.
-#}
{% extends "basic/layout.html" %}
{% block htmltitle %}
{%- if pagename == master_doc -%}
<title>{{ _('psutil: Process and System Utilities for Python') }}</title>
{%- else -%}
{{ super() }}
{%- endif -%}
{% endblock %}
{% block extrahead %}
{{ super() }}
{# Keep the auto-generated index + 404 pages out of search results. #}
{%- if pagename in ['genindex', 'py-modindex', '404'] %}
<meta name="robots" content="noindex">
{%- endif %}
{# Larger icon for iOS home-screen / share sheet. #}
<link rel="apple-touch-icon" href="{{ pathto('_static/images/logo-psutil.png', 1) }}">
<script>
(function() {
const html = document.documentElement;
html.classList.add('no-transition');
const saved = localStorage.getItem('psutil-sphinx-theme');
const theme = saved || (
window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light'
);
html.setAttribute('data-theme', theme);
requestAnimationFrame(() => {
requestAnimationFrame(() => {
html.classList.remove('no-transition');
});
});
})();
</script>
{# GoatCounter. Dashboard: https://psutil.goatcounter.com #}
<script data-goatcounter="https://psutil.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>
{# Google Analytics #}
<script async src="https://www.googletagmanager.com/gtag/js?id=G-G7374TFB11"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-G7374TFB11');
</script>
{% endblock %}
{# Expose the page name on <body> so CSS can match the active sidebar
item, whose link Sphinx renders as href="#". #}
{% block body_tag %}<body data-page="{{ pagename }}">{% endblock %}
{% block header %}
{% include "topbar.html" %}
{% endblock %}
{# Suppress basic's default top/bottom breadcrumb. #}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
{# Suppress basic's body-level footer; ours is rendered in-column
below, inside .main, by footer.html. #}
{% block footer %}{% endblock %}
{# Pages that don't get a right-side TOC. The article column expands
to fill the row. #}
{% set _no_toc_pages = ['index', 'search', 'genindex'] %}
{% set _has_toc = pagename not in _no_toc_pages %}
{% block content %}
<div class="page">
{% include "sidebar.html" %}
<main class="main" id="main-content" role="main">
{# TEMPORARY: remove before release. See dev-banner.html. #}
{% include "dev-banner.html" %}
{% include "breadcrumbs.html" %}
<div class="article-with-toc{% if not _has_toc %} no-toc{% endif %}">
<div class="article-column">
<article class="article">
{% block body %}{% endblock %}
</article>
{% include "prev-next.html" %}
{% include "comments.html" %}
</div>
{% if _has_toc %}{% include "toc.html" %}{% endif %}
</div>
</main>
{# Footer lives outside <main> so its contentinfo landmark is top-level. #}
{% include "footer.html" %}
</div>
{% endblock %}