Skip to content

Commit dc0c18a

Browse files
prisoruersmontero
authored andcommitted
M #- improved image quality (#433)
Signed-off-by: priscill <porue@opennebula.io> (cherry picked from commit 9d8da69)
1 parent 70e3fed commit dc0c18a

File tree

7 files changed

+49
-9
lines changed

7 files changed

+49
-9
lines changed
-55.8 KB
Binary file not shown.

assets/images/one_deploy_arch_local.svg

Lines changed: 1 addition & 0 deletions
Loading
-84.5 KB
Binary file not shown.

assets/images/one_deploy_basic_arch.svg

Lines changed: 1 addition & 0 deletions
Loading

content/software/installation_process/automatic_installation_with_onedeploy/one_deploy_overview.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ The basic procedure is as follows:
3232
3333
Ansible is an agentless platform and uses SSH as the default transport for deployment. The control node must be able to communicate with the managed nodes via SSH.
3434

35-
{{< image path=/images/one_deploy_basic_arch.png width=1080 height=669 >}}
35+
{{< image path="/images/one_deploy_basic_arch.svg" alt="OpenNebula Basic Architecture" align="center" width="50%" pb="20px" >}}
3636

3737
<!-- ![image](/images/one_deploy_basic_arch.png)
3838
<br/> -->
39-
<p></p>
4039

4140
It is worth noting that you can use the control node itself as a managed node. In the tutorials included in this documentation, the OpenNebula Front-end is installed on the Ansible control node and the Hypervisors on the managed nodes.
4241

content/software/installation_process/automatic_installation_with_onedeploy/one_deploy_tutorial_local_ds.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ In this tutorial, we’ll use [OneDeploy](https://github.com/OpenNebula/one-depl
2020

2121
This sample architecture uses a basic network configuration, a flat (bridged) network, where each VM’s IP is part of the same network as the Hypervisors.
2222

23-
![><](/images/one_deploy_arch_local.png)
23+
{{< image path="/images/one_deploy_arch_local.svg" alt="OneDeploy" align="center" width="50%" pb="20px" >}}
2424

25-
Throughout the tutorial we’ll use three server machines, please be sure to replace these references to your own IP addresses:
25+
Throughout the tutorial you will use three server machines. Replace these references to your own IP addresses:
2626

2727
> * OpenNebula Front-end: 172.20.0.2
2828
> * Hypervisor (Host) 1: 172.20.0.3

layouts/shortcodes/image.html

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
1-
{{- with resources.Get (.Get "path") }}
2-
{{- with .Process (printf "resize %dx wepb" ($.Get "width")) -}}
3-
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="{{ $.Get "alt" }}">
4-
{{- end }}
5-
{{- end -}}
1+
{{ $path := .Get "path" }}
2+
{{ $alt := .Get "alt" | default "" }}
3+
{{ $width := .Get "width" }}
4+
{{ $class := .Get "class" | default "" }}
5+
{{ $align := .Get "align" | default "" }}
6+
{{ $pb := .Get "pb" | default "" }}
7+
{{ $src := resources.Get $path }}
8+
9+
{{ if $src }}
10+
{{ $isSVG := eq $src.MediaType.SubType "svg" }}
11+
12+
{{/* Build inline style for centering and size */}}
13+
{{ $finalStyle := "" }}
14+
{{ if eq $align "center" }}
15+
{{ $finalStyle = printf "display: block; margin-left: auto; margin-right: auto;" }}
16+
{{ end }}
17+
{{ if $width }}
18+
{{ $finalStyle = printf "%s width: %s;" $finalStyle $width }}
19+
{{ end }}
20+
21+
{{ if $pb }}
22+
{{ $finalStyle = printf "%s padding-bottom: %s;" $finalStyle $pb }}
23+
{{ end }}
24+
25+
{{ if $isSVG }}
26+
{{/* --- SVG HANDLING --- */}}
27+
<img src="{{ $src.RelPermalink }}" alt="{{ $alt }}"
28+
{{ with $width }}width="{{ . }}"{{ end }}
29+
{{ with $class }}class="{{ . }}"{{ end }}
30+
{{ with $finalStyle }}style="{{ . | safeCSS }}"{{ end }}>
31+
32+
{{ else }}
33+
{{/* --- RASTER IMAGE PROCESSING (Original Logic) --- */}}
34+
{{- with $src.Process (printf "resize %dx webp" $width) -}}
35+
<img src="{{ .RelPermalink }}" alt="{{ $alt }}"
36+
width="{{ .Width }}" height="{{ .Height }}"
37+
{{ with $class }}class="{{ . }}"{{ end }}
38+
{{ with $finalStyle }}style="{{ $finalStyle }}"{{ end }}>
39+
{{- end }}
40+
{{ end }}
41+
42+
{{ else }}
43+
<p style="color: red;">Image not found: {{ $path }}</p>
44+
{{ end }}

0 commit comments

Comments
 (0)