Skip to content

Commit

Permalink
Finishing up site (getzola#131)
Browse files Browse the repository at this point in the history
* Finishing up site

* Make site a bit responsive

* Fix menu responsiveness

* Remove Fira Sans and revamp a bit text

* Update list of syntax and change output of syntax

* Add Rust mention

* Some doc tweaks

* Correct capitalization for GitHub

Correct capitalization for GitHub

* Some CSS tweaks

* More css tweaks + favicon

* Add link to my site
  • Loading branch information
Keats authored Oct 19, 2017
1 parent d6cbf44 commit bdcad38
Show file tree
Hide file tree
Showing 26 changed files with 226 additions and 135 deletions.
4 changes: 3 additions & 1 deletion components/rendering/examples/generate_sublime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ fn main() {
dump_to_file(&ps, packpath_nonewlines).unwrap();

for s in ps.syntaxes() {
println!("Add {} -> {:?}", s.name, s.file_extensions);
if !s.file_extensions.is_empty() {
println!("- {} -> {:?}", s.name, s.file_extensions);
}
}
},
(Some(ref cmd), Some(ref theme_dir), Some(ref packpath), None) if cmd == "themepack" => {
Expand Down
4 changes: 2 additions & 2 deletions docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
base_url = "https://gutenberg.netlify.com/"
base_url = "https://www.getgutenberg.io/"
title = "Gutenberg"
description = "Everything you need to make a static site engine in one binary. And it's fast"
description = "Everything you need to make a static site engine in one binary."

compile_sass = true
highlight_code = true
Expand Down
5 changes: 2 additions & 3 deletions docs/content/documentation/content/linking.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if the slug already exists for that article. For example:
It is possible to have Gutenberg automatically insert anchor links next to the header, as you can see on the site you are currently
reading if you hover a title.

This option is set at the section level, look up the `insert_anchor_links` variable on the
This option is set at the section level: the `insert_anchor_links` variable on the
[Section front-matter page](./documentation/content/section.md#front-matter).

The default template is very basic and will need CSS tweaks in your project to look decent.
Expand All @@ -33,5 +33,4 @@ special syntax to Markdown links to handle them: start the link with `./` and po
to link to. The path to the file starts from the `content` directory.

For example, linking to a file located at `content/pages/about.md` would be `[my link](./pages/about.md)`.
You can still link to a header directly: `[my link](./pages/about.md#example)` would work as expected, granted
the `example` id exists on the header.
You can still link to a header directly: `[my link](./pages/about.md#example)` will work as expected.
16 changes: 11 additions & 5 deletions docs/content/documentation/content/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ weight = 10

Gutenberg uses the folder structure to determine the site structure.
Each folder in the `content` directory represents a [section](./documentation/content/section.md)
that contains [pages](./documentation/content/page.md) : your `.md` files.
that contains [pages](./documentation/content/page.md): your `.md` files.

```bash
.
Expand All @@ -23,8 +23,8 @@ that contains [pages](./documentation/content/page.md) : your `.md` files.
└── _index.md // -> https://mywebsite.com/landing/
```

Obviously, each page path (the part after the `base_url`, for example `blog/`) can be customised by setting the wanted value
in the [page front-matter](./documentation/content/page.md#front-matter).
Each page path (the part after the `base_url`, for example `blog/cli-usage/`) can be customised by changing the `path` or `slug`
attribute of the [page front-matter](./documentation/content/page.md#front-matter).

You might have noticed a file named `_index.md` in the example above.
This file will be used for the metadata and content of the section itself and is not considered a page.
Expand All @@ -37,12 +37,18 @@ and `installation.md`.

While not shown in the example, sections can be nested indefinitely.

## Assets colocation

The `content` directory is not limited to markup files though: it's natural to want to co-locate a page and some related
assets. Gutenberg supports that pattern out of the box: create a folder, add a `index.md` file and as many non-markdown as you want.
Those assets will be copied in the same folder when building so you can just use a relative path to access them.
assets.

Gutenberg supports that pattern out of the box: create a folder, add a `index.md` file and as many non-markdown files as you want.
Those assets will be copied in the same folder when building the site which allows you to use a relative path to access them.

```bash
└── with-assets
├── index.md
└── yavascript.js
```

By default, this page will get the folder name (`with-assets` in this case) as its slug.
7 changes: 4 additions & 3 deletions docs/content/documentation/content/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ named `_index/md`.
The front-matter is a set of metadata embedded in a file. In Gutenberg,
it is at the beginning of the file, surrounded by `+++` and uses TOML.

None of the front-matter variables are mandatory. However the opening and closing `+++` are required even if there are
no variables in it.
While none of the front-matter variables are mandatory, the the opening and closing `+++` are required.

Here is an example page with all the variables available:

Expand Down Expand Up @@ -65,8 +64,10 @@ Some content
```

## Summary

You can ask Gutenberg to create a summary if you only want to show the first
paragraph of each page in a list for example.

To do so, add `<!-- more -->` in your content at the point where you want the
summary to end and the content up to that point will be also available separately
in the template.
in the [template](./documentation/templates/pages-sections.md#page-variables).
19 changes: 10 additions & 9 deletions docs/content/documentation/content/section.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ title = "Section"
weight = 20
+++

A section is automatically created implicitly when a folder is found
in the `content` section.
A section is automatically created when a folder is found
in the `content` section, unless it only contains a `index.md` file and is actually
a page with assets.

You can add `_index.md` file to a folder to augment a section and give it
some metadata and/or content.

The index page is actually a section created automatically like any other: you can add metadata
and content by adding `_index.md` at the root of the `content` folder.

## Front-matter

The front-matter is a set of metadata embedded in a file. In Gutenberg,
it is at the beginning of the file, surrounded by `+++` and uses TOML.

As the file itself is optional, none of the front-matter variables are
mandatory. However the opening and closing `+++` are required even if there are
no variables in it.
While none of the front-matter variables are mandatory, the the opening and closing `+++` are required.

Here is an example `_index.md` with all the variables available:

Expand Down Expand Up @@ -67,12 +69,11 @@ redirect_to = ""
Some content
```

Keep in mind that the variables only apply to the direct pages, not to the subsections' pages. This means
you can only paginate the pages directly in the section folder for example.
Keep in mind that any configuration apply only to the direct pages, not to the subsections' pages.

## Sorting
Sections' pages can be sorted three different ways, not counting the unsorted default.
Sorting is enabled by setting the `sort_by` front-matter variable.
Sections' pages can be sorted three different ways, not counting the unsorted default and
is enabled by setting the `sort_by` front-matter variable.

Any page that cannot be sorted, for example if missing the date variable while sorting by `date`, will be ignored and
won't be rendered. The terminal will warn you if this is happening.
Expand Down
19 changes: 12 additions & 7 deletions docs/content/documentation/content/shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,23 @@ That's it, Gutenberg will now recognise this template as a shortcode named `yout

## Using shortcodes

There are two kinds of shortcodes: ones that do no take a body like the YouTube example above and ones that do, a quote for example.
There are two kinds of shortcodes:

- ones that do not take a body like the YouTube example above
- ones that do, a quote for example

In both cases, their arguments must be named and they will all be passed to the template.

Do note that shortcodes in code blocks will be ignored.
Any shortcodes in code blocks will be ignored.

### Shortcodes without body
Those look like rendering a variable in Tera.

On a new line, call the shortcode as if it was a function in a variable block. All the examples below are valid
On a new line, call the shortcode as if it was a Tera function in a variable block. All the examples below are valid
calls of the YouTube shortcode.

```md
Here is a YouTube video:

{{ youtube(id="dQw4w9WgXcQ") }}

{{ youtube(id="dQw4w9WgXcQ", autoplay=true) }}
Expand All @@ -54,7 +59,6 @@ calls of the YouTube shortcode.
```

### Shortcodes with body
Those look like a block in Tera.
For example, let's imagine we have the following shortcode `quote.html` template:

```jinja2
Expand All @@ -67,13 +71,14 @@ For example, let's imagine we have the following shortcode `quote.html` template
We could use it in our markup file like so:

```md
As someone said:

{% quote(author="Vincent") %}
A quote
{% end %}
```

The `body` variable used in the shortcode template will be implicitly passed down to the rendering
context automatically.
The body of the shortcode will be automatically passed down to the rendering context as the `body` variable.

## Built-in shortcodes

Expand Down
25 changes: 10 additions & 15 deletions docs/content/documentation/content/syntax-highlighting.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@ let highlight = true;

````

You can replace the `rust` by the language you want to highlight.
Here is a full list of the supported languages and the short name you can use:
You can replace the `rust` by the language you want to highlight or not put anything to get it
interpreted as plain text.

Here is a full list of the supported languages and the short names you can use:

```
- Plain Text -> ["txt"]
- Assembly x86 (NASM) -> ["asm", "inc", "nasm"]
- Crystal -> ["cr"]
- Elixir -> ["ex", "exs"]
- Elm -> ["elm"]
- Handlebars -> ["handlebars", "handlebars.html", "hbr", "hbrs", "hbs", "hdbs", "hjs", "mu", "mustache", "rac", "stache", "template", "tmpl"]
- Jinja2 -> ["j2", "jinja2"]
- Julia -> ["jl"]
- Kotlin -> ["kt", "kts"]
- LESS -> ["less"]
- ASP -> ["asa"]
- HTML (ASP) -> ["asp"]
Expand All @@ -44,42 +49,33 @@ Here is a full list of the supported languages and the short name you can use:
- Erlang -> ["erl", "hrl", "Emakefile", "emakefile"]
- HTML (Erlang) -> ["yaws"]
- Go -> ["go"]
- Graphviz (DOT) -> ["dot", "DOT"]
- Graphviz (DOT) -> ["dot", "DOT", "gv"]
- Groovy -> ["groovy", "gvy", "gradle"]
- HTML -> ["html", "htm", "shtml", "xhtml", "inc", "tmpl", "tpl"]
- Haskell -> ["hs"]
- Literate Haskell -> ["lhs"]
- Java Server Page (JSP) -> ["jsp"]
- Java -> ["java", "bsh"]
- JavaDoc -> []
- Java Properties -> ["properties"]
- JSON -> ["json", "sublime-settings", "sublime-menu", "sublime-keymap", "sublime-mousemap", "sublime-theme", "sublime-build", "sublime-project", "sublime-completions", "sublime-commands", "sublime-macro"]
- JavaScript -> ["js", "htc"]
- Regular Expressions (Javascript) -> []
- BibTeX -> ["bib"]
- LaTeX Log -> []
- LaTeX -> ["tex", "ltx"]
- TeX -> ["sty", "cls"]
- Lisp -> ["lisp", "cl", "l", "mud", "el", "scm", "ss", "lsp", "fasl"]
- Lua -> ["lua"]
- Make Output -> []
- Makefile -> ["make", "GNUmakefile", "makefile", "Makefile", "OCamlMakefile", "mak", "mk"]
- Markdown -> ["md", "mdown", "markdown", "markdn"]
- MultiMarkdown -> []
- MATLAB -> ["matlab"]
- OCaml -> ["ml", "mli"]
- OCamllex -> ["mll"]
- OCamlyacc -> ["mly"]
- camlp4 -> []
- Objective-C++ -> ["mm", "M", "h"]
- Objective-C -> ["m", "h"]
- PHP Source -> []
- PHP -> ["php", "php3", "php4", "php5", "php7", "phps", "phpt", "phtml"]
- Pascal -> ["pas", "p", "dpr"]
- Perl -> ["pl", "pm", "pod", "t", "PL"]
- Python -> ["py", "py3", "pyw", "pyi", "rpy", "cpy", "SConstruct", "Sconstruct", "sconstruct", "SConscript", "gyp", "gypi", "Snakefile", "wscript"]
- Regular Expressions (Python) -> []
- R Console -> []
- Python -> ["py", "py3", "pyw", "pyi", "pyx", "pyx.in", "pxd", "pxd.in", "pxi", "pxi.in", "rpy", "cpy", "SConstruct", "Sconstruct", "sconstruct", "SConscript", "gyp", "gypi", "Snakefile", "wscript"]
- R -> ["R", "r", "s", "S", "Rprofile"]
- Rd (R Documentation) -> ["rd"]
- HTML (Rails) -> ["rails", "rhtml", "erb", "html.erb"]
Expand All @@ -90,11 +86,10 @@ Here is a full list of the supported languages and the short name you can use:
- Regular Expression -> ["re"]
- reStructuredText -> ["rst", "rest"]
- Ruby -> ["rb", "Appfile", "Appraisals", "Berksfile", "Brewfile", "capfile", "cgi", "Cheffile", "config.ru", "Deliverfile", "Fastfile", "fcgi", "Gemfile", "gemspec", "Guardfile", "irbrc", "jbuilder", "podspec", "prawn", "rabl", "rake", "Rakefile", "Rantfile", "rbx", "rjs", "ruby.rail", "Scanfile", "simplecov", "Snapfile", "thor", "Thorfile", "Vagrantfile"]
- Cargo Build Results -> []
- Rust -> ["rs"]
- SQL -> ["sql", "ddl", "dml"]
- Scala -> ["scala", "sbt"]
- Shell Script (Bash) -> ["sh", "bash", "zsh", ".bash_aliases", ".bash_functions", ".bash_login", ".bash_logout", ".bash_profile", ".bash_variables", ".bashrc", ".profile", ".textmate_init"]
- Bourne Again Shell (bash) -> ["sh", "bash", "zsh", "fish", ".bash_aliases", ".bash_functions", ".bash_login", ".bash_logout", ".bash_profile", ".bash_variables", ".bashrc", ".profile", ".textmate_init"]
- HTML (Tcl) -> ["adp"]
- Tcl -> ["tcl"]
- Textile -> ["textile"]
Expand Down
4 changes: 2 additions & 2 deletions docs/content/documentation/content/table-of-contents.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ weight = 60

Each page/section will automatically generate a table of content for itself based on the headers present.

TODO: add link for template variables
It is available in the template through `section.toc` and `page.toc`. You can view the [template variables]()
It is available in the template through `section.toc` and `page.toc`.
You can view the [template variables](./documentation/templates/pages-sections.md#table-of-contents)
documentation for information on its structure.

Here is an example of using that field to render a 2-level table of content:
Expand Down
9 changes: 6 additions & 3 deletions docs/content/documentation/getting-started/cli-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ $ gutenberg build
You can override the config `base_url` by passing a new URL to the `base-url` flag.

```bash
$ gutenberg build --base-url https://59a896e2cf321c2dcfd2d6de--tera.netlify.com/
$ gutenberg build --base-url $DEPLOY_URL
```

This is useful for example when you want to deploy previews of a site to a dynamic URL, such as Netlify
deploy previews.

## serve

This will build and serve the site using a local server. You can also specify
Expand All @@ -48,5 +51,5 @@ $ gutenberg serve --interface 0.0.0.0 --port 2000
The serve command will watch all your content and will provide live reload, without
hard refresh if possible.

If you fail to see your change, this means that Gutenberg couldn't reload that bit and you will
need to restart `gutenberg serve`.
Gutenberg does a best-effort to live reload but some changes cannot be handled automatically. If you
fail to see your change, you will need to restart `gutenberg serve`.
6 changes: 3 additions & 3 deletions docs/content/documentation/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Gutenberg provides pre-built binaries for MacOS, Linux and Windows on the

Gutenberg is not currently available on Homebrew at the moment.

If you can help package it, please comment on https://github.com/Keats/gutenberg/issues/12
If you can help package it, please comment on [https://github.com/Keats/gutenberg/issues/12](https://github.com/Keats/gutenberg/issues/12)
if you encounter any issues.

## Windows

I am not aware of the package management state in Windows.

If you can help package it, please comment on https://github.com/Keats/gutenberg/issues/12
If you can help package it, please comment on [https://github.com/Keats/gutenberg/issues/12](https://github.com/Keats/gutenberg/issues/12)
if you encounter any issues.

## Archlinux
Expand All @@ -29,7 +29,7 @@ $ yaourt -S gutenberg-bin
```

## From source
To build it from source, you will need to have Git, [Rust and Cargo](https://www.rust-lang.org/en-US/)
To build it from source, you will need to have Git, [Rust and Cargo](https://www.rust-lang.org/)
installed.

From a terminal, you can now run the following command:
Expand Down
15 changes: 8 additions & 7 deletions docs/content/documentation/templates/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ title = "Overview"
weight = 10
+++

Gutenberg uses the [Tera](tera.netlify.com) template engine.
This documentation will only touch how templates work in Gutenberg, please read
Gutenberg uses the [Tera](tera.netlify.com) template engine and is very similar
to Jinja2, Liquid or Twig.

As this documentation will only talk about how templates work in Gutenberg, please read
the [Tera template documentation](https://tera.netlify.com/docs/templates/) if you want
to know how write them. If you are familiar with Jinja2, Liquid or Twig, this should be
a breeze.
to learn more about it first.

All templates live in the `templates` directory and built-in or themes templates can
be overriden by creating a template with same name in the correct path. For example,
you can override the RSS template by creating a `templates/rss.xml` file.

If you are not sure what is available in a template, you can just stick `{{ __tera_context }}` in it
If you are not sure what variables are available in a template, you can just stick `{{ __tera_context }}` in it
to print the whole context.

A few variables are available on all templates except for RSS/Sitemap:
A few variables are available on all templates minus RSS and sitemap:

- `config`: the [configuration](./documentation/getting-started/configuration.md) without any modifications
- `current_path`: the path (full URL without the `base_url`) of the current page
- `current_path`: the path (full URL without the `base_url`) of the current page, never starting with a `/`
- `current_url`: the full URL for that page

## Built-in filters
Expand Down
10 changes: 3 additions & 7 deletions docs/content/documentation/templates/pages-sections.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
+++
title = "Index, Sections and Pages"
title = "Sections and Pages"
weight = 20
+++

First off, it is important to know that in Gutenberg the index
page is actually a section like any other: you can add metadata
and content by adding `_index.md` at the root of the `content` folder.

Pages and sections are actually very similar.

## Page variables
By default, Gutenberg will try to load `templates/page.html`. If there isn't
one, it will render the built-in template: a blank page.
Gutenberg will try to load the `templates/page.html` template, the `page.html` template of the theme if one is used
or will render the built-in template: a blank page.

Whichever template you decide to render, you will get a `page` variable in your template
with the following fields:
Expand Down
Loading

0 comments on commit bdcad38

Please sign in to comment.