¿Cómo agrego un logotipo de imagen a la barra de navegación superior en Jekyll?

Just started using Jekyll to generate some basic pages and wanted to add a image logo to the top branding area on the navigation bar. Is there a standard way to do this without messing with the themes in Jekyll?

preguntado el 29 de junio de 12 a las 19:06

You mention themes, are you using Jekyll-Bootstrap? -

Yes I am. Just the default one that comes with jekyllbootstrap. -

1 Respuestas

I don't believe it's possible to do this without at least a little customizing of the theme.

However, since you're using the default, twitter theme for Jekyll-Bootstrap, these changes should be fairly straightforward to make:

Put your logo.png in assets/themes/twitter

En su _includes/themes/twitter/default.html querrás agregar un <li> with your logo under the <ul class="nav"> elemento así:

<li><a class="brand-image" href="{{ HOME_PATH }}"><img class="brand-image" src="{{ASSET_PATH}}/logo.png"/></a></li>

A continuación, defina el brand-image class by editing assets/themes/twitter/css/style.css y agregue lo siguiente:

.navbar .nav > li > a.brand-image {
      padding: 4px 0px 0px 0px;
}
.navbar .nav > li > a > img.brand-image {
    -webkit-border-radius: 0px;
       -moz-border-radius: 0px;
            border-radius: 0px;

}

You'll probably have to play with the padding to get it to work just right for your image.

Respondido 28 Jul 15, 18:07

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.