File tree 3 files changed +17
-4
lines changed
3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1
1
{%- if modelname %}
2
2
< b > {{ modelname }}</ b > < br />
3
3
{%- endif %}
4
- {{ dimension_data.height }} mm ({{ dimension_data.height | divided_by: 25.4 | round: 2 | remove: ".0" }} in) (h)< br />
5
- {{ dimension_data.width }} mm ({{ dimension_data.width | divided_by: 25.4 | round: 2 | remove: ".0" }} in) (w)< br />
6
- {{ dimension_data.depth }} mm ({{ dimension_data.depth | divided_by: 25.4 | round: 2 | remove: ".0" }} in) (d)
4
+ {{ dimension_data.height }} mm ({{ dimension_data.height | mm_to_in }} in) (h)< br />
5
+ {{ dimension_data.width }} mm ({{ dimension_data.width | mm_to_in }} in) (w)< br />
6
+ {{ dimension_data.depth }} mm ({{ dimension_data.depth | mm_to_in }} in) (d)
Original file line number Diff line number Diff line change 1
1
{%- if modelname %}
2
2
< b > {{ modelname }}</ b > < br />
3
3
{%- endif %}
4
- {{ screen_data.size }} in ({{ screen_data.size | times: 25.4 | round: 2 | remove: ".0" }} mm)< br />
4
+ {{ screen_data.size }} in ({{ screen_data.size | in_to_mm }} mm)< br />
5
5
{{ screen_data.resolution }} ({{ screen_data.resolution | ppi: screen_data.size }} PPI)< br />
6
6
{{ screen_data.technology }} {% if screen_data.refresh_rate %}(max. {{ screen_data.refresh_rate }} Hz){% endif %}
Original file line number Diff line number Diff line change
1
+ module Jekyll
2
+ module Size
3
+ def in_to_mm ( value )
4
+ ( value * 25.4 ) . round ( 2 ) . to_s ( ) . chomp ( '.0' )
5
+ end
6
+
7
+ def mm_to_in ( value )
8
+ ( value / 25.4 ) . round ( 2 ) . to_s ( ) . chomp ( '.0' )
9
+ end
10
+ end
11
+ end
12
+
13
+ Liquid ::Template . register_filter ( Jekyll ::Size )
You can’t perform that action at this time.
0 commit comments