Skip to content
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

New feature #142

Closed
wants to merge 4 commits into from
Closed

New feature #142

wants to merge 4 commits into from

Conversation

Scott-thedev
Copy link

Checklist

  • [ X] I have read the Contributor Guide
  • [X ] I have read and agree to the Code of Conduct
  • [ X] I have added a description of my changes and why I'd like them included in the section below

Description of Changes

I have added a macro in the macros.html template that fetches the blog data from the dev.to api and stores it in a variable "data". After calling the macro "{{ macro::dev_to_api() }}" in a template.html page, you can use {{ data[$YOUR_BLOG_INDEX] }}.$YOUR_JSON_KEY_NAME

For example:


{{ data[0].title }}

will display the first blog article's title as an H2 header on any page using the template.

I'm currently working on implementing the filter-by-tag functionality

Related Issues

Connect to Medium API and/or dev.to API #26

    I added the embark dev.to api endpoint url to the "[extra]" section as a custom variable "embark_devto_api_endpoint"
    Added a macro that fetches the blog data as a json object from the dev.to endpoint and stores it in the variable "data". To access the data use {{ data[$YOUR_BLOG_ARTICLE_NUMBER].$YOUR_BLOG_DATA_KEY_NAME }}

    For example "{{ data[0].title }}" will evaluate to the value of the "title" field (aka the blogs title) of the first blog in chronological order.

    Im still working on implementing the filter by tag functionality.
    deleted the variable that I added 2 commits ago as it is not needed
    forgot to delete the tag argument in the dev_to_api() macro. Currently working on the filter by tag functionality
@Scott-thedev Scott-thedev requested a review from celialewis3 as a code owner July 6, 2023 10:15
@Scott-thedev Scott-thedev closed this by deleting the head repository Feb 1, 2024
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.

2 participants