Skip to content

Commit

Permalink
⚙️ FEATURE-#23: Sidebar implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoCelmer committed Jan 27, 2025
1 parent 5e23894 commit 08fe3bd
Show file tree
Hide file tree
Showing 14 changed files with 977 additions and 1,455 deletions.
2 changes: 1 addition & 1 deletion LAST_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.9
0.0.10
2 changes: 1 addition & 1 deletion mkdocs_simple_blog/assets/css/main.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 30 additions & 14 deletions mkdocs_simple_blog/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@
<link rel="icon" type="image/x-icon" href="{{ 'assets/img/favicon.ico'|url }}">
{% endif %}

{%- block libs %}
{%- if config.theme.highlightjs %}
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/[email protected]/styles/base16/grayscale-dark.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>

{%- for lang in config.theme.hljs_languages %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/{{lang}}.min.js"></script>
{%- endfor %}
<script>hljs.highlightAll();</script>
{%- endif %}
{%- endblock %}
{%- if config.theme.highlightjs %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@highlightjs/[email protected]/styles/base16/grayscale-dark.min.css">

{%- for lang in config.hljs_languages %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/{{lang}}.min.js"></script>
{%- endfor %}
<script>hljs.highlightAll();</script>
{%- endif %}

{%- endblock %}

Expand Down Expand Up @@ -84,9 +82,27 @@
{%- if 'search' in config['plugins'] %}{%- include "searchbox.html" %}{%- endif %}
{%- endblock %}

{%- block content %}
{% include "/modules/content.html" %}
{%- endblock %}
{% if config.theme.sidebar %}
<div class="container">
<div class="row">
<div class="col-3">
{%- block sidebar %}
{% include "/modules/sidebar.html" %}
{%- endblock %}
</div>
<div class="col-9">
{%- block content_with_sidebar %}
{% include "/modules/content.html" %}
{%- endblock %}
</div>
</div>
</div>
{% else %}
{%- block content %}
{% include "/modules/content.html" %}
{%- endblock %}
{% endif %}

</main>

{% if config.theme.components and config.theme.components.preview == False %}
Expand Down
7 changes: 5 additions & 2 deletions mkdocs_simple_blog/mkdocs_theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ language: en
include_search_page: true
search_index_only: false

highlightjs: true
hljs_languages: []
theme:
sidebar: false
navigation_depth: 4
highlightjs: false
hljs_languages: []
30 changes: 14 additions & 16 deletions mkdocs_simple_blog/modules/preview.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
<!-- block preview -->
{%- block next_prev %}
{%- if page and (page.next_page or page.previous_page) %}
<div class="row row-cols-md-3 text-center pt-md-3" id="component-preview">
<div class="col themed-grid-col">
<a rel="prev" {% if page.previous_page %}href="{{ page.previous_page.url|url }}" class="nav-link"{% else %}class="nav-link disabled"{% endif %}>
<i class="fa fa-arrow-left"></i> Previous
</a>
</div>
<div class="col themed-grid-col"></div>
<div class="col themed-grid-col">
<a rel="next" {% if page.next_page %}href="{{ page.next_page.url|url }}" class="nav-link"{% else %}class="nav-link disabled"{% endif %}>
Next <i class="fa fa-arrow-right"></i>
</a>
</div>
{%- if page and (page.next_page or page.previous_page) %}
<div class="preview row row-cols-md-3 text-center pt-md-3" id="component-preview">
<div class="col themed-grid-col">
<a rel="prev" {% if page.previous_page %}href="{{ page.previous_page.url|url }}" class="nav-link"{% else %}class="nav-link disabled"{% endif %}>
<i class="fa fa-arrow-left"></i> Previous
</a>
</div>
{%- endif %}
{%- endblock %}
<div class="col themed-grid-col"></div>
<div class="col themed-grid-col">
<a rel="next" {% if page.next_page %}href="{{ page.next_page.url|url }}" class="nav-link"{% else %}class="nav-link disabled"{% endif %}>
Next <i class="fa fa-arrow-right"></i>
</a>
</div>
</div>
{%- endif %}
<!-- endblock -->
Loading

0 comments on commit 08fe3bd

Please sign in to comment.