Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mastodon verification support #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Example:
{{ image(src="/img/hello.png", alt="Hello Friend",
position="left", style="border-radius: 8px;") }}
```

### `figure`

Same as `image`, but with a few extra optional arguments:
Expand All @@ -103,7 +103,9 @@ Example:
caption_style="font-style: italic;") }}
```

## OpenGraph
## Features

### OpenGraph

To add an image to a post, set the `og_image` extra option to the desired image
in the same directory of the markdown file:
Expand All @@ -121,6 +123,16 @@ Additionally, for the section pages and for posts to have a fallback image, add
default_og_image = "static/ocean.jpg"
```

### Mastodon

To enable [Mastodon verification](https://docs.joinmastodon.org/user/profile/#verification), add
the following to your `config.toml`:

```toml
[extra]
mastodon_url = "https://hachyderm.io/@my_username_here"
```

## Configuration

### Only show the post's description
Expand Down Expand Up @@ -189,7 +201,7 @@ You can set the footer's copyright author name like this:
# copyright text. Apart from author, it will
# contain current year and a link to the theme.
author = "My Name"
```
```

If you don't like the default copyright text,
you can set it to completely custom HTML:
Expand Down Expand Up @@ -218,13 +230,13 @@ menu_items = [
# each of these is optional, name and url are required
# $BASE_URL is going to be substituted by base_url from configuration
{name = "blog", url = "$BASE_URL"},

# tags should only be enabled if you have "tags" taxonomy
# see documentation below for more details
{name = "tags", url = "$BASE_URL/tags"},
{name = "archive", url = "$BASE_URL/archive"},
{name = "about me", url = "$BASE_URL/about"},

# set newtab to true to make the link open in new tab
{name = "github", url = "url-to-your-github", newtab = true},
]
Expand All @@ -241,7 +253,7 @@ taxonomies = [
]
```

Enabling tags will create a new `/tags` page, and
Enabling tags will create a new `/tags` page, and
cause them to show up in `archive` section. Note
that you still need to create a menu link to the tags
page manually.
Expand Down
4 changes: 4 additions & 0 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") | safe }}" href="{{ config.extra.favicon | safe }}">
{% endif -%}

{%- if config.extra.mastodon_url %}
{%- block mastodon %}{{ head_macros::mastodon(config=config) }}{% endblock mastodon -%}
{% endif -%}

{%- block extra_head %}
{% endblock extra_head -%}
</head>
Expand Down
4 changes: 4 additions & 0 deletions templates/macros/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,7 @@
<meta property="twitter:domain" content="{{ config.base_url | replace(from="https://", to="") }}">
<meta property="twitter:url" content="{{ permalink | safe }}">
{% endmacro open_graph %}

{% macro mastodon(config) %}
<link rel="me" href="{{ config.extra.mastodon_url }}" />
{% endmacro mastodon %}