You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.5 KiB

  1. +++
  2. title = "Getting Started with Hugo"
  3. description = ""
  4. tags = [
  5. "go",
  6. "golang",
  7. "hugo",
  8. "development",
  9. ]
  10. date = "2014-04-02"
  11. categories = [
  12. "Development",
  13. "golang",
  14. ]
  15. menu = "main"
  16. +++
  17. ## Step 1. Install Hugo
  18. Goto [hugo releases](https://github.com/spf13/hugo/releases) and download the
  19. appropriate version for your os and architecture.
  20. Save it somewhere specific as we will be using it in the next step.
  21. More complete instructions are available at [installing hugo](/overview/installing/)
  22. ## Step 2. Build the Docs
  23. Hugo has its own example site which happens to also be the documentation site
  24. you are reading right now.
  25. Follow the following steps:
  26. 1. Clone the [hugo repository](http://github.com/spf13/hugo)
  27. 2. Go into the repo
  28. 3. Run hugo in server mode and build the docs
  29. 4. Open your browser to http://localhost:1313
  30. Corresponding pseudo commands:
  31. git clone https://github.com/spf13/hugo
  32. cd hugo
  33. /path/to/where/you/installed/hugo server --source=./docs
  34. > 29 pages created
  35. > 0 tags index created
  36. > in 27 ms
  37. > Web Server is available at http://localhost:1313
  38. > Press ctrl+c to stop
  39. Once you've gotten here, follow along the rest of this page on your local build.
  40. ## Step 3. Change the docs site
  41. Stop the Hugo process by hitting ctrl+c.
  42. Now we are going to run hugo again, but this time with hugo in watch mode.
  43. /path/to/hugo/from/step/1/hugo server --source=./docs --watch
  44. > 29 pages created
  45. > 0 tags index created
  46. > in 27 ms
  47. > Web Server is available at http://localhost:1313
  48. > Watching for changes in /Users/spf13/Code/hugo/docs/content
  49. > Press ctrl+c to stop
  50. Open your [favorite editor](http://vim.spf13.com) and change one of the source
  51. content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*.
  52. Content files are found in `docs/content/`. Unless otherwise specified, files
  53. are located at the same relative location as the url, in our case
  54. `docs/content/overview/quickstart.md`.
  55. Change and save this file.. Notice what happened in your terminal.
  56. > Change detected, rebuilding site
  57. > 29 pages created
  58. > 0 tags index created
  59. > in 26 ms
  60. Refresh the browser and observe that the typo is now fixed.
  61. Notice how quick that was. Try to refresh the site before it's finished building.. I double dare you.
  62. Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.
  63. ## Step 4. Have fun
  64. The best way to learn something is to play with it.