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

Improve footer #36

Merged
merged 3 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
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: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ html_theme_options = {
'show_drawer_title': True,
# Render footer.
# Values: True, False (Default: True)
'show_footer': True
'show_footer': True,

'hide_symbiflow_links': True,
'github_url': 'https://github.com/SymbiFlow/sphinx_symbiflow_theme',
'license_url': 'https://github.com/SymbiFlow/sphinx_symbiflow_theme/blob/master/LICENSE'
}
```

Expand Down
17 changes: 12 additions & 5 deletions example/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@


project = 'SymbiFlow Theme'
copyright = '2016, Masahiko Yasuda'
author = 'Masahiko Yasuda'
copyright = '2020, The SymbiFlow Authors'
author = 'The SymbiFlow Authors'
Comment on lines +19 to +20
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mithro Not sure if we can just remove the original author here


language = 'en'

Expand Down Expand Up @@ -46,8 +46,7 @@
'header_links' : [
('Home', 'index', False, 'home'),
("ExternalLink", "http://example.com", True, 'launch'),
("NoIconLink", "http://example.com", True, ''),
("GitHub", "https://github.com/SymbiFlow/sphinx_symbiflow_theme", True, 'link')
("NoIconLink", "http://example.com", True, '')
],

# Customize css colors.
Expand Down Expand Up @@ -76,7 +75,15 @@
'show_drawer_title': True,
# Render footer.
# Values: True, False (Default: True)
'show_footer': True
'show_footer': True,

# Show SymbiFlow-related links in header and footer (e.g. Mailing List, IRC, Slack)
# Values: True, False (Default: False)
'hide_symbiflow_links': False,
# Link to GitHub repository
'github_url': 'https://github.com/SymbiFlow/sphinx_symbiflow_theme',
# Link to LICENSE in GitHub repository
'license_url': 'https://github.com/SymbiFlow/sphinx_symbiflow_theme/blob/master/LICENSE'
}

html_show_sourcelink = True
Expand Down
78 changes: 49 additions & 29 deletions sphinx_symbiflow_theme/footer.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,59 @@
<footer class="mdl-mini-footer">
<div class="mdl-mini-footer__left-section">
<div class="mdl-logo">{{ project }}</div>
{% if not theme_hide_symbiflow_links|tobool %}
<div>
<ul>
<li>
<a href="https://symbiflow.github.io/" target="_blank">SymbiFlow</a>
</li>
<li>
<a href="https://lists.librecores.org/listinfo/symbiflow" target="_blank">Mailing List</a>
</li>
<li>
<a href="https://webchat.freenode.net/#symbiflow" target="_blank">IRC</a>
</li>
<li>
<a href="https://join.slack.com/t/symbiflow/shared_invite/enQtNTkyMjcyNTkzOTY4LTU0MzhmYWNjOGMyMTkyNjA0MmEyMWM5OWY3ZDg5MWQ3ODlmOWQwZjk2YzBmMDBjMzkzMzNjYjkwYjAxZTMyNjQ">Slack</a>
</li>
</ul>
</div>
{%- endif %}
<div class="mdl-mini-footer__left-section">
<div class="mdl-logo">{{ project }}</div>
<div>
<ul>
{% if not theme_hide_symbiflow_links|tobool %}
<li>
<a href="https://symbiflow.github.io/" target="_blank">SymbiFlow</a>
</li>
<li>
<a href="https://lists.librecores.org/listinfo/symbiflow" target="_blank">Mailing List</a>
</li>
<li>
<a href="https://webchat.freenode.net/#symbiflow" target="_blank">IRC</a>
</li>
<li>
<a href="https://join.slack.com/t/symbiflow/shared_invite/enQtNTkyMjcyNTkzOTY4LTU0MzhmYWNjOGMyMTkyNjA0MmEyMWM5OWY3ZDg5MWQ3ODlmOWQwZjk2YzBmMDBjMzkzMzNjYjkwYjAxZTMyNjQ"
target="_blank">Slack</a>
</li>
{%- endif %}
{%- if theme_github_url %}
<li>
<a href="{{ theme_github_url }}" target="_blank">GitHub</a>
</li>
{%- endif %}
{%- if theme_license_url %}
<li>
<!-- <a href="https://github.com/SymbiFlow/sphinx_symbiflow_theme/blob/master/LICENSE" target="_blank"><img alt="License Badge" src="https://img.shields.io/github/license/SymbiFlow/symbiflow-arch-defs"/></a> -->
<a href="{{ theme_license_url }}" target="_blank">License</a>
</li>
{%- endif %}

<!-- This is to still take up space when none of the links above are shown in the footer -->
<li style="visibility: hidden;">
a
</li>
</ul>
</div>
</div>

<div class="mdl-mini-footer__right-section">
<div class="mdl-mini-footer__right-section">
{%- if show_copyright %}
{%- if hasdoc('copyright') %}
<div>{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}</div>
{%- else %}
<div>{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}</div>
{%- endif %}
{%- if hasdoc('copyright') %}
<div>{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a>
{{ copyright }}.{% endtrans %}</div>
{%- else %}
<div>{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}</div>
{%- endif %}
{%- endif %}
{%- if last_updated %}
<div>{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}</div>
<div>{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}</div>
{%- endif %}
{%- if show_sphinx %}
<div>{% trans sphinx_version=sphinx_version|e %}Generated by <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }} using <a href="https://github.com/SymbiFlow/sphinx_symbiflow_theme">sphinx_symbiflow_theme</a>.{% endtrans %}</div>
<div>{% trans sphinx_version=sphinx_version|e %}Generated by <a href="http://sphinx.pocoo.org/">Sphinx</a>
{{ sphinx_version }} using <a
href="https://github.com/SymbiFlow/sphinx_symbiflow_theme">sphinx_symbiflow_theme</a>.{% endtrans %}</div>
{%- endif %}
</div>
</div>
</footer>
6 changes: 6 additions & 0 deletions sphinx_symbiflow_theme/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
</a>
{%- endif -%}
{%- endfor %}
{% if theme_github_url %}
<a class="mdl-navigation__link" href="{{ theme_github_url }}">
<i class="material-icons navigation-link-icon">code</i>
GitHub
</a>
{%- endif -%}
{% if not theme_hide_symbiflow_links|tobool %}
<a class="mdl-navigation__link" href="https://symbiflow.github.io/">
<i class="material-icons navigation-link-icon">web</i>
Expand Down
2 changes: 1 addition & 1 deletion sphinx_symbiflow_theme/static/sphinx_symbiflow_theme.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions sphinx_symbiflow_theme/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ show_drawer_title = True
show_footer = True

hide_symbiflow_links = False
github_url =
license_url =
16 changes: 15 additions & 1 deletion src/scss/footer/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,43 @@
footer.mdl-mini-footer {
background-color: #212121;
padding: 16px 32px;
color: #bfbfbf;

> div.mdl-mini-footer__left-section {
display: flex;
flex-direction: column;
align-self: center;
.mdl-logo {
font-size: 1.1rem;
line-height: 1.7rem;
}
ul {
@extend .mdl-mini-footer__link-list;
li {
line-height: 1.5rem;
}
}

a:hover {
text-decoration: underline;
}
}
> div.mdl-mini-footer__right-section {
font-size: 0.9rem;
display: flex;
flex-direction: column;
justify-content: flex-start;
padding-top:12px;
align-self: center;

a {
color: inherit;
font-weight: bold;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}
}
p.caption {
display: none;
Expand Down