Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix external URL variables in href field in toc.yaml #12

Open
iglunchadze opened this issue Dec 12, 2023 · 1 comment
Open

Fix external URL variables in href field in toc.yaml #12

iglunchadze opened this issue Dec 12, 2023 · 1 comment
Labels
cli enhancement New feature or request good first issue Good for newcomers

Comments

@iglunchadze
Copy link

This works fine:

title: Test document
items:
  - name: Index
    href: index.md
  - name: External article
    href: https://example.com

But when you create a variable for the URL, url: https://example.com, and use it in the href value, there's an error:

title: Test document
items:
  - name: Index
    href: index.md
  - name: External article
    href: "{{ url }}"
No such file or has no access to /home/glunchadze/diplodoc-test-gen/.tmp_input/{{ url }}.md Error: ENOENT: no such file or directory, open '/home/glunchadze/diplodoc-test-gen/.tmp_input/{{ url }}.md'
    at Object.openSync (node:fs:603:3)
    at readFileSync (node:fs:471:35)
    at /home/glunchadze/.nvm/versions/node/v18.18.2/lib/node_modules/@diplodoc/cli/build/index.js:2140:49
    at Generator.next (<anonymous>)
    at /home/glunchadze/.nvm/versions/node/v18.18.2/lib/node_modules/@diplodoc/cli/build/index.js:78:61
    at new Promise (<anonymous>)
    at __async (/home/glunchadze/.nvm/versions/node/v18.18.2/lib/node_modules/@diplodoc/cli/build/index.js:62:10)
    at resolveMd2HTML (/home/glunchadze/.nvm/versions/node/v18.18.2/lib/node_modules/@diplodoc/cli/build/index.js:2130:10)
    at /home/glunchadze/.nvm/versions/node/v18.18.2/lib/node_modules/@diplodoc/cli/build/index.js:2969:12
    at Generator.next (<anonymous>) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/glunchadze/diplodoc-test-gen/.tmp_input/{{ url }}.md'
}

ERR No such file or has no access to /{{ url }}.md
@iglunchadze iglunchadze changed the title Fix variable processing in href field in toc.yaml Fix external URL variables in href field in toc.yaml Dec 12, 2023
@3y3 3y3 added enhancement New feature or request good first issue Good for newcomers labels Feb 6, 2024
@3y3
Copy link
Member

3y3 commented Feb 6, 2024

Yep. We need to process href with liquid.

@3y3 3y3 added the cli label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants