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

     1  # Test the new command.
     2  
     3  hugo new site -h
     4  stdout 'Create a new site in the provided directory'
     5  hugo new site my-yaml-site --format yml
     6  checkfile my-yaml-site/hugo.yml
     7  hugo new site mysite -f
     8  stdout 'Congratulations! Your new Hugo site was created in'
     9  cd mysite
    10  checkfile archetypes/default.md
    11  checkfile hugo.toml
    12  exists assets
    13  exists content
    14  exists data
    15  exists i18n
    16  exists layouts
    17  exists static
    18  exists themes
    19  ! exists resources
    20  
    21  hugo new theme -h
    22  stdout 'Create a new theme \(skeleton\) called \[name\] in ./themes'
    23  hugo new theme mytheme
    24  stdout 'Creating new theme'
    25  ! exists resources
    26  cd themes
    27  cd mytheme
    28  checkfile archetypes/default.md
    29  checkfile assets/css/main.css
    30  checkfile assets/js/main.js
    31  checkfile content/_index.md
    32  checkfile content/posts/_index.md
    33  checkfile content/posts/post-1.md
    34  checkfile content/posts/post-2.md
    35  checkfile content/posts/post-3/bryce-canyon.jpg
    36  checkfile content/posts/post-3/index.md
    37  checkfile layouts/_default/baseof.html
    38  checkfile layouts/_default/home.html
    39  checkfile layouts/_default/list.html
    40  checkfile layouts/_default/single.html
    41  checkfile layouts/partials/footer.html
    42  checkfile layouts/partials/head.html
    43  checkfile layouts/partials/head/css.html
    44  checkfile layouts/partials/head/js.html
    45  checkfile layouts/partials/header.html
    46  checkfile layouts/partials/menu.html
    47  checkfile layouts/partials/terms.html
    48  checkfile static/favicon.ico
    49  checkfile LICENSE
    50  checkfile README.md
    51  checkfile hugo.toml
    52  checkfile theme.toml
    53  exists data
    54  exists i18n
    55  
    56  cd $WORK/mysite
    57  
    58  hugo new -h
    59  stdout 'Create a new content file.'
    60  hugo new posts/my-first-post.md
    61  checkfile content/posts/my-first-post.md
    62  
    63  cd ..
    64  cd myexistingsite
    65  hugo new post/foo.md -t mytheme
    66  grep 'Dummy content' content/post/foo.md
    67  
    68  -- myexistingsite/hugo.toml --
    69  theme = "mytheme"
    70  -- myexistingsite/content/p1.md --
    71  ---
    72  title: "P1"
    73  ---
    74  -- myexistingsite/themes/mytheme/hugo.toml --
    75  -- myexistingsite/themes/mytheme/archetypes/post.md --
    76  ---
    77  title: "{{ replace .Name "-" " " | title }}"
    78  date: {{ .Date }}
    79  draft: true
    80  ---
    81  
    82  Dummy content.