Skip to content

Commit

Permalink
Replace data-src with src="..." in docs.
Browse files Browse the repository at this point in the history
Thanks to @m5o for the implementation idea!
  • Loading branch information
XhmikosR committed Nov 11, 2018
1 parent e6a356a commit d0d1d2f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion site/_includes/example.html
Expand Up @@ -18,6 +18,21 @@

{%- if include.hide_markup == null -%}
{%- highlight html -%}
{{- include.content | replace: 'data-src="holder.js', 'src="...' -}}
{%- if include.content contains 'data-src="holder.js' -%}
{%- assign modified_content = include.content
| replace: 'data-src="holder.js', 'src="✂️holder.js'
| replace: '" ', '✂️" '
| split: '✂️' -%}

{%- for content_chunk in modified_content -%}
{%- if content_chunk contains 'holder.js' -%}
{{- "..." -}}
{%- else -%}
{{- content_chunk -}}
{%- endif -%}
{%- endfor -%}
{%- else -%}
{{- include.content -}}
{%- endif -%}
{%- endhighlight -%}
{%- endif -%}

0 comments on commit d0d1d2f

Please sign in to comment.