mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-13 09:07:44 +02:00
docs: add version dropdown
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
1e4496c2b9
commit
7cef246d53
8 changed files with 173 additions and 165 deletions
|
@ -5,12 +5,6 @@
|
|||
<DropdownLink v-if="item.type === 'links'" :item="item" />
|
||||
<NavLink v-else :item="item" />
|
||||
</div>
|
||||
|
||||
<!-- repo link -->
|
||||
<a v-if="repoLink" :href="repoLink" class="repo-link" target="_blank" rel="noopener noreferrer">
|
||||
{{ repoLabel }}
|
||||
<OutboundLink />
|
||||
</a>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
|
@ -65,31 +59,6 @@ export default {
|
|||
items: (link.items || []).map(resolveNavLinkItem)
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
repoLink() {
|
||||
const { repo } = this.$site.themeConfig;
|
||||
if (repo) {
|
||||
return /^https?:/.test(repo) ? repo : `https://github.com/${repo}`;
|
||||
}
|
||||
},
|
||||
|
||||
repoLabel() {
|
||||
if (!this.repoLink) return;
|
||||
if (this.$site.themeConfig.repoLabel) {
|
||||
return this.$site.themeConfig.repoLabel;
|
||||
}
|
||||
|
||||
const repoHost = this.repoLink.match(/^https?:\/\/[^/]+/)[0];
|
||||
const platforms = ["GitHub", "GitLab", "Bitbucket"];
|
||||
for (let i = 0; i < platforms.length; i++) {
|
||||
const platform = platforms[i];
|
||||
if (new RegExp(platform, "i").test(repoHost)) {
|
||||
return platform;
|
||||
}
|
||||
}
|
||||
|
||||
return "Source";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue