Skip to content

Conversation

@oDinZu
Copy link
Contributor

@oDinZu oDinZu commented May 25, 2022

this update allows strapi v4 api to work with jekyll.

🙌

oDinZu and others added 2 commits May 25, 2022 00:00
@oDinZu
Copy link
Contributor Author

oDinZu commented May 25, 2022

Ways to use the Jekyll Strapi plugin

posts.html

{%- if strapi.collections.posts.size > 0 -%}
{%- for post in strapi.collections.posts -%}

<div class="title">
    <h2><a href="{{ post.attributes.url | absolute_url }}">{{ post.attributes.title }}</a></h2>
     <p>{{ post.attributes.subheading }}</p>
</div>

{% endfor %}
{% endif %}

_config.yaml

# Strapi dashboard integration
strapi:
    # Your API endpoint (optional, default to http://localhost:1337)
    endpoint: https://dashboard.example.com/api
    # Collections, key is used to access in the strapi.collections
    # template variable
    collections:
        # Example for a "posts" collection
        posts:
            # Collection name (optional). Used to construct the url requested. Example: type `foo` would generate the following url `http://localhost:1337/foo`.
            type: posts
            # Permalink used to generate the output files (eg. /posts/:id).
            permalink: /blog/:id/
            layout: post.html
            output: true
        authors:
            type: authors
            #permalink: /authors/:id/
            #layout: author.html
            #output: true

@oDinZu
Copy link
Contributor Author

oDinZu commented May 31, 2022

The jekyll plugin works with this PR, but the permalinks feature still isn't working. You can see more details here: https://talk.jekyllrb.com/t/jekyll-strapi-v4-plugin-ruby-help/7387/3

@oDinZu
Copy link
Contributor Author

oDinZu commented Jun 9, 2022

Update: This plugin with this PR has been working, but still needs more complete testings with production websites. One thing that is needed is adding the remote images to local assets when developing. @bluszcz added a image filter I haven't tested yet; this isn't critical, but beneficial to have for debugging and designing.

http://localhost:4000/blog/
image

@oDinZu oDinZu mentioned this pull request Jun 14, 2022
@Marktawa
Copy link

Hi @csharpee

Please share the source code to the Jekyll site seen in the screenshots. I want to test out your plugin.

Update: This plugin with this PR has been working, but still needs more complete testings with production websites. One thing that is needed is adding the remote images to local assets when developing. @bluszcz added a image filter I haven't tested yet; this isn't critical, but beneficial to have for debugging and designing.

http://localhost:4000/blog/ image

@oDinZu
Copy link
Contributor Author

oDinZu commented Jul 5, 2022

@Marktawa This plugin as it is works, but I don't have anything else as of now. I am working on more complex features I won't disclose here.

If you want, you could merge this PR into your Jekyll environment. The instructions are provided in this PR

bluszcz added a commit that referenced this pull request Aug 30, 2022
@bluszcz
Copy link
Member

bluszcz commented Aug 31, 2022

We have merged our (@mkrajewski90) changes into this repo, making this PR obsolete. Thank you for this PR and we encourage the contribution for this new repo - we have Unittests and other hot things ;)

@bluszcz bluszcz closed this Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants