Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda