Skip to content
Open
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
3 changes: 1 addition & 2 deletions docs/_includes/edit_button.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{% assign pagePath = page.inputPath | replace: "./", "" %}
<a
data-toggle="tooltip"
data-placement="top"
title="Edit this on Github"
class="icon-edit"
href="{{ site.github.repository_url }}/edit/master/docs/{{ pagePath }}"
href="{{ site.github.repository_url }}/edit/master/docs/{{ page.inputPath | formatInputPath }}"
target="_blank"
></a>
10 changes: 6 additions & 4 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,14 @@

<div class="container">

<h1 class="margin-bottom-none">{{ title }}</h1>
{% if edit != false %}
<span class="h1 margin-bottom-none">
<h1 class="margin-bottom-none">{{ title }}

{% if edit != false %}
<span>
{% include edit_button.html %}
</span>
{% endif %}
{% endif %}
</h1>
{% if sub_title %}
<h4>{{ sub_title}}</h4>
{% endif %}
Expand Down
8 changes: 7 additions & 1 deletion docs/eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ module.exports = eleventyConfig => {
eleventyConfig.addGlobalData('permalink', '/{{ page.filePathStem }}.html');

eleventyConfig.addCollection('guides', collectionApi => {
return collectionApi.getFilteredByTag('guides').sort((a, b) => a.data.index - b.data.index);
return collectionApi
.getFilteredByTag('guides')
.sort((a, b) => a.data.index - b.data.index);
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.

What's changed here?

});

eleventyConfig.addCollection('pages', collectionApi => {
Expand All @@ -43,6 +45,10 @@ module.exports = eleventyConfig => {
.sort((a, b) => b.date - a.date || b.inputPath.localeCompare(a.inputPath));
});

eleventyConfig.addFilter("formatInputPath", function(value) {
return value.replace("./", "").replace("_guides", "guides").replace("_posts", "post");
});

eleventyConfig.addFilter('first_paragraph', function(content) {
const marker = '</p>';
const idx = content.indexOf(marker);
Expand Down
Loading