aboutsummaryrefslogtreecommitdiff
path: root/_plugins/generate-pastebin-plaintext-alternate.rb
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-10-10 19:29:58 -0300
committerEuAndreh <eu@euandre.org>2020-10-10 19:30:12 -0300
commitd37970ccd647b89a790c0944611f3e3be1f05eaf (patch)
tree3e19e8b77ddee7a3c3db057bcc75568e212efecb /_plugins/generate-pastebin-plaintext-alternate.rb
parentFix home page entry listing (diff)
downloadeuandre.org-d37970ccd647b89a790c0944611f3e3be1f05eaf.tar.gz
euandre.org-d37970ccd647b89a790c0944611f3e3be1f05eaf.tar.xz
Use Jekyll to output slides HTML files
Diffstat (limited to '_plugins/generate-pastebin-plaintext-alternate.rb')
-rw-r--r--_plugins/generate-pastebin-plaintext-alternate.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/_plugins/generate-pastebin-plaintext-alternate.rb b/_plugins/generate-pastebin-plaintext-alternate.rb
index d85cacf..110a943 100644
--- a/_plugins/generate-pastebin-plaintext-alternate.rb
+++ b/_plugins/generate-pastebin-plaintext-alternate.rb
@@ -9,12 +9,13 @@ module Jekyll
site.collections.each do |collection|
_collection_name, collection_documents = collection
collection_documents.docs.each do |document|
- n = 1
- Renderer
- .new(site, document) # create a renderer for the document
- .run # generate the HTML string
- .scan(CODE_BLOCK) # match all occurrences of regexp
- .each do |code_block| # iterate on each match
+ if document.type != :slides
+ n = 1
+ Renderer
+ .new(site, document) # create a renderer for the document
+ .run # generate the HTML string
+ .scan(CODE_BLOCK) # match all occurrences of regexp
+ .each do |code_block| # iterate on each match
unhighlighted_code = code_block[0] # regexp only defines 1 match (only 1 parens)
.gsub(/<span class=".*?">(.*?)<\/span>/m, '\1')
content = CGI.unescapeHTML unhighlighted_code
@@ -23,6 +24,7 @@ module Jekyll
plain.content = content
site.pages << plain
n += 1
+ end
end
end
end