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 OpenGraph and TwitterCards #80

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions docs/async/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
hide:
- toc
description: Patterns for dealing with the asynchronous nature of Pony. Unlike most languages, Pony has zero blocking operations.
---

# Asynchronous Patterns
Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
site_name: Pony Patterns
site_description: "A cookbook style book of patterns for Pony."

copyright: Copyright © 2021 The Pony Developers
edit_uri: edit/main/docs/
Expand All @@ -24,6 +25,7 @@ markdown_extensions:
- smarty
- toc:
permalink: true
- meta

plugins:
- search
Expand All @@ -32,6 +34,7 @@ plugins:

theme:
name: material
custom_dir: overrides

favicon: assets/logo.png

Expand Down
29 changes: 29 additions & 0 deletions overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% extends "base.html" %}

{% block extrahead %}
{% set title = config.site_name %}
{% if page and page.parent is not none %}
{% set title = page.parent.title ~ " - " ~ title %}
{% if page.parent.parent is not none %}
{% set title = page.parent.parent.title ~ " - " ~ title %}
{% endif %}
{% endif %}
{% if page and page.meta and page.meta.title %}
{% set title = page.meta.title ~ " - " ~ title %}
{% elif page and page.title and not page.is_homepage %}
{% set title = page.title | striptags ~ " - " ~ title %}
{% endif %}
{% set description = config.site_description %}
{% if page and page.meta and page.meta.description %}
{% set description = page.meta.description %}
{% endif %}
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ title }}" />
<meta property="og:description" content="{{ description }}" />
<meta property="og:url" content="{{ page.canonical_url }}" />
<meta name="twitter:card" content="app" />
<meta name="twitter:site" content="ponylang" />
<meta name="twitter:creator" content="ponylang" />
<meta name="twitter:title" content="{{ title }}" />
<meta name="twitter:description" content="{{ description }}" />
{% endblock %}
Loading