A fork of hyde, the static site generation. Some patches will be pushed upstream.
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.
 
 
 

236 lines
5.9 KiB

  1. ======================
  2. Command Line Reference
  3. ======================
  4. The ``hyde`` command line supports the following subcommands:
  5. .. TODO: This is a really good candidate for an autoclass.
  6. +-------------+---------------------------------------------------------+
  7. | ``create`` | Initialize a new site at a given path. |
  8. +-------------+---------------------------------------------------------+
  9. | ``gen`` | Generate the website to a configured deploy folder. |
  10. +-------------+---------------------------------------------------------+
  11. | ``serve`` | Start a local HTTP server that regenerates based on the |
  12. | | requested file. |
  13. +-------------+---------------------------------------------------------+
  14. | ``publish`` | Publish the generated site based on configuration. |
  15. +-------------+---------------------------------------------------------+
  16. create
  17. ======
  18. Create a new Hyde website::
  19. hyde create
  20. hyde [-s </site/path>] [-v] create [-l <layout>] [-f] [-h]
  21. Options:
  22. ``-s SITEPATH``, ``--sitepath SITEPATH``
  23. Specify where the site should be created.
  24. A new site will only be created if ``SITEPATH`` does not exist. To overwrite an
  25. existing directory, use the ``--force`` option.
  26. Defaults to the current directory.
  27. ----
  28. ``-f``, ``--force``
  29. Overwrite files and folders at the given site path.
  30. ``hyde create`` will raise an exception if the target directory is not empty
  31. unless this option is specified.
  32. Defaults to false.
  33. ----
  34. ``-l LAYOUT``, ``--layout LAYOUT``
  35. The name of the layout to use for creating the initial site. Hyde provides
  36. three layouts: ``basic``, ``test``, and ``doc``.
  37. Hyde tries to locate the specified layout in the following folders:
  38. 1. In the ``layouts`` folder under the path specified by the ``HYDE_DATA``
  39. environment variable.
  40. 2. In ``hyde``'s own ``layouts`` folder.
  41. Assuming the ``HYDE_DATA`` environment variable is empty and the folder
  42. ``~/test`` is empty, the following command will create a new Hyde site at
  43. ``~/test`` with the contents of the ``layouts/doc`` folder::
  44. hyde -s ~/test create -l doc
  45. Defaults to ``basic``.
  46. ----
  47. ``-v``, ``--verbose``
  48. Log detailed messages to the console.
  49. Defaults to false. Show only essential messages if this option is omitted.
  50. ----
  51. ``-h``, ``--help``
  52. Display the help text for the ``create`` command.
  53. generate
  54. ========
  55. Generate the given website::
  56. hyde gen
  57. hyde [-s <site/path>] [-v] gen [-r] [-d <deploy/path>] [-c <config/path>] [-h]
  58. Options:
  59. ``-s SITEPATH``, ``--sitepath SITEPATH``
  60. The path to the site to be generated.th to the site to be generated.
  61. Defaults to the current directory.
  62. ----
  63. ``-r``, ``regen``
  64. Regenerate the entire website. By default, ``hyde gen`` performs incremental
  65. generation. While Hyde does a good job at understanding dependencies, its far
  66. from perfect. When there are cases where the incremental generation does not
  67. yield the desired results, you can provide this option to generate the website
  68. from scratch.
  69. Defaults to incremental generation.
  70. ----
  71. ``-d DEPLOY_PATH``, ``--deploy-path DEPLOY_PATH``
  72. Location where the site should be generated. This option overrides any setting
  73. specified in the Hyde `configuration <config>`_. The path is assumed to be
  74. relative to the site path unless a preceding path separator is found.
  75. Defaults to the option specified in the config file or the ``deploy`` folder
  76. under the current site path if no config entry exists.
  77. ----
  78. ``-c CONFIG``, ``--config-path CONFIG``
  79. Specify an alternate configuration file to use for generating the site. This is
  80. useful if you have two different configurations for you production versus
  81. development websites. The path is assumed to be relative to the site path
  82. unless a preceding path separator is found.
  83. The following command will use ``production.yaml`` as the configuration file
  84. and generate the website at ``~/test`` to the ``~/production_site`` directory::
  85. cd ~/test
  86. hyde gen -c production.yaml -d ~/production_site
  87. Defaults to ``site.yaml``.
  88. ----
  89. ``-v``, ``--verbose``
  90. Log detailed messages to the console.
  91. Defaults to false. Show only essential messages if this option is omitted.
  92. ----
  93. ``-h``, ``--help``
  94. Display the help text for the ``gen`` command.
  95. serve
  96. =====
  97. Start the built in web server that also regenerates based on the request if
  98. there are changes::
  99. hyde serve
  100. hyde [-s </site/path>] [-v] gen [-d </deploy/path>] [-c <config/path>] [-h]
  101. Options:
  102. ``-s SITEPATH``, ``--sitepath SITEPATH``
  103. ``-d DEPLOY_PATH``, ``--deploy-path DEPLOY_PATH``
  104. ``-c CONFIG``, ``--config-path CONFIG``
  105. Since the ``serve`` command auto generates if there is a need, it needs the
  106. same parameters as the ``gen`` command. The above parameters serve the same
  107. purpose here as in the ``gen`` command.
  108. ----
  109. ``-a ADDRESS``, ``--address ADDRESS``
  110. The address to serve the website.
  111. Defaults to ``localhost``.
  112. ----
  113. ``-p PORT``, ``--port PORT``
  114. The port to serve the website.
  115. The following command will serve the website at http://localhost:8181::
  116. hyde serve -p 8181
  117. Defaults to 8080.
  118. ----
  119. ``-h``, ``--help``
  120. Display the help text for the ``serve`` command.
  121. publish
  122. =======
  123. Publish the site based on configuration. Currently, the only supported
  124. publishing target is a git repository. See the `publisher documentation
  125. <publisher>`_ for more information.
  126. Options:
  127. ``-s SITEPATH``, ``--sitepath SITEPATH``
  128. The path to the site to be generated.
  129. Defaults to the current working directory.
  130. ----
  131. ``-p CONFIG``
  132. The key for configuration section in the site configuration that has the
  133. settings for the publisher. For example, the following configuration, when
  134. invoked with ``hyde publish -p github`` will use the ``Git`` publisher to
  135. publish the generated site to ``hyde/hyde.github.com`` repository::
  136. publisher:
  137. github:
  138. type: hyde.ext.publishers.dvcs.Git
  139. path: ../hyde.github.com
  140. url: git@github.com:hyde/hyde.github.com.git