Giter Club home page Giter Club logo

blog-module's Introduction

Blog

Create a blog with nuxt.

Setup

  • Add @nuxtjs/blog dependency using yarn or npm to your project
  • Add @nuxtjs/blog module to nuxt.config.js:
    modules: [{
        src: '@nuxtjs/blog',
    }]

Usage

Put your markdown articles/posts in blog directory in project root.

blog-module's People

Contributors

bayssmekanique avatar shortdiv avatar znck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blog-module's Issues

How?

Hello
Does this support categories/tags?
Any conventions on how to write the .md files?

This question is available on Nuxt community (#c9)

Support for static sites

This module works very well when I'm running in development mode, but when I go to generate a static site, there are a few issues that I've noticed.

  1. Navigating directly to a post via address works great, however, navigating to a post through any link makes a call to /api/blog/posts/{slug} which doesn't exist.
  2. Webpack does produce static JSON files which correspond to the /api/blog/posts/{slug} calls, but they are nested inside the public path directory (/_nuxt) and they have a .json extension added.
  3. The .json files are not versioned in any way. This is not a 100% deal breaker, since the corresponding .html files are no versioned either so they can share caching strategies, however it does go against the strategy of assuming everything in the pubilc path directory is versioned and thus can be cached for long periods.
  4. Blog routes do not appear to play well with the @nuxtjs/sitemap module and don't appear within the sitemap.xml file or the sitemap-routes.json file.

In the few days I've spent pulling apart code, I have not been able to figure out a way to resolve any of these issues, as this module is failry large and complex. I appreciate the capabilities but I don't know how useful it is without being able to function as a static file site. I'll continue to work on it as time allows but I would be very interested in knowing if there is some configuration that I'm missing that might make some of these pieces fall into place.

This question is available on Nuxt community (#c6)

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.

This question is available on Nuxt.js community (#c1)

Project status?

Is this actively being used or contributed to? Seems a little stale.

This question is available on Nuxt community (#c5)

How to change default port

I start some app through some port.
package.json is like this.
"scripts": {
"dev": "nuxt -p=4400",
...

So after i installed blog module, i have to chage blog-module.js etc like this.

export default function NuxtModule(options) {
  const defaults = {
    base: 'http://localhost:4450',      <<<<<<<<<<<<<
    comments: false,
    ...

But this file is in node_modules directory.
Can i change above default port at nuxt.config.js ?

This question is available on Nuxt community (#c8)

Broken after update to Nuxt 2

❯ npm run dev

> [email protected] dev /Users/simonwjackson/storage/code/sandbox/nuxt-blog-module-example
> nuxt

   blog:api Listening on /api/blog                                                                                                                                                17:05:11

 ERROR  Cannot destructure property createHash of 'undefined' or 'null'.                                                                                                        17:05:13

  at Object.<anonymous> (node_modules/extract-css-chunks-webpack-plugin/dist/index.js:27:5)
  at Module._compile (internal/modules/cjs/loader.js:689:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
  at Module.load (internal/modules/cjs/loader.js:599:32)
  at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
  at Function.Module._load (internal/modules/cjs/loader.js:530:3)
  at Module.require (internal/modules/cjs/loader.js:637:17)
  at require (internal/modules/cjs/helpers.js:20:18)
  at Object.<anonymous> (node_modules/extract-css-chunks-webpack-plugin/dist/cjs.js:3:18)
  at Module._compile (internal/modules/cjs/loader.js:689:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
  at Module.load (internal/modules/cjs/loader.js:599:32)
  at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
  at Function.Module._load (internal/modules/cjs/loader.js:530:3)
  at Module.require (internal/modules/cjs/loader.js:637:17)
  at require (internal/modules/cjs/helpers.js:20:18)
This question is available on Nuxt community (#c10)

Npm run build fails

Nuxt rc11
Blog-module 0.0.1-6
on build Uglify fails

ERROR in 3.401771ae88b5828911b6.js from UglifyJs
Unexpected token: operator (>) [./node_modules/@nuxtjs/blog/src/app/mixins/api.js:7,0][3.401771ae88b5828911b6.js:111,20]

ERROR in 5.607bddffaeab0f9a14c9.js from UglifyJs
Unexpected token: operator (>) [./node_modules/@nuxtjs/blog/src/app/mixins/api.js:7,0][5.607bddffaeab0f9a14c9.js:100,20]

ERROR in 6.72fb925f626a18a70784.js from UglifyJs
Unexpected token punc «(», expected punc «:» [./node_modules/@nuxtjs/blog/src/app/mixins/collection.js:7,0][6.72fb925f626a18a70784.js:117,17]

ERROR in 7.d3452f4d13ebcec5cc93.js from UglifyJs
Unexpected token punc «(», expected punc «:» [./node_modules/@nuxtjs/blog/src/app/mixins/blog.js:6,0][7.d3452f4d13ebcec5cc93.js:77,17]

Looks like the code in the mixins is not run through babel before uglify tries to do what it needs to do, therefore is fails because it does not recognize the es6 arrow functions

This question is available on Nuxt.js community (#c2)

Improve documentation

Could the documentation be improved please? This seems to be a lot more powerful than the README suggests but I'm not sure what the options do exactly or how I can customize the HTML outputted for each post preview, for example.

This question is available on Nuxt.js community (#c3)

Issue with Nuxt 2.8.0?

There seems to be an issue running this module with Nuxt 2.8.0

/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/neo-async/async.js:16
    throw new Error('Callback was already called.');
    ^

Error: Callback was already called.
    at throwError (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/neo-async/async.js:16:11)
    at /Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/neo-async/async.js:2818:7
    at Compilation.processModuleDependencies (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/lib/Compilation.js:725:4)
    at afterBuild (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/lib/Compilation.js:855:15)
    at buildModule.err (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/lib/Compilation.js:899:11)
    at callback (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/lib/Compilation.js:630:5)
    at module.build.error (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/lib/Compilation.js:678:12)
    at handleParseError (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/lib/NormalModule.js:453:12)
    at doBuild.err (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/lib/NormalModule.js:484:5)
    at runLoaders (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/lib/NormalModule.js:343:12)
    at /Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:43:16)
    at provider (/Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:79:9)
    at /Users/justin.dasilva/Sites/dev/justindasilva/web/node_modules/graceful-fs/graceful-fs.js:90:16
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This question is available on Nuxt community (#c11)

Hello World example.

Can someone be kind enough to give me a hello world example? I don't know how to use the blog-module. Thanks in advanced.

This question is available on Nuxt.js community (#c4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.