From 6dd7024672c3ace4c8244efc5e0130ae19ac3915 Mon Sep 17 00:00:00 2001 From: Steve Hull <50039+sdhull@users.noreply.github.com> Date: Wed, 28 Nov 2018 20:27:52 -0800 Subject: [PATCH 1/2] Add .nvmrc file for those of us using it Adding .nvmrc file is a noop for people who don't use nvm. But for those of use using nvm, declaring the target version of node for this project is very helpful. --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..6b35194 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/boron From a476a091f1974437d2217eb2dcad919740dac25e Mon Sep 17 00:00:00 2001 From: Steve Hull <50039+sdhull@users.noreply.github.com> Date: Wed, 28 Nov 2018 20:31:56 -0800 Subject: [PATCH 2/2] Add a link to edit the current page on github Appropriates the pencil svg from Ember API docs. Sends users to the `/edit/master` github page for the current markdown file in a new window. --- app/components/edit-link/component.js | 5 +++++ app/components/edit-link/template.hbs | 11 +++++++++++ app/routes/application.js | 4 ++-- app/routes/page.js | 5 +++-- app/styles/app.css | 1 + app/styles/components/edit-link.css | 5 +++++ app/templates/components/main-nav.hbs | 1 + app/templates/index.hbs | 4 ++-- app/templates/page.hbs | 4 ++-- 9 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 app/components/edit-link/component.js create mode 100644 app/components/edit-link/template.hbs create mode 100644 app/styles/components/edit-link.css diff --git a/app/components/edit-link/component.js b/app/components/edit-link/component.js new file mode 100644 index 0000000..e3ac4fb --- /dev/null +++ b/app/components/edit-link/component.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + tagName: '', +}); diff --git a/app/components/edit-link/template.hbs b/app/components/edit-link/template.hbs new file mode 100644 index 0000000..a888f4d --- /dev/null +++ b/app/components/edit-link/template.hbs @@ -0,0 +1,11 @@ + + + diff --git a/app/routes/application.js b/app/routes/application.js index c907276..f5bef52 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -4,6 +4,6 @@ import markdownFiles from 'ember-fr-markdown-file/markdownFiles'; export default Route.extend({ model() { - return get(markdownFiles, 'intro'); - } + return {markdown: get(markdownFiles, 'intro'), path: 'intro'}; + }, }); diff --git a/app/routes/page.js b/app/routes/page.js index 5441eb2..353aa92 100644 --- a/app/routes/page.js +++ b/app/routes/page.js @@ -4,6 +4,7 @@ import markdownFiles from 'ember-fr-markdown-file/markdownFiles'; export default Route.extend({ model(params) { - return get(markdownFiles, params.path.replace(/\//g, '.')) || null; - } + const path = params.path; + return {markdown: get(markdownFiles, path.replace(/\//g, '.')) || null, path}; + }, }); diff --git a/app/styles/app.css b/app/styles/app.css index 1298318..dad2a28 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -8,6 +8,7 @@ @import "components/main-hero"; @import "components/main-hero-terminal"; @import "components/main-nav"; +@import "components/edit-link"; @import "components/syntax"; :root { diff --git a/app/styles/components/edit-link.css b/app/styles/components/edit-link.css new file mode 100644 index 0000000..1a64ec5 --- /dev/null +++ b/app/styles/components/edit-link.css @@ -0,0 +1,5 @@ +.edit-link { + width: 20px; + text-decoration: none; + border-bottom: none; +} diff --git a/app/templates/components/main-nav.hbs b/app/templates/components/main-nav.hbs index daf0bfe..0cac925 100644 --- a/app/templates/components/main-nav.hbs +++ b/app/templates/components/main-nav.hbs @@ -1,4 +1,5 @@ {{fastboot-logo}} +{{edit-link path=path}}