Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add download attribute to download links #407

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .vuepress/components/InstallInstructions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ usermod -a -G openhab myownuser
&#128712; <small> You don't need the add-ons archives if your machine has Internet access, openHAB will download add-ons you need online as necessary.</small>
<div v-if="(selectedVersion === 'stable' || selectedVersion === 'testing')">
<div class="download-button-container">
<a class="download-button" style="margin-bottom: 0" :href="addonsDownloadLink">Download openHAB {{currentDownloadVersion}} {{currentVersionLabel}} Add-ons</a>
<a class="download-button" style="margin-bottom: 0" :href="addonsDownloadLink" download>Download openHAB {{currentDownloadVersion}} {{currentVersionLabel}} Add-ons</a>
</div>
</div>
<div v-if="selectedVersion === 'snapshot'">
<div class="download-button-container">
<a class="download-button" style="margin-bottom: 0" :href="`https://ci.openhab.org/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-addons/target/openhab-addons-4.0.0-SNAPSHOT.kar`">Download openHAB {{$page.frontmatter.currentSnapshotVersion}} Add-ons</a>
<a class="download-button" style="margin-bottom: 0" :href="`https://ci.openhab.org/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-addons/target/openhab-addons-4.0.0-SNAPSHOT.kar`" download>Download openHAB {{$page.frontmatter.currentSnapshotVersion}} Add-ons</a>
Copy link

@spacemanspiff2007 spacemanspiff2007 May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

download="openhab-addons.kar">

That value should then be used as a suggestion for the browser. See attribute at the very bottom

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make it loose the version number in the name. The filename attribute is optional.
Can you confirm that the current version still does not work for you?

Copy link

@spacemanspiff2007 spacemanspiff2007 May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind if you add the version number again, but I think the attribute needs to be filled so download has any effect at all.
In #405 I posted a screenshot which shows the issue is still there

Maybe like this?

download="openhab-addons-4.0.0-SNAPSHOT.kar">

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<a class="download-button" style="margin-bottom: 0" :href="`https://ci.openhab.org/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-addons/target/openhab-addons-4.0.0-SNAPSHOT.kar`" download>Download openHAB {{$page.frontmatter.currentSnapshotVersion}} Add-ons</a>
<a class="download-button" style="margin-bottom: 0" :href="`https://ci.openhab.org/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-addons/target/openhab-addons-4.0.0-SNAPSHOT.kar`" download="openhab-addons-{{$page.frontmatter.currentSnapshotVersion}}.kar">Download openHAB {{$page.frontmatter.currentSnapshotVersion}} Add-ons</a>

We could add the version dynamically too, so attribute would be used completely and the version still would be included.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works for the snapshot link, but the stable/milestone links are inserted dynamically - this would a bit more scripting to get it right...

Copy link
Contributor

@Confectrician Confectrician Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we should directly add additional methods for the different download file names right away.

Please leave the naming part out for now and merge it without the optional filename in the attribute..
I will take care of setting up proper names and assign me to the issue.

</div>
</div>
</ol>
Expand All @@ -173,12 +173,12 @@ usermod -a -G openhab myownuser
<li>Install a recent Java 11 platform (we recommend <a target="_blank" href="https://www.azul.com/downloads/zulu-community/?version=java-11-lts&package=jdk">the Zulu builds of OpenJDK</a>)</li>
<li>Download and extract the openHAB runtime distribution:</li>
<div class="download-button-container">
<a class="download-button big" :href="runtimeDownloadLink">Download openHAB {{currentDownloadVersion}} {{currentVersionLabel}} Runtime</a>
<a class="download-button big" :href="runtimeDownloadLink" download>Download openHAB {{currentDownloadVersion}} {{currentVersionLabel}} Runtime</a>
</div>
<li><strong>(Optional)</strong> Download the add-on archives for offline use and put them in the <code>addons</code> folder of the extracted distribution:</li>
&#128712; <small> You don't need the add-ons archives if your machine has Internet access, openHAB will download add-ons you need online as necessary.</small>
<div class="download-button-container">
<a class="download-button" style="margin-bottom: 0" :href="addonsDownloadLink">Download openHAB {{currentDownloadVersion}} {{currentVersionLabel}} Add-ons</a>
<a class="download-button" style="margin-bottom: 0" :href="addonsDownloadLink" download>Download openHAB {{currentDownloadVersion}} {{currentVersionLabel}} Add-ons</a>
</div>
<li v-if="selectedSystem === 'apple'">
Open <em>System Preferences &gt; Keyboard &gt; Shortcuts</em> and check the <em>New Terminal at Folder</em> option under <em>Services</em>:<br />
Expand All @@ -204,12 +204,12 @@ usermod -a -G openhab myownuser
<li>Install a recent Java 17 platform (we recommend <a target="_blank" href="https://www.azul.com/downloads/zulu-community/?version=java-17-lts&package=jdk">the Zulu builds of OpenJDK</a>)</li>
<li>Download and extract the distribution from <a href="https://ci.openhab.org/">https://ci.openhab.org/</a>:</li>
<div class="download-button-container">
<a target="_blank" class="download-button big" :href="`https://ci.openhab.org/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab/target/openhab-4.0.0-SNAPSHOT.zip`">Latest openHAB {{$page.frontmatter.currentSnapshotVersion}} Build</a>
<a target="_blank" class="download-button big" :href="`https://ci.openhab.org/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab/target/openhab-4.0.0-SNAPSHOT.zip`" download>Latest openHAB {{$page.frontmatter.currentSnapshotVersion}} Build</a>
</div>
<li><strong>(Optional)</strong> Download the add-on archives for offline use and put them in the <code>addons</code> folder of the extracted distribution:</li>
&#128712; <small> You don't need the add-ons archives if your machine has Internet access, openHAB will download add-ons you need online as necessary.</small>
<div class="download-button-container">
<a class="download-button" style="margin-bottom: 0" :href="`https://ci.openhab.org/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-addons/target/openhab-addons-4.0.0-SNAPSHOT.kar`">Download openHAB {{$page.frontmatter.currentSnapshotVersion}} Add-ons</a>
<a class="download-button" style="margin-bottom: 0" :href="`https://ci.openhab.org/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-addons/target/openhab-addons-4.0.0-SNAPSHOT.kar`" download>Download openHAB {{$page.frontmatter.currentSnapshotVersion}} Add-ons</a>
</div>
</ol>
</div>
Expand Down