You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if I'm using it correctly. {{ page_name | datapage_url: dir }} is mentioned in the docs for generating links to generated pages. I use name_expr in _config.yml to generate the files in an acts folder, so is {{ name_expr | datapage_url: acts }} the right way to do this?
Liquid Exception: undefined method `tr' for nil:NilClass in index.html
Error: undefined method `tr' for nil:NilClass
Would you like to see the --trace output as well?
(Sorry, but I'm also not entirely clear on how to use this liquid tag in my template to generate links for each of the items from the data file.)
As a fallback, I'm currently using slugify to create the page URLs manually, which works just fine, but raising this here to be sure if I'm doing something wrong or if there's a bug.
The text was updated successfully, but these errors were encountered:
Problem: the value of name_expr cannot be directly used in Liquid.
To generate the link, therefore, we need to:
find the record for which we want to generate the URL (this requires an id for the record and the name of the data file in which the record is stored)
get the data for the record (yaml)
check the configuration for the data file and generate the link according to it (e.g., by looking at page_gen and applying the appropriate piece of code to data; that is, getting name or executing name_expr)
Current syntax of datapage_url is inadequate. Proposal for new syntax:
{{ <unique_identifier> | datapage_url_for: }}
where:
<unique_identifier> is a unique identifier of the record for which we want to generate the URL. It should probably be the value assigned to the name field in the record (even if name_expr is used). [Alternatively, a new key, id, has to be added to the configuration.]
is the name of the data structure (= data file) to which the record belongs. The name of the data is needed to
read the appropriate specification in page_gen
read the content of the record (for instance to apply name_expr)
Not sure if I'm using it correctly.
{{ page_name | datapage_url: dir }}
is mentioned in the docs for generating links to generated pages. I usename_expr
in _config.yml to generate the files in anacts
folder, so is{{ name_expr | datapage_url: acts }}
the right way to do this?Would you like to see the
--trace
output as well?(Sorry, but I'm also not entirely clear on how to use this liquid tag in my template to generate links for each of the items from the data file.)
As a fallback, I'm currently using
slugify
to create the page URLs manually, which works just fine, but raising this here to be sure if I'm doing something wrong or if there's a bug.The text was updated successfully, but these errors were encountered: