Can';t在Github页面中呈现twitter流
我从中设置了twitter流,并使其在localhost上运行,但Github页面没有呈现它 page说,所有页面站点都是使用Can';t在Github页面中呈现twitter流,github,twitter,jekyll,github-pages,Github,Twitter,Jekyll,Github Pages,我从中设置了twitter流,并使其在localhost上运行,但Github页面没有呈现它 page说,所有页面站点都是使用--safe选项生成的,以出于安全原因禁用自定义插件,这意味着twitter流不会出现在Github页面上 有人能想出一个替代方案吗 是页面和它的。Github页面只是有自己支持的插件列表,而jekyll twitter插件不在其中。为了完成清单检查,在开始以下内容之前,最好先吃点零食和饮料 Github页面只是有自己支持的插件列表,而JekyllTwitter插件不在
--safe
选项生成的,以出于安全原因禁用自定义插件,这意味着twitter流不会出现在Github页面上
有人能想出一个替代方案吗
是页面和它的。Github页面只是有自己支持的插件列表,而
jekyll twitter插件不在其中。为了完成清单检查,在开始以下内容之前,最好先吃点零食和饮料
Github页面只是有自己支持的插件列表,而JekyllTwitter插件不在其中。
--马里奥·尼古拉斯
虽然从Gemfile
和\u config.yml
文件加载的插件受到限制,但GitHub页面确实支持子模块,只要https
URL用于跟踪这些内容
或者换句话说,如果要解决的问题可以用Liquid和/或S(C | A)SS表示,GitHub页面的一点组合可以鼓励从其他地方自动加载代码
有人能想出一个替代方案吗?
--阿纳伊克
是的,它与GitHub页面配合使用。有关如何在其他存储库中使用的示例和,请参阅。下面的内容可以从快速入门中进行解释
将当前工作目录更改为存储库并签出您的gh页面
分支
cd ~/git/hub/your-project
git checkout gh-pages
在\u includes
子目录下创建modules
目录,并将以前链接的存储库初始化为新的子模块
mkdir -p _includes/modules
git submodule add\
-b master --name 'twitter-timeline'\
'https://github.com/liquid-utilities/twitter-timeline.git'\
'_includes/modules/twitter-timeline'
编辑一个站点布局文件以包含Liquid插件,在本例中,我使用minima2.5.0;提示,如果未在其他地方列出,则可以在Gemfile.lock
文件中找到版本
\u layouts/default.html
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
{%- include head.html -%}
<body>
{%- include header.html -%}
<main class="page-content" aria-label="Content">
<div class="wrapper">
{{ content }}
{% if page.twitter-timeline %}
{% include modules/twitter-timeline/twitter-timeline.html %}
{% endif %}
</div>
</main>
{%- include footer.html -%}
</body>
</html>
{% comment %}
Source: https://raw.githubusercontent.com/jekyll/minima/v2.5.0/_layouts/default.html
License: MIT
{% endcomment %}
---
layout: post
title: "Example Twitter Timeline"
date: 2019-07-15 13:58:05 -0700
categories: twitter timelines
twitter-timeline:
name: TwitterDev
width: 300
height: 300
chrome: nofooter noscrollbar noborders transparent
tweet_limit: 3
inject_js: true
---
Whatever content to be placed before _injection_ of Twitter Timeline
。。。人们可能还需要摆弄布局和CSS,才能使事物很好地啮合
编辑帖子或页面FrontMatter以触发液体插件
2019-07-15-timeline.md
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
{%- include head.html -%}
<body>
{%- include header.html -%}
<main class="page-content" aria-label="Content">
<div class="wrapper">
{{ content }}
{% if page.twitter-timeline %}
{% include modules/twitter-timeline/twitter-timeline.html %}
{% endif %}
</div>
</main>
{%- include footer.html -%}
</body>
</html>
{% comment %}
Source: https://raw.githubusercontent.com/jekyll/minima/v2.5.0/_layouts/default.html
License: MIT
{% endcomment %}
---
layout: post
title: "Example Twitter Timeline"
date: 2019-07-15 13:58:05 -0700
categories: twitter timelines
twitter-timeline:
name: TwitterDev
width: 300
height: 300
chrome: nofooter noscrollbar noborders transparent
tweet_limit: 3
inject_js: true
---
Whatever content to be placed before _injection_ of Twitter Timeline
添加并提交更改,然后推送到GitHub进行测试
git add .gitmodules
git add _includes/modules/twitter-timeline
git add _layouts/default.html
git add _posts/2019-07-15-timeline.md
git commit -F- <<'EOF'
:heavy_plus_sign: Adds liquid-utilities/twitter-timeline submodule
# Add anything else of note, though do be aware that lines
# that begin with `#` are ignored with this _fanciness_
EOF
git push origin gh-pages
- 要将另一个Twitter时间线添加到另一个帖子
- 要添加到另一个项目,请使用前面的说明
- 虽然Gem插件并不是万能的,但它至少展示了如何将类似的功能卸载到可重用的块中
因此,除了初始化/安装外,子模块的运行方式与任何其他插件类似,而且这些功能不需要任何持续的集成解决方案
注意,如果您得到的子模块具有分离头
,请将工作目录更改为子模块,并提取
/拉
主
分支
提示,请检查您是否希望机器人在子模块有更新时自动建议拉取请求
如果对上述建议有任何疑问,请发表评论,以便改进答案。如果发现链接到存储库如何利用Twitter API存在漏洞,请在GitHub上打开问题或请求,以便代码不会惹恼服务器管理员。是,但是你有什么建议作为替代呢?建立在你自己的基础上,twitter提要可以通过
---
layout: post
title: "Example Twitter Collection Timeline"
date: 2019-07-17 13:58:05 -0700
categories: twitter examples
twitter-timeline:
name: TwitterDev
text: National Park Tweets
type: collection
collection: 539487832448843776
chrome: nofooter noscrollbar noborders transparent
tweet_limit: 3
inject_js: true
---
> Something noteworthy about parks, maybe...