Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
Make sub-string of string bold which is populated from jekyll variable

On my page I would like part of a string to be bold, however the string value is created from a Jekyll variable. Effectively, I want to pre-process the string with some function where the jekyll variable is the input.

In my main html file I have:

{% for post in site.posts %}
  {% include archive.html %}
{% endfor %}

Inside archive.html I have:

<p> {{ post.var }} </p>

I'm assuming javascript is the way to go about this using a function along the lines of:

function makeSubStrBold(str) {
  var substr = "something"
  var strRegExp = new RegExp(substr, 'g');
  return str.replace(strRegExp, '<b>'+substr+'</b>');
}

So if post.var = "this is something", what gets actually displayed in html is "this is <b> something </b>"

How could I use this javascript function to pre-process the string from the jekyll variable? Is this maybe possible in css?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!