Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 13 00:57
    elmasse closed #283
  • Nov 12 12:04
    greenkeeper[bot] labeled #283
  • Nov 12 12:04
    greenkeeper[bot] opened #283
  • Nov 12 10:40
    elmasse closed #282
  • Nov 12 10:40
    greenkeeper[bot] commented #282
  • Nov 12 10:38
    elmasse closed #281
  • Nov 12 07:24
    greenkeeper[bot] commented #282
  • Nov 12 06:55
    greenkeeper[bot] commented #282
  • Nov 12 04:37
    greenkeeper[bot] commented #282
  • Nov 12 04:10
    greenkeeper[bot] commented #282
  • Nov 12 03:36
    greenkeeper[bot] labeled #282
  • Nov 12 03:36
    greenkeeper[bot] opened #282
  • Nov 10 08:47
    greenkeeper[bot] labeled #281
  • Nov 10 08:47
    greenkeeper[bot] opened #281
  • Nov 07 10:42
    elmasse closed #280
  • Nov 07 02:04
    greenkeeper[bot] labeled #280
  • Nov 07 02:03
    greenkeeper[bot] opened #280
  • Nov 05 23:35
    elmasse closed #279
  • Nov 05 18:15
    greenkeeper[bot] commented #279
  • Nov 05 14:23
    greenkeeper[bot] labeled #279
Max Fierro
@elmasse
what's the issue you are trying to solve by mutating the posts?
maybe there is a simple way to do it with v2.x
I have to update the docs for plugins for beta
Joseph Knoebel
@knoebelja
I’m checking child headers for duplicate values and appending parent header values to them if they are not unique
so that in-page navigation works with similarly structured content
I can have: ## Example A, ### Beginning, ### Middle, ###End, ## Example B, ### Beginning, ### Middle, ### End
Then the technical writers don’t need to imbed anything and just write pure markup with expected results
Max Fierro
@elmasse
and then the custom-renderer for headings generates duplicated ids? is that the issue?
Joseph Knoebel
@knoebelja
yeah
So im appending each non-unique value, and then giving it a unqiue id but leaving the content as the original content
Max Fierro
@elmasse
oh, ok, then I guess you can modify the custom render to generate the ids with data from the post you are rendering (I believe so)
Joseph Knoebel
@knoebelja
hm
give me like 20 minutes, can i share something with you then?
Max Fierro
@elmasse
sure
Joseph Knoebel
@knoebelja
we can move to a pm
Max Fierro
@elmasse
:+1:
Joseph Knoebel
@knoebelja
@elmasse Is there a way to change the permalink of a folder (not just a post)?
For example, 02-clothes has a permalink of clothes so all posts in the folder become clothes/post-title
Max Fierro
@elmasse
hmmm, the permalink by default is the :category/:name
if no category is assigned the folder name becomes the category
so if your folder is named 02-clothes then it should create 02-clothes/post-title
Joseph Knoebel
@knoebelja
categories are assigned in the post front matter, so I’m curious if there’s a way to set it for the folder itself.
Max Fierro
@elmasse
if you remove the category from the post front matter that will make the container folder name as the category
Max Fierro
@elmasse
If you are using beta you could create a custom transform plugin that given a configuration, inspect each post data._entry and modify the category based in the path, but that might be much simpler by just removing the category in the post front matter if you don't need to set a category different than the folder name.
Max Fierro
@elmasse
Hi @IceOnFire! welcome
Matteo Antony Mistretta
@IceOnFire
Thank you @elmasse! Sorry I didn't try your beta 1 yet, will do asap
Max Fierro
@elmasse
Awesome, please let me know how that goes. It was really odd that loading a huge css such as the highlight-theme blocked the next dev model. It was taking so long to process it that the export was taking +2m to compile client code :/
I'd recommend to use it from the CDN, that's what I did for nextein site
Matteo Antony Mistretta
@IceOnFire
hey @elmasse, I'm trying your beta.1
actually I don't see any difference :/
moreover, I tried creating another "Blogz" page to test what you mentioned on Github, but I cannot seem to navigate there neither
you're right, the highlight theme is quite heavy. but I'm trying to keep my webapp fully offline-capable by design and relying only on itself
Matteo Antony Mistretta
@IceOnFire
oh btw exporting now breaks the 'post' page with the usual 'cannot read data of undefined'
oh ok I saw your edits on Github: so there is no fix with /blog -> /blogz
you say it's a matter of highlight.js
thanks for all the time your putting into it!
Matteo Antony Mistretta
@IceOnFire
found the related issue: zeit/next-plugins#282
thank you for spotting it!
thanks for all the time your putting into it! you're
Matteo Antony Mistretta
@IceOnFire
TL;DR: beta.1 breaks export on the 'post' page (problem seems to be moved from blog to post)
Max Fierro
@elmasse
Try removing out/ and .next/ folders then run dev or export. It worked out just fine for me, I only commented out next-ga in _app.js and the highlight theme css in Pre component.
  ingloriouscoderz.github.io git:(v2) ✗ npm run dev

> ingloriouscoderz.github.io@2.0.0 dev /Users/elmasse/tmp/ingloriouscoderz.github.io
> nextein

Defining routes from exportPathMap
> Using "webpackDevMiddleware" config function defined in default.

✔ success server compiled in 522ms

Compiling

✔ success client compiled in 2s 395ms


 DONE  Compiled successfully in 3042ms                                        12:57:52 AM

watching changes in folders: [ 'posts' ]
> Ready on http://localhost:3000
^C⏎
➜  ingloriouscoderz.github.io git:(v2) ✗ npm run export

> ingloriouscoderz.github.io@2.0.0 export /Users/elmasse/tmp/ingloriouscoderz.github.io
> nextein build && nextein export

[12:57:58 AM] Compiling client
[12:57:59 AM] Compiling server
> Using external babel configuration
> Location: "/Users/elmasse/tmp/ingloriouscoderz.github.io/.babelrc"
Total precache size is about 0 B for 0 resources.
[12:59:15 AM] Compiled server in 1m
Total precache size is about 0 B for 0 resources.
[12:59:39 AM] Compiled client in 2m
> using build directory: /Users/elmasse/tmp/ingloriouscoderz.github.io/.next
  copying "static" directory
  copying "static build" directory
Creating entries...
> posts--blog--2016-02-21-hello-world--Qm20YjNljHRpqrRe~dgxF.json
> posts--blog--2016-05-11-il-vaso-di-piva--Qm20YjNljHRpqrRe~dgxF.json
> posts--blog--2016-07-21-resistere-alla-tentazione-del-procedurale-in-redux--Qm20YjNljHRpqrRe~dgxF.json
> posts--blog--2016-07-22-pokemon-go-e-la-teoria-degli-effetti-collaterali--Qm20YjNljHRpqrRe~dgxF.json
> posts--blog--2016-11-16-componenti-react-redux-come-librerie--Qm20YjNljHRpqrRe~dgxF.json
> posts--blog--2018-02-08-migliorare-il-codice-con-il-currying--Qm20YjNljHRpqrRe~dgxF.json
> posts--blog--2018-10-23-loopback-porting-di-spring-boot--Qm20YjNljHRpqrRe~dgxF.json
> exporting path: /blog/hello-world
i18next: languageChanged it
i18next: initialized { debug: true,
  initImmediate: true,
  ns: [ 'translation' ],
  defaultNS: [ 'translation' ],
  fallbackLng: [ 'en' ],
  fallbackNS: false,
  whitelist: false,
  nonExplicitWhitelist: false,
  load: 'all',
  preload: false,
  simplifyPluralSuffix: true,
  keySeparator: false,
  nsSeparator: false,
  pluralSeparator: '_',
  contextSeparator: '_',
  saveMissing: false,
  updateMissing: false,
  saveMissingTo: 'fallback',
  saveMissingPlurals: true,
  missingKeyHandler: false,
  missingInterpolationHandler: false,
  postProcess: false,
  returnNull: true,
  returnEmptyString: true,
  returnObjects: false,
  joinArrays: false,
  returnedObjectHandler: [Function: returnedObjectHandler],
  parseMissingKeyHandler: false,
  appendNamespaceToMissingKey: false,
  appendNamespaceToCIMode: false,
  overloadTranslationOptionHandler: [Function: handle],
  interpolation: { escapeValue: false },
  resources:
   { en: { translation: [Object] }, it: { translation: [Object] } },
  lng: 'it' }
> exporting path: /blog/il-vaso-di-piva
> exporting path: /blog/resistere-alla-tentazione-del-procedurale-in-redux
> exporting path: /blog/pokemon-go-e-la-teoria-degli-effetti-collaterali
> exporting path: /blog/componenti-react-redux-come-librerie
> exporting path: /blog/migliorare-il-codice-con-il-currying
> exporting path: /blog/loopback-porting-di-spring-boot
> exporting path: /
> exporting path: /how
> exporting path: /what
> exporting path: /when
> exporting path: /where
> exporting path: /who
> exporting path: /why
> exporting path: /blog

Export successful
Matteo Antony Mistretta
@IceOnFire

No can do. I tried a few things:

  1. Removing .next and out before re-exporting
  2. Removing next-ga (although in my workspace next-ga works, and keeping it or removing it yields the same effect)
  3. Removing the highlight theme (although I found a workaround that allows me to keep it)
  4. Using nextein/link from blog to post (I saw a difference here: next/link reloads the page, while nextein/link navigates client-side)

In every test I could yarn dev successfully but couldn't export due to

TypeError: Cannot read property 'data' of undefined
    at /home/antony/ingloriouscoderz.github.io/.next/server/static/1Ot7g708GPGusjwGsThCe/pages/post.js:814:11
I see a path that in your console doesn't show, but does in mine:
> exporting path: /blog/il-vaso-di-piva
> exporting path: /blog/resistere-alla-tentazione-del-procedurale-in-redux
> exporting path: /blog/pokemon-go-e-la-teoria-degli-effetti-collaterali
> exporting path: /blog/componenti-react-redux-come-librerie
> exporting path: /blog/migliorare-il-codice-con-il-currying
> exporting path: /blog/loopback-porting-di-spring-boot
> exporting path: /
> exporting path: /blog
> exporting path: /how
> exporting path: /index
> exporting path: /post
The last one is where it fails
Matteo Antony Mistretta
@IceOnFire
I wonder why it tries to export /post
I had to change the exportPathMap to exclude that path
exportPathMap: defaultPathMap => ({
    // ...defaultPathMap, no thanks
    '/how': { page: '/how' },
    '/what': { page: '/what' },
    '/when': { page: '/when' },
    '/where': { page: '/where' },
    '/who': { page: '/who' },
    '/why': { page: '/why' },
    '/blog': { page: '/blog' },
  }),
Max Fierro
@elmasse
Oh. Lol yes I forgot about that. I commented it out too. The defaultPathMap will export everything in the /pages dir. and for post you don’t want to export it as a page