Skip to content

Instantly share code, notes, and snippets.

@dnlvgl
Created July 25, 2019 07:57
Show Gist options
  • Save dnlvgl/9dc9d211a7fcce4970586f35970440aa to your computer and use it in GitHub Desktop.
Save dnlvgl/9dc9d211a7fcce4970586f35970440aa to your computer and use it in GitHub Desktop.
<template>
<div>
<ol>
<li v-for="doc in docs">
<router-link :to="doc.path">{{ doc.title }}</router-link>
</li>
</ol>
</div>
</template>
<script>
export default {
name: "DocList",
computed: {
docs() {
const pages = this.$site.pages
.filter(x => x.regularPath.startsWith("/docs/code/"))
.sort((a,b) => (a.title > b.title) ? 1 : ((b.title > a.title) ? -1 : 0));
return pages;
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment