Skip to content

Commit

Permalink
update docs base template to support baseurl option
Browse files Browse the repository at this point in the history
  • Loading branch information
jiffyclub committed Mar 6, 2015
1 parent 1971409 commit 4ac103e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
17 changes: 11 additions & 6 deletions doc/_layouts/_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
{% set theme_path = "bootstrap/" + bootstrap + "/css" %}
{% endif %}
<link href="//netdna.bootstrapcdn.com/{{theme_path}}/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="/css/site.css" rel="stylesheet" media="screen">
<link href="/css/syntax.css" rel="stylesheet" media="screen">

{% set url_prefix = '' %}
{% if site.baseurl %}
{% set url_prefix = '/' + site.baseurl %}
{% endif %}
<link href="{{url_prefix + '/css/site.css'}}" rel="stylesheet" media="screen">
<link href="{{url_prefix + '/css/syntax.css'}}" rel="stylesheet" media="screen">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
Expand Down Expand Up @@ -46,12 +51,12 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">{{site.brand}}</a>
<a class="navbar-brand" href="{{url_prefix + '/'}}">{{site.brand}}</a>
</div>
<div class="navbar-collapse collapse">

<ul class="nav navbar-nav navbar-left">
{% block home %}
{% block home %}
{% endblock %}
{% for item in site.reflinks['/'].content[:-navbar_right_items] %}
{% set context = '' %}
Expand All @@ -63,7 +68,7 @@
<a href="{{item.url}}" class="dropdown-toggle" data-toggle="dropdown">{{item.title}} <b class="caret"></b></a>
<ul class="dropdown-menu">
{% for subitem in item.content %}
<li><a href="{{subitem.url}}">{{subitem.title}}</a></li>
<li><a href="{{subitem.url}}">{{subitem.title}}</a></li>
{% endfor %}
</ul>
</li>
Expand All @@ -84,7 +89,7 @@
<a href="{{item.url}}" class="dropdown-toggle" data-toggle="dropdown">{{item.title}} <b class="caret"></b></a>
<ul class="dropdown-menu">
{% for subitem in item.content %}
<li><a href="{{subitem.url}}">{{subitem.title}}</a></li>
<li><a href="{{subitem.url}}">{{subitem.title}}</a></li>
{% endfor %}
</ul>
</li>
Expand Down
14 changes: 7 additions & 7 deletions doc/_layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% block breadcrumbs %}
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li><a href="{{url_prefix + '/'}}">Home</a></li>
{% for bc in this.breadcrumbs[:-1] %}
<li><a href="{{bc.url}}">{{bc.title}}</a></li>
{% endfor %}
Expand All @@ -15,16 +15,16 @@
{% endblock %}

<div class="page-header">
{% block title %}
{% block title %}
<h1>{{this.title}}</h1>
{% endblock %}
</div>

<div class="row">

{% block sidebar %}
<div class="col-md-3" role="navigation">
{% if this.toc %}
<div class="col-md-3" role="navigation">
{% if this.toc %}
<div class="sidebar" data-spy="affix" data-offset-top="80" data-offset-bottom="60">
<div class="well">
<a href="#"><strong>{{this.title}}</strong></a>
Expand All @@ -34,7 +34,7 @@ <h1>{{this.title}}</h1>
{% endif %}
</div>
{% endblock %}

<div class="content">
{% block content %}
<div class="col-md-6" role="main">
Expand All @@ -44,7 +44,7 @@ <h1>{{this.title}}</h1>
</div>

</div>

{% if this.pager %}
<ul class="pager">
{% if this.prev %}
Expand All @@ -58,7 +58,7 @@ <h1>{{this.title}}</h1>

{% include 'footer.html' %}

</div>
</div>

{% endblock %}

0 comments on commit 4ac103e

Please sign in to comment.