Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8446617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:58:44+00:00 2026-06-10T09:58:44+00:00

Here’s a more complex one for me: I have content like this being pulled

  • 0

Here’s a more complex one for me:

I have content like this being pulled into a jekyll post:

# Lorem ipsum dolor sit amet.
Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.
~
# Et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation.
~
# Ullamco laboris nisi.
Ut aliquip ex ea commodo consequat.
~

I’m pulling this into my layout like this: {{ post.content | jekreged: 1 | markdownify }}

Jekreged is a custom liquid plugin I wrote that splits the content based on the ~ and then specifies which piece to include. The layout requires ripping apart a post like that.

I am trying to adapt this to then run a subset of match commands that I can call specifically from the liquid tag.

here’s the example (and the one not working) that I am trying to troubleshoot.

module Jekyll
  module AssetFilter
    def jekreged(input, chunk)
      drugs = input.split("~")[chunk]
      title = (drugs).match(/^#{1}.+$/)
      jekreged = "#{title}"
    end
  end
end

Liquid::Template.register_filter(Jekyll::AssetFilter)

I get no output from this. What I would ideally like is to be able to specify “title” as a parameter from the liquid tag but I’m not sure how to connect that through into the plugin.

Long range version I’ll have something like title = regmatch for title, body = …, img = …

Thanks for any and all help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:58:45+00:00Added an answer on June 10, 2026 at 9:58 am

    took a shot at it (in the future, some example inputs/outputs would go a long way).

    module Jekyll
      module AssetFilter
        def jekreged(input, matcher)
          titles = input.split("\n~\n").select { |title| title.include? matcher }
          if titles.size > 1
            raise "Can't determine title from #{matcher.inspect}, found #{titles.inspect}"
          elsif titles.size.zero?
            raise "#{matcher.inspect} didn't match any of #{titles.inspect}"
          end
          titles.first
        end
      end
    end
    
    describe 'jekreged' do
      include Jekyll::AssetFilter
      let(:titles) { <<-TITLES.gsub /^  /, "" }
      # Lorem ipsum dolor sit amet.
      Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore.
      ~
      # Et dolore magna aliqua.
      Ut enim ad minim veniam, quis nostrud exercitation.
      ~
      # Ullamco laboris nisi.
      Ut aliquip ex ea commodo consequat.
      ~
      TITLES
    
      it 'finds the title that has the string in it' do
        jekreged(titles, "Consectetur" ).should == "# Lorem ipsum dolor sit amet.\nConsectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore."
        jekreged(titles, "minim veniam").should == "# Et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation."
        jekreged(titles, "aliquip"     ).should == "# Ullamco laboris nisi.\nUt aliquip ex ea commodo consequat."
      end
    
      it 'raises an error if there is more than one title that matches' do
        expect { jekreged titles, 'Ut' }.to raise_error /Can't determine title/
      end
    
      it 'raises an error if there are no titles that match' do
        expect { jekreged titles, 'asdfasdfasdf' }.to raise_error /didn't match/
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here, I have one drop down with 3 value like 0, 1, 2 and
Here is my problem : I have a post controller with the action create.
Here is the css: #content ul { font-size: 12px; } I am trying this:
Here is my code, i have wasted lot of time on this but still
Here's a problem I ran into recently. I have attributes strings of the form
Here's a coding problem for those that like this kind of thing. Let's see
Here is what I am trying to achieve in PHP: I have this string:
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here is the code in a function I'm trying to revise. This example works
Here is what I am currently doing. PHP echo's out the recent post in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.