Highlight links when on page

gh-pages
rubenwardy 2014-12-31 16:43:27 +00:00
parent 7d2308af5c
commit 02cda4eb0e
5 changed files with 63 additions and 30 deletions

34
_data/links.yml Normal file
View File

@ -0,0 +1,34 @@
- title: Introduction
link: index.html
- title: Folder Structure
num: 1
link: chapters/folders.html
- title: Nodes, Items and Crafting
num: 2
link: chapters/nodes_items_crafting.html
- title: Node Drawtypes
num: 3
link: chapters/node_drawtypes.html
- title: Lua Scripts
num: 4
link: chapters/lua.html
- title: Active Block Modifiers
num: 5
link: chapters/abms.html
- title: Formspecs
num: 6
link: chapters/formspecs.html
- hr: true
- title: Index
link: book_index.html
- title: Lua Modding API Reference
link: lua_api.html

View File

@ -1,23 +1,24 @@
<!doctype html>
<html>
<head>
<title>{% if page.title != "Minetest Tutorials and Documentation" %}{{ page.title }} - {% endif %}Minetest Tutorials and Documentation</title>
<title>{% if page.title != "Introduction" %}{{ page.title }} - {% endif %}Minetest Tutorials and Documentation</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="{{ page.root }}static/style.css">
<link rel="stylesheet" href="{{ page.root }}static/syntax.css">
</head>
<body>
<ul id="navbar">
<li><a href="{{ page.root }}index.html" class="title">Minetest Tutorials</a></li>
<li><a href="{{ page.root }}chapters/folders.html">1 - Folder Structure</a></li>
<li><a href="{{ page.root }}chapters/nodes_items_crafting.html">2 - Nodes, Items and Crafting</a></li>
<li><a href="{{ page.root }}chapters/node_drawtypes.html">3 - Node Drawtypes</a></li>
<li><a href="{{ page.root }}chapters/lua.html">4 - Lua Scripts</a></li>
<li><a href="{{ page.root }}chapters/abms.html">5 - Active Block Modifiers</a></li>
<li><a href="{{ page.root }}chapters/formspecs.html">6 - Formspecs</a></li>
<li><hr></li>
<li><a href="{{ page.root }}book_index.html">Index</a></li>
<li><a href="{{ page.root }}lua_api.html">Webpage version of lua_api.txt</a></li>
{% for link in site.data.links %}
{% if link.hr %}
{% assign hr = true %}
{% else %}
<li><a href="{{ page.root }}{{ link.link }}"
class="{% if page.title == link.title %}selected{% endif %}{% if hr %} hr {% endif %}">
{% if link.num %} {{ link.num }} - {% endif %}
{{ link.title }}</a></li>
{% assign hr = false %}
{% endif %}
{% endfor %}
</ul>
<div id="page">
<h1>{{ page.title }}</h1>

View File

@ -1,5 +1,5 @@
---
title: Minetest Tutorials and Documentation
title: Introduction
permalink: index.html
layout: default
---

View File

@ -1,5 +1,5 @@
---
title: Minetest Lua Modding API Reference 0.4.11
title: Lua Modding API Reference
layout: default
---

View File

@ -63,10 +63,17 @@ figure {
padding: 0;
}
#navbar li hr {
height: 1px;
background: #666;
border: none;
#navbar li a.hr {
border-top: 2px solid #666;
}
#navbar li a.selected {
background: #363 !important;
color: white !important;
}
#navbar li a.selected:hover {
background: #474 !important;
}
#navbar li a {
@ -76,6 +83,10 @@ figure {
text-decoration: none;
}
#navbar li:nth-child(odd) a {
background: #3c3c3c;
}
#navbar li a:hover {
background: #444;
}
@ -94,19 +105,6 @@ figure {
margin: 0 0 5px 0;
padding: 0 0 2px 0;
}
#navbar li a.title {
text-align: center;
font-size: 120%;
font-weight: bold;
background: #363;
color: white;
}
#navbar li a.section_title {
text-align: center;
font-size: 110%;
border-bottom: 1px solid #999;
}
code {
display: inline-block;