Web page template jinja variable

Hi there,
I have an issue and I don’t know how to pass over.
I’m building a web template and I want pass a jinja variable through it, like:

{% set path = frappe.db.get_value(‘Web Page’, ‘{{title}}’, ‘route’) %}

and build a link < href=“{{path}}”>link</a
{{title}} is a Link field set in web templates, with Web Page as Option, and it’s returning the page title as “page-title”, for “Page title” web page.

…but when used in set path, it’s not returning anything.

How can I use the jinja variable, for doctitle in frappe.db.get_value pls?
Is there a way to do it and get the route for that page, using doctitle as variable?

Thank you all