From 70a0283b6d5a492f6ca055ad973841928adc56cd Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 13 Jan 2018 02:21:18 +0000 Subject: [PATCH] Add footer and improve homepage --- _includes/footer.html | 12 +++++- _includes/header.html | 13 ++++--- _layouts/compress.html | 9 +++++ _layouts/default.html | 3 ++ _sass/_content.scss | 3 +- _sass/_main.scss | 88 ++++++++++++++++++++++++++++++------------ en/index.md | 55 ++++++++------------------ 7 files changed, 111 insertions(+), 72 deletions(-) create mode 100644 _layouts/compress.html diff --git a/_includes/footer.html b/_includes/footer.html index be22a29..e3a1ec9 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,5 +1,13 @@ - - + + + + diff --git a/_includes/header.html b/_includes/header.html index a24f9ee..1d126fb 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -1,13 +1,13 @@ - {% if page.title != "Introduction" %}{{ page.title }} - {% endif %}Minetest Modding Book + {% if page.homepage %}{% else %}{{ page.title }} - {% endif %}Minetest Modding Book - + {% assign pathsplit = page.dir | split: '/' %} @@ -22,7 +22,7 @@ {% endif %}
- + -
-

{{ page.title }}

+
+
+ {% if page.no_header %}{% else %}

{{ page.title }}

{% endif %} diff --git a/_layouts/compress.html b/_layouts/compress.html new file mode 100644 index 0000000..d254d3e --- /dev/null +++ b/_layouts/compress.html @@ -0,0 +1,9 @@ +--- +# Jekyll layout that compresses HTML +# v2.0.0 +# http://jch.penibelst.de/ +# © 2014–2015 Anatol Broder +# MIT License +--- + +{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% assign _pre_befores = _content | split: "" %}{% case _pres.size %}{% when 2 %}{% capture _content %}{{ _content }}{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% when 1 %}{% capture _content %}{{ _content }}{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% endcase %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% assign _comment_befores = _content | split: _comments.first %}{% for _comment_before in _comment_befores %}{% assign _comment_content = _comment_before | split: _comments.last | first %}{% if _comment_content %}{% capture _comment %}{{ _comments.first }}{{ _comment_content }}{{ _comments.last }}{% endcapture %}{% assign _content = _content | remove: _comment %}{% endif %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " ;; ;" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %}
Step Bytes
raw {{ content | size }}{% if _profile_endings %}
endings {{ _profile_endings }}{% endif %}{% if _profile_collapse %}
collapse {{ _profile_collapse }}{% endif %}{% if _profile_comments %}
comments {{ _profile_comments }}{% endif %}{% if _profile_clippings %}
clippings {{ _profile_clippings }}{% endif %}
{% endif %}{% endif %} diff --git a/_layouts/default.html b/_layouts/default.html index 4f0db4c..4cc5f9b 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,3 +1,6 @@ +--- +layout: compress +--- {% include header.html %} {{ content }} {% include footer.html %} diff --git a/_sass/_content.scss b/_sass/_content.scss index 256ba5a..1963491 100644 --- a/_sass/_content.scss +++ b/_sass/_content.scss @@ -60,7 +60,8 @@ figure { h1 { text-align: center; - margin: 10px 0 0 0; + margin: 0; + padding: 10px 0 0 0; } h2 { diff --git a/_sass/_main.scss b/_sass/_main.scss index fe6a194..bd91375 100644 --- a/_sass/_main.scss +++ b/_sass/_main.scss @@ -7,7 +7,6 @@ html, body { color: black; } - #container { width: 100%; max-width: 1100px; @@ -15,17 +14,7 @@ html, body { position: relative; } -#page { - background: white; - margin: 0; - padding: 0 20px 20px 20px; - position: absolute; - left: 280px; - right: 0; - top: 0; -} - -#navbar { +nav { position: absolute; left: 0; width: 280px; @@ -38,26 +27,26 @@ html, body { color: white; } -#navbar li { +nav li { display: block; margin: 0; padding: 0; } -#navbar li a.hr { +nav li a.hr { border-top: 2px solid #666; } -#navbar li a.selected { +nav li a.selected { background: #363 !important; color: white !important; } -#navbar li a.selected:hover { +nav li a.selected:hover { background: #474 !important; } -#navbar li a { +nav li a { display: block; padding: 5px; color: #ccc; @@ -65,33 +54,82 @@ html, body { cursor: pointer; } -#navbar li:nth-child(odd) a { +nav li:nth-child(odd) a { background: #3c3c3c; } -#navbar li a:hover { +nav li a:hover { background: #444; } +main { + margin: 0; + padding: 0; + position: absolute; + left: 280px; + right: 0; + top: 0; +} + +article { + background: white; + padding: 0 20px 20px 20px; +} + +footer { + margin: 0 0 20px 0; + padding: 1em 1.5em; + background: #444; + color: #fff; + border-radius: 0 0 10px 10px; +} + +footer a { + color: #0be; + text-decoration: none; +} + +footer a:hover { + color: #0df; + text-decoration: underline; +} + +#header { + text-align: center; + padding: 100px 0; +} + +#header h1 { + padding-bottom: 20px; +} + +#header span { + display: block; + padding: 6px; +} + +.homepage h1 { + font-size: 200%; +} @media all and (max-height: 568px) { - #navbar { + nav { position: absolute; } } @media all and (max-width: 780px) { - #navbar { + nav { position: static; margin: 0; width: 100%; } - #navbar li a { + nav li a { padding: 10px; } - #page { + main { position: static; margin: 0; padding-top: 20px; @@ -99,11 +137,11 @@ html, body { } @media print { - #navbar{ + nav{ display: none !important; } - #page { + main { left: 0 !important; } diff --git a/en/index.md b/en/index.md index 22109b7..028e5ec 100644 --- a/en/index.md +++ b/en/index.md @@ -1,55 +1,34 @@ --- title: Introduction layout: default +homepage: true +no_header: true root: ../ --- + + ## Introduction Minetest uses Lua scripts to provide modding support. This book aims to teach you how to create your own mods, starting from the basics. +Each chapter focuses on a particular part of the API, and will soon get you making +your own mods. As well as [reading this book online](https://rubenwardy.com/minetest_modding_book), you can also [download it in PDF or HTML form](https://github.com/rubenwardy/minetest_modding_book/releases). -## What you will need +### Feedback and Contributions -* A Code Editor. Talked about in the [Lua Scripts](chapters/lua.html#tools) chapter. -* A copy of Minetest in the 0.4 series. (eg: 0.4.13) -* Motivation to keep trying when things go wrong. You learn more when you work - something out yourself. +Noticed a mistake, or want to give feedback? Make sure to tell me about it. +I'd accept contributions. -## So, go on then. - -Start [learning about how to create a mod folder](chapters/folders.html), or use the navigation bar on -the left (or on the top on mobiles) to open a chapter. - -* [GitHub](https://github.com/rubenwardy/minetest_modding_book). -* [Download for offline use](https://github.com/rubenwardy/minetest_modding_book/releases). -* [Forum Topic](https://forum.minetest.net/viewtopic.php?f=14&t=10729). - -## About this Book - -Noticed a mistake, or want to give feedback? Tell us about it using one of these methods: - -* [GitHub Issue](https://github.com/rubenwardy/minetest_modding_book/issues). +* Create a [GitHub Issue](https://github.com/rubenwardy/minetest_modding_book/issues). * Post in the [Forum Topic](https://forum.minetest.net/viewtopic.php?f=14&t=10729). -* Send me a [PM](https://forum.minetest.net/ucp.php?i=pm&mode=compose&u=2051) on the Forum. -* Submit a report below. - -You can contribute to this project on [GitHub](https://github.com/rubenwardy/minetest_modding_book).\\ -Read the [contribution README]({{ page.root }}README.html). - -Written by rubenwardy.\\ -License: [CC-BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) - - +* Send me a [PM](https://forum.minetest.net/ucp.php?i=pm&mode=compose&u=2051) on the forums. +* [Read the contribution README](../README.html).