Skip to content

Commit

Permalink
rubik-sidebar-nav update
Browse files Browse the repository at this point in the history
  • Loading branch information
abjarna committed Jun 8, 2024
1 parent 0735278 commit 05660e1
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 1,191 deletions.
38 changes: 24 additions & 14 deletions rit/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,13 @@ Síðan er stærðin á myndunum skilgreint inn í tikz skránum. */
margin: 0 !important;
}

/* Setja sama style á textann "Kaflayfirlit" eins og er í toctree caption */
.page-toc.tocsection.onthispage {
/* Setja sama style og er í toctree caption á eftirfarandi fyrirsagnir */
.page-toc.tocsection.onthispage,
.rubik-social-media-text,
.rubik-sidebar-nav-section-top {
font-weight: var(--pst-sidebar-header-font-weight);
margin-bottom: .5rem;
}

/* Setja sama style á "social-media-text" eins og er í toctree caption */
.social-media-text {
font-weight: var(--pst-sidebar-header-font-weight);
margin-bottom: .5rem;
}
}

/* Tryggja icon-links séu left-aligned og byrja á sama stað og logo og annar texti í sidebar */
.navbar-icon-links {
Expand Down Expand Up @@ -131,8 +127,7 @@ mjx-container[jax="SVG"] use[data-c] {
stroke-width: 3px !important;
}

/* Fjarlægja "back to top" takkann og "Skip to main content" container-inn sem birtist stundum efst á síðu í Safari */
#pst-back-to-top,
/* Fjarlægja "Skip to main content" container-inn sem birtist stundum efst á síðu í Safari */
#pst-skip-link {
display: none !important;
}
Expand All @@ -141,14 +136,16 @@ mjx-container[jax="SVG"] use[data-c] {
:focus-visible {
outline: none !important;
}
a.nav-link:focus-visible {
box-shadow: none !important;
}
.nav-link.nav-internal:focus {
color: var(--pst-color-text-muted);
}
.nav-link.nav-internal:hover {
color: var(--pst-color-link-hover);
}


/* Laga þetta vandamál hér: https://github.com/pydata/pydata-sphinx-theme/issues/1855 */
table.indextable.genindextable {
border: none !important;
Expand All @@ -160,14 +157,27 @@ table.indextable.genindextable tr {
background-color: inherit !important;
}

/* Gera línu fyrir ofan social-media-text */
.social-media-text {
/* Setja hover lit á toggle takkann í toctree */
.toctree-toggle:hover {
color: var(--pst-color-link-hover);
}





/* Gera línu fyrir ofan rubik-social-media-text -- GERA ÞETTA FREKAR FYRIR NEÐAN OF SAMRÆMA VIÐ AÐRA CONTAINER-A */
.rubik-social-media-text {
padding: .5rem 0;
border-top: 1px solid var(--pst-color-border);
}







/* Smá lita-test
Expand Down
2 changes: 1 addition & 1 deletion rit/_templates/rubik-icon-links.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{# Displays icon-links as list items. #}
<div
class="social-media-text">
class="rubik-social-media-text">
Fylgstu með á samfélagsmiðlum
</div>
{%- macro icon_link_nav_item(url, icon, name, type, attributes='') -%}
Expand Down
16 changes: 0 additions & 16 deletions rit/_templates/rubik-sidebar-nav-bs.html

This file was deleted.

16 changes: 16 additions & 0 deletions rit/_templates/rubik-sidebar-nav-root-top.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{%- set sidebar_nav_html = generate_toctree_html(
"sidebar",
startdepth=0,
show_nav_level=theme_show_nav_level | int,
maxdepth=theme_navigation_depth | int,
collapse=theme_collapse_navigation | tobool,
includehidden=theme_sidebar_includehidden | tobool,
titles_only=True
) -%}

<div class="bd-links test" id="bd-docs-nav" aria-label="{{ _('Section navigation') }}">
<!-- <p class="bd-links__title" role="heading" aria-level="1">{{ _("Section Navigation") }}</p> -->
<div class="bd-toc-item navbar-nav test2">
{{ sidebar_nav_html }}
</div>
</div>
20 changes: 20 additions & 0 deletions rit/_templates/rubik-sidebar-nav-section-top.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{%- set sidebar_nav_html = generate_toctree_html(
"sidebar",
startdepth=0,
show_nav_level=theme_show_nav_level | int,
maxdepth=1,
collapse=theme_collapse_navigation | tobool,
includehidden=theme_sidebar_includehidden | tobool,
titles_only=True
) -%}

<div class="bd-links test" id="bd-docs-nav" aria-label="{{ _('Section navigation') }}">
<p class="bd-links__title rubik-sidebar-nav-section-top" role="heading" aria-level="1">Allar síður</p>
<div class="bd-toc-item navbar-nav test2">
{{ sidebar_nav_html }}
</div>
</div>




15 changes: 15 additions & 0 deletions rit/_templates/rubik-sidebar-nav-section.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{%- set sidebar_nav_html = generate_toctree_html(
"sidebar",
show_nav_level=theme_show_nav_level | int,
maxdepth=theme_navigation_depth | int,
collapse=theme_collapse_navigation | tobool,
includehidden=theme_sidebar_includehidden | tobool,
titles_only=True
) -%}

<nav class="bd-docs-nav bd-links" aria-label="{{ _('Section Navigation') }}">
<!-- <p class="bd-links__title" role="heading" aria-level="1">{{ _("Section Navigation") }}</p> -->
<div class="bd-toc-item navbar-nav">
{{ sidebar_nav_html }}
</div>
</nav>
24 changes: 15 additions & 9 deletions rit/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,13 @@ def update_config_values(app):
"image_dark": "_static/rubik-logo-dark.svg", # Logo fyrir dark-mode
},
"use_edit_page_button": True, # "Edit on GitHub" takkinn virkjaður
"search_bar_text": "Sláðu inn leitarorð...", # Þegar smellt er á "Leit", þá kemur upp gluggi með þessum texta
"search_bar_text": "Sláðu inn leitarorð...", # Þegar smellt er á "Leit" takkan, þá sést þessi texti í leitarglugga
"navbar_align": "content", # "navbar" er left-aligned frá þeim stað sem "content" byrjar
"navigation_depth": 7,
"collapse_navigation": True,
"header_links_before_dropdown": 3, # Ákveða hversu margar síður birtast í header áður en að "More" takkinn kemur í staðinn
"navigation_depth": 5, # Toc dýpt í left sidebar
"show_toc_level": 5, # Toc dýpt í right sidebar
"header_links_before_dropdown": 3, # Hversu margar síður birtast í header áður en að "More" takkinn tekur við
"header_dropdown_text": "Meira", # Íslenskur texti fyrir "More" takkann
"back_to_top_button": False, # Fjarlægja "Efst á síðu" takkann
# "announcement": "My announcement!", # Tilkynning efst á síðunni

# Icon og tenglar inn á samfélagsmiðla
Expand Down Expand Up @@ -236,7 +237,11 @@ def update_config_values(app):
"icon": "fa-brands fa-threads",
},
],
"secondary_sidebar_items": ["rubik-page-toc", "rubik-pdf", "rubik-sourcelink", "rubik-edit-this-page"],
"secondary_sidebar_items": {
"**": ["rubik-page-toc", "rubik-pdf", "rubik-sourcelink", "rubik-edit-this-page"],
"genindex": [],
"search": [],
},
"show_prev_next": False,
"article_header_start": [],
"footer_end": [],
Expand All @@ -256,9 +261,10 @@ def update_config_values(app):
html_css_files = ['custom.css'] # Slóð á CSS skrár
html_static_path = ['_static'] # Slóð á "static" skrár
html_sidebars = {
"*/**": ["rubik-sidebar-nav-bs", "rubik-icon-links"],
"genindex": ["sidebar-nav-bs.html", "rubik-icon-links"],
"index": ["sidebar-nav-bs.html", "rubik-icon-links"],
"**": ["rubik-sidebar-nav-section", "rubik-sidebar-nav-section-top", "rubik-icon-links"],
"index": ["rubik-sidebar-nav-root-top", "rubik-icon-links"],
"genindex": ["rubik-sidebar-nav-root-top", "rubik-icon-links"],
"search": ["rubik-sidebar-nav-root-top", "rubik-icon-links"],
}
html_show_copyright = False # Slökkt á default texta um höfundarrétt í HTML
html_show_sphinx = False # Slökkt á "Created using Sphinx" texta í HTML
Expand Down Expand Up @@ -454,4 +460,4 @@ def add_data_attributes(app, pagename, templatename, context, doctree):
def setup(app):

# Tengja add_data_attributes fallið við 'html-page-context' atburðinn í Sphinx
app.connect('html-page-context', add_data_attributes)
app.connect('html-page-context', add_data_attributes)
29 changes: 29 additions & 0 deletions rit/eldhusvaskur/admonitions/admonitions-1/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Admonitions 1
=============

Text below header one

Header two
----------

Text below header two

Header three
^^^^^^^^^^^^

Text below header three

Header four
~~~~~~~~~~~

Text below header four

Header five
"""""""""""

Text below header five

Header six
++++++++++

Text below header six
29 changes: 29 additions & 0 deletions rit/eldhusvaskur/admonitions/admonitions-2/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Admonitions 2
=============

Text below header one

Header two
----------

Text below header two

Header three
^^^^^^^^^^^^

Text below header three

Header four
~~~~~~~~~~~

Text below header four

Header five
"""""""""""

Text below header five

Header six
++++++++++

Text below header six
29 changes: 29 additions & 0 deletions rit/eldhusvaskur/admonitions/admonitions-3/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Admonitions 3
=============

Text below header one

Header two
----------

Text below header two

Header three
^^^^^^^^^^^^

Text below header three

Header four
~~~~~~~~~~~

Text below header four

Header five
"""""""""""

Text below header five

Header six
++++++++++

Text below header six
11 changes: 10 additions & 1 deletion rit/eldhusvaskur/admonitions/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Admonitions
===========

.. toctree::
:caption: Admonitions kaflar
:maxdepth: 6

admonitions-1/index
admonitions-2/index
admonitions-3/index

Hér er smá texti fyrir ofan yfirlit fyrirsafna.

.. contents:: Yfirlit fyrirsagna í Admonitions
Expand Down Expand Up @@ -133,4 +141,5 @@ Text below header five
Header six
++++++++++

Text below header six
Text below header six

10 changes: 0 additions & 10 deletions rit/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,4 @@ Samanber :numref:`kodabalkur`, þá er þetta mjög flottur kóði.
fjarmal-einstaklinga/index
fjarmal-fyrirtaekja/index
eldhusvaskur/index

.. toctree::
:numbered:
:maxdepth: 7

testing

.. toctree::
:maxdepth: 7

genindex
Loading

0 comments on commit 05660e1

Please sign in to comment.