Giter VIP home page Giter VIP logo

prismicio-community / eleventy-plugin-prismic Goto Github PK

View Code? Open in Web Editor NEW
97.0 5.0 5.0 2.48 MB

Eleventy plugin and shortcodes to fetch and present Prismic content

Home Page: https://github.com/prismicio-community/eleventy-plugin-prismic/blob/master/DOCUMENTATION.md

License: MIT License

JavaScript 1.99% Nunjucks 4.19% TypeScript 93.82%
eleventy eleventy-plugin 11ty 11ty-plugin prismic javascript typescript

eleventy-plugin-prismic's Introduction

eleventy-plugin-prismic

npm version npm downloads Github Actions CI Codecov Conventional Commits License

Eleventy plugin and shortcodes to fetch and present Prismic content.

  • 🎣  Inject Prismic content into Eleventy data;
  • 🧰  Display content Prismic with provided shortcodes;
  • 📦  Batteries included, no need for extra Prismic dependencies.

Install

npm install eleventy-plugin-prismic

Documentation

To discover what's new on this package check out the changelog. For full documentation, check out the dedicated document (GitHub).

Contributing

Whether you're helping us fix bugs, improve the docs, or spread the word, we'd love to have you as part of the Prismic developer community!

Asking a question: Open a new topic on our community forum explaining what you want to achieve / your question. Our support team will get back to you shortly.

Reporting a bug: Open an issue explaining your application's setup and the bug you're encountering.

Suggesting an improvement: Open an issue explaining your improvement or feature so we can discuss and learn more.

Submitting code changes: For small fixes, feel free to open a pull request with a description of your changes. For large changes, please first open an issue so we can discuss if and how the changes should be implemented.

For more clarity on this project and its structure you can also check out the detailed CONTRIBUTING.md document.

License

MIT License

eleventy-plugin-prismic's People

Contributors

lihbr avatar mklblangenois avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eleventy-plugin-prismic's Issues

Unknow asHtml, seems to be replaced by asHTML

Versions

  • @11ty/eleventy: ^0.12.1
  • eleventy-plugin-prismic: ^0.1.0
  • node: v15.1.0

Reproduction

{% asHtml content %}

What is actually happening?

unknown block tag: prismic_asHtml

Resolve purpose

When I launch a DEBUG output, shortcode seems to be asHTML instead of asHtml (and asHTML works fine in my code). I did not send PR's since I'm not sure if it is an oversight in the documentation or an error in the name of the asHTML function.

Thanks !

Lang Switcher

Hey the team.

Is there a way to create a lang switcher ?

{% image %} is not working

It's me again 😅...

For {% image %}

When I want to run my local server I have this error :
image

So at the end the server stopped:
image

To temporary avoid this issue on my local server, I have to comment all {% image ......%}, then the local server will work and my images will be rendered but I'll still have the same error between each saving after I uncommented the images.
image
image
image
image

Btw... I also have this error on Netlify which make all my images are not visible.

Notation with Liquid

Hey !

Is it normal I have to write for example : prismic.layout.en-us.0.data.main_navigation.0.main_navigation_link instead of prismic.layout["en-us"].data.main_navigation.main_navigation_link as mentioned in the documentation ?

Broken with Prismic Changes

It looks like Prismic have made some changes to the client:

[eleventy:default] [11ty] > client.getAll is not a function
[eleventy:default]
[eleventy:default] TypeError was thrown:
[eleventy:default] [11ty] TypeError: client.getAll is not a function

Versions

  • @11ty/eleventy: 1.0.0-canary.44
  • eleventy-plugin-prismic: 0.1.2
  • node: 14

Reproduction

npm update

You can see the change here:
prismicio/prismic-client@4efdfa0

Trouble navigating through data structure

Versions

  • @11ty/eleventy: v1.0.0
  • eleventy-plugin-prismic: v0.2.1
  • node: v14.17.0

Reproduction

Hello,

Fetching data is OK

image

My problem is when I want to display the content, nothing is shown I tried a lot of things but nothing works except when I add the json filter

image
image

So... I tried to use 11ty serverless but same thing, another issue Here's the issue in the terminal :

image

Btw... When I comment these bits the issue disappeared

image

Additional Details

Live repo : https://github.com/haroldao/11ty-prismic-boilerplate/tree/main
Staging branch : https://github.com/haroldao/11ty-prismic-boilerplate/tree/dev-temp (branch you have to take a look at)

Steps to reproduce

What is expected?

What is actually happening?

Access to multiple languages

When I create a Custom Type with multiple languages, I don't see a way to get access to languages other than the main language. I tried {{ prismic.author | dump | safe }} to see all the fetched content, but I only get the main language's content.

Maybe I am missing something here.

Image Shortcode Properties Issue

Hi,

I'm using the following shortcode:

{% image post.data.featured_image, { loading: "lazy", pixelDensities: [1, 2] } %}

If the following properties are used, the class gets [object Object] and none of the properties actually work.

Cheers!

Versions

  • @11ty/eleventy: 2.0.0-canary.4
  • eleventy-plugin-prismic: 0.2.1

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.