Add 'Improve this Tutorial' link

pull/2143/head
Brian Hann 7 years ago
parent 5563b3781e
commit c6076be5e6

@ -45,7 +45,12 @@
}); });
}); });
// TODO: this will need to be changed to the master branch, and probably should be dynamic instead of included
// here statically
const tutorial_repo_link = 'https://github.com/sveltejs/svelte/tree/restructure-docs/site/content/tutorial';
$: selected = lookup.get(slug); $: selected = lookup.get(slug);
$: improve_link = `${tutorial_repo_link}/${selected.chapter.section_dir}/${selected.chapter.chapter_dir}/text.md`;
// TODO once reactive values are fixed // TODO once reactive values are fixed
// $: app = { // $: app = {
@ -159,10 +164,10 @@
.controls { .controls {
border-top: 1px solid rgba(255,255,255,0.1); border-top: 1px solid rgba(255,255,255,0.1);
padding: 1em 0 0 0; padding: 1em 0 0 0;
display: flex;
} }
.show { .show {
float: left;
text-transform: uppercase; text-transform: uppercase;
background: rgba(255,255,255,0.1); background: rgba(255,255,255,0.1);
padding: 0.2em 0.7em; padding: 0.2em 0.7em;
@ -178,8 +183,25 @@
} }
a.next { a.next {
float: right; margin-left: auto;
text-decoration: none;
}
.improve-chapter {
text-align: center;
padding: 1em 0 .5em 0;
}
.improve-chapter > a {
font-size: 0.6em;
text-decoration: none; text-decoration: none;
border-radius: 0.7em;
background: rgba(255,255,255,0.1);
padding: 0.2em 0.7em;
}
.improve-chapter > a:hover {
background: rgba(255,255,255,0.2);
} }
</style> </style>
@ -205,6 +227,10 @@
<a class="next" href="tutorial/{selected.next.slug}">Next <Icon name="arrow-right" /></a> <a class="next" href="tutorial/{selected.next.slug}">Next <Icon name="arrow-right" /></a>
{/if} {/if}
</div> </div>
<div class="improve-chapter">
<a href={improve_link}>Improve this Tutorial</a>
</div>
</div> </div>
</div> </div>

@ -26,7 +26,9 @@ function get_sections() {
return { return {
slug, slug,
title: metadata.title title: metadata.title,
section_dir: dir,
chapter_dir: tutorial,
}; };
}) })
} }

Loading…
Cancel
Save