diff --git a/content/chapter1/_index.md b/content/chapter1/_index.md index c296793..8bde197 100644 --- a/content/chapter1/_index.md +++ b/content/chapter1/_index.md @@ -5,62 +5,20 @@ sort_by = "weight" insert_anchor_links = "right" +++ -Testing every `elements` you can find in [CommonMark](http://commonmark.org). +A theme based on [Gitbook](https://www.gitbook.com/), to write documentation or books. -Quisque viverra a eros id auctor. Proin id nibh ut nisl dignissim pellentesque et ac mi. Nullam mattis urna quis consequat bibendum. Donec pretium dui elit, a semper purus tristique et. Mauris euismod nisl eu vehicula facilisis. Maecenas facilisis non massa non scelerisque. Integer malesuada cursus erat eu viverra. Duis ligula mi, eleifend vel justo id, laoreet porttitor ex. Etiam ultricies lacus lorem, sed aliquam nulla blandit in. Maecenas vel facilisis neque, vitae fringilla eros. In justo nibh, pellentesque sed faucibus nec, varius sit amet risus. +Book will generate a book from the files you place in the `content` directory. Your book +can have two levels of hierarchy: chapters and subchapters. -> This is a quote +Each chapter should be a `section` within the Gutenberg site and should have an `_index.md` +file that sets its `weight` front-matter variable to its chapter number. For example, +chapter 2 should have `weight = 2`. Additionally, each chapter should also set the +`sort_by = "weight"` in its front matter. -- a -- bullet -- point +Each subchapter should be a `page` and should have its `weight` variable set to the subchapter +number. For example, subchapter 3.4 should have `weight = 4`. -## Some code - -```rust -fn main() { - let greetings = ["Hello", "Hola", "Bonjour", - "Ciao", "こんにちは", "안녕하세요", - "Cześć", "Olá", "Здравствуйте", - "Chào bạn", "您好", "Hallo", - "Hej", "Ahoj", "سلام"]; - - for (num, greeting) in greetings.iter().enumerate() { - print!("{} : ", greeting); - match num { - 0 => println!("This code is editable and runnable!"), - 1 => println!("¡Este código es editable y ejecutable!"), - 2 => println!("Ce code est modifiable et exécutable !"), - 3 => println!("Questo codice è modificabile ed eseguibile!"), - 4 => println!("このコードは編集して実行出来ます!"), - 5 => println!("여기에서 코드를 수정하고 실행할 수 있습니다!"), - 6 => println!("Ten kod można edytować oraz uruchomić!"), - 7 => println!("Este código é editável e executável!"), - 8 => println!("Этот код можно отредактировать и запустить!"), - 9 => println!("Bạn có thể edit và run code trực tiếp!"), - 10 => println!("这段代码是可以编辑并且能够运行的!"), - 11 => println!("Dieser Code kann bearbeitet und ausgeführt werden!"), - 12 => println!("Den här koden kan redigeras och köras!"), - 13 => println!("Tento kód můžete upravit a spustit"), - 14 => println!("این کد قابلیت ویرایش و اجرا دارد!"), - _ => {}, - } - } -} -``` - -## A table - -| a | table | in | markdown | !! | -|----|-------|----|----------|---------------------------------| -| 1 | 2 | 3 | 4 | 5 | -| 1 | we | ew | we | with a longish column inside it | - -## An image - -![a cat](https://i.imgur.com/t6nPdY8.jpg "A cat") - -## An iframe - -{{ youtube(id="dQw4w9WgXcQ") }} +Finally, you should create an `_index.md` file and set the `redirect_to` front-matter variable +to redirect to the first section of your content. For example, if your first section has the +slug `introduction`, then you would set `redirect_to = "introduction"`. diff --git a/content/chapter1/page2.md b/content/chapter1/page2.md new file mode 100644 index 0000000..6e0ee40 --- /dev/null +++ b/content/chapter1/page2.md @@ -0,0 +1,62 @@ ++++ +title = "Page 2" +weight = 2 +sort_by = "weight" +insert_anchor_links = "right" ++++ + +Testing every `elements` you can find in [CommonMark](http://commonmark.org). + + +Quisque viverra a eros id auctor. Proin id nibh ut nisl dignissim pellentesque et ac mi. Nullam mattis urna quis consequat bibendum. Donec pretium dui elit, a semper purus tristique et. Mauris euismod nisl eu vehicula facilisis. Maecenas facilisis non massa non scelerisque. Integer malesuada cursus erat eu viverra. Duis ligula mi, eleifend vel justo id, laoreet porttitor ex. Etiam ultricies lacus lorem, sed aliquam nulla blandit in. Maecenas vel facilisis neque, vitae fringilla eros. In justo nibh, pellentesque sed faucibus nec, varius sit amet risus. + +> This is a quote + +- a +- bullet +- point + +## Some code + +```rust +fn main() { + let greetings = ["Hello", "Hola", "Bonjour", + "Ciao", "こんにちは", "안녕하세요", + "Cześć", "Olá", "Здравствуйте", + "Chào bạn", "您好", "Hallo", + "Hej", "Ahoj", "سلام"]; + + for (num, greeting) in greetings.iter().enumerate() { + print!("{} : ", greeting); + match num { + 0 => println!("This code is editable and runnable!"), + 1 => println!("¡Este código es editable y ejecutable!"), + 2 => println!("Ce code est modifiable et exécutable !"), + 3 => println!("Questo codice è modificabile ed eseguibile!"), + 4 => println!("このコードは編集して実行出来ます!"), + 5 => println!("여기에서 코드를 수정하고 실행할 수 있습니다!"), + 6 => println!("Ten kod można edytować oraz uruchomić!"), + 7 => println!("Este código é editável e executável!"), + 8 => println!("Этот код можно отредактировать и запустить!"), + 9 => println!("Bạn có thể edit và run code trực tiếp!"), + 10 => println!("这段代码是可以编辑并且能够运行的!"), + 11 => println!("Dieser Code kann bearbeitet und ausgeführt werden!"), + 12 => println!("Den här koden kan redigeras och köras!"), + 13 => println!("Tento kód můžete upravit a spustit"), + 14 => println!("این کد قابلیت ویرایش و اجرا دارد!"), + _ => {}, + } + } +} +``` + +## A table + +| a | table | in | markdown | !! | +|----|-------|----|----------|---------------------------------| +| 1 | 2 | 3 | 4 | 5 | +| 1 | we | ew | we | with a longish column inside it | + +## An image + +![a cat](https://i.imgur.com/t6nPdY8.jpg "A cat") diff --git a/netlify.toml b/netlify.toml index b1f6962..da3ec95 100644 --- a/netlify.toml +++ b/netlify.toml @@ -2,7 +2,17 @@ command = "zola build" [build.environment] - ZOLA_VERSION = "0.16.0" + ZOLA_VERSION = "0.17.2" [context.deploy-preview] - command = "zola build --base-url $DEPLOY_PRIME_URL" \ No newline at end of file + command = "zola build --base-url $DEPLOY_PRIME_URL" + +[[headers]] + for = "/*" + [headers.values] + X-Frame-Options = "DENY" + X-Content-Type-Options = "nosniff" + X-XSS-Protection = "1; mode=block" + Referrer-Policy = "strict-origin-when-cross-origin" + Strict-Transport-Security = "max-age=63072000; includeSubdomains" + Content-Security-Policy = "default-src 'none'; frame-ancestors 'none'; object-src 'none'; base-uri 'self'; manifest-src 'self'; connect-src 'self'; form-action 'self'; script-src 'self'; img-src 'self' data: cdn.cloudflare.com; frame-src 'self' www.youtube-nocookie.com player.vimeo.com; media-src 'self' data: cdn.cloudflare.com www.youtube-nocookie.com player.vimeo.com; font-src 'self' cdn.cloudflare.com cdn.jsdelivr.net fonts.gstatic.com; style-src 'self' cdn.cloudflare.com cdn.jsdelivr.net fonts.googleapis.com;" diff --git a/sass/_content.scss b/sass/_content.scss index f45feb2..244b215 100644 --- a/sass/_content.scss +++ b/sass/_content.scss @@ -9,7 +9,7 @@ transition: 0.5s; .zola-anchor { - color: #4183c4; + color: #357aba; padding-left: 10px; text-decoration: none; font-weight: initial; @@ -25,7 +25,7 @@ &__content { a { - color: #4183c4; + color: #357aba; text-decoration: none; &:hover { diff --git a/sass/_navigation.scss b/sass/_navigation.scss index 5d11289..590da23 100644 --- a/sass/_navigation.scss +++ b/sass/_navigation.scss @@ -29,7 +29,7 @@ } li.active > a { - color: #008cff; + color: #0053bc; text-decoration: none; } diff --git a/templates/index.html b/templates/index.html index 88e2ad3..f75ae1b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -5,7 +5,16 @@ - + + {% if page %} + {% if page.description %} + + {% elif config.description %} + + {% endif %} + {% elif config.description %} + + {% endif %} {% block title %}{{ config.title }}{% endblock title %} @@ -33,7 +42,7 @@ {% set subsection = get_section(path=s) %}
  • {% set chapter_num = loop.index %} - + {% if config.extra.book_number_chapters %}{{ chapter_num }}.{% endif %} {{ subsection.title }} @@ -41,7 +50,7 @@