将袖珍书签同步到Jekyll LinkPosts
pockyll的Python项目详细描述
#pockyll是一个python工具,可以从
[pocket][pocket]集合中创建[jekyll][j]链接帖子,因为自动链接帖子更新就像死亡棒一样。<;br>;
>;"你不想卖给我死亡之杖。"<;br>;
>;"我不想卖给你死亡之杖。"<;br>;
>;"你想回家重新思考你的生活。"<;br>;
>;"我想回家重新思考我的生活。"<;br>;
>;--elan sleazebaggano&obi wanKenobi
功能
*口袋物品/书签同步,将您保存的带标签的口袋物品
转换为与标准Jekyll帖子无缝合并的链接帖子
*链接帖子管理与工具完全兼容,如
[octopress][octopress]
*incremental更新支持
*标签特定同步
*Pocket OAuth身份验证
GES到您的站点设置(以使jekyll能够正确处理
链接帖子)。
用法://github.com/mkirchner/pockyll.git
$cd pockyll
$python setup.py install
``````
登录到[Pocket][Pocket\u login],[create a new
application][Pocket\u newapp]具有*retrieve*权限。
2.切换到jekyll站点目录
3。生成一个虚拟配置文件`_pockyll.yml`。这可以使用
$pockyll init
4来实现。在"pockyll.yml"中,输入在步骤1中创建的"pocket_consumer"密钥。
根据需要编辑其他字段。
5.根据pocket api对pockyll应用程序进行身份验证
$pockyll auth
这将打开一个浏览器窗口并请求pocket身份验证。
它还将在yaml post头中的'ref`
变量中包含目标链接:
--
标题:"clojure,good parts"
日期:2016-04-19t23:05:26
类型:"reference"
ref:https://rasterize.io/blog/clojure the good parts.html
--
at区分正常和链接柱是
因此很简单。您可以简单地使用post类型作为指示符。
下面是一个根目录"index.html"文件的示例,该文件为每个正常的post插入
到post的链接,并为每个
链接post插入到引用的链接:
``html
<;div id="home">;
<;ul id="blog posts"class="posts fa ul">;
{%在site.posts%}
{%如果post.type=="reference"%}
<;li>;<;i class="fa li fa fa-bookmark-o">;
<;a href="{post.ref}">;{post.title}<;&a>;!--这里-->;
<;SPAN>;{{post.date{date{u to_string}<;SPAN>;{li>;
{%else%}
<;li>;<;i class="fa li fa pencil square">;
<;a href="{{post.url}">;{{post.title}<;&a>;!--这里-->;
<;SPAN>;{{post.date}date{u to_string}<;SPAN>;
{%endif%}
{%endfor%}
</ul>;
</div>;
```
对于普通帖子,链接指向"post.url"。如果post
是linkpost,则链接指向"post.ref",从而启用直接外部链接。
` Pockyll同步`(单向同步在所有标记有
"pocket_sync_tags"的新帖子中
2。`杰基尔建造`
3。可选:`jekyll serve`并惊叹于
<;http://localhost:4000>;
\examples
````
mk@kowalski:~/src/mysite$pockyll sync
从Pocket API请求新项目…
同步164个项目。
fixme:['fixme',u'http://insighthealthdata.com/blog/healthybeats/index.html',u'1227075798']
fixme:['fixme',u'374320379']
fixme:['fixme',none,u'0']
skipping:['fixme',none,u'0']
skipping:['fixme',none,u'0']
fixme:['fixme',u'http://www.linkedin.com/pulse/agile dead matthew-kern',u'1264106151']
fixme:['fixme',u'fixme',u'http://www.linkedied.com/pulse/agile dead-dead-matthew-mat/',u'1152066420']
修复时间:[修复时间',u'https://www.chrisstucchio.com/blog/2013/bayesian_bandit.html',u'393364879']
完成(跳过1)。
mk@kowalski:~/src/mysite$
```
pockyll会自动"修复"丢失的标题,但会跳过缺少uri或id的项。我现在将更改为"linkpost_dir",为"title:"fixme"字符串显示所有文件,并开始编辑,例如:
配置文件位于jekyll基目录中。OAuth身份验证成功后,文件
包含您的秘密Pocket访问令牌。因此,请确保
*在`.gitignore'文件中包含pockyll配置!*
整个配置文件结构如下:
```yaml
pocket消费品密钥:**secret***
pocket消费品密钥:**pocket消费品密钥:**pocket消费品密钥:**secret***
pocket消费品令牌:**secret***
pocket重定向网址:https://getpocket.com/a/'
pocket同步消费品标签:['blog']
pocket自:12326342
linkpost消费品目录:'''u post消费品目录:'''''u post消费品入户入户入户入户入户入户入户入户入户入/linkposts'
```
选项
-`Pocket_Consumer_Key`:这是您从
Pocket Developer API获取的使用者密钥。
-`Pocket_Access_Token`:访问令牌。pockyll会在第一个成功的oauth
身份验证事件之后自动在配置文件中存储
令牌。
-`pocket_redirect_uri`:身份验证成功后重定向到的位置(可以是任何位置)。
-`pocket_sync_tags`:应同步到
jeky的pocket标记列表ll.
-`pocket\u since`:标记上次同步的pocket时间戳。
由pockyll自动更新。
-`linkpost\u dir`:应将linkposts同步到的目录。如果要在发布前查看更改,请将其更改为"草稿/链接帖子"。在这种情况下,使用
拉取请求总是受欢迎的。
[j]:http://jekyllrb.com/
[octopress]:http://octopress.org/
[pocket]:https://getpocket.com/
[pocket登录]:https://getpocket.com/login
[pocket newapp]:https://getpocket.com/developer/apps/new
[pocket][pocket]集合中创建[jekyll][j]链接帖子,因为自动链接帖子更新就像死亡棒一样。<;br>;
>;"你不想卖给我死亡之杖。"<;br>;
>;"我不想卖给你死亡之杖。"<;br>;
>;"你想回家重新思考你的生活。"<;br>;
>;"我想回家重新思考我的生活。"<;br>;
>;--elan sleazebaggano&obi wanKenobi
功能
*口袋物品/书签同步,将您保存的带标签的口袋物品
转换为与标准Jekyll帖子无缝合并的链接帖子
*链接帖子管理与工具完全兼容,如
[octopress][octopress]
*incremental更新支持
*标签特定同步
*Pocket OAuth身份验证
GES到您的站点设置(以使jekyll能够正确处理
链接帖子)。
用法://github.com/mkirchner/pockyll.git
$cd pockyll
$python setup.py install
``````
登录到[Pocket][Pocket\u login],[create a new
application][Pocket\u newapp]具有*retrieve*权限。
2.切换到jekyll站点目录
3。生成一个虚拟配置文件`_pockyll.yml`。这可以使用
$pockyll init
4来实现。在"pockyll.yml"中,输入在步骤1中创建的"pocket_consumer"密钥。
根据需要编辑其他字段。
5.根据pocket api对pockyll应用程序进行身份验证
$pockyll auth
这将打开一个浏览器窗口并请求pocket身份验证。
它还将在yaml post头中的'ref`
变量中包含目标链接:
--
标题:"clojure,good parts"
日期:2016-04-19t23:05:26
类型:"reference"
ref:https://rasterize.io/blog/clojure the good parts.html
--
at区分正常和链接柱是
因此很简单。您可以简单地使用post类型作为指示符。
下面是一个根目录"index.html"文件的示例,该文件为每个正常的post插入
到post的链接,并为每个
链接post插入到引用的链接:
``html
<;div id="home">;
<;ul id="blog posts"class="posts fa ul">;
{%在site.posts%}
{%如果post.type=="reference"%}
<;li>;<;i class="fa li fa fa-bookmark-o">;
<;a href="{post.ref}">;{post.title}<;&a>;!--这里-->;
<;SPAN>;{{post.date{date{u to_string}<;SPAN>;{li>;
{%else%}
<;li>;<;i class="fa li fa pencil square">;
<;a href="{{post.url}">;{{post.title}<;&a>;!--这里-->;
<;SPAN>;{{post.date}date{u to_string}<;SPAN>;
{%endif%}
{%endfor%}
</ul>;
</div>;
```
对于普通帖子,链接指向"post.url"。如果post
是linkpost,则链接指向"post.ref",从而启用直接外部链接。
` Pockyll同步`(单向同步在所有标记有
"pocket_sync_tags"的新帖子中
2。`杰基尔建造`
3。可选:`jekyll serve`并惊叹于
<;http://localhost:4000>;
\examples
````
mk@kowalski:~/src/mysite$pockyll sync
从Pocket API请求新项目…
同步164个项目。
fixme:['fixme',u'http://insighthealthdata.com/blog/healthybeats/index.html',u'1227075798']
fixme:['fixme',u'374320379']
fixme:['fixme',none,u'0']
skipping:['fixme',none,u'0']
skipping:['fixme',none,u'0']
fixme:['fixme',u'http://www.linkedin.com/pulse/agile dead matthew-kern',u'1264106151']
fixme:['fixme',u'fixme',u'http://www.linkedied.com/pulse/agile dead-dead-matthew-mat/',u'1152066420']
修复时间:[修复时间',u'https://www.chrisstucchio.com/blog/2013/bayesian_bandit.html',u'393364879']
完成(跳过1)。
mk@kowalski:~/src/mysite$
```
pockyll会自动"修复"丢失的标题,但会跳过缺少uri或id的项。我现在将更改为"linkpost_dir",为"title:"fixme"字符串显示所有文件,并开始编辑,例如:
配置文件位于jekyll基目录中。OAuth身份验证成功后,文件
包含您的秘密Pocket访问令牌。因此,请确保
*在`.gitignore'文件中包含pockyll配置!*
整个配置文件结构如下:
```yaml
pocket消费品密钥:**secret***
pocket消费品密钥:**pocket消费品密钥:**pocket消费品密钥:**secret***
pocket消费品令牌:**secret***
pocket重定向网址:https://getpocket.com/a/'
pocket同步消费品标签:['blog']
pocket自:12326342
linkpost消费品目录:'''u post消费品目录:'''''u post消费品入户入户入户入户入户入户入户入户入户入/linkposts'
```
选项
-`Pocket_Consumer_Key`:这是您从
Pocket Developer API获取的使用者密钥。
-`Pocket_Access_Token`:访问令牌。pockyll会在第一个成功的oauth
身份验证事件之后自动在配置文件中存储
令牌。
-`pocket_redirect_uri`:身份验证成功后重定向到的位置(可以是任何位置)。
-`pocket_sync_tags`:应同步到
jeky的pocket标记列表ll.
-`pocket\u since`:标记上次同步的pocket时间戳。
由pockyll自动更新。
-`linkpost\u dir`:应将linkposts同步到的目录。如果要在发布前查看更改,请将其更改为"草稿/链接帖子"。在这种情况下,使用
拉取请求总是受欢迎的。
[j]:http://jekyllrb.com/
[octopress]:http://octopress.org/
[pocket]:https://getpocket.com/
[pocket登录]:https://getpocket.com/login
[pocket newapp]:https://getpocket.com/developer/apps/new