Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

170
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda