Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
lektor opengraph support
[model]
name = Page
label = {{ this.title }}
[fields.title]
label = Title
type = string
[fields.meta_title]
label = MetaData Title
type = string
[fields.meta_description]
label = MetaData Description
type = string
[fields.og_title]
label = OpenGraph Title
type = string
[fields.og_description]
label = OpenGraph Description
type = string
[fields.body]
label = Body
type = markdown
{% extends "site_layout.html" %}
{% block title %}{{ this.title }}{% endblock %}
{% block meta_title %}{{ this.meta_title or this.title }}{% endblock %}
{% block meta_description %}{{ this.meta_description }}{% endblock %}
{% block og_title %}{{ this.og_title or this.meta_title or this.title }}{% endblock %}
{% block og_description %}{{ this.og_description or this.meta_description }}{% endblock %}
{% block body %}
{{ this.body }}
{% endblock %}
<title>{% block title %}DEFAULT TITLE{% endblock %}</title>
<meta name="title" content="{% block meta_title %}{% endblock %}"/>
<meta name="description" content="{% block meta_description %}{% endblock %}"/>
<meta name="author" content="AUTHOR"/>
<link href="{{ this.url_path | url(external=True) }}" rel="canonical">
<meta property="og:title" content="{% block og_title %}{% endblock %}" />
<meta property="og:site_name" content="SITE NAME" />
<meta property="og:url" content="{{ this.url_path | url(external=True) }}" />
<meta property="og:description" content="{% block og_description %}{% endblock %}" />
<meta property="og:type" content="website" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.