Skip to main content

Microdata plugin for Pelican

https://secure.travis-ci.org/noirbizarre/pelican-microdata.svg?tag=0.3.0 https://coveralls.io/repos/noirbizarre/pelican-microdata/badge.svg?tag=0.3.0 https://img.shields.io/pypi/l/pelican-microdata.svg https://img.shields.io/pypi/pyversions/pelican-microdata.svg

Microdata semantic markups support for Pelican static blog generator.

Installation

Install the plugin via pip:

~$ pip install pelican-microdata

Usage

To load the plugin, you have to add it in your settings file.

PLUGINS = (
    'microdata',
)

Once loaded you have access to microdata rst directives.

Directives

Microdata plugin provides two directives:

  • itemscope, a block directive allowing to declare an itemscope block:

    .. itemscope:: <Schema type>
        :tag: element type (default: div)
        :itemprop: optionnal itemprop attribute
        :compact: optionnal
    
        Nested content
  • itemprop, an inline directive/role allowing to annotate some text with an itemprop attribute.

    :itemprop:`Displayed text <itemprop name>`
    :itemprop:`Displayed text <itemprop name:http://some.url/>`

Settings

You can define a vocabulary to use with the MICRODATA_VOCABULARY setting.

MICRODATA_VOCABULARY = 'http://data-vocabulary.org'

If not set, schema.org <http://schema.org> is the default value.

Example

This reStructuredText document:

.. itemscope:: Person
    :tag: p

    My name is :itemprop:`Bob Smith <name>`
    but people call me :itemprop:`Smithy <nickanme>`.
    Here is my home page:
    :itemprop:`www.exemple.com <url:http://www.example.com>`
    I live in Albuquerque, NM and work as an :itemprop:`engineer <title>`
    at :itemprop:`ACME Corp <affiliation>`.

will result in:

<p itemscope itemtype="http://schema.org/Person">
    My name is <span itemprop="name">Bob Smith</span>
    but people call me <span itemprop="nickname">Smithy</span>.
    Here is my home page:
    <a href="http://www.example.com" itemprop="url">www.example.com</a>
    I live in Albuquerque, NM and work as an <span itemprop="title">engineer</span>
    at <span itemprop="affiliation">ACME Corp</span>.
</p>

Changelog

0.3.0 (2017-02-02)

  • Support for Pelican 2.7 and Python 3.3+

  • Drop support for Python 3.2

  • Use schema.org as default vocabulary prefix

  • Make vocabulary prefix configurable with MICRODATA_VOCABULARY

0.2 (2013-06-21)

  • Start working on Python 3 compatibility

  • Added compact option to ItemScope block

  • Consider nested <p> tags as compact

0.1 (2013-03-25)

  • Initial implementation

Release files for pelican-microdata 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pelican-microdata 0.3.0
File Interpreter ABI Platform
pelican_microdata-0.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / pelican_microdata-0.3.0-py2.py3-none-any.whl

Download URL pelican_microdata-0.3.0-py2.py3-none-any.whl
Size 10.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
737c7a6c1afc84fcb2170231710d370629678b9c064cca77ab92b890c7447e0a
BLAKE2b-256 checksum
How to use checksums
bad45bba70f5b2e3399696f2d950b4368719ac8b7afa253c804b6d03e97cc2be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page