New Gem - Insert github repo code into Github Pages
まだ誰も着手していません。
評価
調査の方向性
この依頼では、リポジトリのファイル、テスト、エントリポイントは指定されていません。まず、既存の Jekyll と Liquid の統合、およびリポジトリのコードをリモートで読み込むことによるセキュリティ上の影響を確認してください。この issue では、合意された実装も完了基準も定義されていません。
索引モデルが issue の本文から書いたものです。
説明
New Gem Feature Request
I know Gem plug-ins are somewhat frowned upon for security and stability reasons. However, I hope this request will be met with broad acceptance.
I recently stumbled across a gem that will include your repo source code into your Github Pages Jekyll blog post. The advantage of this gem is:
- You no longer have to copy your source code from your repo/file to your blog post.
- You can update your repo source code without having to worry your blog will be up-to-date when your Github Pages site is rebuilt.
- All too often people update their repo source code and think: "I'll update the blog later" but, time passes and they forget to update the blog.
The gem is pretty simple:
# Dynamically insert code block from URL
# From: https://blog.bryanroessler.com/2020-03-18-insert-code-blocks-from-repository/
require 'open-uri'
module Jekyll
class InsertGitCode < Liquid::Tag
def initialize(tag_name, url, tokens)
super
url = url.strip()
@filename = File.basename(url)
encoded_url = URI.encode(url)
@file = URI.parse(encoded_url).read
end
def render(_context)
@file
end
end
end
Liquid::Template.register_tag('insert_git_code', Jekyll::InsertGitCode)
Calling the gem is by a simple liquid tag:
{% highlight ruby %}
{% insert_git_code https://git... %}
{% endhighlight %}
Thank you for considering this request!
- 主要言語
- Ruby
- スター
- 1.9k
- フォーク
- 361
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/pages-gem のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 5/100
-
index.htmlオープン
難易度 5/5 1週間以上 初心者へのやさしさ 5/100
github/pages-gem の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
rubocop/ruby-style-guide#984 ·
-
internal product:dev-portal release-docs
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Kong/developer.konghq.com#7393 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
fastlane/fastlane#30286 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
TheOdinProject/curriculum#31432 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area/web interface
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信