Add a page

Let's add a page to our website.

As an example, let's add a profile page "profile.html".

To add a page, just place the file in the "templates" directory.

templates templates

Create "profile.html" in this directory.

Open it in a text editor and edit it.

Let's write a brief profile.

<h2> Perl Zemi Profile </h2>

I'm creating a website in Perl.

Thank you.

Write the title inside the "h2" tag. Write the text paragraph by paragraph as above.

As a caveat, do not put a half-width space at the beginning.

This is because if you insert a half-width space at the beginning, the automatic line feed function will be disabled.

If the characters are garbled, make sure that the character code for saving the file is UTF-8.

morbo serve.pl

You can access the page at the following URL:

http://127.0.0.1:3000/profile.html

To link to this page, write the following on another page:

<a href="/profile.html"> Perl Zemi Profile</a>

You can also create pages in the "templates" directory by creating subdirectories.

templates / menu / service.html

Please note that do not place files in the initially created "blog", "common" and "static" directories.

This directory is reserved as a special directory.