From c3f38f3a12c80d1bbffa67448aa0a56581beea83 Mon Sep 17 00:00:00 2001 From: southerntofu Date: Sun, 29 Mar 2020 21:25:56 +0200 Subject: [PATCH] Update README with contribution instructions --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 455b764..b704148 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,55 @@ # dnsmanager-website -Prototype for a dnsmanager homepage \ No newline at end of file +Prototype for a dnsmanager homepage + +# Blog + +## Create a new article + +Create a new folder in the content/blog/YEAR/ folder. index.md is the English version, with the extension prefixed by the language code for translations. + +Each post has some TOML metadata attached. This is called a frontmatter, and the available variables are described in the [Zola documentation](https://www.getzola.org/documentation/content/page/#front-matter): + +``` ++++ +title = "My article" +date = 2020-03-29 ++++ + +My article! +``` + +## Post summaries + +The post summary is taken from the first part of the article. If you add a `<-- more -->` tag, everything before that will be treated as the post summary. + +# Translations + +## How to add a new language + +Adding a language is not hard, but it takes a few steps. The example here takes `fr` as language code for french translations, just replace it with your own language. + +In config.toml: +- declare the language in the languages variable: `{code = "fr", rss = true}` +- translate the basic template strings in the translations section: + +``` +[translations.fr] +source = "Source de cette page" +readmore = "Lire la suite" +``` + +Now you can translate the Markdown pages in the content folder. The translated page should have the language code before the .md extension, like `index.fr.md`. The homepage is translated from content/_index.md, and some common parts (such as the navigation bar) are located in the content/_common folder. + +Warning: don't forget to copy the placeholder section file for year-folders in the blog, otherwise no article will appear on your language's blog. You can safely copy content/2020/_index.md to, say, content/2020/_index.fr.md. + +# TODO + +- [ ] blog + - [x] basic blog + - [ ] pagination + - [x] summaries +- [x] i18n + - [x] pages + - [x] blogposts + - [x] other strings in the templates