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,30511329




3,30511329








  • 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 %}
{{ content | number_of_words | minus: 180 }}
{% endcapture %}
{% unless words contains '-' %}
{{ words | plus: 180 | divided_by: 180 | append: ' minutes to read' }}
{% 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 preprocessed_content=preprocessed_content | replace: '</p>', '__/p__' %}
{% assign truncated_content=preprocessed_content | strip_html %}
{% assign cleaned_content=truncated_content | replace: '__p__', '<p>' %}
{% assign cleaned_content=cleaned_content | replace: '__/p__', '</p>' %}


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.






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 %}
{{ content | number_of_words | minus: 180 }}
{% endcapture %}
{% unless words contains '-' %}
{{ words | plus: 180 | divided_by: 180 | append: ' minutes to read' }}
{% 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 preprocessed_content=preprocessed_content | replace: '</p>', '__/p__' %}
{% assign truncated_content=preprocessed_content | strip_html %}
{% assign cleaned_content=truncated_content | replace: '__p__', '<p>' %}
{% assign cleaned_content=cleaned_content | replace: '__/p__', '</p>' %}


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 %}
{{ content | number_of_words | minus: 180 }}
{% endcapture %}
{% unless words contains '-' %}
{{ words | plus: 180 | divided_by: 180 | append: ' minutes to read' }}
{% 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 preprocessed_content=preprocessed_content | replace: '</p>', '__/p__' %}
{% assign truncated_content=preprocessed_content | strip_html %}
{% assign cleaned_content=truncated_content | replace: '__p__', '<p>' %}
{% assign cleaned_content=cleaned_content | replace: '__/p__', '</p>' %}


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 %}
{{ content | number_of_words | minus: 180 }}
{% endcapture %}
{% unless words contains '-' %}
{{ words | plus: 180 | divided_by: 180 | append: ' minutes to read' }}
{% 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 preprocessed_content=preprocessed_content | replace: '</p>', '__/p__' %}
{% assign truncated_content=preprocessed_content | strip_html %}
{% assign cleaned_content=truncated_content | replace: '__p__', '<p>' %}
{% assign cleaned_content=cleaned_content | replace: '__/p__', '</p>' %}


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 %}
{{ content | number_of_words | minus: 180 }}
{% endcapture %}
{% unless words contains '-' %}
{{ words | plus: 180 | divided_by: 180 | append: ' minutes to read' }}
{% 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 preprocessed_content=preprocessed_content | replace: '</p>', '__/p__' %}
{% assign truncated_content=preprocessed_content | strip_html %}
{% assign cleaned_content=truncated_content | replace: '__p__', '<p>' %}
{% assign cleaned_content=cleaned_content | replace: '__/p__', '</p>' %}


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,89721536




5,89721536












  • 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.






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.






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.






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.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 11 at 0:30









VonC

821k28425793094




821k28425793094












  • 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



















































 


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







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues