My personal blog hauleth.dev
blog
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ft: show Webmentions on articles

+33 -5
+16
.github/workflows/rebuild.yml
··· 1 + name: Trigger Netlify rebuild 2 + on: 3 + schedule: 4 + # Run every 4h 5 + - cron: '0 */4 * * *' 6 + 7 + jobs: 8 + trigger: 9 + name: Send trigger 10 + runs-on: ubuntu-latest 11 + env: 12 + BUILD_HOOK_URL: 'https://api.netlify.com/build_hooks/629f4bdea589057c66219efd' 13 + steps: 14 + - name: Run cURL request 15 + run: | 16 + curl -X POST -d '{}' "$BUILD_HOOK_URL"
+17 -5
templates/page.html
··· 61 61 </div> 62 62 {%- endif -%} 63 63 64 - <!-- 65 64 <div class="webmentions"> 66 65 {%- set webmentions = load_data(url="https://webmention.io/api/mentions.jf2?target=" ~ page.permalink, format="json") -%} 67 - {%- for mention in webmentions.children -%} 68 - Foo 66 + {%- if webmentions.children | length > 0 -%} 67 + <p>Webmentions:</p> 68 + <ul> 69 + {%- for mention in webmentions.children -%} 70 + <li> 71 + <a href="{{ mention.url }}"> 72 + {%- if mention.name -%} 73 + {{ mention.name }} 74 + {%- else -%} 75 + {{ mention.url }} 76 + {%- endif -%} 77 + </a> 78 + by <a href="{{ mention.author.url }}">{{ mention.author.name }}</a> 79 + </li> 80 + {%- endfor -%} 81 + </ul> 69 82 {%- else -%} 70 83 No webmentions yet, you can be first. 71 - {%- endfor -%} 84 + {%- endif -%} 72 85 </div> 73 - --> 74 86 </article> 75 87 {%- endblock main -%}