A new Riff-radio.org site with a static approach.

path_handlers.rst 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. .. title: Path Handlers for Nikola
  2. .. slug: path-handlers
  3. .. author: The Nikola Team
  4. .. DO NOT EDIT, this file is auto-generated by scripts/document_path_handlers.py
  5. Nikola supports special links with the syntax ``link://kind/name``. In
  6. templates you can also use ``_link(kind, name)``. You can add query strings
  7. (``?key=value``) for extra arguments, or pass keyword arguments to ``_link`` in
  8. templates (support and behavior depends on path handlers themselves). Fragments
  9. (``#anchor``) will be appended to the transformed link.
  10. Here are the descriptions for all the supported kinds.
  11. .. class:: dl-horizontal
  12. archive
  13. Link to archive path, name is the year.
  14. Example:
  15. link://archive/2013 => /archives/2013/index.html
  16. author
  17. Link to an author's page.
  18. Example:
  19. link://author/joe => /authors/joe.html
  20. author_atom
  21. Link to an author's Atom feed.
  22. Example:
  23. link://author_atom/joe => /authors/joe.atom
  24. author_index
  25. Link to the authors index.
  26. Example:
  27. link://authors/ => /authors/index.html
  28. author_rss
  29. Link to an author's RSS feed.
  30. Example:
  31. link://author_rss/joe => /authors/joe.xml
  32. category
  33. A link to a category. Takes page number as optional keyword argument.
  34. Example:
  35. link://category/dogs => /categories/dogs.html
  36. category_atom
  37. A link to a category's Atom feed.
  38. Example:
  39. link://category_atom/dogs => /categories/dogs.atom
  40. category_index
  41. A link to the category index.
  42. Example:
  43. link://category_index => /categories/index.html
  44. category_rss
  45. A link to a category's RSS feed.
  46. Example:
  47. link://category_rss/dogs => /categories/dogs.xml
  48. filename
  49. Link to post or page by source filename.
  50. Example:
  51. link://filename/manual.txt => /docs/handbook.html
  52. gallery
  53. Link to an image gallery's path.
  54. It will try to find a gallery with that name if it's not ambiguous
  55. or with that path. For example:
  56. link://gallery/london => /galleries/trips/london/index.html
  57. link://gallery/trips/london => /galleries/trips/london/index.html
  58. gallery_global
  59. Link to the global gallery path, which contains all the images in galleries.
  60. There is only one copy of an image on multilingual blogs, in the site root.
  61. link://gallery_global/london => /galleries/trips/london/index.html
  62. link://gallery_global/trips/london => /galleries/trips/london/index.html
  63. (a ``gallery`` link could lead to eg. /en/galleries/trips/london/index.html)
  64. gallery_rss
  65. Link to an image gallery's RSS feed.
  66. It will try to find a gallery with that name if it's not ambiguous
  67. or with that path. For example:
  68. link://gallery_rss/london => /galleries/trips/london/rss.xml
  69. link://gallery_rss/trips/london => /galleries/trips/london/rss.xml
  70. index
  71. Link to a numbered index.
  72. Example:
  73. link://index/3 => /index-3.html
  74. index_atom
  75. Link to a numbered Atom index.
  76. Example:
  77. link://index_atom/3 => /index-3.atom
  78. index_rss
  79. A link to the RSS feed path.
  80. Example:
  81. link://rss => /blog/rss.xml
  82. listing
  83. Return a link to a listing.
  84. It will try to use the file name if it's not ambiguous, or the file path.
  85. Example:
  86. link://listing/hello.py => /listings/tutorial/hello.py.html
  87. link://listing/tutorial/hello.py => /listings/tutorial/hello.py.html
  88. listing_source
  89. Return a link to the source code for a listing.
  90. It will try to use the file name if it's not ambiguous, or the file path.
  91. Example:
  92. link://listing_source/hello.py => /listings/tutorial/hello.py
  93. link://listing_source/tutorial/hello.py => /listings/tutorial/hello.py
  94. post_path
  95. Link to the destination of an element in the POSTS/PAGES settings.
  96. Example:
  97. link://post_path/posts => /blog
  98. root
  99. Link to the current language's root.
  100. Example:
  101. link://root_path => /
  102. link://root_path => /translations/spanish/
  103. rss
  104. A link to the RSS feed path.
  105. Example:
  106. link://rss => /blog/rss.xml
  107. slug
  108. Return a link to a post with given slug, if not ambiguous.
  109. Example:
  110. link://slug/yellow-camaro => /posts/cars/awful/yellow-camaro/index.html
  111. tag
  112. A link to a tag's page. Takes page number as optional keyword argument.
  113. Example:
  114. link://tag/cats => /tags/cats.html
  115. tag_atom
  116. A link to a tag's Atom feed.
  117. Example:
  118. link://tag_atom/cats => /tags/cats.atom
  119. tag_index
  120. A link to the tag index.
  121. Example:
  122. link://tag_index => /tags/index.html
  123. tag_rss
  124. A link to a tag's RSS feed.
  125. Example:
  126. link://tag_rss/cats => /tags/cats.xml