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.

hugoisforlovers.md 2.4KB

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