Browse Source

add some notes and other useful information that I've discovered...

Include a list of the urls that previous existed at URLS.txt
main
John-Mark Gurney 3 years ago
parent
commit
b5fb9b58d7
3 changed files with 93 additions and 0 deletions
  1. +57
    -0
      NOTES.md
  2. +24
    -0
      README.md
  3. +12
    -0
      URLS.txt

+ 57
- 0
NOTES.md View File

@@ -0,0 +1,57 @@
Various Notes on templating
===========================

The markdown filter is located in hyde.ext.templates.jinja, and is to
be configured by addeding a markdown property to the `site.yaml` file, such as:
```
markdown:
extensions:
- toc
- footnotes
- fenced_code
- tables
extension_configs:
toc:
permalink: true
```

Some extensions are listed here: https://python-markdown.github.io/extensions/
but not all of them are (headerid is not, but toc implements a similar feature).

Some useful extensions:
https://python-markdown.github.io/extensions/attr_list/
https://python-markdown.github.io/extensions/fenced_code_blocks/
https://python-markdown.github.io/extensions/toc/ - implement permanent links

To access the site context data, define them in the `site.yaml` as context->data,
and it will be accessible via site.context (without the data for some reason).

Also, uses Tufte CSS, which is documented here: https://edwardtufte.github.io/tufte-css/

Another person's site built using this: https://github.com/pattern/verdant-refuge

h1 should not be used in blog posts, as it is used by the title of the blog and
in the template, h2 and h3 are fine.

the blog post entry is in macros.j2 in the render macro

A useful way to do testing:
find content/ site.yaml -type f | entr sh -c 'hyde -v gen && grep -A 20 ^BEGIN deploy/index.html'

Jinaja2 template language documentation: https://jinja2docs.readthedocs.io/en/stable/templates.html

Documentation for what variables are available in the template that hyde provides:
https://hyde.readthedocs.io/en/latest/templates.html#context-variables

Resource is a template that has metadata associated with it, see hyde.site.Resource for
more inforation. A Node (sibling) is a directory.

You can import a template via a `{% refer to <file> as <var> %}` and it appears to import
a template but NOT the metadata. The <var> appears to have a resource member which mirrors
the resource structure of a normal template.

Once the "template" has been imported, any data that is surrounded by a mark tag can be accessed
via <var>.<markname>.

Dependancy tracking isn't great. Modifying the `meta.yaml` file will not take effect until
the files are touched/update. Make sure you do a `touch *` after updating the `meta.yaml` file.

+ 24
- 0
README.md View File

@@ -1,3 +1,27 @@
Template information:
- title: The title of the page
- created: Initial date of post, ISO-8601 format
- updated: Last updated date of post, ISO-8601 format
- twittertitle (option): Title to use for the twitter card instead of title.
- description: Description of the page
- image: URL of an image for this page for Twitter (maybe other uses?)
- imagealt: Alterante text for the image
- twitterlabel1: Label 1 for twitter.
- twitterlabel2: Label 2 for twitter.
- twitterdata1: Data 1 for twitter.
- twitterdata2: Data 2 for twitter.
- author: Author of the post.
- viewport: Contents for the viewport meta tag in the page header.
- id: ID for this resource

Template Hierarchy:
- base.j2
- frontpage.j2: The index.html page
- blog.j2: Page for a specific blog

Notes:

- Look at DraftsPlugin (is_draft to mark a post as draft and not include it if site is in prod)
Initial setup:
```
virtualenv-3.8 p


+ 12
- 0
URLS.txt View File

@@ -0,0 +1,12 @@
https://blog.funkthat.com/2019/08/installing-freebsd-on-pc-engines-apu4c2.html
https://blog.funkthat.com/2019/04/using-signal-on-server.html
https://blog.funkthat.com/2018/10/crash-dumps-do-i-submit-them.html
https://blog.funkthat.com/2018/10/tls-client-authentication-leaks-user.html
https://blog.funkthat.com/2018/07/making-freebsd-magnet-links.html
https://blog.funkthat.com/2018/03/unusable-insecurity.html
https://blog.funkthat.com/2017/09/adventures-in-autobahnwamp-security.html
https://blog.funkthat.com/2015/07/installing-and-running-netbsd-and.html
https://blog.funkthat.com/2015/05/xml-schema-validation-for-command-line.html
https://blog.funkthat.com/2014/10/building-bhyve-images-using-makefs-and.html
https://blog.funkthat.com/2014/03/python-ctypes-wrapper-for-flac.html
https://blog.funkthat.com/2014/03/ctf-armeb-debugging.html

Loading…
Cancel
Save