From 1ca3ba1e82b174889044a3f975e89d43031acb3a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 15 Jul 2018 15:28:10 +0100 Subject: [PATCH] Use Jekyll collections --- README.md | 6 +- _config.yml | 4 + _data/links_en.yml | 129 ------------------ {en/chapters => _en/basics}/folders.md | 4 +- {en/chapters => _en/basics}/lua.md | 2 + {en => _en}/index.md | 1 + .../inventories}/inventories.md | 3 +- .../inventories}/itemstacks.md | 1 + .../items}/creating_textures.md | 2 + {en/chapters => _en/items}/node_drawtypes.md | 2 + .../items}/nodes_items_crafting.md | 2 + {en/chapters => _en/map}/abms.md | 2 + {en/chapters => _en/map}/environment.md | 2 + {en/chapters => _en/map}/lvm.md | 2 + {en/chapters => _en/map}/node_metadata.md | 2 + {en/chapters => _en/players}/chat.md | 2 + {en/chapters => _en/players}/chat_complex.md | 2 + {en/chapters => _en/players}/formspecs.md | 1 + {en/chapters => _en/players}/hud.md | 1 + .../players}/player_physics.md | 3 +- {en/chapters => _en/players}/privileges.md | 4 +- {en/chapters => _en/players}/sfinv.md | 1 + .../quality}/common_mistakes.md | 1 + {en/chapters => _en/quality}/luacheck.md | 2 + {en/chapters => _en/quality}/mvc.md | 1 + {en/chapters => _en/quality}/readmore.md | 1 + {en/chapters => _en/quality}/releasing.md | 3 +- {en/chapters => _en/quality}/unit_testing.md | 1 + _includes/header.html | 23 ++-- sitemap.json | 7 +- 30 files changed, 66 insertions(+), 151 deletions(-) delete mode 100644 _data/links_en.yml rename {en/chapters => _en/basics}/folders.md (96%) rename {en/chapters => _en/basics}/lua.md (99%) rename {en => _en}/index.md (99%) rename {en/chapters => _en/inventories}/inventories.md (99%) rename {en/chapters => _en/inventories}/itemstacks.md (99%) rename {en/chapters => _en/items}/creating_textures.md (95%) rename {en/chapters => _en/items}/node_drawtypes.md (99%) rename {en/chapters => _en/items}/nodes_items_crafting.md (98%) rename {en/chapters => _en/map}/abms.md (97%) rename {en/chapters => _en/map}/environment.md (99%) rename {en/chapters => _en/map}/lvm.md (98%) rename {en/chapters => _en/map}/node_metadata.md (97%) rename {en/chapters => _en/players}/chat.md (98%) rename {en/chapters => _en/players}/chat_complex.md (98%) rename {en/chapters => _en/players}/formspecs.md (99%) rename {en/chapters => _en/players}/hud.md (99%) rename {en/chapters => _en/players}/player_physics.md (98%) rename {en/chapters => _en/players}/privileges.md (97%) rename {en/chapters => _en/players}/sfinv.md (99%) rename {en/chapters => _en/quality}/common_mistakes.md (99%) rename {en/chapters => _en/quality}/luacheck.md (98%) rename {en/chapters => _en/quality}/mvc.md (99%) rename {en/chapters => _en/quality}/readmore.md (98%) rename {en/chapters => _en/quality}/releasing.md (99%) rename {en/chapters => _en/quality}/unit_testing.md (99%) diff --git a/README.md b/README.md index 26b1bed..b1d1d88 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/_config.yml b/_config.yml index 3c957d5..62aa90f 100644 --- a/_config.yml +++ b/_config.yml @@ -4,3 +4,7 @@ sass: gems: - jekyll-sitemap + +collections: + en: + output: true diff --git a/_data/links_en.yml b/_data/links_en.yml deleted file mode 100644 index 4695619..0000000 --- a/_data/links_en.yml +++ /dev/null @@ -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 diff --git a/en/chapters/folders.md b/_en/basics/folders.md similarity index 96% rename from en/chapters/folders.md rename to _en/basics/folders.md index 6c5eea3..235b36c 100644 --- a/en/chapters/folders.md +++ b/_en/basics/folders.md @@ -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 @@ -23,7 +25,7 @@ minetest/mods. ![Find the mod's folder]({{ page.root }}/static/folder_modfolder.jpg) A "mod name" is used to refer to a mod. Each mod should have a unique mod name. -Mod names can include letters, numbers, and underscores. A good mod name should +Mod names can include letters, numbers, and underscores. A good mod name should describe what the mod does, and the folder which contains the components of a mod needs to be given the same name as the mod name. diff --git a/en/chapters/lua.md b/_en/basics/lua.md similarity index 99% rename from en/chapters/lua.md rename to _en/basics/lua.md index 19e7a79..84e228b 100644 --- a/en/chapters/lua.md +++ b/_en/basics/lua.md @@ -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 diff --git a/en/index.md b/_en/index.md similarity index 99% rename from en/index.md rename to _en/index.md index 1a6b6c1..d5a7fe8 100644 --- a/en/index.md +++ b/_en/index.md @@ -4,6 +4,7 @@ layout: default homepage: true no_header: true root: ../ +idx: 0.1 ---