Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jade template: How to create a hyperlink in UL with description to the hyperlink

Tags:

node.js

pug

I'm trying to create a list with hyperlinks. Each list item contains a subject and a simple description to that subject in one line. I want to include a hyperlink for the subject but not the description. What I did is as below.

ul#subjects
    li
        a(href="#") Subject: Here is the description of the subject

The link works fine but it covers the whole line of text. How do I close the hyperlink so that it becomes something like below in HTML? Note that the ':' is not covered by the hyperlink.

<ul id='subjects'>
    <li><a href='#'>Subject</a>: Here is is the description of the subject
</ul>

Thank you. : )

like image 412
Lee Avatar asked Sep 22 '14 07:09

Lee


People also ask

What is Jade format?

Jade is a template engine for node. js and the default rendering engine for the Express web framework. It is a new, simplified language that compiles into HTML and is extremely useful for web developers. Jade is designed primarily for server-side templating in node.

What is Jade in ui?

JADE (Java Agent DEvelopment Framework) is a software Framework fully implemented in the Java language.

What is Jade css?

Jade is an elegant templating engine, primarily used for server-side templating in NodeJS. In plain words, Jade gives you a powerful new way to write markup, with a number of advantages over plain HTML.


1 Answers

use | to display the HTML text in Jade

e.g.

ul#subjects
  li
    a(href="#") Subject
    | : Here is the description of the subject
like image 142
Ravi Avatar answered Sep 28 '22 01:09

Ravi