DougBeney / jekyll-pug

Jekyll Plugin That Allows You To Use Pug
MIT License
37 stars 2 forks source link

Feature Request: Include SVG files #4

Closed ericirish closed 7 years ago

ericirish commented 7 years ago

I commonly use pug includes to render SVGs inline. It would be great to be able to include them with the liquid markup like {% include images/my-svg.svg %}.

DougBeney commented 7 years ago

Interesting idea.

A current workaround is to create an HTML file, paste your SVG inside, and then use the tag {% include images/my-svg.html %}

I think you could also use a regular pug include tag like:

include my-svg.svg

Just make sure your file is in the ./_includes folder.


Is {% include images/my-svg.svg %} something that worked in regular Jekyll but then stopped working after you installed Jekyll-pug? Just want to make sure I am not breaking any sort of functionality.

shaqonline commented 7 years ago
  1. File logo.svg added to _includes folder
  2. {% include logo.svg %} added to _includes/header.html
  3. Error: Included file 'logo.svg.pug' not found in _includes directory
DougBeney commented 7 years ago

@shaqonline Yep, that's a bug I have to fix. It's an easy fix luckily.

For now, you could rename logo.svg to logo.html and use the code {% include logo.html %}.

DougBeney commented 7 years ago

@ecirish @shaqonline Very good news! I released version 1.0.1 of Jekyll-Pug with many improvements.

One of those improvements being SVG include support.

You could also use regular Pug includes too, as they are fully functional now.