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

Prepare release 0.3.2 #26

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [0.3.2] - 2024-03-13

- Use the directive `:hideindex: 1`, to hide the nftt-sidebar-content.
- For compatibility with previous versions, rename stored color from cyan to default.
- Move footer to the bottom of the page.

## [0.3.1] - 2024-03-11

- Serve static files with the version number in the name.
3 changes: 3 additions & 0 deletions docs/source/_static/colorsets.js
Original file line number Diff line number Diff line change
@@ -3,6 +3,9 @@ const DEFAULT = "default";
export class ColorSetHandler {
constructor() {
this.stored_color = localStorage.getItem('snftt-color');
if (this.stored_color == "cyan") { // Fix for previos stored value 'cyan'.
this.stored_color = DEFAULT;
}
this.applyColor(this.preferredColor);
this.updateDropdown(this.preferredColor);
}
24 changes: 7 additions & 17 deletions js/src/tocresize.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
export function resizeAsides() {
let height = "";

const nftt_layout = document.querySelector(".nftt-layout");
const nftt_content = document.querySelector(".nftt-content");
const nftt_sidebar = document.querySelector(".nftt-sidebar");
const nftt_sidebar_content = document.querySelector(".nftt-sidebar-content");
const nftt_toc = document.querySelector(".nftt-toc");

// If min-width is not >= 992px, don't do anything.
if (window.matchMedia('(min-width: 992px)').matches == false) {
nftt_sidebar?.setAttribute("style", "");
nftt_toc?.setAttribute("style", "");
return "";
}

if (nftt_content != undefined) {
height = nftt_content.clientHeight > document.body.clientHeight
? "height: calc(100vh - 7rem)"
: `height: ${nftt_content.clientHeight}px`;
}

// Height for nftt-sidebar.
// Apply style attribute to nftt-sidebar (when min-width >= 1200px).
if (window.matchMedia('(min-width: 1200px)').matches == false) {
nftt_sidebar?.setAttribute("style", "");
} else {
nftt_sidebar?.setAttribute("style", height);
}

// Height for nftt-toc.
// Apply style attribute to nftt-toc (when min-width >= 992px).
if (window.matchMedia('(min-width: 992px)').matches == false) {
nftt_toc?.setAttribute("style", "");
return "";
} else {
nftt_toc?.setAttribute("style", height);
}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sphinx-nefertiti",
"version": "0.3.1",
"version": "0.3.2",
"private": true,
"description": "Nefertiti is a theme for the Sphinx Documentation Generator.",
"engines": {
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@

setup(
name="sphinx-nefertiti",
version="0.3.1",
version="0.3.2",
packages=find_packages(),
include_package_data=True,
license="MIT",
2 changes: 1 addition & 1 deletion site/index.html
Original file line number Diff line number Diff line change
@@ -300,7 +300,7 @@ <h6 class="dropdown-header">Light/dark</h6>
</nav>
</header>

<div class="container-fluid">
<div class="container-fluid flex-grow-1">
<div class="nftt-gutter nftt-page">
<aside class="nftt-sidebar">
<div class="nftt-sidebar-content">
3 changes: 3 additions & 0 deletions sphinx_nefertiti/__init__.py
Original file line number Diff line number Diff line change
@@ -10,6 +10,9 @@
__version__ = utils.get_version()


pages_wo_index = ["genindex", "search"]


def get_html_theme_path():
"""Return absolute path to parent folder of installed theme."""
return str(Path(__file__).parents[1].absolute)
12 changes: 9 additions & 3 deletions sphinx_nefertiti/layout.html
Original file line number Diff line number Diff line change
@@ -6,8 +6,12 @@
{%- else %}
{%- set titlesuffix = "" -%}
{%- endif -%}
{%- set hideindex = '' %}
{%- set hidetoc = '' %}
{%- if meta is defined and meta %}
{%- if 'hideindex' in meta.keys() %}
{%- set hideindex = meta.get('hideindex') %}
{%- endif %}
{%- if 'hidetoc' in meta.keys() %}
{%- set hidetoc = meta.get('hidetoc') %}
{%- endif %}
@@ -98,7 +102,7 @@
</head>
<body>
<header class="navbar navbar-expand-xl navbar-dark nftt-navbar flex-column fixed-top">
<div class="skip-links container-fluid visually-hidden-focusable overflow-hidden justify-content-start">
<div class="skip-links container-fluid visually-hidden-focusable overflow-hidden justify-content-start flex-grow-1">
<div class="border-bottom mb-2 pb-2 w-100">
<a class="d-none d-md-inline-flex p-2 m-1" href="#sidebar-filter">{{ _('Skip to docs navigation') }}</a>
<a class="d-inline-flex p-2 m-1" href="#content">{{ _('Skip to main content') }}</a>
@@ -191,10 +195,11 @@
</nav>
</header>

<div class="container-fluid">
<div class="container-fluid flex-grow-1">
<div class="nftt-gutter {% if hidetoc %}nftt-page-wo-toc{% else %}nftt-page{% endif %}">
<aside class="nftt-sidebar">
<aside class="nftt-sidebar {% if hideindex %}border-0{% endif %}">
<div class="nftt-sidebar-content">
{% if not hideindex %}
<div class="title d-none d-xl-block">
<i class="bi bi-book"></i>&nbsp;&nbsp;<span>{{ _('Index') }}</span>
</div>
@@ -204,6 +209,7 @@
{%- include sidebartemplate %}
{%- endfor %}
</div>
{% endif %}
</div>
</aside>
<article id="content" class="nftt-content" role="main">
2 changes: 1 addition & 1 deletion sphinx_nefertiti/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_CURRENT_VERSION = (0, 3, 1, "f", 0) # following PEP 440
_CURRENT_VERSION = (0, 3, 2, "f", 0) # following PEP 440


def get_version():