-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish to rubygems.org #3
Comments
Good idea. I have not published anything to RubyGems before, but I will look into the process. |
I’m not clear: how would I bundle the JS and rakefile with this as a Gem? The JS I could always expose via a Jekyll tag, so that isn’t as big of a deal, but I’m not sure the convention for supplementary stuff like this, especially the Rake task. |
I'm no expert in this either, maybe we could it a go with just the liquid tag and then add to it? I've published a compass extension as a gem before, but that was using this yeoman setup https://github.com/at-import/generator-compass-extension |
This might help https://github.com/jekyll/jekyll-test-gem-plugin |
+1, definitely interested in this as a gem. Just made a similar PR for indirect/jekyll-postfiles#7 which was mostly generated using One thing that I had to do was change the |
This is still definitely a thing i'd be keen on! Any chance you'll have the time to do it? Or if not, got some pointers how you'd want it done, open to PR's? |
I started working on it and got frustrated when trying to figure out how to On Tue, Apr 12, 2016 at 12:58 AM, alias1 notifications@github.com wrote:
|
I saw that :) (just installed it) |
How to properly bundle it in the Gem and the best way to expose it back to On Tuesday, April 12, 2016, alias1 notifications@github.com wrote:
Cheers, Aaron |
So reading over the type of plugins, the 2 that sound potentially useful for exposing the JS to me would be generators (most likely) or hooks. If we had a generator that reads the contents of the JS file from the gem and makes a new Jekyll::StaticFile, outputting it to a location controlled from the site config, that could probably work? Then a tag for loading the JS file from the same path that we output it to. What do you think? I haven't worked much with gems before, so if it's not easy to just read a file stored in it, I found this workaround for determining the path: Also, I started hacking together (haven't touched ruby in ages) a tag for the webmention/pingback header tags (and looking to do one for redirected_from as well once I figure out how it works) class WebmentionHeaderTag < Liquid::Tag
@@warned = {}
def initialize(tag_name, text, tokens)
super
# @text = text
end
def render(context)
site = context.registers[:site]
if site.config['jekyll-webmention-io']
@config = site.config['jekyll-webmention-io']
else
if !@@warned.has_key?('config')
Jekyll.logger.warn "jekyll-webmention-io:", "_config.yml key not defined: jekyll-webmention-io"
@@warned['config'] = true
end
return ""
end
if @config.has_key?('domain')
@domain = @config['domain']
else
if !@@warned.has_key?('domain')
Jekyll.logger.warn "jekyll-webmention-io:", "_config.yml key not defined: jekyll-webmention-io.domain"
@@warned['domain'] = true
end
return ""
end
out = ""
if @domain
out += "<link rel=\"webmention\" href=\"https://webmention.io/#{@domain}/webmention\" />\n"
out += "<link rel=\"pingback\" href=\"https://webmention.io/#{@domain}/xmlrpc\" />\n"
end
return out
end
end Not sure of a nicer/less verbose way of doing those config key checks, but if there is one, would simplify this down a lot. |
Started working on the conversion to gem on my fork. Will see if I can get the above JS loading idea working. Ref for local loading: https://stackoverflow.com/questions/4487948/how-can-i-specify-a-local-gem-in-my-gemfile Edit: Hrmm, seems jekyll doesn't like loading the gem that way.. Any ideas?
Edit2: Ok, my bad, had some files named wrong.. |
Got the JS file from gem -> built site working with a generator. Pushed all I have currently to my fork |
Just created a PR for this @aarongustafson @lewisnyman Mostly tested with Jekyll 3.x Let me know what you think. |
Heya, Just wondering if you'd had a chance to check the PR out yet? |
I’m sorry I have not had much of a chance to tuck into it yet. I’m prepping I should have some time toward the end of next week. I sincerely apologize On Thu, May 12, 2016 at 9:36 PM, alias1 notifications@github.com wrote:
|
Eep, business! No stress, just wanted to make sure it didn't get forgotten about :) |
Still tracking this, I‘m sorry I have been so quiet. I will review soon, I promise! |
That's alright. I know the feels when life gets crazy. Let me know if there's anything I can do to help get it merged. |
Just an update: The move to a gem is in progress. |
Woohoo!! |
You can preview here: https://github.com/aarongustafson/jekyll-webmention_io/tree/gem_conversion |
If we publish this then it becomes a lot simpler to find, install, and contribute back to. The only way to use it right now is to copy it into the plugins directory which tends to encourage the behaviour of copying and editing instead of posting PRs.
What do you think?
The text was updated successfully, but these errors were encountered: