Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
updated nuxtent to latest PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alid Castano authored and Alid Castano committed Sep 23, 2017
2 parents 8474a4f + 0222f02 commit 1d700fa
Show file tree
Hide file tree
Showing 47 changed files with 617 additions and 451 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
lib/plugins/nuxtentBodyComponent.template.js
dist/
nuxt/
28 changes: 28 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"root": true,
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
},
"env": {
"node": true,
"es6": true
},
"plugins": [
"babel",
"ava"
],
"extends": [
"eslint-config-standard",
"eslint-config-i-am-meticulous",
"plugin:ava/recommended",
"eslint-config-prettier"
],
"rules": {
"curly": [
"error",
"all"
]
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Nuxtent

[![js-standard-style](https://cdn.rawgit.com/standard/standard/master/badge.svg)](http://standardjs.com)

The goal of Nuxtent is to make using Nuxt for content heavy sites as easy as using Jekyll, Hugo, or any other static site generator.

It does in two main ways:
Expand Down
14 changes: 7 additions & 7 deletions docs/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ module.exports = {
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Nuxtent Documentation' }
{
hid: 'description',
name: 'description',
content: 'Nuxtent Documentation'
}
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
},
modules: [
'nuxtent'
],
modules: ['nuxtent'],
css: [
'prismjs/themes/prism-coy.css',
{ src: '~/assets/sass/base.sass', lang: 'sass' }
Expand Down
28 changes: 16 additions & 12 deletions docs/nuxtent.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,33 @@ module.exports = {
page: 'guide/_slug',
permalink: ':slug',
isPost: false,
generate: [
'get',
'getAll'
]
generate: ['get', 'getAll']
},

parsers: {
md: {
highlight: (code, lang) => {
return Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)
return Prism.highlight(
code,
Prism.languages[lang] || Prism.languages.markup
)
},
use: [
[externalLinks, {
target: '_blank',
rel: 'noopener'
}]
[
externalLinks,
{
target: '_blank',
rel: 'noopener'
}
]
]
}
},

api: {
baseURL: process.env.NODE_ENV === 'production'
? 'https://nuxtent.now.sh'
: 'http://localhost:3000'
baseURL:
process.env.NODE_ENV === 'production'
? 'https://nuxtent.now.sh'
: 'http://localhost:3000'
}
}
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"markdown-it-link-attributes": "^1.0.0",
"nuxt": "1.0.0-alpha.3",
"nuxtent": "0.2.59",
"prismjs": "^1.6.0"
"prismjs": "^1.8.1"
},
"scripts": {
"dev": "nuxt",
Expand Down
5 changes: 5 additions & 0 deletions examples/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
rules: {
"import/no-unresolved": 0
}
}
6 changes: 2 additions & 4 deletions examples/content-navigation/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ module.exports = {
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Nuxt.js project' }
],
]
},
modules: [
'nuxtent'
]
modules: ['nuxtent']
}
2 changes: 1 addition & 1 deletion examples/content-navigation/nuxtent.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
content: {
page: '/guide/_slug',
permalink: ":slug",
permalink: ':slug',
isPost: false
}
}
2 changes: 1 addition & 1 deletion examples/content-navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"private": true,
"dependencies": {
"@nuxtjs/axios": "^2.2.1",
"nuxt": "^1.0.0-alpha.4",
"nuxt": "latest",
"nuxtent": "latest"
},
"scripts": {
Expand Down
6 changes: 2 additions & 4 deletions examples/custom-build/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ module.exports = {
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Nuxt.js project' }
],
]
},
modules: [
'nuxtent'
]
modules: ['nuxtent']
}
20 changes: 13 additions & 7 deletions examples/custom-build/nuxtent.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
const Prism = require('prismjs')

module.exports = {
content: { // basic content configuration
content: {
// basic content configuration
permalink: ':slug',
isPost: false
},

parser: { // custom parser options
parser: {
// custom parser options
md: {
highlight: (code, lang) => {
return Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)
return Prism.highlight(
code,
Prism.languages[lang] || Prism.languages.markup
)
}
}
},

api: { // custom url for development and production builds
baseURL: process.env.NODE_ENV ?
'https://production-url.now.sh' :
'http://localhost:3000'
api: {
// custom url for development and production builds
baseURL: process.env.NODE_ENV
? 'https://production-url.now.sh'
: 'http://localhost:3000'
}
}
18 changes: 18 additions & 0 deletions examples/custom-build/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "nuxtent-example",
"version": "1.0.0",
"description": "nuxtent custom-build example",
"author": "Alid Castano <[email protected]>",
"dependencies": {
"@nuxtjs/axios": "^2.2.1",
"nuxt": "latest",
"nuxtent": "latest",
"prismjs": "^1.8.1"
},
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxtent generate"
}
}
4 changes: 1 addition & 3 deletions examples/i18n/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module.exports = {
loading: { color: 'cyan' },
modules: [
'nuxtent'
]
modules: ['nuxtent']
}
5 changes: 1 addition & 4 deletions examples/i18n/nuxtent.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ const contentOptions = {
}

module.exports = {
content: [
['en', contentOptions],
['fe', contentOptions]
]
content: [['en', contentOptions], ['fe', contentOptions]]
}
2 changes: 1 addition & 1 deletion examples/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"dependencies": {
"@nuxtjs/axios": "^3.1.4",
"nuxt": "latest",
"nuxtent": "file:///Users/acastano/Sites/nuxt/nuxtent"
"nuxtent": "latest"
},
"scripts": {
"dev": "nuxt",
Expand Down
23 changes: 7 additions & 16 deletions examples/markdown-components/content/HelloWorld.comp.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Hello World!
title: Markdown Component Demo!
---

### Here's my demo:
Expand All @@ -10,24 +10,15 @@ title: Hello World!

Template:

So it works on client side renderning but not on refresh...

```html
<div>
<h1> {{ name }}</h1>
<button @click="someMethod"> Click here! </h1>
</div>
```
<template>
<div> <h1> {{ name || 'Hello World!!' }}</h1></div>
</template>
Script:
```js
<script>
export default {
props: ['name'],
methods: {
someMethod () {
return this.name
}
}
props: ['name']
}
</script>
```
4 changes: 1 addition & 3 deletions examples/markdown-components/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module.exports = {
modules: [
'nuxtent'
]
modules: ['nuxtent']
}
4 changes: 2 additions & 2 deletions examples/markdown-components/nuxtent.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
content: {
page: '/_slug',
permalink: "/:slug",
permalink: '/:slug',
isPost: false,
generate: ['get']
generate: ['get', 'getAll']
}
}
6 changes: 3 additions & 3 deletions examples/markdown-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"private": true,
"dependencies": {
"@nuxtjs/axios": "^2.2.1",
"nuxt": "^1.0.0-alpha.3",
"nuxtent": "file:///Users/acastano/Sites/nuxt/nuxtent"
"nuxt": "1.0.0-rc11",
"nuxtent": "latest"
},
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
"generate": "nuxtent generate"
}
}
20 changes: 4 additions & 16 deletions examples/markdown-components/pages/_slug.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
<template>
<div>
<h1> Markdown Component </h1>
<h1> {{ post.title }} </h1>
<div>
<h1>{{ post.title }}</h1>
<nuxtent-body v-if="isObject(post.body)" :body="post.body" />
<div v-else v-html="post.body" />
<!-- <ContentComp /> -->
<nuxtent-body :body="post.body" />
</div>
</div>
</template>

<script>
export default {
async asyncData ({ app, route, payload }) {
async asyncData ({ app, route }) {
return {
post: payload || await app.$content('/').get(route.params.slug)
post: await app.$content('/').get(route.params.slug)
}
},
methods: {
isObject (body) {
return typeof body === 'object'
}
},
components: {
// ContentComp: () => import('~/content/HelloWorld.comp.md')
}
}
</script>
4 changes: 1 addition & 3 deletions examples/multiple-content-types/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module.exports = {
modules: [
'nuxtent'
]
modules: ['nuxtent']
}
Loading

0 comments on commit 1d700fa

Please sign in to comment.