Guest User

Untitled

a guest
Nov 18th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. If you want to call a partial `test-partial.html` from within a shortcode it can be done like:
  2.  
  3. `test.md`:
  4.  
  5. ```
  6. {{< incpartials >}}
  7. ```
  8.  
  9. `layouts/shortcodes/incpartials.html`:
  10.  
  11. ```
  12. {{ partial "test-partial.html" . }}
  13. ```
  14.  
  15. To add to @Leo_Merkel’s handy example, if you want to pass the partial name as an argument:
  16.  
  17. Usage:
  18.  
  19. ```
  20. {{< incpartials "test-partial.html" >}}
  21. ```
  22.  
  23. Definition:
  24.  
  25. ```
  26. {{ partial (.Get 0) . }}
  27. ```
Add Comment
Please, Sign In to add comment