Skip to content

Commit

Permalink
Merge pull request #130 from jannecederberg/main
Browse files Browse the repository at this point in the history
Enable html_theme_options keys for a few hardcoded theme strings
  • Loading branch information
bashtage authored Jan 16, 2023
2 parents 6e0ef82 + baa6c02 commit 49868b5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sphinx_material/sphinx_material/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
<span class="md-flex__ellipsis">
<span
class="md-footer-nav__direction"> Previous </span> {{ prev.title }} </span>
class="md-footer-nav__direction"> {{ theme_nav_previous_text }} </span> {{ prev.title }} </span>
</div>
</a>
{% endif %}
Expand All @@ -145,7 +145,7 @@
rel="next">
<div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span
class="md-flex__ellipsis"> <span
class="md-footer-nav__direction"> Next </span> {{ next.title }} </span>
class="md-footer-nav__direction"> {{ theme_nav_next_text }} </span> {{ next.title }} </span>
</div>
<div class="md-flex__cell md-flex__cell--shrink"><i
class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
Expand Down
2 changes: 1 addition & 1 deletion sphinx_material/sphinx_material/localtoc.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% set toc_nodes = derender_toc(toc, True, pagename) if display_toc else [] %}
<nav class="md-nav md-nav--secondary">
{%- if display_toc and toc_nodes and sidebars and 'localtoc.html' in sidebars %}
<label class="md-nav__title" for="__toc">Contents</label>
<label class="md-nav__title" for="__toc">{{ theme_localtoc_label_text }}</label>
{%- endif %}
<ul class="md-nav__list" data-md-scrollfix="">
{%- if display_toc and sidebars and 'localtoc.html' in sidebars %}
Expand Down
2 changes: 1 addition & 1 deletion sphinx_material/sphinx_material/searchbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" action="{{ pathto('search') }}" method="get" name="search">
<input type="text" class="md-search__input" name="q" placeholder="Search"
<input type="text" class="md-search__input" name="q" placeholder="{{ theme_search_placeholder_text }}"
autocapitalize="off" autocomplete="off" spellcheck="false"
data-md-component="query" data-md-state="active">
<label class="md-icon md-search__icon" for="__search"></label>
Expand Down
8 changes: 8 additions & 0 deletions sphinx_material/sphinx_material/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ globaltoc_depth = 1
globaltoc_collapse = true
# If true, the global TOC tree will also contain hidden entries
globaltoc_includehidden = true
# Label text for local TOC
localtoc_label_text = "Contents"

# Colors
# The theme color for mobile browsers. Hex color.
Expand Down Expand Up @@ -84,6 +86,9 @@ master_doc = True
# title: The title to appear (str)
# internal: Flag indicating to use pathto (bool)
nav_links =
# Text for previous/next links
nav_previous_text = "Previous"
nav_next_text = "Next"

# Text to appear at the top of the home page in a "hero" div. Must be a
# dict[str, str] of the form pagename: hero text, e.g., {'index': 'text on index'}
Expand Down Expand Up @@ -115,3 +120,6 @@ table_classes =
# classes is set, **all** table classes are kept.
# This is different to "table_classes", which only keeps the configured classes.
table_no_strip =

# Enable customizing the placeholder text of the search field
search_placeholder_text = "Search"

0 comments on commit 49868b5

Please sign in to comment.