So all URLs are absolute.
</div>
<div class="m-clearfix-t"></div>
<div class="m-col-s-3 m-col-t-6">
- <h3><a href="#">Contact</a></h3>
+ <h3>Contact</h3>
<ul>
- <li><a href="#">E-mail</a></li>
- <li><a href="#">GitHub</a></li>
+ <li><a href="mailto:you@your.brand">E-mail</a></li>
+ <li><a href="https://github.com/your-brand">GitHub</a></li>
</ul>
</div>
<div class="m-col-s-3 m-col-t-6">
will make the menu item never highlighted; providing an empty list of sub-menu
items will not add any submenu. All blog-related pages (articles, article
listing, authors, tags, categories etc.) have the slug set to a special value
-``[blog]``.
+``[blog]``. The URL is prepended with :py:`SITEURL` unless it contains also
+domain name, then it's left as-is (`detailed behavior <{filename}/plugins/htmlsanity.rst#siteurl-formatting>`_).
Example configuration, matching example markup from the
`CSS page layout <{filename}/css/page-layout.rst#sub-menus-in-the-navbar>`__
SITE_LOGO_TEXT = 'Your Brand'
- LINKS_NAVBAR1 = [('Features', '/features/', 'features', []),
- ('Showcase', '/showcase/', 'showcase', []),
- ('Download', '/download/', 'download', [])]
+ LINKS_NAVBAR1 = [('Features', 'features/', 'features', []),
+ ('Showcase', 'showcase/', 'showcase', []),
+ ('Download', 'download/', 'download', [])]
- LINKS_NAVBAR2 = [('Blog', '/blog/', '[blog]', [
- ('News', '/blog/news/', ''),
- ('Archive', '/blog/archive/', '')]),
- ('Contact', '/contact/', 'contact', [])]
+ LINKS_NAVBAR2 = [('Blog', 'blog/', '[blog]', [
+ ('News', 'blog/news/', ''),
+ ('Archive', 'blog/archive/', '')]),
+ ('Contact', 'contact/', 'contact', [])]
`Footer navigation`_
--------------------
The variables are lists of 2-tuples, containing link title and URL. First item
is used for column header, if link URL of the first item is empty, given column
-header is just a plain :html:`<h3>` without a link.
+header is just a plain :html:`<h3>` without a link. The URLs are processed in
+the same way as in the `top navbar`_.
Footer fine print can be specified via :py:`FINE_PRINT`. Contents of the
variable are processed as :abbr:`reST <reStructuredText>`, so you can use all
.. code:: py
LINKS_FOOTER1 = [('Your Brand', '/'),
- ('Features', '/features/'),
- ('Showcase', '/showcase/')]
+ ('Features', 'features/'),
+ ('Showcase', 'showcase/')]
- LINKS_FOOTER2 = [('Download', '/download/'),
- ('Packages', '/download/packages/'),
- ('Source', '/download/source/')]
+ LINKS_FOOTER2 = [('Download', 'download/'),
+ ('Packages', 'download/packages/'),
+ ('Source', 'download/source/')]
- LINKS_FOOTER3 = [('Contact', '/contact/'),
- ('E-mail', '#'),
- ('GitHub', '#')]
+ LINKS_FOOTER3 = [('Contact', ''),
+ ('E-mail', 'mailto:you@your.brand'),
+ ('GitHub', 'https://github.com/your-brand')]
FINE_PRINT = """
Your Brand. Copyright © `You <mailto:you@your.brand>`_, 2017. All rights
<meta name="theme-color" content="{{ THEME_COLOR }}" />
{% endif %}
{% if FEED_ALL_ATOM_URL %}
- <link href="{{ FEED_ALL_ATOM_URL }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }}" />
+ <link href="{{ FEED_ALL_ATOM_URL|format_siteurl }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }}" />
{% endif %}
{% if CATEGORY_FEED_ATOM_URL and category %}
- <link href="{{ CATEGORY_FEED_ATOM_URL|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} | {{ category }}" />
+ <link href="{{ CATEGORY_FEED_ATOM_URL|format(category.slug)|format_siteurl }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} | {{ category }}" />
{% endif %}
{% endblock head %}
</head>
<ol class="m-col-t-6 m-col-m-none">
{% for title, link, slug, sub in LINKS_NAVBAR1 %}
<li>
- <a href="{{ link }}"{% if (page and page.highlight == slug) or slug == page_slug %} id="m-navbar-current"{% endif %}>{{ title }}</a>
+ <a href="{{ link|format_siteurl }}"{% if (page and page.highlight == slug) or slug == page_slug %} id="m-navbar-current"{% endif %}>{{ title }}</a>
{% if sub %}
<ol>
{% for title, link, slug in sub %}
- <li><a href="{{ link }}"{% if (page and page.highlight == slug) or slug == page_slug %} id="m-navbar-current"{% endif %}>{{ title }}</a></li>
+ <li><a href="{{ link|format_siteurl }}"{% if (page and page.highlight == slug) or slug == page_slug %} id="m-navbar-current"{% endif %}>{{ title }}</a></li>
{% endfor %}
</ol>
{% endif %}
<ol class="m-col-t-6 m-col-m-none">
{% for title, link, slug, sub in LINKS_NAVBAR2 %}
<li>
- <a href="{{ link }}"{% if (page and page.highlight == slug) or slug == page_slug %} id="m-navbar-current"{% endif %}>{{ title }}</a>
+ <a href="{{ link|format_siteurl }}"{% if (page and page.highlight == slug) or slug == page_slug %} id="m-navbar-current"{% endif %}>{{ title }}</a>
{% if sub %}
<ol>
{% for title, link, slug in sub %}
- <li><a href="{{ link }}"{% if (page and page.highlight == slug) or slug == page_slug %} id="m-navbar-current"{% endif %}>{{ title }}</a></li>
+ <li><a href="{{ link|format_siteurl }}"{% if (page and page.highlight == slug) or slug == page_slug %} id="m-navbar-current"{% endif %}>{{ title }}</a></li>
{% endfor %}
</ol>
{% endif %}
<div class="m-col-s-3 m-col-t-6">
{% if LINKS_FOOTER1 %}
<h3>
- {%- if LINKS_FOOTER1[0][1] %}<a href="{{ LINKS_FOOTER1[0][1] }}">{% endif %}
+ {%- if LINKS_FOOTER1[0][1] %}<a href="{{ LINKS_FOOTER1[0][1]|format_siteurl }}">{% endif %}
{{- LINKS_FOOTER1[0][0] -}}
{% if LINKS_FOOTER1[0][1] -%}</a>{% endif -%}
</h3>
<ul>
{% for title, link in LINKS_FOOTER1 %}{% if loop.index0 != 0 %}
- <li><a href="{{ link }}">{{ title }}</a></li>
+ <li><a href="{{ link|format_siteurl }}">{{ title }}</a></li>
{% endif %}{% endfor %}
</ul>
{% endif %}
<div class="m-col-s-3 m-col-t-6">
{% if LINKS_FOOTER2 %}
<h3>
- {%- if LINKS_FOOTER2[0][1] %}<a href="{{ LINKS_FOOTER2[0][1] }}">{% endif %}
+ {%- if LINKS_FOOTER2[0][1] %}<a href="{{ LINKS_FOOTER2[0][1]|format_siteurl }}">{% endif %}
{{- LINKS_FOOTER2[0][0] -}}
{% if LINKS_FOOTER2[0][1] %}</a>{% endif -%}
</h3>
<ul>
{% for title, link in LINKS_FOOTER2 %}{% if loop.index0 != 0 %}
- <li><a href="{{ link }}">{{ title }}</a></li>
+ <li><a href="{{ link|format_siteurl }}">{{ title }}</a></li>
{% endif %}{% endfor %}
</ul>
{% endif %}
<div class="m-col-s-3 m-col-t-6">
{% if LINKS_FOOTER3 %}
<h3>
- {%- if LINKS_FOOTER3[0][1] %}<a href="{{ LINKS_FOOTER3[0][1] }}">{% endif %}
+ {%- if LINKS_FOOTER3[0][1] %}<a href="{{ LINKS_FOOTER3[0][1]|format_siteurl }}">{% endif %}
{{- LINKS_FOOTER3[0][0] -}}
{% if LINKS_FOOTER3[0][1] %}</a>{% endif -%}
</h3>
<ul>
{% for title, link in LINKS_FOOTER3 %}{% if loop.index0 != 0 %}
- <li><a href="{{ link }}">{{ title }}</a></li>
+ <li><a href="{{ link|format_siteurl }}">{{ title }}</a></li>
{% endif %}{% endfor %}
</ul>
{% endif %}
<div class="m-col-s-3 m-col-t-6">
{% if LINKS_FOOTER4 %}
<h3>
- {%- if LINKS_FOOTER4[0][1] %}<a href="{{ LINKS_FOOTER4[0][1] }}">{% endif %}
+ {%- if LINKS_FOOTER4[0][1] %}<a href="{{ LINKS_FOOTER4[0][1]|format_siteurl }}">{% endif %}
{{- LINKS_FOOTER4[0][0] -}}
{% if LINKS_FOOTER4[0][1] %}</a>{% endif -%}
</h3>
<ul>
{% for title, link in LINKS_FOOTER4 %}{% if loop.index0 != 0 %}
- <li><a href="{{ link }}">{{ title }}</a></li>
+ <li><a href="{{ link|format_siteurl }}">{{ title }}</a></li>
{% endif %}{% endfor %}
</ul>
{% else %}
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None
-LINKS_NAVBAR1 = [('Why?', '/why/', 'why', []),
- ('CSS', '/css/', 'css', [
- ('Grid system', '/css/grid/', 'css/grid'),
- ('Typography', '/css/typography/', 'css/typography'),
- ('Components', '/css/components/', 'css/components'),
- ('Page layout', '/css/page-layout/', 'css/page-layout'),
- ('Themes', '/css/themes/', 'css/themes')]),
- ('Pelican', '/pelican/', 'pelican', [
- ('Writing content', '/pelican/writing-content/', 'pelican/writing-content'),
- ('Theme', '/pelican/theme/', 'pelican/theme')])]
-
-LINKS_NAVBAR2 = [('Pelican plugins', '/plugins/', 'plugins', [
- ('HTML sanity', '/plugins/htmlsanity/', 'plugins/htmlsanity'),
- ('Components', '/plugins/components/', 'plugins/components'),
- ('Images', '/plugins/images/', 'plugins/images'),
- ('Math and code', '/plugins/math-and-code/', 'plugins/math-and-code'),
- ('Links', '/plugins/links/', 'plugins/links')]),
+LINKS_NAVBAR1 = [('Why?', 'why/', 'why', []),
+ ('CSS', 'css/', 'css', [
+ ('Grid system', 'css/grid/', 'css/grid'),
+ ('Typography', 'css/typography/', 'css/typography'),
+ ('Components', 'css/components/', 'css/components'),
+ ('Page layout', 'css/page-layout/', 'css/page-layout'),
+ ('Themes', 'css/themes/', 'css/themes')]),
+ ('Pelican', 'pelican/', 'pelican', [
+ ('Writing content', 'pelican/writing-content/', 'pelican/writing-content'),
+ ('Theme', 'pelican/theme/', 'pelican/theme')])]
+
+LINKS_NAVBAR2 = [('Pelican plugins', 'plugins/', 'plugins', [
+ ('HTML sanity', 'plugins/htmlsanity/', 'plugins/htmlsanity'),
+ ('Components', 'plugins/components/', 'plugins/components'),
+ ('Images', 'plugins/images/', 'plugins/images'),
+ ('Math and code', 'plugins/math-and-code/', 'plugins/math-and-code'),
+ ('Links', 'plugins/links/', 'plugins/links')]),
('GitHub', 'https://github.com/mosra/m.css', '', [])]
LINKS_FOOTER1 = [('m.css', '/'),
- ('Why?', '/why/'),
+ ('Why?', 'why/'),
('GitHub', 'https://github.com/mosra/m.css'),
('Gitter', 'https://gitter.im/mosra/m.css'),
('Twitter', 'https://twitter.com/czmosra')]
-LINKS_FOOTER2 = [('CSS', '/css/'),
- ('Grid system', '/css/grid/'),
- ('Typography', '/css/typography/'),
- ('Components', '/css/components/'),
- ('Page layout', '/css/page-layout/'),
- ('Themes', '/css/themes/')]
-
-LINKS_FOOTER3 = [('Pelican', '/pelican/'),
- ('Writing content', '/pelican/writing-content/'),
- ('Theme', '/pelican/theme/')]
-
-LINKS_FOOTER4 = [('Pelican plugins', '/plugins/'),
- ('HTML sanity', '/plugins/htmlsanity/'),
- ('Components', '/plugins/components/'),
- ('Images', '/plugins/images/'),
- ('Math and code', '/plugins/math-and-code/'),
- ('Links', '/plugins/links/')]
+LINKS_FOOTER2 = [('CSS', 'css/'),
+ ('Grid system', 'css/grid/'),
+ ('Typography', 'css/typography/'),
+ ('Components', 'css/components/'),
+ ('Page layout', 'css/page-layout/'),
+ ('Themes', 'css/themes/')]
+
+LINKS_FOOTER3 = [('Pelican', 'pelican/'),
+ ('Writing content', 'pelican/writing-content/'),
+ ('Theme', 'pelican/theme/')]
+
+LINKS_FOOTER4 = [('Pelican plugins', 'plugins/'),
+ ('HTML sanity', 'plugins/htmlsanity/'),
+ ('Components', 'plugins/components/'),
+ ('Images', 'plugins/images/'),
+ ('Math and code', 'plugins/math-and-code/'),
+ ('Links', 'plugins/links/')]
FINE_PRINT = """
m.css. Copyright © Vladimír Vondruš 2017. Site powered by `Pelican <https://getpelican.com>`_