diff options
author | EuAndreh <eu@euandre.org> | 2020-10-10 19:29:58 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-10-10 19:30:12 -0300 |
commit | d37970ccd647b89a790c0944611f3e3be1f05eaf (patch) | |
tree | 3e19e8b77ddee7a3c3db057bcc75568e212efecb /_plugins/generate-pastebin-plaintext-alternate.rb | |
parent | Fix home page entry listing (diff) | |
download | euandre.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.rb | 14 |
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 |