From 45cf82ceec6c9e2fdacb08f06830ef8e194757e4 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Tue, 27 Oct 2020 12:56:53 +0100 Subject: [PATCH 1/3] Add metadata (boards & competency levels) Must be the first thing in the file. Please check README.md for a reference. Example: --- board: mox competency: expert --- --- docs/theme/main.html | 49 +++++++++++++ docs/theme/partials/board.html | 17 +++++ docs/theme/partials/competency.html | 13 ++++ docs/theme/turris.css | 108 ++++++++++++++++++++++++++-- mkdocs.yml | 2 + 5 files changed, 183 insertions(+), 6 deletions(-) create mode 100644 docs/theme/main.html create mode 100644 docs/theme/partials/board.html create mode 100644 docs/theme/partials/competency.html diff --git a/docs/theme/main.html b/docs/theme/main.html new file mode 100644 index 0000000..35c3d93 --- /dev/null +++ b/docs/theme/main.html @@ -0,0 +1,49 @@ +{% extends "base.html" %} + + +{% block content %} + + +{% if page.edit_url %} + + {% include ".icons/material/pencil.svg" %} + +{% endif %} + + +{% if page and page.meta %} +
+ {% if page.meta.board %} + {% include "partials/board.html" %} + {% endif %} + {% if page.meta.competency %} + {% include "partials/competency.html" %} + {% endif %} +
+{% endif %} + +{% if not "\x3ch1" in page.content %} +

{{ page.title | default(config.site_name, true)}}

+{% endif %} + + +{{ page.content }} + + +{% if page and page.meta %} +{% if page.meta.git_revision_date_localized or page.meta.revision_date %} +{% include "partials/source-date.html" %} +{% endif %} +{% endif %} +{% endblock %} + + +{% block disqus %} +{% include "partials/integrations/disqus.html" %} +{% endblock %} + + \ No newline at end of file diff --git a/docs/theme/partials/board.html b/docs/theme/partials/board.html new file mode 100644 index 0000000..03922b0 --- /dev/null +++ b/docs/theme/partials/board.html @@ -0,0 +1,17 @@ + +{% if "shield" in page.meta.board %} +Shield +{% endif %} +{% if "mox" in page.meta.board %} +Mox +{% endif %} +{% if "omnia" in page.meta.board %} +Omnia +{% endif %} +{% if "1.x" in page.meta.board %} +1.x +{% endif %} \ No newline at end of file diff --git a/docs/theme/partials/competency.html b/docs/theme/partials/competency.html new file mode 100644 index 0000000..6bb546c --- /dev/null +++ b/docs/theme/partials/competency.html @@ -0,0 +1,13 @@ + +{% if "novice" in page.meta.competency %} +Novice +{% endif %} +{% if "intermediate" in page.meta.competency %} +Intermediate +{% endif %} +{% if "advanced" in page.meta.competency %} +Advanced +{% endif %} +{% if "expert" in page.meta.competency %} +Expert +{% endif %} \ No newline at end of file diff --git a/docs/theme/turris.css b/docs/theme/turris.css index 00fb461..6e55ba3 100644 --- a/docs/theme/turris.css +++ b/docs/theme/turris.css @@ -1,18 +1,114 @@ /* Set turris colors */ :root { - --md-primary-fg-color: rgb(38, 38, 38); - --md-accent-fg-color: rgb(00, 123, 255); + --md-primary-fg-color: rgb(38, 38, 38); + --md-accent-fg-color: rgb(00, 123, 255); } /* Make links in articles always visible */ .md-typeset a { - color: rgb(00, 00, 255); + color: rgb(00, 00, 255); } /* Add border to images to make them stand out */ .md-typeset img { - border: solid; - border-width: 1px; - border-color: lightgrey; + border: solid; + border-width: 1px; + border-color: lightgrey; } +.metadata a.badge { + color: #fff; +} + +.metadata span.badge { + cursor: help; +} + +.badge { + display: inline-block; + padding: .25em .4em; + font-size: 70%; + font-weight: 700; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: middle; + border-radius: .25rem; + cursor: pointer; +} + +/* Labels: Devices */ +.badge-shield { + color: #fff; + background-color: #438bca; +} + +.badge-shield:hover { + background-color: #2D6A9F; +} + +.badge-mox { + color: #fff; + background-color: #343a40; +} + +.badge-mox:hover { + background-color: #1d2124; +} + +.badge-omnia { + color: #fff; + background-color: #00a2e2; +} + +.badge-omnia:hover { + background-color: #0075A3; +} + +.badge-turris { + color: #fff; + background-color: #ce1126; +} + +.badge-turris:hover { + color: #fff; + background-color: #970C1C; +} + +/* Labels: Competency levels */ +.badge-novice { + color: #fff; + background-color: #54b445; +} + +.badge-novice:hover { + background-color: #449438; +} + +.badge-intermediate { + color: #fff; + background-color: #efd000; +} + +.badge-intermediate:hover { + background-color: #B89F00; +} + +.badge-advanced { + color: #fff; + background-color: #f89217; +} + +.badge-advanced:hover { + background-color: #DA7B07; +} + +.badge-expert { + color: #fff; + background-color: #e64f3b; +} + +.badge-expert:hover { + color: #fff; + background-color: #D9321C; +} diff --git a/mkdocs.yml b/mkdocs.yml index da225e4..d91b81c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,6 +6,7 @@ copyright: CC-BY-SA-4.0 theme: name: 'material' + custom_dir: docs/theme logo: '/theme/turris-logo.svg' favicon: '/theme/favicon.ico' font: false @@ -21,6 +22,7 @@ extra_css: markdown_extensions: + - meta - markdown_include.include: base_path: docs - admonition -- GitLab From 414278470681ed9adcd1c26fe1aa9e233e6e8816 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Tue, 27 Oct 2020 12:57:45 +0100 Subject: [PATCH 2/3] index: Swap warning for important note It looks better with a green accent warning than with an orange one. Also, that is a signal for user that something is relevant but not broken. --- docs/index.md | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/index.md b/docs/index.md index 0c45d28..0efbe0a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,21 +1,22 @@ -!!! warning +# What is Turris project? + +Turris project encompasses both software and hardware development efforts aiming +to provide open and secure routers. Devices that can be truly yours and you can +trust in. + +!!! important This documentation applies primarily to Turris OS version 4.0 and newer. You might still be running Turris OS 3 and in that case you can find old official documentation [on community wiki](https://wiki.turris.cz/doc/en/howto/start). More info about Turris OS versions can also be found [here](basics/tos_versions.md). -# What is Turris project? - -Turris project encompasses both software and hardware development efforts -aiming to provide open and secure routers. Devices that can be truly yours and -you can trust in. - ## Openness Our devices come with open source firmware. You can check what is running on -your router line-by-line, see what we changed or you can even contribute yourself. All -sources are available on our [GitLab](https://gitlab.nic.cz/turris). You get full root account on your device +your router line-by-line, see what we changed or you can even contribute +yourself. All sources are available on our +[GitLab](https://gitlab.nic.cz/turris). You get full root account on your device and you can do whatever you want with it. We are not locking you out. Apart from software, you'll get full schematics for your device so you can check @@ -27,19 +28,19 @@ We consider security as one of our main focus areas. ### Safe defaults -First step in security is setting up your unique password. Therefore we don't enable -internet connection unless user sets a password. We don't provide any +The first step in security is setting up your unique password. Therefore we don't +enable internet connection unless a user sets a password. We don't provide any defaults and you have to come with your own. We also encourage protecting your -Wi-Fi with a password and we provide you with an easy way to create separate network -for devices you don't trust. Last but not least, our devices come with DNSSEC -validation enabled by default. +Wi-Fi with a password and we provide you with an easy way to create separate +network for devices you don't trust. Last but not least, our devices come with +DNSSEC validation enabled by default. ### Updates No software is ever perfect. To keep up with a new security standards and to fix -existing bugs and vulnerabilities, you need your router up to date all the -time. We provide updates for all our devices to fix discovered issues but also -to provide new features. Those updates can be even installed automatically. +existing bugs and vulnerabilities, you need your router up to date all the time. +We provide updates for all our devices to fix discovered issues but also to +provide new features. Those updates can be even installed automatically. ### Data collection -- GitLab From 8bc8024c16503f5250dd956f3aec3cf118d4ffcd Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Fri, 30 Oct 2020 17:17:17 +0100 Subject: [PATCH 3/3] readme: Add instructions how to use metadata --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index 3c3115e..a4ca085 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,48 @@ contamination by system themes. Switch your browser to English. For highlighting the important part of the screenshot (if you need to, most of the time not necessary) use rectangular shape and 3-pixel red line `rgb(255, 0, 0)` +### Metadata + +The metadata must be the first thing in the file and must take the form of a +valid YAML set between triple-dashed lines. Here is a basic example: +``` +--- +board: mox +competency: expert +--- +``` +Between these triple-dashed lines, use predefined variables (see below for a +reference). + +### Turris boards + +In case you want to specify Turris device(s) in the article, use one or multiple +options provided below. + +- shield +- mox +- omnia +- 1.x + +``` +--- +board: shield, mox, omnia, 1.x +--- +``` +### Competency level + +In case you want to specify competency level choose one of the levels below. + +- novice +- intermediate +- advanced +- expert + +``` +--- +competency: expert +--- +``` ### Formating -- GitLab