mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 14:17:43 +00:00
Remove comments from quickstart code samples
- the code samples are prefixed with text that explains what the code samples do, so there is no need for bash-comments in the sample code - I also moved the comment about getting GIT out of a code sample and into it's own little section after the first time use of `git` - lots of double newlines removed.
This commit is contained in:
1 parent
348821b5da
commit
59830ea44a
1 file changed
+7
-25
@@ -26,8 +26,6 @@ It is recommended to have [Git installed](https://git-scm.com/downloads) to run
|
|||||||
For other approaches learning Hugo like book or a video tutorial refer to the [external learning resources](/getting-started/external-learning-resources/) page.
|
For other approaches learning Hugo like book or a video tutorial refer to the [external learning resources](/getting-started/external-learning-resources/) page.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Step 1: Install Hugo
|
## Step 1: Install Hugo
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
@@ -44,10 +42,8 @@ To verify your new install:
|
|||||||
hugo version
|
hugo version
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
{{< asciicast ItACREbFgvJ0HjnSNeTknxWy9 >}}
|
{{< asciicast ItACREbFgvJ0HjnSNeTknxWy9 >}}
|
||||||
|
|
||||||
|
|
||||||
## Step 2: Create a New Site
|
## Step 2: Create a New Site
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -58,7 +54,6 @@ The above will create a new Hugo site in a folder named `quickstart`.
|
|||||||
|
|
||||||
{{< asciicast 3mf1JGaN0AX0Z7j5kLGl3hSh8 >}}
|
{{< asciicast 3mf1JGaN0AX0Z7j5kLGl3hSh8 >}}
|
||||||
|
|
||||||
|
|
||||||
## Step 3: Add a Theme
|
## Step 3: Add a Theme
|
||||||
|
|
||||||
See [themes.gohugo.io](https://themes.gohugo.io/) for a list of themes to consider. This quickstart uses the beautiful [Ananke theme](https://themes.gohugo.io/gohugo-theme-ananke/).
|
See [themes.gohugo.io](https://themes.gohugo.io/) for a list of themes to consider. This quickstart uses the beautiful [Ananke theme](https://themes.gohugo.io/gohugo-theme-ananke/).
|
||||||
@@ -67,31 +62,25 @@ First, download the theme from Github and add it to your site's `theme` director
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd quickstart
|
cd quickstart
|
||||||
|
|
||||||
# Download the theme
|
|
||||||
git init
|
git init
|
||||||
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
|
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
|
||||||
# Note for non-git users:
|
|
||||||
# - If you do not have git installed, you can download the archive of the latest
|
|
||||||
# version of this theme from:
|
|
||||||
# https://github.com/budparr/gohugo-theme-ananke/archive/master.zip
|
|
||||||
# - Extract that .zip file to get a "gohugo-theme-ananke-master" directory.
|
|
||||||
# - Rename that directory to "ananke", and move it into the "themes/" directory.
|
|
||||||
# End of note for non-git users.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
*Note for non-git users:*
|
||||||
|
- If you do not have git installed, you can download the archive of the latest
|
||||||
|
version of this theme from:
|
||||||
|
https://github.com/budparr/gohugo-theme-ananke/archive/master.zip
|
||||||
|
- Extract that .zip file to get a "gohugo-theme-ananke-master" directory.
|
||||||
|
- Rename that directory to "ananke", and move it into the "themes/" directory.
|
||||||
|
|
||||||
Then, add the theme to the site configuration:
|
Then, add the theme to the site configuration:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Edit your config.toml configuration file
|
|
||||||
# and add the Ananke theme.
|
|
||||||
echo 'theme = "ananke"' >> config.toml
|
echo 'theme = "ananke"' >> config.toml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
{{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}}
|
{{< asciicast 7naKerRYUGVPj8kiDmdh5k5h9 >}}
|
||||||
|
|
||||||
|
|
||||||
## Step 4: Add Some Content
|
## Step 4: Add Some Content
|
||||||
|
|
||||||
You can manually create content files (for example as `content/<CATEGORY>/<FILE>.<FORMAT>`) and provide metadata in them, however you can use the `new` command to do few things for you (like add title and date):
|
You can manually create content files (for example as `content/<CATEGORY>/<FILE>.<FORMAT>`) and provide metadata in them, however you can use the `new` command to do few things for you (like add title and date):
|
||||||
@@ -113,15 +102,12 @@ draft: true
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Step 5: Start the Hugo server
|
## Step 5: Start the Hugo server
|
||||||
|
|
||||||
Now, start the Hugo server with [drafts](/getting-started/usage/#draft-future-and-expired-content) enabled:
|
Now, start the Hugo server with [drafts](/getting-started/usage/#draft-future-and-expired-content) enabled:
|
||||||
|
|
||||||
{{< asciicast BvJBsF6egk9c163bMsObhuNXj >}}
|
{{< asciicast BvJBsF6egk9c163bMsObhuNXj >}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
▶ hugo server -D
|
▶ hugo server -D
|
||||||
|
|
||||||
@@ -146,12 +132,10 @@ Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
|
|||||||
Press Ctrl+C to stop
|
Press Ctrl+C to stop
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
**Navigate to your new site at [http://localhost:1313/](http://localhost:1313/).**
|
**Navigate to your new site at [http://localhost:1313/](http://localhost:1313/).**
|
||||||
|
|
||||||
Feel free to edit or add new content and simply refresh in browser to see changes quickly (You might need to force refresh in webbrowser, something like Ctrl-R usually works).
|
Feel free to edit or add new content and simply refresh in browser to see changes quickly (You might need to force refresh in webbrowser, something like Ctrl-R usually works).
|
||||||
|
|
||||||
|
|
||||||
## Step 6: Customize the Theme
|
## Step 6: Customize the Theme
|
||||||
|
|
||||||
Your new site already looks great, but you will want to tweak it a little before you release it to the public.
|
Your new site already looks great, but you will want to tweak it a little before you release it to the public.
|
||||||
@@ -173,12 +157,10 @@ Replace the `title` above with something more personal. Also, if you already hav
|
|||||||
**Tip:** Make the changes to the site configuration or any other file in your site while the Hugo server is running, and you will see the changes in the browser right away, though you may need to [clear your cache](https://kb.iu.edu/d/ahic).
|
**Tip:** Make the changes to the site configuration or any other file in your site while the Hugo server is running, and you will see the changes in the browser right away, though you may need to [clear your cache](https://kb.iu.edu/d/ahic).
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
For theme specific configuration options, see the [theme site](https://github.com/budparr/gohugo-theme-ananke).
|
For theme specific configuration options, see the [theme site](https://github.com/budparr/gohugo-theme-ananke).
|
||||||
|
|
||||||
**For further theme customization, see [Customize a Theme](/themes/customizing/).**
|
**For further theme customization, see [Customize a Theme](/themes/customizing/).**
|
||||||
|
|
||||||
|
|
||||||
### Step 7: Build static pages
|
### Step 7: Build static pages
|
||||||
|
|
||||||
It is simple. Just call:
|
It is simple. Just call:
|
||||||
|
|||||||
Reference in new issue
Block a user