Skip to content
Merged
Show file tree
Hide file tree
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
41 changes: 0 additions & 41 deletions scripts/spin.rhai

This file was deleted.

43 changes: 11 additions & 32 deletions static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ parcelHelpers.export(exports, "searchButton", ()=>searchButton);
parcelHelpers.export(exports, "searchModal", ()=>searchModal);
const { el , mount , text , list , setChildren , setStyle , setAttr } = redom;
const projectList = [
"Spin",
"Wasm Functions",
"Cloud",
"Bartholomew"
];
Expand All @@ -659,21 +659,6 @@ async function setupSearch() {
let currentPath = window.location.pathname;
let splitPath = currentPath.split("/");
let version = splitPath[2];
if (version == "v1") documents = documents.filter((k)=>{
if (k.project != "spin") return true;
return k.url.includes("spin/v1/");
});
else if (version == "v2") documents = documents.filter((k)=>{
if (k.project != "spin") return true;
return k.url.includes("spin/v2/");
});
else if (version == "v3") documents = documents.filter((k)=>{
if (k.project != "spin") return true;
return k.url.includes("spin/v3/");
});
else documents = documents.filter((k)=>{
return k.project != "spin" || k.url.includes("spin/v3/");
});
idx = lunr(function() {
this.field("title");
this.field("subheading");
Expand Down Expand Up @@ -865,22 +850,22 @@ class ModalSuggest {
constructor(){
this.projectData = [
{
project: "Spin",
project: "Wasm Functions",
link1: [
"Install",
"/spin/install"
"Quickstart",
"/wasm-functions/quickstart"
],
link2: [
"Quickstart",
"/spin/quickstart/"
"Deploy",
"/wasm-functions/deploy"
],
link3: [
"Develop",
"/spin/developing"
"Support",
"/wasm-functions/support"
],
link4: [
"Deploy",
"/spin/deploying-to-fermyon/"
"FAQ",
"/wasm-functions/faq"
]
},
{
Expand Down Expand Up @@ -1250,15 +1235,9 @@ class multiTabBlockHandler {
return k.dataset.title;
});
this.active = this.langs.indexOf(activeValue);
if (tabClass != "spin-version") this.active = this.active > 0 ? this.active : 0;
else this.active = this.active > 0 ? this.active : this.nodes.length - 1;
this.active = this.active > 0 ? this.active : 0;
this.tabs = list("ul", codeblockLanguageTab, null, this.ChildEventHandler.bind(this));
this.el = el("div.tabs.is-boxed", this.tabs);
// If the tabClass is `spin-version` reverse the order of the list
if (tabClass === "spin-version") setStyle(this.tabs, {
display: "flex",
"flex-direction": "row-reverse"
});
this.tabs.update(this.langs, {
active: this.active
});
Expand Down
12 changes: 1 addition & 11 deletions static/js/src/modules/multiTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,9 @@ class multiTabBlockHandler {
this.nodes = Array.from(nodes)
this.langs = this.nodes.map(k => { return k.dataset.title })
this.active = this.langs.indexOf(activeValue)
if (tabClass != "spin-version") {
this.active = this.active > 0 ? this.active : 0
} else {
this.active = this.active > 0 ? this.active : this.nodes.length - 1
}
this.active = this.active > 0 ? this.active : 0
this.tabs = list("ul", codeblockLanguageTab, null, this.ChildEventHandler.bind(this))
this.el = el("div.tabs.is-boxed", this.tabs)

// If the tabClass is `spin-version` reverse the order of the list
if (tabClass === "spin-version") {
setStyle(this.tabs, { display: "flex", "flex-direction": "row-reverse" })
}

this.tabs.update(this.langs, { active: this.active })
this.updateTabContent(this.active)
}
Expand Down
43 changes: 7 additions & 36 deletions static/js/src/modules/search.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { el, mount, text, list, setChildren, setStyle, setAttr } = redom;

const projectList = ["Spin", "Cloud", "Bartholomew"];
const projectList = ["Wasm Functions", "Cloud", "Bartholomew"];
const versionPattern = /^v\d+$/;
let idx;
let documents;
Expand All @@ -15,41 +15,12 @@ async function getSearchIndex() {
}

//
// This function filters and builds the search index, based on which project is selected (Spin v1, V2, V3, Cloud, Etc.),
// This function filters and builds the search index, based on which project is selected (Wasm Functions, Cloud, Etc.),
//
async function setupSearch() {
documents = await getSearchIndex();
let currentPath = window.location.pathname;
let splitPath = currentPath.split("/");
let version = splitPath[2];
// Adds spin/v1, spin/v2 or spin/v3 based on current path.
// If not on a spin project (e.g., cloud), add spin/v3 (latest)
if (version == "v1") {
documents = documents.filter((k) => {
if (k.project != "spin") {
return true;
}
return k.url.includes("spin/v1/");
});
} else if (version == "v2") {
documents = documents.filter((k) => {
if (k.project != "spin") {
return true;
}
return k.url.includes("spin/v2/");
});
} else if (version == "v3") {
documents = documents.filter((k) => {
if (k.project != "spin") {
return true;
}
return k.url.includes("spin/v3/");
});
} else {
documents = documents.filter((k) => {
return k.project != "spin" || k.url.includes("spin/v3/");
});
}

idx = lunr(function () {
this.field("title");
Expand Down Expand Up @@ -271,11 +242,11 @@ class ModalSuggest {
constructor() {
this.projectData = [
{
project: "Spin",
link1: ["Install", "/spin/install"],
link2: ["Quickstart", "/spin/quickstart/"],
link3: ["Develop", "/spin/developing"],
link4: ["Deploy", "/spin/deploying-to-fermyon/"],
project: "Wasm Functions",
link1: ["Quickstart", "/wasm-functions/quickstart"],
link2: ["Deploy", "/wasm-functions/deploy"],
link3: ["Support", "/wasm-functions/support"],
link4: ["FAQ", "/wasm-functions/faq"],
},
{
project: "Cloud",
Expand Down
2 changes: 1 addition & 1 deletion templates/404.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 class="blog-post-title border-bottom">The page does not exist!</h1>


<p> Find your way back to the <a href="/">homepage</a> or the <a href="/spin">Spin docs</a> or the <a href="/cloud"> Fermyon Cloud docs</a></p>
<p> Find your way back to the <a href="/">homepage</a> or the <a href="/wasm-functions">Fermyon Wasm Functions docs</a> or the <a href="/cloud"> Fermyon Cloud docs</a></p>
1 change: 0 additions & 1 deletion templates/changelog.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ read_pages_glob = ["cloud/changelog/*.md"]
Projects
</p>
<ul class="menu-list">
<li><a href="/spin/index">Spin</a></li>
<li><a href="/cloud/index">Fermyon Cloud</a></li>
<li><a href="/bartholomew/index">Bartholomew</a></li>
</ul>
Expand Down
2 changes: 0 additions & 2 deletions templates/common_sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Index
</p>
<ul class="menu-list">
<li><a {{#if (active_content request.spin-path-info "/spin/index" )}} class="active" {{/if}} href="{{site.info.base_url}}/spin/">Spin</a></li>
<li><a {{#if (active_content request.spin-path-info "/cloud/index" )}} class="active" {{/if}} href="{{site.info.base_url}}/cloud/">Cloud</a></li>
<li><a {{#if (active_content request.spin-path-info "/bartholomew/index" )}} class="active" {{/if}} href="{{site.info.base_url}}/bartholomew/">Bartholomew</a></li>
</ul>
Expand All @@ -21,7 +20,6 @@
</p>
<ul class="menu-list">
<li><a {{#if (active_content request.spin-path-info "/common/contributing-docs" )}} class="active" {{/if}} href="{{site.info.base_url}}/common/contributing-docs">Contributing to Docs</a></li>
<li><a {{#if (active_content request.spin-path-info "/spin/contributing-spin" )}} class="active" {{/if}} href="{{site.info.base_url}}/spin/contributing-spin">Contributing to Spin</a></li>
<li><a {{#if (active_content request.spin-path-info "/bartholomew/contributing-bartholomew" )}} class="active" {{/if}} href="{{site.info.base_url}}/bartholomew/contributing-bartholomew">Contributing to Bartholomew</a></li>
</ul>

Expand Down
20 changes: 7 additions & 13 deletions templates/content_navbar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,19 @@
<div class="navbar-start">
<div class="navbar-item has-dropdown is-hoverable">
<!-- show the active project name -->
{{#if (active_project request.spin-full-url "/spin/" )}}
{{#if (active_project request.spin-full-url "/cloud/" )}}
<a class="navbar-link is-active is-hoverable">
<span>Spin</span>
<span>Cloud</span>
</a>
{{else}}
{{#if (active_project request.spin-full-url "/cloud/" )}}
{{#if (active_project request.spin-full-url "/wasm-functions/" )}}
<a class="navbar-link is-active is-hoverable">
<span>Cloud</span>
<span>Wasm Functions</span>
</a>
Comment on lines +48 to 56
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to present cloud as the top option in the drop down. I do not have strong feelings about this but just wanted to check. oh, I also see it just keeps the same structure as before.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, same order remains; just removed Spin.

{{else}}
{{#if (active_project request.spin-full-url "/wasm-functions/" )}}
<a class="navbar-link is-active is-hoverable">
<span>Wasm Functions</span>
</a>
{{else}}
<a class="navbar-link is-hoverable">
<span>Docs</span>
</a>
{{/if}}
<a class="navbar-link is-hoverable">
<span>Docs</span>
</a>
{{/if}}
{{/if}}

Expand Down
2 changes: 0 additions & 2 deletions templates/home.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ read_pages_glob = ["events/*.md"]
Projects
</p>
<ul class="menu-list">
<li><a href="/spin/index" {{#if (active_project request.spin-path-info "/spin/" )}}
class="is-active" {{/if}}>Spin</a></li>
<li><a href="/cloud/index" {{#if (active_project request.spin-path-info "/cloud/" )}}
class="is-active" {{/if}}>Cloud</a></li>
<li><a href="/wasm-functions/index" {{#if (active_project request.spin-path-info "/wasm-functions/" )}}
Expand Down
4 changes: 0 additions & 4 deletions templates/main.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
<div class="columns">

{{! This adds the sidebar }}
{{#if (active_project request.spin-path-info "/spin/" )}}
{{> spin_sidebar }}
{{else}}
{{#if (active_project request.spin-path-info "/cloud/" )}}
{{> cloud_sidebar }}
{{else}}
{{#if (active_project request.spin-path-info "/bartholomew/" )}}
{{> bartholomew_sidebar }}
{{/if}}
{{/if}}
{{/if}}

<article class="column content content-docs content-docs-wide">
<section id="type">
Expand Down
21 changes: 0 additions & 21 deletions templates/page_lang.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,11 @@
{{! This adds the sidebar }}
<div class="menu-wrap is-narrow is-fixed-desktop" id="docsMenu">
<aside class="menu">
{{! This adds the version selector - uncomment after v2 launch }}
<select class="version-dropdown"
onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);">
<option value="/spin/v2/index">Spin v2.x</option>
<option value="/spin/v1/index" {{#if (active_project request.spin-full-url "/spin/v1/" )}} selected
{{/if}}>Spin v1.x</option>
</select>
{{#if (active_project request.spin-full-url "/spin/v3/" )}}
{{> spin_sidebar_v3 }}
{{else}}
{{#if (active_project request.spin-full-url "/spin/v2/" )}}
{{> spin_sidebar_v2 }}
{{else}}
{{> spin_sidebar }}
{{/if}}
{{/if}}
</aside>
</div>

<article class="column content content-docs content-docs-wide">
<section id="type">
{{! This adds an archival notice - needs to styled }}
{{#if (active_project request.spin-full-url "/spin/v1" )}}
<div class="archived-notice"> This page refers to an older version of Spin. <a href="/spin">Go to the
latest version.</a></div>
{{/if}}
<h1 class="blog-post-title border-bottom">{{page.head.title}}</h1>

<p class="subtitle is-size-6 backlink"><a href="{{site.info.base_url}}/wasm-languages/webassembly-language-support"> &larr; Back to Language Index</a></p>
Expand Down
5 changes: 0 additions & 5 deletions templates/sitemap.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@ For date/time format, see https://www.w3.org/TR/NOTE-datetime
<loc>https://developer.fermyon.com{{uri}}</loc>
{{/if}}
{{#if page.head.date }}<lastmod>{{date_format "%Y-%m-%dT%H:%M:%SZ" page.head.date}}</lastmod>{{/if}}
{{#if (active_project uri "/spin/v1" )}}
<changefreq>weekly</changefreq>
<priority>0.5</priority>
{{else}}
<changefreq>daily</changefreq>
<priority>1</priority>
{{/if}}
</url>
{{/each}}
</urlset>
Loading
Loading