tlienart / FranklinTemplates.jl

Simple website templates for Franklin.jl

Home Page:https://tlienart.github.io/FranklinTemplates.jl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changing title on Vela theme doesn't change tab information

YanniPapandreou opened this issue · comments

Hi,

I have been experimenting with the Vela theme for Franklin and I notice that if I change the @def title = "My Title" at the top of the index.md file this does not change the browser tab information which still prints out "Franklin Example | Vela". Changing the title on the sandbox template does cause the browser tab to change. How can I do this in Vela?

Hello @YanniPapandreou ,

In the _layout folder you'll see the <title> part (see here:

<title>Franklin Example | Vela</title>
but it's reproduced in your folder at _layout/head.html)

You'll see here that it's fixed to "Franklin Example | Vela"; if you want it to be controlled by each page, you could replace this by

<title>{{title}}</title>

what this will do is that it will check the page variable title for each page; note that this requires the title page variable to be defined on all pages.

If you want to use a "default" title that gets used whenever title is not specified on a page, you can assign title = "The Default Title" in your config.md.


PS: @def ... is being deprecated in favour of +++ ... +++ blocks so prefer for instance

+++
title = "Hello"
some_other_var = 25
+++

to

@def title = "Hello"
@def some_other_var = 25

the effect is the same (and you can have multiple +++ blocks on a page if that's useful to you.

Hello @tlienart thanks a lot for getting back to me so quickly! This fixed the issue for me :)

Cool, good luck and hi to Andrew ;-)

Thanks, I will do!