-
Notifications
You must be signed in to change notification settings - Fork 1
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
Jekyll data pulling from JSON #3
Comments
Hi @inetbiz ! Good question! I don't currently have a Jekyll site for testing, and don't have the time to set one up to make sure I put up a good working example. However, I do have an old Jekyll version of my site that I used with Morris, so I have the beginnings of a Jekyll snippet. Would you perhaps be willing to try it out and validate it? The principal is the same as with Hugo:
I have it in an partial at
At that point For my personal templates I also had this bit to sort them by when they were received (published date would have been better but not all webmentions have a published date so this is a compromise). I also group them by type because I collect likes and reacji into facepiles, etc:
Let me know if that first snippet works for you, or if it can be updated for clarity/correctness! |
I'm just testing to get data. I'll go back and make a facepile It's not pulling data. Sample JSON:
|
hey @inetbiz! it's worth doing some checks at each step to see what you're getting and how it matches up your expectations. for example, check the value of |
@martymcguire I'm stumped! jekyll 3.9.0 this line is not working:
{{ mention_ids | inspect }} is a null value. |
@inetbiz ah! that may mean that the lookup index is not what i expected. check the value of |
@martymcguire I know I can print |
@inetbiz a-ha! perhaps that's a hint as to the problem. i wrote this example as a Jekyll include that is meant to be included in the larger page template. |
@martymcguire |
ahhhh, what is your folder structure for your webmentions? for example,
if you're storing your mentions in a different folder in |
oh that's not what i expected / hoped for. 😅 can you inspect |
@martymcguire I changed structure just as you "expected". I did `{{site.data.webmentions.index | inspect}} and got good results.
|
ah, okay! getting closer! what is the value of |
@martymcguire |
hmmmm. i am stumped! your output from and does |
@martymcguire positive results! So |
I fixed it.
|
@inetbiz glad you have it working! somewhat frustrating that you needed to capture would you be interested in boiling down what you've got working into a minimal example that could be added to the README? |
So far I have:
Mention counts could probably be stored in a var and stats displayed higher in the page. |
@martymcguire would I need to create a method to micropub for comments recycling some of your code and storing in data? I'm not good with php sanitation. |
@inetbiz thanks for the example template! Can you explain a little more about what you mean by Micropub for comments? the code in Morris is hard-coded to understand the webhook format of webmention.io, which is not actually Micropub (the authentication method and data types are totally different). If you are looking for a way to accept comments via a form directly on your site, it might be possible to use Morris. To make minimal changes to Morris you'd need a bit of Javascript on the frontend to turn the comment form data into JSON that "looks like" the webmention data from webmention.io. You'd also want to extend Morris to accept an additional authentication method beyond the secret token shared with webmention.io. Does that answer your question? |
@martymcguire I bet I could include the login authentication from indieauth. I'll work on that project and ping you. =) |
@inetbiz authentication is definitely not the only thing to worry about for Micropub! It's worth looking into some of the dedicated Micropub implementations around for generating content files for static sites. I use a fork of skpy/Micropub for my own site and I like how it's structured! |
I see you documented HUGO. Can you also include a snippet for pulling in from jekyll data?
The text was updated successfully, but these errors were encountered: