mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
@@ -1,7 +1,7 @@
|
||||
# Test the config command.
|
||||
|
||||
hugo config -h
|
||||
stdout 'Display site configuration'
|
||||
stdout 'Display project configuration'
|
||||
|
||||
|
||||
hugo config
|
||||
@@ -18,4 +18,4 @@ stdout '\"source\": \"content\",'
|
||||
# Test files
|
||||
-- hugo.toml --
|
||||
baseURL="https://example.com/"
|
||||
title="My New Hugo Site"
|
||||
title="My New Hugo Project"
|
||||
|
||||
@@ -15,4 +15,4 @@ hugo config
|
||||
|
||||
-- hugo.toml --
|
||||
baseURL="https://example.com/"
|
||||
title="My New Hugo Site"
|
||||
title="My New Hugo Project"
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
# Test the import + import jekyll command.
|
||||
|
||||
hugo import -h
|
||||
stdout 'Import a site from another system'
|
||||
hugo import -h
|
||||
stdout 'Import a project from another system'
|
||||
|
||||
hugo import jekyll -h
|
||||
stdout 'hugo import from Jekyll\.'
|
||||
|
||||
hugo import jekyll myjekyllsite myhugosite
|
||||
checkfilecount 1 myhugosite/content/post
|
||||
grep 'example\.org' myhugosite/hugo.yaml
|
||||
hugo import jekyll my-jekyll-project my-hugo-project
|
||||
checkfilecount 1 my-hugo-project/content/post
|
||||
grep 'example\.org' my-hugo-project/hugo.yaml
|
||||
|
||||
# A simple Jekyll site.
|
||||
-- myjekyllsite/_posts/2012-01-18-hello-world.markdown --
|
||||
# A simple Jekyll project.
|
||||
-- my-jekyll-project/_posts/2012-01-18-hello-world.markdown --
|
||||
---
|
||||
layout: post
|
||||
title: "Hello World"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# Test the new command.
|
||||
|
||||
hugo new site -h
|
||||
stdout 'Create a new site at the specified path.'
|
||||
hugo new site my-yaml-site --format yml
|
||||
checkfile my-yaml-site/hugo.yml
|
||||
hugo new site mysite -f
|
||||
stdout 'Congratulations! Your new Hugo site was created in'
|
||||
cd mysite
|
||||
hugo new project -h
|
||||
stdout 'Create a new project at the specified path.'
|
||||
hugo new project my-yaml-project --format yml
|
||||
checkfile my-yaml-project/hugo.yml
|
||||
hugo new project my-project -f
|
||||
stdout 'Congratulations! Your new Hugo project was created in'
|
||||
cd my-project
|
||||
checkfile archetypes/default.md
|
||||
checkfile hugo.toml
|
||||
exists assets
|
||||
@@ -20,11 +20,11 @@ exists themes
|
||||
|
||||
hugo new theme -h
|
||||
stdout 'Create a new theme with the specified name in the ./themes directory.'
|
||||
hugo new theme mytheme --format yml
|
||||
hugo new theme my-theme --format yml
|
||||
stdout 'Creating new theme'
|
||||
! exists resources
|
||||
cd themes
|
||||
cd mytheme
|
||||
cd my-theme
|
||||
checkfile archetypes/default.md
|
||||
checkfile assets/css/main.css
|
||||
checkfile assets/js/main.js
|
||||
@@ -52,7 +52,7 @@ checkfile hugo.yml
|
||||
exists data
|
||||
exists i18n
|
||||
|
||||
cd $WORK/mysite
|
||||
cd $WORK/my-project
|
||||
|
||||
hugo new -h
|
||||
stdout 'Create a new content file.'
|
||||
@@ -60,8 +60,8 @@ hugo new posts/my-first-post.md
|
||||
checkfile content/posts/my-first-post.md
|
||||
|
||||
cd ..
|
||||
cd myexistingsite
|
||||
hugo new post/foo.md -t mytheme
|
||||
cd my-existing-project
|
||||
hugo new post/foo.md -t my-theme
|
||||
grep 'Dummy content' content/post/foo.md
|
||||
|
||||
cd $WORK
|
||||
@@ -69,23 +69,23 @@ cd $WORK
|
||||
# In the three archetype format tests below, skip Windows testing to avoid
|
||||
# newline differences when comparing to golden.
|
||||
|
||||
hugo new site json-site --format json
|
||||
[!windows] cmp json-site/archetypes/default.md archetype-golden-json.md
|
||||
hugo new project json-project --format json
|
||||
[!windows] cmp json-project/archetypes/default.md archetype-golden-json.md
|
||||
|
||||
hugo new site toml-site --format toml
|
||||
[!windows] cmp toml-site/archetypes/default.md archetype-golden-toml.md
|
||||
hugo new project toml-project --format toml
|
||||
[!windows] cmp toml-project/archetypes/default.md archetype-golden-toml.md
|
||||
|
||||
hugo new site yaml-site --format yaml
|
||||
[!windows] cmp yaml-site/archetypes/default.md archetype-golden-yaml.md
|
||||
hugo new project yaml-project --format yaml
|
||||
[!windows] cmp yaml-project/archetypes/default.md archetype-golden-yaml.md
|
||||
|
||||
-- myexistingsite/hugo.toml --
|
||||
theme = "mytheme"
|
||||
-- myexistingsite/content/p1.md --
|
||||
-- my-existing-project/hugo.toml --
|
||||
theme = "my-theme"
|
||||
-- my-existing-project/content/p1.md --
|
||||
---
|
||||
title: "P1"
|
||||
---
|
||||
-- myexistingsite/themes/mytheme/hugo.toml --
|
||||
-- myexistingsite/themes/mytheme/archetypes/post.md --
|
||||
-- my-existing-project/themes/my-theme/hugo.toml --
|
||||
-- my-existing-project/themes/my-theme/archetypes/post.md --
|
||||
---
|
||||
title: "{{ replace .Name "-" " " | title }}"
|
||||
date: {{ .Date }}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
hugo new site myblog
|
||||
cd myblog
|
||||
hugo new project my-project
|
||||
cd my-project
|
||||
hugo new content --kind post post/first-post.md
|
||||
! exists resources
|
||||
grep 'draft = true' content/post/first-post.md
|
||||
@@ -7,7 +7,7 @@ grep 'draft = true' content/post/first-post.md
|
||||
# Issue 12599
|
||||
cd $WORK
|
||||
|
||||
hugo new site --format toml --force issue-12599
|
||||
hugo new project --format toml --force issue-12599
|
||||
cp hugo.toml issue-12599/hugo.toml
|
||||
cd issue-12599
|
||||
hugo new content content/s1/2099-12-31-p1.md
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Test the hugo version command.
|
||||
|
||||
hugo -h
|
||||
stdout 'hugo is the main command, used to build your Hugo site'
|
||||
stdout 'hugo is the main command, used to build your Hugo project'
|
||||
|
||||
hugo version
|
||||
stdout 'hugo v.* BuildDate=unknown'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Test the deploy command.
|
||||
|
||||
hugo deploy -h
|
||||
stdout 'Deploy your site to a cloud provider'
|
||||
stdout 'Deploy your project to a cloud provider'
|
||||
mkdir mybucket
|
||||
hugo deploy --target mydeployment --invalidateCDN=false
|
||||
grep 'hello' mybucket/index.html
|
||||
|
||||
Reference in New Issue
Block a user