Skip to content

Commit

Permalink
feat: document repo_view
Browse files Browse the repository at this point in the history
  • Loading branch information
not-matthias committed Jul 9, 2024
1 parent 3a27148 commit dbc4819
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fancy_code = true
dynamic_note = true # a note that can be toggled
mathjax = true
mathjax_dollar_inline_enable = true
repo_url = "https://github.com/not-matthias/apollo/tree/main/content"

menu = [
{ name = "/posts", url = "/posts", weight = 1 },
Expand Down
15 changes: 15 additions & 0 deletions content/posts/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ date = "2024-07-09"

[taxonomies]
tags=["documentation"]

[extra]
repo_view = true
+++

## Theme Mode (`theme`)
Expand Down Expand Up @@ -107,6 +110,18 @@ Allows for the creation of togglable note sections in your content.

When enabled, you can create expandable/collapsible note sections in your blog posts.

## Source code (`repo_view`)

Do you want to link to the source code of your blog post? You can turn on the `repo_view` inside the `[extra]` section of your blog post.

```toml
[extra]
repo_view = true
repo_url = "https://github.com/not-matthias/apollo/tree/main/content" # Alternatively add the repo here
```

The `repo_url` can be set in the `[extra]` section or in your `config.toml`.

## Anchor Links

You can add anchor links by adding the following to your `_index.md`:
Expand Down
1 change: 0 additions & 1 deletion templates/macros/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ <h1 class="title">

{# View the page on GitHub #}
{% if page.extra.repo_view | default(value=false) %}

{# Use the page's repo_url if defined, otherwise use the global edit_repo_url #}
{% if page.extra.repo_url is defined %}
{% set repo_url = page.extra.repo_url %}
Expand Down

0 comments on commit dbc4819

Please sign in to comment.