Logo

How to add custom titles (or meta tags) for each page

As you can see, using ./share/l.upphtml to generate all our pages, means we have only one title tag for each page, hence all of our generated pages will have the same title. If we would prefer specific titles for each page, we would have to edit ./share/l.upphtml like in the following example:

<head>
#!
case "$1" in
./index.upphtml)
#!
<title>My Website</title>
<meta name=description content='Latest news about my website'>
#!
;;
./docs.upphtml)
#!
<title>Documentation</title>
<meta name=description content='Documentation for my website'>
#!
;;
./src.upphtml)
#!
<title>Sources</title>
<meta name=description content='Sources for my website'>
#!
;;
./contact.upphtml)
#!
<title>Contact</title>
<meta name=description content='Contact for my website'>
#!
;;
esac
#!
</head>

Edit to match your website.

Then, regenerate your site using the mkws command:

./bin/mkws https://example.com