Skip to content

Commit

Permalink
add info about website sections
Browse files Browse the repository at this point in the history
  • Loading branch information
bedroesb committed Jul 24, 2023
1 parent 5e651c9 commit db348a3
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 39 deletions.
58 changes: 57 additions & 1 deletion pages/documentation/website_sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,62 @@
title: Website sections
---

##
When content grows, the need to categorize grows. The theme makes it possible to categorize in the [sidebar](navigation_structures#sidebar), but also to list pages in a nice way that belong to the same section.

A section is simple a collection of pages of the same `type`, see [page mechanics](page_mechanics). Adding the pages you want to list in an overview, can be simply done by tagging them with a type (in the example `type: example_pages`) in the metadata and listing that type using the snippets below.


## Section tiles with information
```
{% raw %}
{% include section-navigation-tiles.html type="example_pages" affiliations=true search=true except="index.md" %}
{% endraw %}
```

Becomes:

{% include section-navigation-tiles.html type="example_pages" affiliations=true search=true except="index.md" %}

### Parameters

* `affiliations`: Turn on filtering by affiliation (`true` or `false`)
* `search`: enable search in the tiles (`true` or `false`)
* `except`: `, ` separated list of page file names which should be excluded, including the file extension.
* `col`: give an integer to specify the number of columns/section cards per row. Default: 2.


## Section tiles simple

```
{% raw %}
{% include section-navigation-tiles-simple.html type="example_pages" %}
{% endraw %}
```


{% include section-navigation-tiles-simple.html type="example_pages" %}

### Parameters

* `except`: `, ` separated list of page names which should be excluded, including the file extension.
* `col`: give an integer to specify the number of columns/section cards per row. Default: 2.



## A more clever way of tagging pages with a certain type

It is important to know that you can also set the these key-value pairs on multiple pages at the same time by specifying them in the `_config.yml` file as described in the [Jekyll documentation](https://jekyllrb.com/docs/configuration/front-matter-defaults/) using the frontmatter defaults.

Example

```yml
defaults:
-
scope:
path: "pages/data_life_cycle"
values:
type: data_life_cycle

```

This will give all markdown files in the `pages/data_life_cycle` subdirectory the *data_life_cycle* type.
38 changes: 0 additions & 38 deletions pages/example_pages/overview_tiles.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
---
title: Overview page example
---

Nam non sollicitudin sapien. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Maecenas consectetur nulla nec rutrum rhoncus. Sed non urna sem. Maecenas sed lobortis urna, hendrerit aliquet massa. Phasellus felis dui, feugiat ut sapien vel, mattis dictum eros. Suspendisse in felis sit amet dui elementum rutrum tristique eget velit. Sed hendrerit, ante sit amet hendrerit cursus, ante nibh accumsan nibh, vitae rhoncus quam ipsum placerat ante.

## Section tiles with information
```
{% raw %}
{% include section-navigation-tiles.html type="example_pages" affiliations=true search=true except="index.md" %}
{% endraw %}
```

Becomes:

{% include section-navigation-tiles.html type="example_pages" affiliations=true search=true except="index.md" %}

### Parameters

* `affiliations`: Turn on filtering by affiliation (`true` or `false`)
* `search`: enable search in the tiles (`true` or `false`)
* `except`: `, ` separated list of page file names which should be excluded, including the file extension.
* `col`: give an integer to specify the number of columns/section cards per row. Default: 2.


## Section tiles simple

```
{% raw %}
{% include section-navigation-tiles-simple.html type="example_pages" %}
{% endraw %}
```


{% include section-navigation-tiles-simple.html type="example_pages" %}

### Parameters

* `except`: `, ` separated list of page names which should be excluded, including the file extension.
* `col`: give an integer to specify the number of columns/section cards per row. Default: 2.

0 comments on commit db348a3

Please sign in to comment.