aboutsummaryrefslogtreecommitdiff
path: root/doc/plugins/contrib/opengraph.mdwn
blob: 9932c50d2faae483b7a25f179e355cf0ca1bd8bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# TL;DR

**Plugin**: [opengraph.pm](https://notabug.org/hiatobr/ikiwiki-plugin-opengraph/raw/master/opengraph.pm)

**Source**: [git](https://notabug.org/hiatobr/ikiwiki-plugin-opengraph)

---

[[!toc]]

---

# NAME

IkiWiki::Plugin::opengraph - Adds Open Graph tags on the html head

---

# DESCRIPTION

This plugin implements the Open Graph tags in the head of the hmtl for all pages, provided you configure it properly and add it to the current template.
For more information on what is Open Graph, visit [[!wikipedia Open_Graph]].
To test your site against the Open Graph rules, use the tool available on <https://developers.facebook.com/tools/debug/og/object/>.

# DISCLAIMER

> **WARNING: Open Graph is modern spyware. You should use this if and only if you don't mind making the readers of your wiki/blog being tracked by evil corporations without their consent. By using this plugin you are being mean to the people who are reading your content. You have been warned.**

---

# INSTALLATION

Put [opengraph.pm](https://notabug.org/hiatobr/ikiwiki-plugin-opengraph/raw/master/opengraph.pm) in *${HOME}/.ikiwiki/IkiWiki/Plugin/* or elsewhere in
your *@INC* path. Or read [[/plugins/install]].

---

# CONFIGURATION

Add to the configuration in your [[blog.setup|/setup#index5h2]] file.

    ## Open Graph plugin
    # For more information, see
    # <https://en.wikipedia.org/wiki/Open_Graph#Open_Graph_protocol>.
    # Default values for <http://ikiwiki.info>
    # obtained from <https://developers.facebook.com/tools/debug/og/object/>
    # meta property="og:title"
    opengraph_title: "ikiwiki"
    # meta property="og:type"
    opengraph_type: "website"
    # meta property="og:url"
    opengraph_url: "http://ikiwiki.info/"
    # meta property="og:image"
    opengraph_image: "http://ikiwiki.info/logo/ikiwiki.png"
    # meta property="og:description"
    opengraph_description: "Ikiwiki is a wiki compiler."

Add *opengraph* to the list of plugins:

    add_plugins: [qw{goodstuff opengraph}]

---

# TEMPLATES

You will need to add the following code to [[page.tmpl|/templates]] on the current
[[template|/templates]]. It **must** be in the <head> section of the <html>. I recommend
puting it after the <title> tag.

    <TMPL_IF OPENGRAPH>
    <TMPL_VAR OPENGRAPH_TAGS>
    </TMPL_IF>

---

# BUGS AND LIMITATIONS

...that's not a bug. It's an issue. Issues shall be reported [here](https://notabug.org/hiatobr/ikiwiki-plugin-opengraph/issues)

Seriously, I don't know how to fetch the current page's description. Help on that is appreciated.

---

# LICENSE AND COPYRIGHT

Copyleft (.) 2015 Hacklab Independência

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

---

# SEE ALSO

[[Ikiwiki|index]]

[[!wikipedia Open_Graph]]

<https://ikiwiki.info/plugins/contrib/opengraph>