跳转到主要内容

Pelican博客生成器的社会指令

项目描述

Pelican的社会插件

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

Pelican静态博客生成器的社会指令。

通过简单的内联指令轻松链接到社交网络内容。

兼容性

pelican-social与Pelican 3.3+和Python 2.7兼容。

安装

通过pip安装插件

~$ pip install pelican-social

用法

要加载插件,您必须在设置文件中添加它。

PLUGINS = (
    'social',
)

加载后,您将可以访问社会rst指令。

每个指令都可以以两种形式调用

:network:`target`

:network:`Displayed text <target>`

尽可能,指令提供安全的(https)链接。

Twitter

您可以使用:twitter::tw:指令来链接到Twitter个人资料,它们是等效的。使用用户名中的@将只更改显示的用户名,如果未指定自定义显示方式。

示例

:twitter:`username`
:twitter:`@username`
:twitter:`User <username>`
:twitter:`User <@username>`

将导致

<a href="https://twitter.com/username">username</a>
<a href="https://twitter.com/username">&#64;username</a>
<a href="https://twitter.com/username">User</a>
<a href="https://twitter.com/username">User</a>

Google+

Google+对用户名很棘手。如果您是名人且幸运的话,您可以在+MyUser形式中拥有自定义用户名。如果没有,您将有一个21位数字标识符。

示例

:gplus:`username`
:gplus:`User <username>`

将导致

<a href="https://plus.google.com/username">username</a>
<a href="https://plus.google.com/username">User</a>

Github

您可以使用:github::gh:指令来链接到github个人资料、仓库和问题/拉取请求(如果问题与拉取请求相关联,github将自动将您重定向到拉取请求)。

以下形式被接受

目标

期望的目标形式

个人资料

用户名

仓库

用户名/仓库

问题/拉取请求

用户名/仓库#问题

示例

:github:`username`
:github:`User <username>`
:github:`username/repository`
:github:`Repository <username/repository>`
:github:`username/repository#2`
:github:`Issue #2 <username/repository#2>`

将导致

<a href="https://github.com/username">username</a>
<a href="https://github.com/username">User</a>
<a href="https://github.com/username/repository">repository</a>
<a href="https://github.com/username/repository">Repository</a>
<a href="https://github.com/username/repository/issues/2">#2</a>
<a href="https://github.com/username/repository/issues/2">Issue #2</a>

Facebook

您可以使用:facebook::fb:指令来链接到Facebook个人资料,它们是等效的。

示例

:facebook:`User <username>`
:facebook:`username`

将导致

<a href="https://facebook.com/username">User</a>
<a href="https://facebook.com/username">username</a>

变更日志

0.2.0 (2017-02-02)

  • 支持Pelican 3.7+和Python 3.3+

  • 停止支持Python 3.2

0.1.1 (2013-07-02)

  • 处理Github用户名和仓库名中的点和破折号

0.1 (2013-06-20)

  • 初始实现,允许链接到
    • Facebook个人资料

    • Twitter个人资料

    • Google+个人资料

    • Github个人资料、仓库和问题

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分发

此版本没有可用的源代码分发文件。请参阅生成分发归档的教程

构建分发

pelican_social-0.2.0-py2.py3-none-any.whl (9.3 kB 查看哈希值)

上传时间 Python 2 Python 3

由以下组织支持