y7kim/agency-jekyll-theme

Recommend just using forloop.index instead of requiring a modal-id property to be set for every post.

georgeslabreche opened this issue · 2 comments

Using {{forloop.index}} instead of {{post.modal-id}} here:

<a href="#portfolioModal{{ post.modal-id }}" class="portfolio-link" data-toggle="modal">

and here:

<div class="portfolio-modal modal fade" id="portfolioModal{{ post.modal-id }}" tabindex="-1" role="dialog" aria-hidden="true">

Will eliminate the need for set and track modal-id properties in every post that is created.

Alternatively could just use {{ post.title | slugify }} instead of portfolioModal{{ post.modal-id }}, this would result in a SEO friendlier URL to share direct link to modal.

y7kim commented