JavaScript Express Basics Parameters, Query Strings, and Modularizing Routes Linking Around the Application

why is PUG so flexible?

a(href=?side=${otherSide}) #{sideToShowDisplay} and

a(href=`/card/${id}/?side=${otherSide}`) #{sideToShowDisplay}

show the exact same href!! why?

1 Answer

Tom Geraghty
Tom Geraghty
24,147 Points

From the docs:

If the path is absolute (e.g., include /root.pug), it is resolved by prepending options.basedir. Otherwise, paths are resolved relative to the current file being compiled.