Giter Club home page Giter Club logo

grav-plugin-import's Issues

Import doesn't always inject the data the same way

If we import a single file that is entered as:

imports: file.yaml

the plugin injects the data extracted directly into the imports object. If we import an array of files as:

imports:
    - file1.yaml
    - file2.yaml

the plugin will inject each file's data into corresponding named arrays under the imports object. This is inconsistent and we should be using the latter as the preferred method, to make it easier to consistently recall the data.

Request for fork

hey @Deester4x4jr, a request for Fork has been submitted to our Repo: getgrav/grav#1191

This basically asks for the GPM version to be pointed to the forked version. Are you continuing to maintain and support this plugin?

Cheers!

Don't seem able to access values

I know you said we have to implement ourselves, but I have a problem.

{{ dump(page.header.import) }} works fine and tells me I have a nested array with three top-level elements. But absolutely everything I have tried to access the first element has failed.

{{ dump(page.header.import[0]) }} gives null

I tried to get back to basics.

{% set myvar = ['foo','bar','crap'] %}
{% set newvar = ( myvar|slice(0, 1)) %}

Works exactly as expected. But {% set newvar = ( page.header.import|slice(0, 1)) %} results in a blank, not null, when I {{ dump(newvar) }}

I really want to be able to access that array that is the top element, but I just cannot see how. Any help gratefully received.

How to implement correctly

I think I am missing something in how to implement this.

I have added a file named ex_config.json to the folder for a page.

For the docs.md file in that folder I have added imports: ex_config.json to the frontmatter and then used {{ page.header.imports.ex_config.json }} in the main body of the markdown.

This is not working and the page only renders {{ page.header.imports.ex_config.json }}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.