Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

New Gem - Insert github repo code into Github Pages

オープン
#804 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
ruby
領域
web-dev

調査の方向性

この依頼では、リポジトリのファイル、テスト、エントリポイントは指定されていません。まず、既存の 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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/pages-gem のほかの issue

github/pages-gem の issue をすべて見る

似ている issue

Ruby の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。