-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support
pipe
in Serbea 2.0, add new pure Ruby template syntax (WIP) (…
…#817) * Support `pipe` in Serbea 2.0, add new pure Ruby template syntax * Refactor HTMLinRuby template syntax * Ensure `pipe` is available to components * Support MARKDOWN in cop * Arrive at final syntax * fix test on Ruby 3.2 * Skip Ruby template test on v2.7.2 * Update how the text string helpers works * Pull in new Streamlined dependency * Streamlined tweaks; components now automatically support syntax * Support Ruby 3.3 for Nokolexbor * Streamline (heh) Streamlined integration * Syntax improvements based on updated Streamlined * Add slick "Ruby front matter" DSL to Roda routes - also update cookies config * Fix test with cookies * back out of secure default
- Loading branch information
1 parent
6e0751a
commit 54e56ef
Showing
24 changed files
with
221 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 56 additions & 3 deletions
59
bridgetown-core/lib/bridgetown-core/converters/ruby_templates.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
bridgetown-core/test/resources/src/_components/ruby_html_text.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class RubyHtmlText < Bridgetown::Component | ||
def template | ||
# blub = ->(input, str, replace_str) { input.sub(str, replace_str) } | ||
|
||
macro :flub do |input, str, replace_str| | ||
input.sub str, replace_str | ||
end | ||
|
||
html -> { | ||
<<~HTML | ||
<p>This is #{text -> { "<b>escaped!</b>" }}</p> | ||
#{html "piping <i>bad</i>", -> { text | concat(" <b>good</b>") | markdownify }} | ||
#{text "_yipee_", -> { markdownify | flub("yipee", "yay") | html_safe }} | ||
HTML | ||
} | ||
end | ||
end |
Oops, something went wrong.