Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use front matter loader to import markdown content, start on switchin… #1

Merged
merged 1 commit into from
Jun 27, 2018
Merged
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
5 changes: 5 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ module.exports = {
exclude: /(node_modules)/
});
}

config.module.rules.push({
test: /\.md$/,
use: ['json-loader', 'yaml-frontmatter-loader']
});
}
}
};
112 changes: 111 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"*.{json,css,scss}": ["prettier --write", "git add"]
},
"dependencies": {
"@nuxtjs/markdownit": "^1.2.1",
"normalize.scss": "^0.1.0",
"nuxt": "^1.0.0",
"vue-smooth-scroll": "^1.0.13"
Expand All @@ -39,6 +40,7 @@
"prettier": "^1.12.1",
"pug": "^2.0.3",
"pug-loader": "^2.4.0",
"sass-loader": "^7.0.1"
"sass-loader": "^7.0.1",
"yaml-frontmatter-loader": "^0.1.0"
}
}
44 changes: 22 additions & 22 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
div
header.hero
.hero-inner
h1 contents.hero.title
p.type-featured contents.hero.dek
h1 {{ contents.hero.title }}
p.type-featured {{ contents.hero.dek }}
form.js-ajax-form.hero-signup(name='Quick Signup Form')
.form-input
label(for='hero-signup').sr-only Enter your email address
Expand All @@ -15,19 +15,18 @@ div
strong Thanks! You'll hear from us soon.
section#hack-nights.content-section.section-hack-nights
.page-contain
h2 contents.location.title
div contents.location.dek
h2 {{ contents.location.title }}
div {{ contents.location.dek }}
.locations
//- each location in contents.location.locations
//- .location
//- .location-img(style=`background-image: url("${location.image}")`)
//- .location-details
//- h3.location-header
//- strong= location.title
//- | #{location.date}
//- address.
//- #{location.address1}#[br]
//- #{location.address2}, #{location.city}, #{location.state} #{location.zip}
.location(v-for='location in contents.location.locations')
.location-img(:style='{ "background-image": `url(${location.image})` }')
.location-details
h3.location-header
strong {{ location.title }}
| {{ location.date }}
address.
{{ location.address1 }}#[br]
{{ location.address2 }}, {{ location.city }}, {{ location.state }} {{ location.zip }}
p
a(href='https://www.meetup.com/hackforla/',
target='_blank').btn.btn-primary RSVP on Meetup
Expand Down Expand Up @@ -76,9 +75,9 @@ div
section#press.content-section.press
.page-contain
blockquote.quote
p contents.testimonial.quote
cite.type-h4 contents.testimonial.source
img(src=`contents.testimonial.image`).quote-tmb
p {{ contents.testimonial.quote }}
cite.type-h4 {{ contents.testimonial.source }}
img(:src='contents.testimonial.image').quote-tmb
h2 Press
ul.news-cards.unstyled-list
//- each item in contents.press
Expand All @@ -91,8 +90,8 @@ div

section#about.content-section.about
.page-contain
h2 contents.about.title
| contents.about.dek
h2 {{ contents.about.title }}
| {{ contents.about.dek }}
#contact
h3 Contact Us
p.
Expand Down Expand Up @@ -124,11 +123,12 @@ div
</template>

<script>
import AppLogo from '~/components/AppLogo.vue';
import content from '~/static/content/index.md';

export default {
components: {
AppLogo
components: {},
data: function() {
return { contents: content.attributes };
}
};
</script>
Expand Down
Loading