Skip to content

Commit

Permalink
split logo and doc site nav
Browse files Browse the repository at this point in the history
  • Loading branch information
wangeguo committed Oct 17, 2023
1 parent ec5d705 commit 862ddb7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
5 changes: 5 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ label_edit_tips = "在 Github 上查看或编辑此文件"
search_placeholder = "搜索此文档..."
label_sidebar_title = "浏览文档"

[[extra.menu.main]]
name = "Documentation"
path = "@/_index.md"
active = true

[[extra.menu.social]]
name = "GitHub"
pre = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-github"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>'
Expand Down
1 change: 1 addition & 0 deletions static/js/bootstrap.bundle.min.js.map

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion templates/macros/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<span class="d-none fs-6 pe-1">Browse</span>
</button>
</div>
<a class="navbar-brand order-1 order-md-0 me-auto" href="{{ get_url(path="@/_index.md", lang=lang) }}">{{ config.title | default(value="Doks") }}</a>
<a class="navbar-brand order-1 order-md-0 me-auto" href="https://amphitheatre.app/">Amphitheatre</a>

<input class="menu-btn order-4" type="checkbox" id="menu-btn">
{% if config.build_search_index %}
Expand All @@ -33,6 +33,17 @@
{% endif %}
</ul>
<div class="collapse navbar-collapse order-4 order-md-1">
<ul class="navbar-nav main-nav me-auto order-5 order-md-2">
{% for val in config.extra.menu.main %}
<li class="nav-item">
{%- if val.path -%}
<a class="nav-link {% if val.active %}active{% endif %}" href="{{ get_url(path=val.path, lang=lang) }}">{{ val.name }}</a>
{%- else -%}
<a class="nav-link {% if val.active %}active{% endif %}" href="{{ val.url | safe }}">{{ val.name }}</a>
{%- endif -%}
</li>
{% endfor %}
</ul>
<div class="break order-6 d-md-none"></div>
{% if config.build_search_index %}
<form class="navbar-form flex-grow-1 order-7 order-md-3">
Expand Down
8 changes: 4 additions & 4 deletions templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% else %}
{% set title = config.title %}
{% endif %}

{% if page.description %}
{% set description = page.description %}
{% else %}
Expand All @@ -24,12 +24,12 @@
{% else %}
{% set page_section = "" %}
{% endif %}

{{ macros_head::seo(title=title, title_addition=title_addition, description=description, type="article", is_page=true, page_section=page_section) }}
{% endblock seo %}

{% block header %}
{{ macros_header::header(current_section=current_section)}}
{{ macros_header::header()}}
{% endblock header %}

{% block body %}
Expand All @@ -55,7 +55,7 @@ <h1 class="docs-title mb-0" id="content">{{ page.title }}</h1>
</div>

{{ macros_toc::docs_toc(page=page) }}

<div class="docs-content ps-lg-2">
{{ page.content | safe }}
</div>
Expand Down

0 comments on commit 862ddb7

Please sign in to comment.