Giter VIP home page Giter VIP logo

next-blog's Introduction

next-blog

Markdown based blog using next. It also uses processmd to compile the markdown files and watch for changes (disclaimer: another project of mine).

Mentioned in Awesome Next JS

Clone this repo and use it as a starting point for your own blog.

next blog screenshot

NOTE: Make sure to run npm run build:content before npm start for the first time.

Install dependencies

npm install

Build content

npm run build:content

Run development server

npm start

Build for production

npm run build

TODO

  • Add RSS feed support

next-blog's People

Contributors

dependabot[bot] avatar pieterdd avatar stephensauceda avatar tscanlin 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  avatar

next-blog's Issues

query parameter not work with latest nextjs

i'm test with build using latest nextjs version, query parameter is not work for load json with current url path

in this case when i click read more (url) to view article details, it work, and have a problem when i reload the article, showing the blank screen

Not rendering latex, processmd set to render latex: true

Not rendering latex, processmd set to render latex: true

Proceeding the installation specifications. I am unable to get the following change to first-post.md to render latex.

$ cat first_post.md
---
title: First post
date: 2017-06-01
---

First post!

Checkout [github to see my other projects](github.com/tscanlin)

[another page](/custom-post)

Math;

$ x = y $

after the change to the post.

I run rm -rf content/summary.json and && npm run build:content

image

Expected
To get mathematical syntax highlight

Cannot find module './content/summary.json'

> [email protected] start /Users/josefranciscoverdugambin/Downloads/next-blog
> node server.js

atom .
Error: Cannot find module './content/summary.json'
    at Function.Module._resolveFilename (module.js:543:15)
    at Function.Module._load (module.js:470:25)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/josefranciscoverdugambin/Downloads/next-blog/next.config.js:1:22)
    at Module._compile (module.js:649:30)
    at Module._compile (/Users/josefranciscoverdugambin/Downloads/next-blog/node_modules/source-map-support/source-map-support.js:483:25)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)

Post pages fail to compile

macOS: 10.12.6
node: 9.5.0
npm: 5.6.0

npm install
npm run build:content
npm start

Index page works fine, clicking on a post yields:

 ERROR  Failed to compile with 79 errors                                11:47:19

These modules were not found:

* fs in ./node_modules/send/index.js, ./node_modules/etag/index.js and 60 others
* module in (webpack)/lib/NormalModule.js, ./node_modules/babel-core/lib/helpers/resolve.js
* child_process in ./node_modules/fsevents/node_modules/osenv/osenv.js, ./node_modules/fsevents/node_modules/uid-number/uid-number.js and 3 others
* tls in ./node_modules/fsevents/node_modules/forever-agent/index.js, ./node_modules/fsevents/node_modules/tunnel-agent/index.js
* net in ./node_modules/fsevents/node_modules/forever-agent/index.js, ./node_modules/fsevents/node_modules/tunnel-agent/index.js and 2 others
* aws-sdk in ./node_modules/fsevents/node_modules/node-pre-gyp/lib/info.js, ./node_modules/fsevents/node_modules/node-pre-gyp/lib/publish.js and 1 other
* readline in ./node_modules/friendly-errors-webpack-plugin/src/output.js

To install them, you can run: npm install --save fs module child_process tls net aws-sdk readline

Ran the suggested command line:

npm install --save fs module net child_process tls readline aws-sdk
npm start

It still can't find fs(?!) or child_process(?!), is this webpack craziness?

 ERROR  Failed to compile with 72 errors                                11:49:14

These modules were not found:

* fs in ./node_modules/send/index.js, ./node_modules/etag/index.js and 65 others
* child_process in ./node_modules/fsevents/node_modules/osenv/osenv.js, ./node_modules/fsevents/node_modules/uid-number/uid-number.js and 3 others

To install them, you can run: npm install --save fs child_process

Alias paths break export

From your boilerplate in custom-post.md:

paths:
  - /custom-post
  - /custom-post-alias
  - /subpath/custom-post-alias

when running npm run build:content and then npm run build:export I get the following error:

> [email protected] export ~/next-blog
> next export && cp -R static/* out/

> using build directory: ~/next-blog/.next
  copying "static" directory
  copying "static build" directory
  launching 11 workers
[=== ] Exporting (1/7)
Error occurred prerendering page "/custom-post": TypeError: Cannot read property 'title' of undefined
    at Index (~/next-blog/.next/server/static/6zaBqk6zC6TNCE7-lIOZ9/pages/post.js:362:92)
    at d (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:498)
    at Za (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:39:16)
    at a.b.render (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:476)
    at a.b.read (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:18)
    at renderToString (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:54:364)
    at render (~/next-blog/node_modules/next/dist/next-server/server/render.js:81:16)
    at renderPage (~/next-blog/node_modules/next/dist/next-server/server/render.js:296:20)
    at ~/next-blog/.next/server/static/6zaBqk6zC6TNCE7-lIOZ9/pages/_document.js:600:17
    at Generator.next (<anonymous>)

Error occurred prerendering page "/custom-post-alias": TypeError: Cannot read property 'title' of undefined
    at Index (~/next-blog/.next/server/static/6zaBqk6zC6TNCE7-lIOZ9/pages/post.js:362:92)
    at d (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:498)
    at Za (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:39:16)
    at a.b.render (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:476)
    at a.b.read (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:18)
    at renderToString (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:54:364)
    at render (~/next-blog/node_modules/next/dist/next-server/server/render.js:81:16)
    at renderPage (~/next-blog/node_modules/next/dist/next-server/server/render.js:296:20)
    at ~/next-blog/.next/server/static/6zaBqk6zC6TNCE7-lIOZ9/pages/_document.js:600:17
    at Generator.next (<anonymous>)

Error occurred prerendering page "/subpath/custom-post-alias": TypeError: Cannot read property 'title' of undefined
    at Index (~/next-blog/.next/server/static/6zaBqk6zC6TNCE7-lIOZ9/pages/post.js:362:92)
    at d (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:498)
    at Za (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:39:16)
    at a.b.render (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:476)
    at a.b.read (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:44:18)
    at renderToString (~/next-blog/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:54:364)
    at render (~/next-blog/node_modules/next/dist/next-server/server/render.js:81:16)
    at renderPage (~/next-blog/node_modules/next/dist/next-server/server/render.js:296:20)
    at ~/next-blog/.next/server/static/6zaBqk6zC6TNCE7-lIOZ9/pages/_document.js:600:17
    at Generator.next (<anonymous>)
Exporting (7/7)
Error: Export encountered errors
    at _default (~/next-blog/node_modules/next/dist/export/index.js:15:734)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm ERR! code ELIFECYCLE
...

Removing the alias paths from the custom-post seems to resolve the issue, albeit without alias paths of course.

custom-post page does not load content

On unaltered clone of project,

npm install
npm run build:content
npm start

I get all pages converted to json, with the custom-content page included, but on accessing the url, nothing renders in the page body.

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.