Skip to content

Commit 65efeed

Browse files
Add sdk in linux
1 parent 89f1f4e commit 65efeed

File tree

8 files changed

+99
-26
lines changed

8 files changed

+99
-26
lines changed

_data/new-data/install/linux/amazon-linux/amazon-linux-2/releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ latest-release:
6767
copy: 'nightly-amazonlinux2'
6868
release-6-2:
6969
pre-code-text: |-
70-
<small>May 15, 2025</small>xw
70+
<small>May 15, 2025</small>
7171
headline: release/6.2
7272
links:
7373
- group:

_data/new-data/install/linux/releases.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,19 @@ latest-release:
3535
copy: 'Docker Hub'
3636
- href: 'https://www.swift.org/install/linux/docker'
3737
copy: 'Instructions'
38+
static-linux-sdk:
39+
pre-code-text: |-
40+
Static Linux SDK - Cross compile to Linux
41+
<br /><br />
42+
<button onclick="copyToClipboard(this, 'swift sdk install https://download.swift.org/swift-6.1.1-release/static-sdk/swift-6.1.1-RELEASE/swift-6.1.1-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum 8a69753e181e40c202465f03bcafcc898070a86817ca0f39fc808f76638e90c2')">
43+
Copy install command
44+
</button>
45+
headline: Static Linux SDK
46+
links:
47+
- group:
48+
- href: 'https://download.swift.org/swift-6.1.1-release/static-sdk/swift-6.1.1-RELEASE/swift-6.1.1-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz'
49+
copy: 'Download Linux Static SDK'
50+
- href: 'https://download.swift.org/swift-6.1.1-release/static-sdk/swift-6.1.1-RELEASE/swift-6.1.1-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz.sig'
51+
copy: 'Signature (PGP)'
52+
- href: 'https://www.swift.org/documentation/articles/static-linux-getting-started.html'
53+
copy: 'Instructions (Static Linux SDK)'

_data/new-data/install/windows/releases.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ latest-release:
2020
copy: "Editors"
2121
manual:
2222
pre-code-text: |
23-
Download the Swift installer (.exe).
23+
Download the Swift installer (.exe)
2424
headline: Manual Installation
2525
links:
26-
- href: 'https://download.swift.org/swift-6.1-release/windows10/swift-6.1-RELEASE/swift-6.1-RELEASE-windows10.exe'
26+
- href: 'https://download.swift.org/{swift-6.1-release}/{windows10}/{swift-6.1-RELEASE}/{swift-6.1-RELEASE}-windows10.exe'
2727
copy: 'Download (x86_64)'
28-
- href: 'https://download.swift.org/swift-6.1-release/windows10-arm64/swift-6.1-RELEASE/swift-6.1-RELEASE-windows10-arm64.exe'
28+
- href: 'https://download.swift.org/{swift-6.1-release}/{windows10}-arm64/{swift-6.1-RELEASE}/{swift-6.1-RELEASE}-windows10-arm64.exe'
2929
copy: 'Download (arm64)'
3030
- href: 'https://www.swift.org/install/windows/manual'
3131
copy: 'Instructions'
@@ -35,11 +35,11 @@ latest-release:
3535
headline: Container
3636
links:
3737
- href: 'https://hub.docker.com/_/swift'
38-
copy: '6.1-windowsservercore-ltsc2022'
38+
copy: '{6.1-windowsservercore-ltsc2022}'
3939
main:
4040
pre-code-text: |
41-
<small>April 3, 2025</small><br />
42-
Package installers (.exe).
41+
<small>{April 3, 2025}</small><br />
42+
Package installers (.exe)
4343
headline: main
4444
links:
4545
- href: 'https://download.swift.org/development/windows10/swift-DEVELOPMENT-SNAPSHOT-2025-04-03-a/swift-DEVELOPMENT-SNAPSHOT-2025-04-03-a-windows10.exe'
@@ -49,7 +49,7 @@ latest-release:
4949
release-6-1:
5050
pre-code-text: |
5151
<small>March 6, 2025</small><br />
52-
Package installers (.exe).
52+
Package installers (.exe)
5353
headline: release/6.1
5454
links:
5555
- href: 'https://download.swift.org/swift-6.1-branch/windows10/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-06-a/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-03-06-a-windows10.exe'

_layouts/new-layouts/install.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,19 @@
77

88
<div class="swoop swoop-1"></div>
99
</section>
10+
11+
<script>
12+
function copyToClipboard(button, text) {
13+
const originalText = button.innerText;
14+
15+
navigator.clipboard.writeText(text).then(() => {
16+
button.innerText = 'Copied!';
17+
setTimeout(() => {
18+
button.innerText = originalText;
19+
}, 1000);
20+
}).catch(err => {
21+
console.error('Failed to copy:', err);
22+
button.innerText = 'Failed';
23+
});
24+
}
25+
</script>

_plugins/liquid-in-yaml.rb

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
require 'yaml'
2+
3+
module Jekyll
4+
class LiquidInYaml < Generator
5+
priority :highest
6+
7+
def generate(site)
8+
context = Liquid::Context.new(site.site_payload)
9+
10+
site.data.each do |filename, content|
11+
site.data[filename] = process_yaml(content, context)
12+
end
13+
end
14+
15+
private
16+
17+
def render_liquid_string(data, context)
18+
last = nil
19+
current = data
20+
21+
while current != last && current =~ /{{|{%/
22+
last = current
23+
current = Liquid::Template.parse(current).render!(context)
24+
end
25+
current
26+
end
27+
28+
def process_yaml(data, context)
29+
case data
30+
when Hash
31+
data.transform_values { |value| process_yaml(value, context) }
32+
when Array
33+
data.map { |item| process_yaml(item, context) }
34+
when String
35+
if data =~ /({{.*}}|{%.+%})/
36+
begin
37+
render_liquid_string(data, context)
38+
rescue => e
39+
Jekyll.logger.error "LiquidInYaml Plugin:", "Error rendering: #{data.inspect}"
40+
Jekyll.logger.error "", e.message
41+
data
42+
end
43+
else
44+
data
45+
end
46+
else
47+
data
48+
end
49+
end
50+
51+
end
52+
end

install/linux/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ title: Install Swift - Linux
1616
{% include new-includes/components/code-box.html content = site.data.new-data.install.linux.releases.latest-release.container %}
1717
</div>
1818
</div>
19+
<div class="release-box section">
20+
<div class="content">
21+
{% include new-includes/components/code-box.html content = site.data.new-data.install.linux.releases.latest-release.static-linux-sdk %}
22+
</div>
23+
</div>
1924
<div class="callout">
2025
<div>
2126
<p class="content-copy">

install/macos/_old-release.html

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,6 @@
2121
{% if static_sdk %}
2222
{% assign tag_downcase = include.release.tag | downcase %}
2323
<button onclick="copyToClipboard(this, 'swift sdk install https://download.swift.org/{{ tag_downcase }}/static-sdk/{{ include.release.tag }}/{{ include.release.tag }}_static-linux-0.0.1.artifactbundle.tar.gz --checksum {{ static_sdk.checksum }}')">Copy install command</button>
24-
25-
<script>
26-
function copyToClipboard(button, text) {
27-
const originalText = button.innerText;
28-
29-
navigator.clipboard.writeText(text).then(() => {
30-
button.innerText = 'Copied!';
31-
setTimeout(() => {
32-
button.innerText = originalText;
33-
}, 1000);
34-
}).catch(err => {
35-
console.error('Failed to copy:', err);
36-
button.innerText = 'Failed';
37-
});
38-
}
39-
</script>
4024
{% else %}
4125
Unavailable
4226
{% endif %}

install/windows/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ title: Install Swift - Windows
5353
<div class="releases-grid">
5454
<div class="release-box section">
5555
<div class="content">
56-
{% include new-includes/components/code-box.html content = site.data.new-data.install.windows.releases.latest-release.main%}
56+
{% include new-includes/components/code-box.html content = site.data.new-data.install.windows.releases.latest-release.main %}
5757
</div>
5858
</div>
5959
<div class="release-box section">
6060
<div class="content">
61-
{% include new-includes/components/code-box.html content = site.data.new-data.install.windows.releases.latest-release.release-6-1%}
61+
{% include new-includes/components/code-box.html content = site.data.new-data.install.windows.releases.latest-release.release-6-1 %}
6262
</div>
6363
</div>
6464
</div>

0 commit comments

Comments
 (0)