在页面中嵌入公共GitHub项目的列表

pelican-github-projects的Python项目详细描述


在页面中嵌入公共GitHub项目的列表。

安装

要安装pelican github项目,只需从pypi安装即可:

$ pip install pelican-github-projects

配置

在pelicanconf.py中启用插件

PLUGINS=[# ...'pelican-github-projects',# ...]

使用github用户名添加设置。

GITHUB_USER='kyah'

可用数据

name:The name of your project.
language:The language your project is written in, information on how GitHub detects languages is available here. It is GitHub that detects the language, not this plugin. So please, no issues about that.
description:The description of your project (as set on GitHub.)
homepage:The homepage of your project (as set on GitHub.)
github_url:The web page URL of your project on GitHub (not the GIT or API URL.)

用法

在您的模板中,您将能够迭代github_项目 变量,如下所示。

{% if GITHUB_USER %}
    {% for project in github_projects %}
      <h2>{{ project.name }} {% if project.language %}<sup>({{ project.language }})</sup>{% endif %}</h2><p>{{ project.description }}</p><p>
        {% if project.homepage %}
            <ahref="{{ project.homepage }}">Homepage</a>
        {% endif %}
        <ahref="{{ project.github_url }}">GitHub</a></p>
    {% endfor %}
{% endif %}

许可证

GPLv2许可证。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
以最原始的方式在Hadoop中协调java数据   smb将smb文件转换为Java文件   在JSP中生成xml文件时,JSP中的java表达式语言不起作用   Java使用datetime反序列化JSON到对象   h2如何在Java中导出数据库应用程序以正常工作   java错误:没有if的else。但我把它放在了后面   java反向迭代ConcurrentSkipListMap   java逻辑在某个地方出错,试图从1100到1100之间的用户处获取输入   java有人能给我解释一下这段代码的输出吗?   java有没有办法实现一个通用类来显示一个对象字段?   高级安装程序中的java MySql Dll文件   Java URLClassLoader可以在eclipse中工作,但不能在cmd中工作   java我的应用程序在启动新线程时崩溃   java在安卓中读取xml的最佳方式是什么?   java灰度图像在小程序中显示时变为黑色   java数组、算法和元素