github.com/anakojm/hugo-katex@v0.0.0-20231023141351-42d6f5de9c0b/testscripts/commands/server.txt (about)

     1  # Test the hugo server command.
     2  
     3  # We run these tests in parallel so let Hugo decide which port to use.
     4  hugo server --gc &
     5  
     6  waitServer
     7  
     8  httpget $HUGOTEST_BASEURL_0 'Title: Hugo Server Test' $HUGOTEST_BASEURL_0 'ServerPort: \d{4,5}' 'myenv: thedevelopment' 'livereload\.js' 'Env: development' 'IsServer: true'
     9  httpget ${HUGOTEST_BASEURL_0}doesnotexist 'custom 404'
    10  
    11  # By defauilt, the server renders to memory.
    12  ! exists public/index.html
    13  
    14  stopServer
    15  ! stderr .
    16  
    17  -- hugo.toml --
    18  title = "Hugo Server Test"
    19  baseURL = "https://example.org/"
    20  disableKinds = ["taxonomy", "term", "sitemap"]
    21  -- config/production/params.toml --
    22  myenv = "theproduction"
    23  -- config/development/params.toml --
    24  myenv = "thedevelopment"
    25  -- layouts/index.html --
    26  <body>
    27  Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|ServerPort: {{ site.ServerPort }}|myenv: {{ .Site.Params.myenv }}|Env: {{ hugo.Environment }}|IsServer: {{ site.IsServer }}|
    28  </body>
    29  -- layouts/404.html --
    30  custom 404