jekyll / jekyll-gist Goto Github PK
View Code? Open in Web Editor NEW:page_with_curl: Liquid tag for displaying GitHub Gists in Jekyll sites.
Home Page: https://rubygems.org/gems/jekyll-gist
License: MIT License
:page_with_curl: Liquid tag for displaying GitHub Gists in Jekyll sites.
Home Page: https://rubygems.org/gems/jekyll-gist
License: MIT License
First of all, let me just say that jekyll-gist is extremely useful!
I was just wondering if it is possible to customise or change the style of the embedded gist (font type and size) in a straightforward manner. I realise it takes the css from github's embed, but I was wondering if you could point me on how to achieve such customisation.
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Hi,
Some tests seem to be failing,
Here are the logs:
All examples were filtered out; ignoring {:focus=>true}
Randomized with seed 5559
Jekyll::Gist::GistTag
invalid gist
no gist id present
Liquid Exception: Syntax error in tag 'gist' while parsing the following markup: Valid syntax: {% gist user/1234567 %} {% gist user/1234567 foo.js %} {% gist 28949e1d5ee2273f9fd3 %} {% gist 28949e1d5ee2273f9fd3 best.md %} in /home/utkarsh2102/debian/updates/gist/ruby-jekyll-gist/tmp/source/_test/doc.md
WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<ArgumentError: Syntax error in tag 'gist' while parsing the following markup:
Valid synt.../1234567 foo.js %}
{% gist 28949e1d5ee2273f9fd3 %}
{% gist 28949e1d5ee2273f9fd3 best.md %}
>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /home/utkarsh2102/debian/updates/gist/ruby-jekyll-gist/spec/gist_tag_spec.rb:171:in `block (4 levels) in <top (required)>'.
raises an error
valid gist
with noscript disabled
does not produce the noscript tag
with valid gist id and invalid filename
produces the correct script tag
does not produce the noscript tag
classic Gist id style
produces the correct noscript tag (FAILED - 1)
produces the correct script tag
with file specified
produces the correct noscript tag (FAILED - 2)
produces the correct script tag
with variable gist id
produces the correct script tag (FAILED - 3)
produces the correct noscript tag (FAILED - 4)
with token
produces the noscript tag (FAILED - 5)
with a filename
produces the noscript tag (FAILED - 6)
with user prefix
produces the correct noscript tag (FAILED - 7)
produces the correct script tag
without user prefix
produces the correct noscript tag (FAILED - 8)
produces the correct script tag
with variable gist id and filename
produces the correct noscript tag (FAILED - 9)
produces the correct script tag (FAILED - 10)
Failures:
1) Jekyll::Gist::GistTag valid gist classic Gist id style produces the correct noscript tag
Failure/Error: expect(output).to match(%r!<noscript><pre><test>true<\/test><\/pre><\/noscript>\n!)
expected "<script src=\"https://gist.github.com/1234321.js\"> </script>\n\n" to match /<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
Diff:
@@ -1,2 +1,2 @@
-/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
+<script src="https://gist.github.com/1234321.js"> </script>
# ./spec/gist_tag_spec.rb:47:in `block (4 levels) in <top (required)>'
2) Jekyll::Gist::GistTag valid gist with file specified produces the correct noscript tag
Failure/Error: expect(output).to match(%r!<noscript><pre><test>true<\/test><\/pre><\/noscript>\n!)
expected "<script src=\"https://gist.github.com/mattr-/24081a1d93d2898ecf0f.js?file=myfile.ext\"> </script>\n\n" to match /<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
Diff:
@@ -1,2 +1,2 @@
-/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
+<script src="https://gist.github.com/mattr-/24081a1d93d2898ecf0f.js?file=myfile.ext"> </script>
# ./spec/gist_tag_spec.rb:61:in `block (4 levels) in <top (required)>'
3) Jekyll::Gist::GistTag valid gist with variable gist id produces the correct script tag
Failure/Error: expect(output).to match(%r!<script src="https:\/\/gist.github.com\/#{doc.data['gist_id']}.js">\s<\/script>!)
expected "<script src=\"https://gist.github.com/page.gist_id.js\"> </script>\n\n" to match /<script src="https:\/\/gist.github.com\/1342013.js">\s<\/script>/
Diff:
@@ -1,2 +1,2 @@
-/<script src="https:\/\/gist.github.com\/1342013.js">\s<\/script>/
+<script src="https://gist.github.com/page.gist_id.js"> </script>
# ./spec/gist_tag_spec.rb:76:in `block (4 levels) in <top (required)>'
4) Jekyll::Gist::GistTag valid gist with variable gist id produces the correct noscript tag
Failure/Error: expect(output).to match(%r!<noscript><pre><test>true<\/test><\/pre><\/noscript>\n!)
expected "<script src=\"https://gist.github.com/page.gist_id.js\"> </script>\n\n" to match /<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
Diff:
@@ -1,2 +1,2 @@
-/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
+<script src="https://gist.github.com/page.gist_id.js"> </script>
# ./spec/gist_tag_spec.rb:79:in `block (4 levels) in <top (required)>'
5) Jekyll::Gist::GistTag valid gist with token produces the noscript tag
Failure/Error: expect(output).to match(%r!<noscript><pre>contents of gist<\/pre><\/noscript>!)
expected "<script src=\"https://gist.github.com/page.gist_id.js\"> </script>\n\n" to match /<noscript><pre>contents of gist<\/pre><\/noscript>/
Diff:
@@ -1,2 +1,2 @@
-/<noscript><pre>contents of gist<\/pre><\/noscript>/
+<script src="https://gist.github.com/page.gist_id.js"> </script>
# ./spec/gist_tag_spec.rb:136:in `block (4 levels) in <top (required)>'
6) Jekyll::Gist::GistTag valid gist with token with a filename produces the noscript tag
Failure/Error: expect(output).to match(%r!<noscript><pre>puts 'hello world'<\/pre><\/noscript>!)
expected "<script src=\"https://gist.github.com/1342013.js?file=hello-world.rb\"> </script>\n\n" to match /<noscript><pre>puts 'hello world'<\/pre><\/noscript>/
Diff:
@@ -1,2 +1,2 @@
-/<noscript><pre>puts 'hello world'<\/pre><\/noscript>/
+<script src="https://gist.github.com/1342013.js?file=hello-world.rb"> </script>
# ./spec/gist_tag_spec.rb:147:in `block (5 levels) in <top (required)>'
7) Jekyll::Gist::GistTag valid gist with user prefix produces the correct noscript tag
Failure/Error: expect(output).to match(%r!<noscript><pre><test>true<\/test><\/pre><\/noscript>\n!)
expected "<script src=\"https://gist.github.com/mattr-/24081a1d93d2898ecf0f.js\"> </script>\n\n" to match /<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
Diff:
@@ -1,2 +1,2 @@
-/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
+<script src="https://gist.github.com/mattr-/24081a1d93d2898ecf0f.js"> </script>
# ./spec/gist_tag_spec.rb:23:in `block (4 levels) in <top (required)>'
8) Jekyll::Gist::GistTag valid gist without user prefix produces the correct noscript tag
Failure/Error: expect(output).to match(%r!<noscript><pre><test>true<\/test><\/pre><\/noscript>\n!)
expected "<script src=\"https://gist.github.com/28949e1d5ee2273f9fd3.js\"> </script>\n\n" to match /<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
Diff:
@@ -1,2 +1,2 @@
-/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
+<script src="https://gist.github.com/28949e1d5ee2273f9fd3.js"> </script>
# ./spec/gist_tag_spec.rb:35:in `block (4 levels) in <top (required)>'
9) Jekyll::Gist::GistTag valid gist with variable gist id and filename produces the correct noscript tag
Failure/Error: expect(output).to match(%r!<noscript><pre><test>true<\/test><\/pre><\/noscript>\n!)
expected "<script src=\"https://gist.github.com/page.gist_id.js?file=page.gist_filename\"> </script>\n\n" to match /<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
Diff:
@@ -1,2 +1,2 @@
-/<noscript><pre><test>true<\/test><\/pre><\/noscript>\n/
+<script src="https://gist.github.com/page.gist_id.js?file=page.gist_filename"> </script>
# ./spec/gist_tag_spec.rb:102:in `block (4 levels) in <top (required)>'
10) Jekyll::Gist::GistTag valid gist with variable gist id and filename produces the correct script tag
Failure/Error: expect(output).to match(%r!<script src="https:\/\/gist.github.com\/#{doc.data['gist_id']}.js\?file=#{doc.data['gist_filename']}">\s<\/script>!)
expected "<script src=\"https://gist.github.com/page.gist_id.js?file=page.gist_filename\"> </script>\n\n" to match /<script src="https:\/\/gist.github.com\/1342013.js\?file=atom.xml">\s<\/script>/
Diff:
@@ -1,2 +1,2 @@
-/<script src="https:\/\/gist.github.com\/1342013.js\?file=atom.xml">\s<\/script>/
+<script src="https://gist.github.com/page.gist_id.js?file=page.gist_filename"> </script>
# ./spec/gist_tag_spec.rb:98:in `block (4 levels) in <top (required)>'
Finished in 0.11652 seconds (files took 3.19 seconds to load)
18 examples, 10 failures
Failed examples:
rspec ./spec/gist_tag_spec.rb:46 # Jekyll::Gist::GistTag valid gist classic Gist id style produces the correct noscript tag
rspec ./spec/gist_tag_spec.rb:60 # Jekyll::Gist::GistTag valid gist with file specified produces the correct noscript tag
rspec ./spec/gist_tag_spec.rb:75 # Jekyll::Gist::GistTag valid gist with variable gist id produces the correct script tag
rspec ./spec/gist_tag_spec.rb:78 # Jekyll::Gist::GistTag valid gist with variable gist id produces the correct noscript tag
rspec ./spec/gist_tag_spec.rb:135 # Jekyll::Gist::GistTag valid gist with token produces the noscript tag
rspec ./spec/gist_tag_spec.rb:146 # Jekyll::Gist::GistTag valid gist with token with a filename produces the noscript tag
rspec ./spec/gist_tag_spec.rb:22 # Jekyll::Gist::GistTag valid gist with user prefix produces the correct noscript tag
rspec ./spec/gist_tag_spec.rb:34 # Jekyll::Gist::GistTag valid gist without user prefix produces the correct noscript tag
rspec ./spec/gist_tag_spec.rb:101 # Jekyll::Gist::GistTag valid gist with variable gist id and filename produces the correct noscript tag
rspec ./spec/gist_tag_spec.rb:97 # Jekyll::Gist::GistTag valid gist with variable gist id and filename produces the correct script tag
Randomized with seed 5559
/usr/bin/ruby2.5 /usr/bin/rspec --pattern ./spec/\*\*/\*_spec.rb --format documentation failed
ERROR: Test "ruby2.5" failed. Exiting.
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Hello,
I wonder if it is possible to add lines highlighting ?
Thanks
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 3 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Refused to execute script from 'https://gist.github.com/inetbiz/xxxxx.js?file=head.html' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
If you're going to require ruby 2.0, then you should increment your major version number as well. It's a backwards compatibility breaking change, especially since Jekyll depends on jekyll-gist ~> 1.0
Looks like we aren't so good about checking types...
Fatal: NoMethodError
undefined method `empty?' for 428626:Fixnum
+ .bundle/ruby/2.3.0/gems/jekyll-gist-1.4.0/lib/jekyll-gist/gist_tag.rb:50:in `gist_script_tag'
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.5.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.5.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Would it be possible to generate an async script, to not block the page?
<script async src="https://gist.github.com/parkr/c08ee0f2726fd0e3909d.js"></script>Hi,
First, thanks a lot for this Jekyll core extension :)
After updating to version v1.3.1, I've noticed that generating static websites on my local machine were taking 5 sec to 20 sec. After rolling back to v1.2.1, my website took 0.1 sec to generate.
I started investigating, and found out that the new noscript
fallback feature is to blame (#7), since it depends on a connection, instead of handling everything locally.
I understand that this feature is desirable for RSS feeds and many public facing websites, but Jekyll's speed is one of its great features.
Is it interesting having an option where users could deactivate the noscript
fallback? something like:
{% gist user/1234567 foo.js noscript:false %}
I could be wrong, but I would think most people would want the gist's to load asynchronously and not stop page render.
<script src="http://gist.github.com/xxx.js" async></script>
$ jekyll serve --trace
NoMethodError: undefined method `has_key?' for #<Liquid::Context:0x0055e25ad300f8>
/var/lib/gems/2.3.0/gems/jekyll-gist-1.4.0/lib/jekyll-gist/gist_tag.rb:17:in `render'
...
In Liquid 4.0 has_key has been renamed to key
Fixed in #41
Currently generated gist can be generated to https://gist.github.com/....
It would be great if we can support syntax like
{% gist username/0cae31fdc http://mygithub.enterpise.com/gist %}
to give http://mygithub.enterpise.com/gist/username/0cae31fdc
I'm getting into a right pickle here trying to get jekyll gems running in general, not sure what's causing the problem so my apologies if this is the wrong place to start asking for help.
Here is my gemfile, following by the commands I've tried:
source 'https://rubygems.org'
gem 'jekyll'
$ bundle update
Fetching gem metadata from http://rubygems.org/...........
Fetching version metadata from http://rubygems.org/...
Fetching dependency metadata from http://rubygems.org/..
Resolving dependencies...
Using blankslate 2.1.2.4
Using hitimes 1.2.2
Using timers 4.0.1
Using celluloid 0.16.1
Using fast-stemmer 1.0.2
Using classifier-reborn 2.0.3
Using coffee-script-source 1.9.1.1
Using execjs 2.6.0
Using coffee-script 2.4.1
Using colorator 0.1
Using ffi 1.9.10
Using jekyll-coffeescript 1.0.1
Installing jekyll-gist 1.3.2 (was 1.3.0)
Gem::InstallError: jekyll-gist requires Ruby version >= 2.0.
An error occurred while installing jekyll-gist (1.3.2), and Bundler cannot
continue.
Make sure that `gem install jekyll-gist -v '1.3.2'` succeeds before bundling.
I'm on Ubuntu 14.04 which had Ruby 1.9.3 (the apt-get version), which I painstakingly updated to version 2.1 as you can see:
$ ruby --version
ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux-gnu]
And the thing that really confusing is that it installs okay individually
$ sudo gem install jekyll-gist -v '1.3.2'
Successfully installed jekyll-gist-1.3.2
Parsing documentation for jekyll-gist-1.3.2
Done installing documentation for jekyll-gist after 0 seconds
1 gem installed
But then if I run bundle update again, it fails in the same way as before.
Check:
http://makingiants.com/blog/ios--swift--show-image-picker-for-gallerycamera/
My post is
---
layout: post
title: "iOS - Swift - Show image picker for gallery/camera"
date: "2015-07-08"
---
Sample code:
{% gist danielgomezrico/83707ddf456ad2405e0d %}
Thanks to [The App Guruz](http://www.theappguruz.com/blog/user-interaction-camera-using-uiimagepickercontroller-swift/)
Why?
It would be nice to either mark all gist scripts as loading="lazy"
or have an option to do so per tag. See https://web.dev/native-lazy-loading/
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Given I add the example gists from the README to a post
{% gist parkr/c08ee0f2726fd0e3909d %}
{% gist parkr/c08ee0f2726fd0e3909d test.md %}
When I run `bundle exec jekyll serve`
Then I get the following error message:
/Users/frank/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/jekyll-gist-1.4.1/lib/jekyll-gist/gist_tag.rb:96: warning: constant ::TimeoutError is deprecated
Liquid Exception: GET https://api.github.com/gists/parkr: 404 - Not Found // See: https://developer.github.com/v3/gists/#get-a-single-gist in
/Users/frank/code/jekyll/tests/default/_posts/2017/2017-07-06-welcome-to-jekyll.markdown
jekyll 3.6.0 | Error: GET https://api.github.com/gists/parkr: 404 - Not Found // See: https://developer.github.com/v3/gists/#get-a-single-gist
The message is not displayed if I omit the username in the gist tag:
{% gist c08ee0f2726fd0e3909d %}
{% gist c08ee0f2726fd0e3909d test.md %}
@jekyll/plugin-core Should we update the documentation?
From the readme:
Pro-tip: If you provide a personal access token with Gist scope, as the environmental variable JEKYLL_GITHUB_TOKEN, Jekyll Gist will use the Gist API to speed up site generation.
This sounds like this is optional, but if not supplied, jekyll serve
will error out with a 401
error on a local test install.
When I insert one of my gists with Unicode characters in it (e.g. this one) I get a Liquid error:
Liquid Exception: incompatible character encodings: UTF-8 and ASCII-8BIT
After a bit of debugging it turned out that the contents of the Gist is not encoded right, most probably because github itself doesnβt send a Content-Type header or any other means of specifying the encoding of the raw Gist.
The latest version of Gist has the following url structure.
https://gist.githubusercontent.com/[gist username]/[gist ID]/raw/[file name]
So
jekyll-gist/lib/jekyll-gist/gist_tag.rb
Line 82 in 8b78b41
should be fixed.
Embedding gists with #
for comments (languages like Ruby, Bash...) are compiled to <h1>
tags on my site (example gist).
To reproduce:
bundle exec rake dev
Disclaimer: I don't know whether this is my fault, the fault of jekyll or the fault of jekyll-gist!
Similar to what was proposed over in #17, it'd be awesome to have some way, either via an environmental variable, or via a site config to programmatically disable the HTTP request required by the fallback.
For one, as @tiagoamaro pointed out, for large sites, it significantly slows down generation. It'd be preferable, in that case, to have the gist tags there with no, non-javascript fallback, than to have the site not generate at all (with not-all including > 10 minutes).
For another, as we're looking to bump the version used in GitHub Pages, there's a bit of a DDoS concern. This can happen in two ways:
It'd be awesome to be able to disable the non-javascript fallback entirely (and I suspect other users would want the option for themselves as well, especially for local development).
Edit: Glad to implement if there's consensus.
/cc #27
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.5.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
If I don't set noscript: false
in _config.yml
, a Liquid exception is raised at build time:
/Users/frank/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/jekyll-gist-1.4.0/lib/jekyll-gist/gist_tag.rb:86: warning: constant Jekyll::Gist::GistTag::TimeoutError is deprecated
Liquid Exception: GET https://api.github.com/gists/DirtyF/24cb9c96b64173ecd85578f38bcc940d: 404 - Not Found // See: https://developer.github.com/v3 in /Users/frank/code/jekyll-fr.org/_posts/2016-09-18-utiliser-des-plugins-jekyll-avec-github-pages.markdown
jekyll 3.2.1 | Error: GET https://api.github.com/gists/DirtyF/24cb9c96b64173ecd85578f38bcc940d: 404 - Not Found // See: https://developer.github.com/v3
I don't know if it's related, but even if I add a JEKYLL_GITHUB_TOKEN with Gist, our tiny blog takes more than a minute to build π’ , with just two embedded Gists, whereas without gists it takes a few seconds. π
At this point, I might as well remove the gists and insert code snippets π₯
Is there a way i could replace the normal string gist id with a variable i have in my post that holds the gist id for example?
I tried these two following formats but both ended up being added as a literal string, is there a way to force it to be evaluated first?
----
gist_id: 123456789
----
{% gist gist_id file.ext %}
{% gist {{gist_id}} file.ext %}
(back ported from jekyll/jekyll#3969)
Hi,
until today, I was using the jekyll
gem but I wanted to try the new github-pages
gem, so I followed the doc and installed it. It updated my gems and after that my jekyll build didn't work anymore:
$ jekyll build
Configuration file: /home/jp/src/perso/barreverte.github.io/_config.yml
Source: /home/jp/src/perso/barreverte.github.io
Destination: /home/jp/src/perso/barreverte.github.io/_site
Generating...
Liquid Exception: incompatible character encodings: UTF-8 and ASCII-8BIT in _posts/2012-08-27-binomer-avec-un-clavier-dvorak-et-un-clavier-azerty.markdown
jekyll 2.4.0 | Error: incompatible character encodings: UTF-8 and ASCII-8BIT
But this post is online since 2012 (see http://www.barreverte.fr/binomer-avec-un-clavier-dvorak-et-un-clavier-azerty/ and its source: https://github.com/barreverte/barreverte.github.io/blob/master/_posts/2012-08-27-binomer-avec-un-clavier-dvorak-et-un-clavier-azerty.markdown)
I removed this post, just to test, and another one post failed for the same reason. I feared I had to destroy a lot of posts to be back on track, so I stopped there.
I created a travis build that shows the issue: https://travis-ci.org/barreverte/barreverte.github.io/ (see broken build https://travis-ci.org/barreverte/barreverte.github.io/builds/84308129 for instance)
I also tried with jekyll/docker and it also failed.
After a lot of searching, the issue was related to jekyll-gist and only 2 files were with problems. In both cases, I replaced the gist
commands in these files (but a lot remain in other posts) and the site builds:
see commit barreverte/barreverte.github.io@3eda156
For a library/framework documentation site it would be useful to be able to link to a sample in the repository and have it included into the generated page. Much like gist
, but for a file from a repository.
This plugin seems to break it's output when attempting to embed the following gist when noscript
is enabled, and jekyll-commonmark is used as the markdown renderer
{% gist 0xdevalias/e8bb28726a37854606ad %}
_config.yml
markdown: CommonMark
commonmark:
options: ["UNSAFE", "FOOTNOTES", "STRIKETHROUGH_DOUBLE_TILDE", "VALIDATE_UTF8", "GITHUB_PRE_LANG", "HARDBREAKS"]
extensions: ["autolink", "strikethrough", "table", "tasklist"]
<p><noscript><pre># Dogedraw, now with more Nyaan!</p>
<p>Paste these functions into the js console on <a href="https://dogedraw.firebaseapp.com">https://dogedraw.firebaseapp.com</a> and run them to nyaan nyaan nyaan..</p>
<p>Developed at <a href="http://hs.hact.io">http://hs.hact.io</a> 2015!!</p>
<pre><code>function clearScreen(w, h, color) {
var pixelDataRef = new Firebase(&#39;https://dogedraw.firebaseio.com/pixels&#39;);
for (var i = 0; i &lt; h; i++) {
for (var j = 0; j &lt; w; j++) {
pixelDataRef.child(j + &quot;:&quot; + i).set(color);
}
}
}
function nyaan(startX, startY) {
function rpt(value, times) {
var arr = [];
for (rpti = 0; rpti &lt; times; rpti++) {
arr[rpti] = value;
}
return arr;
}
function cc(arr) {
var joined = [];
for (cci = 0; cci &lt; arr.length; cci++) {
joined = joined.concat(arr[cci]);
}
return joined;
}
var nyaanHax = new Firebase(&#39;https://dogedraw.firebaseio.com/pixels&#39;);
var w = &quot;fff&quot; // white
var bl = &quot;00f&quot; // blue
var k = &quot;000&quot; // black
var r = &quot;f00&quot; // red
var gy = &quot;333&quot; // grey
var gr = &quot;0f0&quot; // green
var y1 = &quot;FFFFE0&quot; // pale yellow
var y2 = &quot;FFFF00&quot; // yellow
var o = &quot;FF4500&quot; // orange
var p1 = &quot;FFC0CB&quot; // pink
var p2 = &quot;9370DB&quot; //purple
var p3 = &quot;800080&quot; // dark purple
var nyaan = []
nyaan[0] = rpt(w, 38)
nyaan[1] = cc([rpt(w, 3), rpt(r, 6), rpt(w, 7), rpt(k, 14), rpt(w, 8)])
nyaan[2] = cc([[w], rpt(r, 14), [k], rpt(y1, 14), [k], rpt(w, 7)])
nyaan[3] = cc([[w], rpt(r, 3), rpt(o, 5), rpt(r, 5), [k, y1, y1], rpt(p1, 4), [p2, p1, p1, p2], rpt(p1, 3), rpt(y1, 3), [k], rpt(w, 6)])
nyaan[4] = cc([[w], rpt(o, 13), [k, y1], rpt(p1, 2), [p2], rpt(p1, 4), [k, k], rpt(p1, 5), [y1, k, w, k, k], rpt(w, 3)])
nyaan[5] = cc([[w], rpt(o, 3), rpt(y2, 4), rpt(k, 4), rpt(o, 2), [k, y1], rpt(p1, 6), [k, gy, gy, k], [p1, p1, p2, p1, y1, k, k, gy, gy, k], rpt(w, 2)])
nyaan[6] = cc([[w], rpt(y2, 6), [k, gy, gy, gy], rpt(k, 4), [y1], rpt(p1, 6), [k, gy, gy, gy, k], rpt(p1, 3), [y1, k, gy, gy, gy, k], rpt(w, 2)])
nyaan[7] = cc([[w], rpt(y2, 3), rpt(gr, 3), [k, k], rpt(gy, 5), [k, y1], rpt(p1, 3), [p2], rpt(p1, 2), [k], rpt(gy, 4), rpt(k, 4), rpt(gy, 4), [k], rpt(w, 2)])
nyaan[8] = cc([[w], rpt(gr, 8), rpt(k, 4), [gy, k, y1], rpt(p1, 6), [k], rpt(gy, 12), [k], rpt(w, 2)])
nyaan[9] = cc([[w], rpt(gr, 3), rpt(bl, 8), rpt(k, 3), [y1], rpt(p1, 4), [p2, k], rpt(gy, 3), [w, k], rpt(gy, 5), [w, k, gy, gy, k, w]])
nyaan[10] = cc([[w], rpt(bl, 13), [k, y1, p1, p2], rpt(p1, 3), [k], rpt(gy, 3), [k, k], rpt(gy, 3), [k, gy, k, k, gy, gy, k, w]])
nyaan[11] = cc([[w], rpt(bl, 3), rpt(p3, 5), rpt(bl, 5), [k, y1], rpt(p1, 3), [p2, p1, k, gy, p1 ,p1], rpt(gy, 9), [p1, p1, k, w]])
nyaan[12] = cc([[w], rpt(p3, 12), [k, k, y1, y1, p1, p2, p1, p1, k, gy, p1, p1, gy, k, gy, gy, k, gy, gy, k, gy, p1, p1, k, w]])
nyaan[13] = cc([[w], rpt(p3, 3), rpt(w, 5), rpt(p3, 2), rpt(k, 4), rpt(y1, 3), rpt(p1, 4), [k], rpt(gy, 3), rpt(k, 7), rpt(gy, 2), [k, w, w]])
nyaan[14] = cc([rpt(w, 10), [k, gy, gy, gy, k, k], rpt(y1, 7), [k], rpt(gy, 10), [k], rpt(w, 3)])
nyaan[15] = cc([rpt(w, 10), [k, gy, gy, k, w], rpt(k, 19), rpt(w, 4)])
nyaan[16] = cc([rpt(w, 10), rpt(k, 3), rpt(w, 3), [k, gy, gy, k, w, w, w, k, gy, gy, k, w, k, gy, gy, k], rpt(w, 6)])
nyaan[17] = cc([rpt(w, 17), rpt(k, 3), rpt(w, 4), rpt(k, 3), rpt(w, 2), rpt(k, 3), rpt(w, 6)])
nyaan[18] = rpt(w, 38)
for (var i = 0; i &lt; nyaan.length; i++) {
for (var j = 0; j &lt; nyaan[i].length; j++) {
nyaanHax.child(parseInt(startX+j) + &quot;:&quot; + parseInt(startY+i)).set(nyaan[i][j]);
}
}
return &quot;I drew a cat!&quot;
}
```</pre></noscript><script src="https://gist.github.com/0xdevalias/e8bb28726a37854606ad.js"> </script>
</code></pre>
In particular, the end part of the rendered noscript
seems to be getting itself confused, and then ends up breaking the output:
```</pre></noscript><script src="https://gist.github.com/0xdevalias/e8bb28726a37854606ad.js"> </script>
</code></pre>
This doesn't appear to happen on other posts where I have gists embedded.
My theory is that maybe because the gist ends in a triple backtick codeblock (possibly with no newline?), that that may be breaking something within this plugin, that then flows on to breaking how commonmark parses/renders things?
Can I link to a file in a specific revision of a Gist? I'd like to show changes over a couple of revisions in a blog post.
In my case, gist file extension is ".scala".
So, I write below in my post.
{% gist jungbin-kim/acc54d54af4ff954105338534636526a Kakao-coding-test-#1.scala %}
However, it generates
https://gist.github.com/jungbin-kim/acc54d54af4ff954105338534636526a.js?file=Kakao-coding-test-
I think it miss special character like '#'
I expect like below
https://gist.github.com/jungbin-kim/acc54d54af4ff954105338534636526a?file=Kakao-coding-test-#1.scala
It might be involved at this line.
jekyll-gist/lib/jekyll-gist/gist_tag.rb
Line 59 in 6ab6a20
Thank you
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.5.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Hey,
I don't think octokit 4.2 will work with for the test.
There's 4.13 out now. Could you please patch the same?
jekyll-gist/jekyll-gist.gemspec
Line 24 in ca86372
Or I can send a PR for the same?
I was directed here from Jekyll, but for the sake of clarity and saving a click, I've pasted the original text here.
I preface this with the fact that I'm not a Rubyist, and I'm just getting back on Windows, so I seem a little green, it's because I am.
I'm currently working on Windows 10, trying to build a site using the Poole theme, Jekyll 3.1.0 and Ruby ruby 2.2.3p173 x64. I seemed to keep running up against Liquid errors. I managed to fix a few common ones after installing jekyll-gist and jekyll-paginate, but then I hit this wall:
$ jekyll serve --trace Configuration file: C:/Users/cdvillard/Projects/cvillard/new-site/poole/_config.yml Source: C:/Users/cdvillard/Projects/cvillard/new-site/poole Destination: C:/Users/cdvillard/Projects/cvillard/new-site/poole/_site Incremental build: disabled. Enable with --incremental Generating... Liquid Exception: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed in C:/Users/cdvillard/Projects/cvillard/new-site/poole/_posts/2014-01-01-example-content.md C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `block in connect' from C:/Ruby22-x64/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout' from C:/Ruby22-x64/lib/ruby/2.2.0/timeout.rb:98:in `call' from C:/Ruby22-x64/lib/ruby/2.2.0/timeout.rb:98:in `timeout' from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:923:in `connect' from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:863:in `do_start' from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:852:in `start' from C:/Ruby22-x64/lib/ruby/2.2.0/net/http.rb:583:in `start' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-gist-1.4.0/lib/jekyll-gist/gist_tag.rb:79:in `fetch_raw_code' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-gist-1.4.0/lib/jekyll-gist/gist_tag.rb:56:in `gist_noscript_tag' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-gist-1.4.0/lib/jekyll-gist/gist_tag.rb:23:in `render' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/block.rb:151:in `render_token' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/profiler/hooks.rb:5:in `block in render_token_with_profiling' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/profiler.rb:80:in `profile_token_render' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/profiler/hooks.rb:4:in `render_token_with_profiling' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/block.rb:135:in `block in render_all' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/block.rb:122:in `each' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/block.rb:122:in `render_all' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/block.rb:108:in `render' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/template.rb:210:in `block in render' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/template.rb:262:in `with_profiling' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/template.rb:209:in `render' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/liquid-3.0.6/lib/liquid/template.rb:222:in `render!' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/liquid_renderer/file.rb:28:in `block (2 levels) in render!' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/liquid_renderer/file.rb:36:in `measure_bytes' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/liquid_renderer/file.rb:27:in `block in render!' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/liquid_renderer/file.rb:43:in `measure_time' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/liquid_renderer/file.rb:26:in `render!' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/renderer.rb:106:in `render_liquid' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/renderer.rb:61:in `run' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/site.rb:171:in `block (2 levels) in render' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/site.rb:169:in `each' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/site.rb:169:in `block in render' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/site.rb:168:in `each' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/site.rb:168:in `render' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/site.rb:59:in `process' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/command.rb:26:in `process_site' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/commands/build.rb:60:in `build' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/commands/build.rb:33:in `process' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/lib/jekyll/commands/serve.rb:34:in `block (2 levels) in init_with_program' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program' from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/jekyll-3.1.0/bin/jekyll:13:in `<top (required)>' from C:/Ruby22-x64/bin/jekyll:23:in `load' from C:/Ruby22-x64/bin/In the jekyll:23:in `<main>'
I haven't followed the trace just yet, but what I have done until this point is researched. I've tried several methods including Nichol's and Lavena's. I also know that if I remove the gist tag, it serves the site without complaint. Does anyone have ANY clue what could be causing this?
In the original issue, it was suggested that I enforce Net::HTTP#ssl_version
to ':TLSv1_2'. I'm not sure how to.
No biggie, but I debugged it for quite a while.
{% gist 0d05fb4a6249ebbd49b8668afb5c0850 filename.py %}
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Rather than using the /raw
endpoint, if JEKYLL_GITHUB_TOKEN
is passed as an environmental variable, use the Gist API to retrieve the Gist content. This can be done directly, or via Octokit.gist [gist_id]
if you don't mind the extra dependency (since the Gem is no longer bundled by default).
The advantage here, other than using an API over a raw endpoint (for better error handling, proper response codes, etc.), is that it'd be going through an authenticated and rate-limited endpoint, meaning requests can be tracked, and there's less risk of accidental DDoS (as it can gracefully fallback if the rate limit is hit).
The downside is that it would not work for Gists > 1MB, but I suspect that's a major edge case for content being embedded in a site.
Glad to tackle if there's consensus on the best approach, if any.
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.4.1.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
Hello, maintainers! π
By my calculations, it's time for a new release of jekyll-gist. It's been over 2 months since the last release, v1.6.0.
What else is left to be done before a new release can be made? Please make sure to update History.markdown too if it's not already updated.
Thanks! π β¨
This issue is reserved for people who never contributed to Open Source before. We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you π
If you havenβt yet, sign up for Hacktoberfest to earn an exclusive T-Shirt. Plus Iβm sure we can teach you a cool trick or two in the process
Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.
π Claim this issue: Comment below.
Once claimed we add you as contributor to this repository.
π Accept our invitation to this repository. Once accepted, assign yourself to this issue
π Update the file README.md in the jekyll-gist
repository (press the little pen Icon) and edit the line as shown below.
@@ -25,6 +25,8 @@ plugins:
- jekyll-gist
+:bulb: If you are using a Jekyll version less than 3.5.0
, use the gems
key instead of plugins
.
+
Use the tag as follows in your Jekyll pages, posts and collections:
- [ ] πΎ **Commit** your changes
- [ ] π **Start a Pull Request**. There are two ways how you can start a pull request:
1. If you are familiar with the terminal or would like to learn it, [here is a great tutorial](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github) on how to send a pull request using the terminal.
2. You can [edit files directly in your browser](https://help.github.com/articles/editing-files-in-your-repository/)
- [ ] π **Done** Ask in comments for a review :)
### π€β Questions
Leave a comment below!
This issue was created by [First-Timers-Bot](https://github.com/hoodiehq/first-timers-bot).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.