Use Jekyll collections

master
rubenwardy 2018-07-15 15:28:10 +01:00
parent 712b151de6
commit 1ca3ba1e82
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C
30 changed files with 66 additions and 151 deletions

View File

@ -32,10 +32,10 @@ fit my idea of quality.
## Adding a new language
* Add entry to `_data/languages.yml`
* Copy links_en, and customise it for your language
* Add your language to the if else in `_includes/header.html`
* Copy en/ to your language code
* Translate your language code folder
* Copy `_en/` to your language code
* Translate your language code folder.
You can translate the file paths, just make sure you keep any ids the same.
## Using Jeykll

View File

@ -4,3 +4,7 @@ sass:
gems:
- jekyll-sitemap
collections:
en:
output: true

View File

@ -1,129 +0,0 @@
- title: Introduction
link: index.html
- hr: true
- title: Folder Structure
description: Learn how to make a mod folder, including init.lua, depends.txt and more.
num: 1
link: chapters/folders.html
- title: Lua Scripts
description: A basic introduction to Lua, including a guide on global/local scope.
num: 2
link: chapters/lua.html
- hr: true
- title: Nodes, Items, and Crafting
description: Learn how to register node, items, and craft recipes using register_node, register_item, and register_craft.
num: 3
link: chapters/nodes_items_crafting.html
- title: Creating Textures
description: An introduction to making textures in your editor of choice, an a guide on GIMP.
num: 4
link: chapters/creating_textures.html
- title: Node Drawtypes
description: Guide to all drawtypes, including node boxes/nodeboxes and mesh nodes.
num: 5
link: chapters/node_drawtypes.html
- hr: true
- title: Basic Map Operations
description: Basic operations like set_node and get_node
num: 6
link: chapters/environment.html
- title: Active Block Modifiers
description: Learn how to make ABMs to change blocks.
num: 7
link: chapters/abms.html
- title: Node Metadata
description: Using get_meta to obtain a NodeMetaRef
num: 8
link: chapters/node_metadata.html
- title: Lua Voxel Manipulators
description: Learn how to use LVMs to speed up map operations.
num: 9
link: chapters/lvm.html
- hr: true
- title: Privileges
description: Registering privs
num: 10
link: chapters/privileges.html
- title: Chat and Commands
description: Register a chatcommand
num: 11
link: chapters/chat.html
- title: Chat Command Builder
description: Use ChatCmdBuilder to make a complex chat command
num: 12
link: chapters/chat_complex.html
- title: Player Physics
num: 13
link: chapters/player_physics.html
- title: Formspecs
num: 14
link: chapters/formspecs.html
- title: HUD
num: 15
link: chapters/hud.html
- title: "SFINV: Inventory Formspec"
num: 16
link: chapters/sfinv.html
- hr: true
- title: ItemStacks
num: 17
link: chapters/itemstacks.html
- title: Inventories
num: 18
link: chapters/inventories.html
- hr: true
- title: Common Mistakes
num: 19
link: chapters/common_mistakes.html
- title: Automatic Error Checking
description: Use LuaCheck as a linter to find errors
num: 20
link: chapters/luacheck.html
- title: Intro to Clean Architectures
description: Separate logic from data and API calls using the MVC pattern - Model View Controller.
num: 21
link: chapters/mvc.html
- title: Automatic Unit Testing
description: Write tests for your mods using Busted.
num: 22
link: chapters/unit_testing.html
- hr: true
- title: Releasing a Mod
num: 23
link: chapters/releasing.html
- title: More Resources
num: 24
link: chapters/readmore.html
- hr: true

View File

@ -2,6 +2,8 @@
title: Folder Structure
layout: default
root: ../../
idx: 1.1
description: Learn how to make a mod folder, including init.lua, depends.txt and more.
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Lua Scripts
layout: default
root: ../../
idx: 1.2
description: A basic introduction to Lua, including a guide on global/local scope.
---
## Introduction

View File

@ -4,6 +4,7 @@ layout: default
homepage: true
no_header: true
root: ../
idx: 0.1
---
<div id="header">

View File

@ -2,6 +2,7 @@
title: Inventories
layout: default
root: ../../
idx: 5.2
---
## Introduction

View File

@ -2,6 +2,7 @@
title: ItemStacks
layout: default
root: ../../
idx: 5.1
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Creating Textures
layout: default
root: ../../
idx: 2.2
description: An introduction to making textures in your editor of choice, an a guide on GIMP.
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Node Drawtypes
layout: default
root: ../../
idx: 2.3
description: Guide to all drawtypes, including node boxes/nodeboxes and mesh nodes.
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Nodes, Items, and Crafting
layout: default
root: ../../
idx: 2.1
description: Learn how to register node, items, and craft recipes using register_node, register_item, and register_craft.
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Active Block Modifiers
layout: default
root: ../../
idx: 3.2
description: Learn how to make ABMs to change blocks.
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Basic Map Operations
layout: default
root: ../../
idx: 3.1
description: Basic operations like set_node and get_node
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Lua Voxel Manipulators
layout: default
root: ../../
idx: 3.4
description: Learn how to use LVMs to speed up map operations.
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Node Metadata
layout: default
root: ../../
idx: 3.3
description: Using get_meta to obtain a NodeMetaRef.
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Chat and Commands
layout: default
root: ../../
idx: 4.2
description: Registering a chatcommand and handling chat messages with register_on_chat_message
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Chat Command Builder
layout: default
root: ../../
idx: 4.3
description: Use ChatCmdBuilder to make a complex chat command
---
## Introduction

View File

@ -2,6 +2,7 @@
title: Formspecs
layout: default
root: ../../
idx: 4.5
---
## Introduction

View File

@ -2,6 +2,7 @@
title: HUD
layout: default
root: ../../
idx: 4.6
---
## Introduction

View File

@ -2,6 +2,7 @@
title: Player Physics
layout: default
root: ../../
idx: 4.4
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Privileges
layout: default
root: ../../
idx: 4.1
description: Registering privs.
---
## Introduction

View File

@ -2,6 +2,7 @@
title: "SFINV: Inventory Formspec"
layout: default
root: ../../
idx: 4.7
---
## Introduction

View File

@ -2,6 +2,7 @@
title: Common Mistakes
layout: default
root: ../../
idx: 6.1
---
## Introduction

View File

@ -2,6 +2,8 @@
title: Automatic Error Checking
layout: default
root: ../../
idx: 6.2
description: Use LuaCheck to find errors
---
## Introduction

View File

@ -2,6 +2,7 @@
title: Intro to Clean Architectures
layout: default
root: ../../
idx: 6.3
---
## Introduction

View File

@ -2,6 +2,7 @@
title: Read More
layout: default
root: ../../
idx: 6.6
---
## List of Resources

View File

@ -2,6 +2,7 @@
title: Releasing a Mod
layout: default
root: ../../
idx: 6.5
---
## Introduction

View File

@ -2,6 +2,7 @@
title: Automatic Unit Testing
layout: default
root: ../../
idx: 6.4
---
## Introduction

View File

@ -14,25 +14,26 @@
{% assign language = pathsplit[1] %}
{% if language == "en" %}
{% assign links = site.data.links_en %}
{% assign links = site.en | sort: "idx" %}
{% else %}
{% assign language = "en" %}
{% assign links = site.data.links_en %}
{% assign links = site.en | sort: "idx" %}
{% endif %}
{% assign num = 0 %}
<div id="container">
<nav>
{% for link in links %}
{% if link.hr %}
{% assign hr = true %}
{% else %}
<li><a href="{{ page.root }}{{ language }}/{{ link.link }}"
class="{% if page.title == link.title %}selected{% endif %}{% if hr %} hr {% endif %}">
{% if link.num %} {{ link.num }} - {% endif %}
{% assign idsplit = link.id | split: '/' %}
{% assign section = idsplit[2] %}
<li><a href="{{ link.url }}"
class="{% if page.title == link.title %}selected{% endif %}{% if section != last_section and section != 'index' %} hr {% endif %}">
{% if section != "index" %}{{ num }} - {% endif %}
{{ link.title }}</a></li>
{% assign hr = false %}
{% endif %}
{% assign last_section = section %}
{% assign num = num | plus:1 %}
{% endfor %}
<li><a href="{{ page.root }}lua_api.html" class="hr">Lua Modding API Reference</a></li>

View File

@ -1,10 +1,12 @@
---
---
{% assign pages = site.en | sort: "idx" %}
[
{% for link in site.data.links_en %}
{% if link.hr != true %}
{% for link in pages %}
{
"idx": {{ link.idx }},
"title": "{{ link.title }}",
"loc": "https://rubenwardy.com/minetest_modding_book/en/{{ link.link }}",
{% if link.description %}
@ -13,7 +15,6 @@
"priority": 1
{% if link.num %}, "chapter_number": {{ link.num }}{% endif %}
},
{% endif %}
{% endfor %}
{