update Post with fetched content
This commit is contained in:
parent
4ec79f9a28
commit
598da3ff80
1 changed files with 6 additions and 4 deletions
|
|
@ -8,17 +8,19 @@ tags: ['fetch', 'feature']
|
||||||
[Eleventy Fetch](https://www.11ty.dev/docs/plugins/fetch/) fetches and caches resources -- at configurable intervals.
|
[Eleventy Fetch](https://www.11ty.dev/docs/plugins/fetch/) fetches and caches resources -- at configurable intervals.
|
||||||
|
|
||||||
This is an example of fetching external data.
|
This is an example of fetching external data.
|
||||||
In this case, my public repositories (with more than zero stargazer) and a cache duration of 1 day.
|
In this case, my public repositories (with more than 20 stargazer) and a cache duration of 1 day.
|
||||||
|
|
||||||
Endpoint editable in `_data/github.js.`
|
Endpoint editable in `_data/github.js.`
|
||||||
|
|
||||||
{% for repository in github %}
|
{% for repository in github %}
|
||||||
{% if repository.stargazers_count > 10 %}
|
{% if repository.stargazers_count > 20 %}
|
||||||
|
|
||||||
## [{{ repository.name }}]({{ repository.html_url }})
|
<h2>{{ repository.name }}</h2>
|
||||||
|
|
||||||
|
{{ repository.html_url }}
|
||||||
|
|
||||||
**{{ repository.stargazers_count }} GitHub stars**
|
**{{ repository.stargazers_count }} GitHub stars**
|
||||||
{{ repository.description }}
|
{{ repository.description }}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
Loading…
Reference in a new issue