Splitting the view into multiple files

In this section, we will split our view into multiple files. We will also add additional content to it, so that when we are finished, we have a complete single-page site. 

To begin, let's think about what part of our view code we can split into a separate file. It's obvious that the ul function is a separate chunk of code, so let's turn it into a module. In your View folder, open a new file and call it Navigation.elm. Next, paste in the following code:

module View.Navigation exposing (navigation)import HTML exposing (HTML, a, li, text, ul)import HTML.Attributes exposing (class, href)navigation : HTML Nevernavigation =    ul [ class "nav justify-content-center" ]        [ li [ class "nav-item" ] [ a [ class "nav-link ...

Get Elm Web Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.