The blog.
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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Various Notes on templating
  2. ===========================
  3. The markdown filter is located in hyde.ext.templates.jinja, and is to
  4. be configured by addeding a markdown property to the `site.yaml` file, such as:
  5. ```
  6. markdown:
  7. extensions:
  8. - toc
  9. - footnotes
  10. - fenced_code
  11. - tables
  12. extension_configs:
  13. toc:
  14. permalink: true
  15. ```
  16. Some extensions are listed here: https://python-markdown.github.io/extensions/
  17. but not all of them are (headerid is not, but toc implements a similar feature).
  18. Some useful extensions:
  19. https://python-markdown.github.io/extensions/attr_list/
  20. https://python-markdown.github.io/extensions/fenced_code_blocks/
  21. https://python-markdown.github.io/extensions/toc/ - implement permanent links
  22. To access the site context data, define them in the `site.yaml` as context->data,
  23. and it will be accessible via site.context (without the data for some reason).
  24. Also, uses Tufte CSS, which is documented here: https://edwardtufte.github.io/tufte-css/
  25. Another person's site built using this: https://github.com/pattern/verdant-refuge
  26. h1 should not be used in blog posts, as it is used by the title of the blog and
  27. in the template, h2 and h3 are fine.
  28. the blog post entry is in macros.j2 in the render macro
  29. A useful way to do testing:
  30. find content/ site.yaml -type f | entr sh -c 'hyde -v gen && grep -A 20 ^BEGIN deploy/index.html'
  31. Jinaja2 template language documentation: https://jinja2docs.readthedocs.io/en/stable/templates.html
  32. Documentation for what variables are available in the template that hyde provides:
  33. https://hyde.readthedocs.io/en/latest/templates.html#context-variables
  34. Resource is a template that has metadata associated with it, see hyde.site.Resource for
  35. more inforation. A Node (sibling) is a directory.
  36. You can import a template via a `{% refer to <file> as <var> %}` and it appears to import
  37. a template but NOT the metadata. The <var> appears to have a resource member which mirrors
  38. the resource structure of a normal template.
  39. Once the "template" has been imported, any data that is surrounded by a mark tag can be accessed
  40. via <var>.<markname>.
  41. Dependancy tracking isn't great. Modifying the `meta.yaml` file will not take effect until
  42. the files are touched/update. Make sure you do a `touch *` after updating the `meta.yaml` file.