Skip to content
Myr

Minor fixes to website generation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by William Langford · committed by William Langford · parent d24c3d2 · Browse files · 4 files+13 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+13 added−5 removed

  • other:+13 added−5 removed

4 files+13 added−5 removed

modified:docs/templates/shared/_head.html.j2+1 added-1 removed
5 unmodified lines
6 <meta charset="utf-8">7 <title>{{headline}}</title>8 <meta name="viewport" content="width=device-width, initial-scale=1">9 <meta http-equiv="X-UA-Compatible" content="IE=edge" />10 <link rel="canonical" href="{{ url }}{{ permalink | replace('/index','') }}" />10 <link rel="canonical" href="{{ url }}/{{ permalink }}" />11 <link href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.5/spacelab/bootstrap.min.css" rel="stylesheet" integrity="sha256-j7Dtnd7ZjexEiPNbscbopFn9+Cs0b3TLipKsWAPHZIM= sha512-RFhfi6P8zWMAJrEGU+CPjuxPh3r/UUBGqQ+/o6WKPIVZmQqeOipGotH2ihRULuQ8wsMBoK15TSZqc/7VYWyuIw==" crossorigin="anonymous">12 <link rel="stylesheet" href="{{ root }}/css/base.css" type="text/css">13 <!--[if lt IE 9]>14 <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
3 unmodified lines
modified:docs/templates/shared/_navbar.html.j2+2 added-2 removed
11 unmodified lines
1213 <div class="navbar-collapse collapse" id="nav-collapse">14 <ul class="nav navbar-nav">15 {% for item in navigation %}16 <li {% if item == permalink %} class="active" {% endif %}>17 <a href="{{root}}/{{item}}">{{item | capitalize}}</a>16 <li {% if item == navitem %} class="active" {% endif %}>17 <a href="{{root}}/{{item}}/">{{item | capitalize}}</a>18 </li>19 {% endfor %}20 <li><a href="https://github.com/stedolan/jq/issues">Issues</a></li>21 <li><a href="https://github.com/stedolan/jq">Source</a></li>
6 unmodified lines
modified:docs/build_website.py+9 added-1 removed
33 unmodified lines
3435def generate_file(env, fname='content/1.tutorial/default.yml'):36 path, base = os.path.split(fname)37 path = os.path.relpath(path, 'content')38 if path == '.':39 path = ''40 slug = 'index'41 permalink = ''42 else:43 slug = os.path.basename(path)44 permalink = path + '/'4546 output_dir = os.path.join('output', path)47 output_path = os.path.join(output_dir, 'index.html')4849 template_name = re.sub(r".yml$", '.html.j2', base)5051 ctx = load_yml_file(fname)44 ctx.update(unique_ctr=itertools.count(1), permalink=path)52 ctx.update(unique_ctr=itertools.count(1), permalink=permalink, slug=slug, navitem=path)53 os.makedirs(output_dir, exist_ok=True)54 env.get_template(template_name).stream(ctx).dump(output_path, encoding='utf-8')5556
14 unmodified lines
modified:docs/site.yml+1 added-1 removed