Jekyll: How to use custom plugins with GitHub pages









up vote
4
down vote

favorite
1












It turns out that custom ruby plugins don't work on GitHub pages because of security concerns.



I'm trying to add a plugin (this one) to the _plugins folder of my Jekyll project, but when I deploy it to GitHub it is ignored.



Question: Is there a way to workaround this? Has anyone found a solution?



Note: Obviously I can generate html files locally and commit them to my repository. But that's not what I want.










share|improve this question

















  • 1




    You can use an hosting like Netlify.
    – David Jacquel
    Nov 9 at 8:18














up vote
4
down vote

favorite
1












It turns out that custom ruby plugins don't work on GitHub pages because of security concerns.



I'm trying to add a plugin (this one) to the _plugins folder of my Jekyll project, but when I deploy it to GitHub it is ignored.



Question: Is there a way to workaround this? Has anyone found a solution?



Note: Obviously I can generate html files locally and commit them to my repository. But that's not what I want.










share|improve this question

















  • 1




    You can use an hosting like Netlify.
    – David Jacquel
    Nov 9 at 8:18












up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





It turns out that custom ruby plugins don't work on GitHub pages because of security concerns.



I'm trying to add a plugin (this one) to the _plugins folder of my Jekyll project, but when I deploy it to GitHub it is ignored.



Question: Is there a way to workaround this? Has anyone found a solution?



Note: Obviously I can generate html files locally and commit them to my repository. But that's not what I want.










share|improve this question













It turns out that custom ruby plugins don't work on GitHub pages because of security concerns.



I'm trying to add a plugin (this one) to the _plugins folder of my Jekyll project, but when I deploy it to GitHub it is ignored.



Question: Is there a way to workaround this? Has anyone found a solution?



Note: Obviously I can generate html files locally and commit them to my repository. But that's not what I want.







ruby jekyll github-pages






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 8 at 20:06









Oleksandr Shpota

3,36521430




3,36521430







  • 1




    You can use an hosting like Netlify.
    – David Jacquel
    Nov 9 at 8:18












  • 1




    You can use an hosting like Netlify.
    – David Jacquel
    Nov 9 at 8:18







1




1




You can use an hosting like Netlify.
– David Jacquel
Nov 9 at 8:18




You can use an hosting like Netlify.
– David Jacquel
Nov 9 at 8:18












2 Answers
2






active

oldest

votes

















up vote
1
down vote



+50










Without a plugin



A reading time script does not require a plugin. I have created a collection of scripts that can be added without using a plugin. You can find them here. A reading time script is one of them.



Here you find the code:



% capture words %
minus: 180
% endcapture %
% unless words contains '-' %
divided_by: 180
% endunless %


Note that this code contains only Liquid and no Ruby. Therefore it can be used in your layout or in an include (without a plugin).



Optimizing the script



Suppose you have something like this:



<p>lorem ipsum</p>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>


Then you could remove the above code blocks like this:



% assign preprocessed_content=post.content 
replace: '</p>', '__/p__' %
% assign truncated_content=preprocessed_content
% assign cleaned_content=truncated_content
% assign cleaned_content=cleaned_content


Ofcourse this can be extended to support more tags.



Using the plugin anyway



If you REALLY want to use a plugin you can let your local machine or CloudCannon build your site and push the result to Github Pages. See also: https://learn.cloudcannon.com/jekyll/using-jekyll-plugins/






share|improve this answer






















  • Thank you. number_of_words was the first thing I tried. Unfortunately it doesn't satisfy my needs. My articles often contain code blocks but number_of_words doesn't provide any mechanism to filter page content. Excluding code, pre, script etc might help but it is currently not possible. That's why for some articles it shows 2-3times more words than needed. Do you know how to fix this?
    – Oleksandr Shpota
    Nov 11 at 18:12










  • You could try to split your content on code blocks. Are you sure that you can read code faster than normal words? I would say the opposite is true.
    – JoostS
    Nov 11 at 19:05











  • It is not about performance. I don't want my code to be included to words count, it doesn't make sense. For instance, this article of mine sashashpota.com/2018/10/30/… contains around 800 words, but number_of_words shows 1400 words as it counts code blocks as well.
    – Oleksandr Shpota
    Nov 11 at 19:20











  • No, it is not about performance. It is about the speed at which humans read text and code. I do not think that you can read code faster than normal words/text. Code blocks are no images and should not be considered as such (IMO).
    – JoostS
    Nov 11 at 19:30







  • 1




    Thank you for suggesting replace and strip_html. I solved my problem using your suggestion github.com/Shpota/shpota.github.io/commit/… It is not ideal but it works.
    – Oleksandr Shpota
    Nov 15 at 10:02

















up vote
0
down vote













You need an alternative to those plugins.



As detailed in "Building a Series List with Hugo Shortcodes":



Ruby plugin execution is disabled altogether on Github pages:




Plugins on GitHub Pages GitHub Pages is powered by Jekyll.
However, all Pages sites are generated using the -safe option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages.



You can still use GitHub Pages to publish your site, but you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.




I understand you mention:




Obviously I can generate html files locally and commit them to my repository. But that's not what I want.




Still, a static website generator (compatible with GitHub pages) like Hugo is to be considered in your case.



R.J Lorimer adds:




Hugo has the concept of Shortcodes, which are much like “Liquid Tags” in Jekyll.

Also like Jekyll, you can create custom shortcode tags.



However, the major difference is that in Hugo you can create them without resorting to actually writing Go code - see Create Your Own Shortcodes.

Because Hugo uses Go Templates for rendering the pages, shortcodes can use any and all Go template functions inside of them, as well as a whole list of custom Hugo functions added to help. This makes it arguably more powerful than a liquid-template solution, but still in a template file that can be easily updated on the fly.




Plus, Hugo does support MathJax, as seen in this article.



Update Nov. 2018: with Hugo 0.52, this tweet confirms (referencing this thread):




The inline shortcode is similar to the way Jekyll allows you to use Liquid tags within Markdown







share|improve this answer






















  • Thank you for proposing an alternative solution. But I'm afraid switching from Jekyll to Hugo is even bigger pain. Alternatively I could host my blog on GitLab where custom plugins are supported.
    – Oleksandr Shpota
    Nov 11 at 8:08










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53215356%2fjekyll-how-to-use-custom-plugins-with-github-pages%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



+50










Without a plugin



A reading time script does not require a plugin. I have created a collection of scripts that can be added without using a plugin. You can find them here. A reading time script is one of them.



Here you find the code:



% capture words %
minus: 180
% endcapture %
% unless words contains '-' %
divided_by: 180
% endunless %


Note that this code contains only Liquid and no Ruby. Therefore it can be used in your layout or in an include (without a plugin).



Optimizing the script



Suppose you have something like this:



<p>lorem ipsum</p>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>


Then you could remove the above code blocks like this:



% assign preprocessed_content=post.content 
replace: '</p>', '__/p__' %
% assign truncated_content=preprocessed_content
% assign cleaned_content=truncated_content
% assign cleaned_content=cleaned_content


Ofcourse this can be extended to support more tags.



Using the plugin anyway



If you REALLY want to use a plugin you can let your local machine or CloudCannon build your site and push the result to Github Pages. See also: https://learn.cloudcannon.com/jekyll/using-jekyll-plugins/






share|improve this answer






















  • Thank you. number_of_words was the first thing I tried. Unfortunately it doesn't satisfy my needs. My articles often contain code blocks but number_of_words doesn't provide any mechanism to filter page content. Excluding code, pre, script etc might help but it is currently not possible. That's why for some articles it shows 2-3times more words than needed. Do you know how to fix this?
    – Oleksandr Shpota
    Nov 11 at 18:12










  • You could try to split your content on code blocks. Are you sure that you can read code faster than normal words? I would say the opposite is true.
    – JoostS
    Nov 11 at 19:05











  • It is not about performance. I don't want my code to be included to words count, it doesn't make sense. For instance, this article of mine sashashpota.com/2018/10/30/… contains around 800 words, but number_of_words shows 1400 words as it counts code blocks as well.
    – Oleksandr Shpota
    Nov 11 at 19:20











  • No, it is not about performance. It is about the speed at which humans read text and code. I do not think that you can read code faster than normal words/text. Code blocks are no images and should not be considered as such (IMO).
    – JoostS
    Nov 11 at 19:30







  • 1




    Thank you for suggesting replace and strip_html. I solved my problem using your suggestion github.com/Shpota/shpota.github.io/commit/… It is not ideal but it works.
    – Oleksandr Shpota
    Nov 15 at 10:02














up vote
1
down vote



+50










Without a plugin



A reading time script does not require a plugin. I have created a collection of scripts that can be added without using a plugin. You can find them here. A reading time script is one of them.



Here you find the code:



% capture words %
minus: 180
% endcapture %
% unless words contains '-' %
divided_by: 180
% endunless %


Note that this code contains only Liquid and no Ruby. Therefore it can be used in your layout or in an include (without a plugin).



Optimizing the script



Suppose you have something like this:



<p>lorem ipsum</p>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>


Then you could remove the above code blocks like this:



% assign preprocessed_content=post.content 
replace: '</p>', '__/p__' %
% assign truncated_content=preprocessed_content
% assign cleaned_content=truncated_content
% assign cleaned_content=cleaned_content


Ofcourse this can be extended to support more tags.



Using the plugin anyway



If you REALLY want to use a plugin you can let your local machine or CloudCannon build your site and push the result to Github Pages. See also: https://learn.cloudcannon.com/jekyll/using-jekyll-plugins/






share|improve this answer






















  • Thank you. number_of_words was the first thing I tried. Unfortunately it doesn't satisfy my needs. My articles often contain code blocks but number_of_words doesn't provide any mechanism to filter page content. Excluding code, pre, script etc might help but it is currently not possible. That's why for some articles it shows 2-3times more words than needed. Do you know how to fix this?
    – Oleksandr Shpota
    Nov 11 at 18:12










  • You could try to split your content on code blocks. Are you sure that you can read code faster than normal words? I would say the opposite is true.
    – JoostS
    Nov 11 at 19:05











  • It is not about performance. I don't want my code to be included to words count, it doesn't make sense. For instance, this article of mine sashashpota.com/2018/10/30/… contains around 800 words, but number_of_words shows 1400 words as it counts code blocks as well.
    – Oleksandr Shpota
    Nov 11 at 19:20











  • No, it is not about performance. It is about the speed at which humans read text and code. I do not think that you can read code faster than normal words/text. Code blocks are no images and should not be considered as such (IMO).
    – JoostS
    Nov 11 at 19:30







  • 1




    Thank you for suggesting replace and strip_html. I solved my problem using your suggestion github.com/Shpota/shpota.github.io/commit/… It is not ideal but it works.
    – Oleksandr Shpota
    Nov 15 at 10:02












up vote
1
down vote



+50







up vote
1
down vote



+50




+50




Without a plugin



A reading time script does not require a plugin. I have created a collection of scripts that can be added without using a plugin. You can find them here. A reading time script is one of them.



Here you find the code:



% capture words %
minus: 180
% endcapture %
% unless words contains '-' %
divided_by: 180
% endunless %


Note that this code contains only Liquid and no Ruby. Therefore it can be used in your layout or in an include (without a plugin).



Optimizing the script



Suppose you have something like this:



<p>lorem ipsum</p>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>


Then you could remove the above code blocks like this:



% assign preprocessed_content=post.content 
replace: '</p>', '__/p__' %
% assign truncated_content=preprocessed_content
% assign cleaned_content=truncated_content
% assign cleaned_content=cleaned_content


Ofcourse this can be extended to support more tags.



Using the plugin anyway



If you REALLY want to use a plugin you can let your local machine or CloudCannon build your site and push the result to Github Pages. See also: https://learn.cloudcannon.com/jekyll/using-jekyll-plugins/






share|improve this answer














Without a plugin



A reading time script does not require a plugin. I have created a collection of scripts that can be added without using a plugin. You can find them here. A reading time script is one of them.



Here you find the code:



% capture words %
minus: 180
% endcapture %
% unless words contains '-' %
divided_by: 180
% endunless %


Note that this code contains only Liquid and no Ruby. Therefore it can be used in your layout or in an include (without a plugin).



Optimizing the script



Suppose you have something like this:



<p>lorem ipsum</p>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>
<code>lorem ipsum</code>
<p>lorem ipsum</p>


Then you could remove the above code blocks like this:



% assign preprocessed_content=post.content 
replace: '</p>', '__/p__' %
% assign truncated_content=preprocessed_content
% assign cleaned_content=truncated_content
% assign cleaned_content=cleaned_content


Ofcourse this can be extended to support more tags.



Using the plugin anyway



If you REALLY want to use a plugin you can let your local machine or CloudCannon build your site and push the result to Github Pages. See also: https://learn.cloudcannon.com/jekyll/using-jekyll-plugins/







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 11 at 21:56

























answered Nov 11 at 18:03









JoostS

5,92721536




5,92721536











  • Thank you. number_of_words was the first thing I tried. Unfortunately it doesn't satisfy my needs. My articles often contain code blocks but number_of_words doesn't provide any mechanism to filter page content. Excluding code, pre, script etc might help but it is currently not possible. That's why for some articles it shows 2-3times more words than needed. Do you know how to fix this?
    – Oleksandr Shpota
    Nov 11 at 18:12










  • You could try to split your content on code blocks. Are you sure that you can read code faster than normal words? I would say the opposite is true.
    – JoostS
    Nov 11 at 19:05











  • It is not about performance. I don't want my code to be included to words count, it doesn't make sense. For instance, this article of mine sashashpota.com/2018/10/30/… contains around 800 words, but number_of_words shows 1400 words as it counts code blocks as well.
    – Oleksandr Shpota
    Nov 11 at 19:20











  • No, it is not about performance. It is about the speed at which humans read text and code. I do not think that you can read code faster than normal words/text. Code blocks are no images and should not be considered as such (IMO).
    – JoostS
    Nov 11 at 19:30







  • 1




    Thank you for suggesting replace and strip_html. I solved my problem using your suggestion github.com/Shpota/shpota.github.io/commit/… It is not ideal but it works.
    – Oleksandr Shpota
    Nov 15 at 10:02
















  • Thank you. number_of_words was the first thing I tried. Unfortunately it doesn't satisfy my needs. My articles often contain code blocks but number_of_words doesn't provide any mechanism to filter page content. Excluding code, pre, script etc might help but it is currently not possible. That's why for some articles it shows 2-3times more words than needed. Do you know how to fix this?
    – Oleksandr Shpota
    Nov 11 at 18:12










  • You could try to split your content on code blocks. Are you sure that you can read code faster than normal words? I would say the opposite is true.
    – JoostS
    Nov 11 at 19:05











  • It is not about performance. I don't want my code to be included to words count, it doesn't make sense. For instance, this article of mine sashashpota.com/2018/10/30/… contains around 800 words, but number_of_words shows 1400 words as it counts code blocks as well.
    – Oleksandr Shpota
    Nov 11 at 19:20











  • No, it is not about performance. It is about the speed at which humans read text and code. I do not think that you can read code faster than normal words/text. Code blocks are no images and should not be considered as such (IMO).
    – JoostS
    Nov 11 at 19:30







  • 1




    Thank you for suggesting replace and strip_html. I solved my problem using your suggestion github.com/Shpota/shpota.github.io/commit/… It is not ideal but it works.
    – Oleksandr Shpota
    Nov 15 at 10:02















Thank you. number_of_words was the first thing I tried. Unfortunately it doesn't satisfy my needs. My articles often contain code blocks but number_of_words doesn't provide any mechanism to filter page content. Excluding code, pre, script etc might help but it is currently not possible. That's why for some articles it shows 2-3times more words than needed. Do you know how to fix this?
– Oleksandr Shpota
Nov 11 at 18:12




Thank you. number_of_words was the first thing I tried. Unfortunately it doesn't satisfy my needs. My articles often contain code blocks but number_of_words doesn't provide any mechanism to filter page content. Excluding code, pre, script etc might help but it is currently not possible. That's why for some articles it shows 2-3times more words than needed. Do you know how to fix this?
– Oleksandr Shpota
Nov 11 at 18:12












You could try to split your content on code blocks. Are you sure that you can read code faster than normal words? I would say the opposite is true.
– JoostS
Nov 11 at 19:05





You could try to split your content on code blocks. Are you sure that you can read code faster than normal words? I would say the opposite is true.
– JoostS
Nov 11 at 19:05













It is not about performance. I don't want my code to be included to words count, it doesn't make sense. For instance, this article of mine sashashpota.com/2018/10/30/… contains around 800 words, but number_of_words shows 1400 words as it counts code blocks as well.
– Oleksandr Shpota
Nov 11 at 19:20





It is not about performance. I don't want my code to be included to words count, it doesn't make sense. For instance, this article of mine sashashpota.com/2018/10/30/… contains around 800 words, but number_of_words shows 1400 words as it counts code blocks as well.
– Oleksandr Shpota
Nov 11 at 19:20













No, it is not about performance. It is about the speed at which humans read text and code. I do not think that you can read code faster than normal words/text. Code blocks are no images and should not be considered as such (IMO).
– JoostS
Nov 11 at 19:30





No, it is not about performance. It is about the speed at which humans read text and code. I do not think that you can read code faster than normal words/text. Code blocks are no images and should not be considered as such (IMO).
– JoostS
Nov 11 at 19:30





1




1




Thank you for suggesting replace and strip_html. I solved my problem using your suggestion github.com/Shpota/shpota.github.io/commit/… It is not ideal but it works.
– Oleksandr Shpota
Nov 15 at 10:02




Thank you for suggesting replace and strip_html. I solved my problem using your suggestion github.com/Shpota/shpota.github.io/commit/… It is not ideal but it works.
– Oleksandr Shpota
Nov 15 at 10:02












up vote
0
down vote













You need an alternative to those plugins.



As detailed in "Building a Series List with Hugo Shortcodes":



Ruby plugin execution is disabled altogether on Github pages:




Plugins on GitHub Pages GitHub Pages is powered by Jekyll.
However, all Pages sites are generated using the -safe option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages.



You can still use GitHub Pages to publish your site, but you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.




I understand you mention:




Obviously I can generate html files locally and commit them to my repository. But that's not what I want.




Still, a static website generator (compatible with GitHub pages) like Hugo is to be considered in your case.



R.J Lorimer adds:




Hugo has the concept of Shortcodes, which are much like “Liquid Tags” in Jekyll.

Also like Jekyll, you can create custom shortcode tags.



However, the major difference is that in Hugo you can create them without resorting to actually writing Go code - see Create Your Own Shortcodes.

Because Hugo uses Go Templates for rendering the pages, shortcodes can use any and all Go template functions inside of them, as well as a whole list of custom Hugo functions added to help. This makes it arguably more powerful than a liquid-template solution, but still in a template file that can be easily updated on the fly.




Plus, Hugo does support MathJax, as seen in this article.



Update Nov. 2018: with Hugo 0.52, this tweet confirms (referencing this thread):




The inline shortcode is similar to the way Jekyll allows you to use Liquid tags within Markdown







share|improve this answer






















  • Thank you for proposing an alternative solution. But I'm afraid switching from Jekyll to Hugo is even bigger pain. Alternatively I could host my blog on GitLab where custom plugins are supported.
    – Oleksandr Shpota
    Nov 11 at 8:08














up vote
0
down vote













You need an alternative to those plugins.



As detailed in "Building a Series List with Hugo Shortcodes":



Ruby plugin execution is disabled altogether on Github pages:




Plugins on GitHub Pages GitHub Pages is powered by Jekyll.
However, all Pages sites are generated using the -safe option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages.



You can still use GitHub Pages to publish your site, but you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.




I understand you mention:




Obviously I can generate html files locally and commit them to my repository. But that's not what I want.




Still, a static website generator (compatible with GitHub pages) like Hugo is to be considered in your case.



R.J Lorimer adds:




Hugo has the concept of Shortcodes, which are much like “Liquid Tags” in Jekyll.

Also like Jekyll, you can create custom shortcode tags.



However, the major difference is that in Hugo you can create them without resorting to actually writing Go code - see Create Your Own Shortcodes.

Because Hugo uses Go Templates for rendering the pages, shortcodes can use any and all Go template functions inside of them, as well as a whole list of custom Hugo functions added to help. This makes it arguably more powerful than a liquid-template solution, but still in a template file that can be easily updated on the fly.




Plus, Hugo does support MathJax, as seen in this article.



Update Nov. 2018: with Hugo 0.52, this tweet confirms (referencing this thread):




The inline shortcode is similar to the way Jekyll allows you to use Liquid tags within Markdown







share|improve this answer






















  • Thank you for proposing an alternative solution. But I'm afraid switching from Jekyll to Hugo is even bigger pain. Alternatively I could host my blog on GitLab where custom plugins are supported.
    – Oleksandr Shpota
    Nov 11 at 8:08












up vote
0
down vote










up vote
0
down vote









You need an alternative to those plugins.



As detailed in "Building a Series List with Hugo Shortcodes":



Ruby plugin execution is disabled altogether on Github pages:




Plugins on GitHub Pages GitHub Pages is powered by Jekyll.
However, all Pages sites are generated using the -safe option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages.



You can still use GitHub Pages to publish your site, but you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.




I understand you mention:




Obviously I can generate html files locally and commit them to my repository. But that's not what I want.




Still, a static website generator (compatible with GitHub pages) like Hugo is to be considered in your case.



R.J Lorimer adds:




Hugo has the concept of Shortcodes, which are much like “Liquid Tags” in Jekyll.

Also like Jekyll, you can create custom shortcode tags.



However, the major difference is that in Hugo you can create them without resorting to actually writing Go code - see Create Your Own Shortcodes.

Because Hugo uses Go Templates for rendering the pages, shortcodes can use any and all Go template functions inside of them, as well as a whole list of custom Hugo functions added to help. This makes it arguably more powerful than a liquid-template solution, but still in a template file that can be easily updated on the fly.




Plus, Hugo does support MathJax, as seen in this article.



Update Nov. 2018: with Hugo 0.52, this tweet confirms (referencing this thread):




The inline shortcode is similar to the way Jekyll allows you to use Liquid tags within Markdown







share|improve this answer














You need an alternative to those plugins.



As detailed in "Building a Series List with Hugo Shortcodes":



Ruby plugin execution is disabled altogether on Github pages:




Plugins on GitHub Pages GitHub Pages is powered by Jekyll.
However, all Pages sites are generated using the -safe option to disable custom plugins for security reasons. Unfortunately, this means your plugins won’t work if you’re deploying to GitHub Pages.



You can still use GitHub Pages to publish your site, but you’ll need to convert the site locally and push the generated static files to your GitHub repository instead of the Jekyll source files.




I understand you mention:




Obviously I can generate html files locally and commit them to my repository. But that's not what I want.




Still, a static website generator (compatible with GitHub pages) like Hugo is to be considered in your case.



R.J Lorimer adds:




Hugo has the concept of Shortcodes, which are much like “Liquid Tags” in Jekyll.

Also like Jekyll, you can create custom shortcode tags.



However, the major difference is that in Hugo you can create them without resorting to actually writing Go code - see Create Your Own Shortcodes.

Because Hugo uses Go Templates for rendering the pages, shortcodes can use any and all Go template functions inside of them, as well as a whole list of custom Hugo functions added to help. This makes it arguably more powerful than a liquid-template solution, but still in a template file that can be easily updated on the fly.




Plus, Hugo does support MathJax, as seen in this article.



Update Nov. 2018: with Hugo 0.52, this tweet confirms (referencing this thread):




The inline shortcode is similar to the way Jekyll allows you to use Liquid tags within Markdown








share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 29 at 9:45

























answered Nov 11 at 0:30









VonC

825k28425943129




825k28425943129











  • Thank you for proposing an alternative solution. But I'm afraid switching from Jekyll to Hugo is even bigger pain. Alternatively I could host my blog on GitLab where custom plugins are supported.
    – Oleksandr Shpota
    Nov 11 at 8:08
















  • Thank you for proposing an alternative solution. But I'm afraid switching from Jekyll to Hugo is even bigger pain. Alternatively I could host my blog on GitLab where custom plugins are supported.
    – Oleksandr Shpota
    Nov 11 at 8:08















Thank you for proposing an alternative solution. But I'm afraid switching from Jekyll to Hugo is even bigger pain. Alternatively I could host my blog on GitLab where custom plugins are supported.
– Oleksandr Shpota
Nov 11 at 8:08




Thank you for proposing an alternative solution. But I'm afraid switching from Jekyll to Hugo is even bigger pain. Alternatively I could host my blog on GitLab where custom plugins are supported.
– Oleksandr Shpota
Nov 11 at 8:08

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53215356%2fjekyll-how-to-use-custom-plugins-with-github-pages%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

Museum of Modern and Contemporary Art of Trento and Rovereto