mirror of
https://github.com/cirosantilli/china-dictatorship.git
synced 2025-09-01 02:31:53 +02:00
Modify templates to use loading="lazy"
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -1,3 +1,5 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'asciidoctor', '2.0.10'
|
||||
gem 'concurrent-ruby', '1.1.7'
|
||||
gem 'tilt', '2.0.10'
|
||||
|
@@ -2,12 +2,16 @@ GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
asciidoctor (2.0.10)
|
||||
concurrent-ruby (1.1.7)
|
||||
tilt (2.0.10)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
asciidoctor (= 2.0.10)
|
||||
concurrent-ruby (= 1.1.7)
|
||||
tilt (= 2.0.10)
|
||||
|
||||
BUNDLED WITH
|
||||
2.0.2
|
||||
|
4
Makefile
4
Makefile
@@ -12,12 +12,14 @@ else
|
||||
MEDIA_CMD = -a china-dictatorship-media-base='$(MEDIA)'
|
||||
endif
|
||||
|
||||
$(OUT): README.adoc $(HEAD) $(FOOT)
|
||||
$(OUT): README.adoc $(HEAD) $(FOOT) template_dir/*
|
||||
bundle exec asciidoctor \
|
||||
$(MEDIA_CMD) \
|
||||
--embedded \
|
||||
--failure-level info \
|
||||
-o $(BODY) \
|
||||
--template-dir template_dir \
|
||||
--trace \
|
||||
-v \
|
||||
'$<'
|
||||
cat $(HEAD) $(BODY) $(FOOT) > '$@'
|
||||
|
@@ -2678,7 +2678,7 @@ Self made video shows the ex-model chained to a bed in a camp. Text messages giv
|
||||
Text messages and translation: https://medium.com/@millwarj/wear-your-mask-under-your-hood-an-account-of-prisoner-abuse-in-xinjiang-during-the-2020-3007a1f7437d
|
||||
|
||||
++++
|
||||
<iframe width="400" height="500" frameborder="0" src="https://www.bbc.co.uk/news/av/embed/p08mr1tm/53650246"></iframe>
|
||||
<iframe loading="lazy" width="400" height="500" frameborder="0" src="https://www.bbc.co.uk/news/av/embed/p08mr1tm/53650246"></iframe>
|
||||
++++
|
||||
|
||||
[[other-islam-countries-speak-up-for-uyghur]]
|
||||
|
15
template_dir/block_image.html.erb
Normal file
15
template_dir/block_image.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<%#encoding:UTF-8%><div<%= @id && %( id="#{@id}") %> class="<%= ['imageblock',@style,role].compact * ' ' %>"<%
|
||||
if (attr? :align) || (attr? :float)
|
||||
%> style="<%= [("text-align: #{attr :align};" if attr? :align),("float: #{attr :float};" if attr? :float)].compact * ' ' %>"<%
|
||||
end %>>
|
||||
<div class="content"><%
|
||||
if attr? :link %>
|
||||
<a class="image" href="<%= attr :link %>"><img src="<%= image_uri(attr :target) %>" loading="lazy" alt="<%= attr :alt %>"<%= (attr? :width) ? %( width="#{attr :width}") : nil %><%= (attr? :height) ? %( height="#{attr :height}") : nil %>></a><%
|
||||
else %>
|
||||
<img src="<%= image_uri(attr :target) %>" loading="lazy" alt="<%= attr :alt %>"<%= (attr? :width) ? %( width="#{attr :width}") : nil %><%= (attr? :height) ? %( height="#{attr :height}") : nil %>><%
|
||||
end %>
|
||||
</div><%
|
||||
if title? %>
|
||||
<div class="title"><%= captioned_title %></div><%
|
||||
end %>
|
||||
</div>
|
34
template_dir/block_video.html.erb
Normal file
34
template_dir/block_video.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
<%#encoding:UTF-8%><div<%= @id && %( id="#{@id}") %> class="<%= ['videoblock',@style,role].compact * ' ' %>"><%
|
||||
if title? %>
|
||||
<div class="title"><%= captioned_title %></div><%
|
||||
end %>
|
||||
<div class="content"><%
|
||||
case attr :poster
|
||||
when 'vimeo'
|
||||
start_anchor = (attr? :start) ? %(#at=#{attr :start}) : nil
|
||||
delimiter = '?'
|
||||
autoplay_param = (option? :autoplay) ? %(#{delimiter}autoplay=1) : nil
|
||||
delimiter = '&' if autoplay_param
|
||||
loop_param = (option? :loop) ? %(#{delimiter}loop=1) : nil
|
||||
src = %(//player.vimeo.com/video/#{attr :target}#{start_anchor}#{autoplay_param}#{loop_param}) %>
|
||||
<iframe<%= (attr? :width) ? %( width="#{attr :width}") : nil %><%= (attr? :height) ? %( height="#{attr :height}") : nil %> src="<%= src %>" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe><%
|
||||
when 'youtube'
|
||||
params = ['rel=0']
|
||||
params << %(start=#{attr :start}) if attr? :start
|
||||
params << %(end=#{attr :end}) if attr? :end
|
||||
params << 'autoplay=1' if option? :autoplay
|
||||
params << 'loop=1' if option? :loop
|
||||
params << 'controls=0' if option? :nocontrols
|
||||
src = %(//www.youtube.com/embed/#{attr :target}?#{params * '&'}) %>
|
||||
<iframe loading="lazy"<%= (attr? :width) ? %( width="#{attr :width}") : nil %><%= (attr? :height) ? %( height="#{attr :height}") : nil %> src="<%= src %>" frameborder="0"<%= (option? :nofullscreen) ? nil : ' allowfullscreen' %>></iframe><%
|
||||
else %>
|
||||
<video src="<%= media_uri(attr :target) %>"<%= (attr? :width) ? %( width="#{attr :width}") : nil %><%= (attr? :height) ? %( height="#{attr :height}") : nil %><%
|
||||
if attr? :poster %> poster="<%= media_uri(attr :poster) %>"<% end
|
||||
if option? :autoplay %> autoplay<% end
|
||||
unless option? :nocontrols %> controls<% end
|
||||
if option? :loop %> loop<% end %>>
|
||||
Your browser does not support the video tag.
|
||||
</video><%
|
||||
end %>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user