GithubHelp home page GithubHelp logo

ayushn21 / bridgetown-svg-inliner Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 2.0 41 KB

Liquid and ERB helper for Bridgetown to inline SVG files in HTML

License: MIT License

Ruby 89.82% Shell 10.18%
bridgetown bridgetown-plugin svg

bridgetown-svg-inliner's Introduction

Hey, I'm Ayush ๐Ÿ‘‹

I'm a freelance web developer based in London, UK. I like boring tech like Ruby on Rails and the Hotwire approach to building websites.

I built and maintain a mailing list app called Scattergun. I'm also on the core team of the Bridgetown project.

My experience and portfolio is available on my website. I spout my opinions regularly on my blog.



I'm available for contract work and consulting in Ruby, Rails, static HTML websites and pretty much anything Web related. Drop me a line and let's chat!

bridgetown-svg-inliner's People

Contributors

ayushn21 avatar ikass avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

topofocus ikass

bridgetown-svg-inliner's Issues

Bridgetownrb returns an error when using {% svg "path" %} in a code piece

As I said in my blog I wanted to show off how to install and use this gem in Bridgetown

when I was writing in a markdown file and put the following lines as code blocks, the compiler just breaks down.

<!-- Liquid -->
{% svg "/assets/icons/thumbs-up.svg" %}
<!-- ERB -->
<%= svg "/assets/icons/thumbs-up.svg" %>

in order to solve the problem, I put a # to scape the code.

<!-- Liquid -->
{#% svg "/assets/icons/thumbs-up.svg" %}
<!-- ERB -->
<#%= svg "/assets/icons/thumbs-up.svg" %>

reference article

Support for Bridgetown v1.2.0

When adding this gem to a Bridgetown v1.2.0 project I get a deprecation warning in the console.

[Bridgetown]       Initializing: The `bridgetown-svg-inliner' initializer could not be found

Relevant code:

# Gemfile
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gem "bridgetown", "1.2.0.beta4"

gem "bridgetown-svg-inliner"

group :development do
  gem "puma", "~> 5.6"
end
# config/initializers.rb
Bridgetown.configure do |config|
  permalink "pretty"
  template_engine "erb"

  init :"bridgetown-svg-inliner"
end

Add ability to specify default directory and omit .svg extension

It would be nice to be able to specify a default subdirectory like images that automatically gets prepended to the path we pass into svg while also omitting the file extension as it seems very redundant given the nature of the method.

Example:

A file existing at src/images/icons/check.svg would allow us to simply write erb <%= svg 'icons/check' %> instead of erb <%= svg 'images/icons/check.svg' %>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.