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

Cheers #2

Open
EmmanuelBeziat opened this issue Aug 27, 2016 · 5 comments
Open

Cheers #2

EmmanuelBeziat opened this issue Aug 27, 2016 · 5 comments

Comments

@EmmanuelBeziat
Copy link

Hi!

Just found out your project (while looking at the problem of dynamic statements for vue-head, as I have issues with it too), and I'm doing exactly the same stuff for my own blog (https://github.com/EmmanuelBeziat/emmanuelbeziat).

I'll follow your work with interest, as I'll surely learn some great stuff.

@reverland
Copy link
Owner

wow, cheers

@EmmanuelBeziat
Copy link
Author

I’ve started a new version, more based on your work. :) I wasn't happy with what I did initially, and I find your way really clever — especially about the way you handle custom scripts in webpack, while I was doing it all "manually".

As I thought, I‘ve learn much by studying your work. Many thanks. :)

@reverland
Copy link
Owner

@EmmanuelBeziat Thanks, I came across this idea after exploring webpack and just to implement a blog for personal use in the first time. Its great that may useful to others.

There are still some idea, if you like, I wish to discuss about.

  1. the markdown posts should be rendered at runtime or build time?
  2. Does it a really good idea to use webpack plugin/loaders to do this? I mean, all is in memory, so its scared when I see the memory usage. and sometimes I find maybe its better to just use scripts to automate all the process.
  3. spa makes deploy and seo harder than just plain htmls everywhere

however, we've implement something I think is cool~

@EmmanuelBeziat
Copy link
Author

EmmanuelBeziat commented Sep 25, 2016

I’ve had the same questions.

First, I came up with a script that got all the content of the post/markdown inside the json file, already "converted" in html, instead of just the yaml part. It was working perfectly, but I thought this process was a bit heavy (I only have ~20 posts so far, but it was already a big file. And when I see yours with tons of posts, it might reach 4 or 5 Mb…). Moreover, I couldn‘t just require a single file to get a single post, I needed to load the whole Json and make a loop to find the good one…

So when I found your way to do this, I thought it might be a better idea, and I managed to do it like you. But I have no clue about how to "benchmark" the two options. But I know by experience that really heavy JSON files are always a heavier process than, for example, storing datas in a SQL database. So I assume that requiring and converting a markdown file "on demand" is still the simplest way to do it. I think that’s what all "flat-files" cms do (jekyll for example).

But at the time, I have issues with require() and dynamic path…

Regarding the use of webpack and loaders, I really can‘t argue on this point. I’m all new to webpack, and you have explored it more than I did (I started to read your post about webpack, it really helped me understand some points).

And for the SEO part, yeah it‘s a bit hard. In the first version, I came up with this : https://github.com/EmmanuelBeziat/emmanuelbeziat/blob/v1/src/pages/blog/post.vue (the "head" part). It was okay for shares in Twitter, but Facebook wasn’t okay with a non-absolute path for the image… But deploy on github is an easy-go to "constant integration" (and auto-build/deployment with Travis-CI).

But yeah, even if Vue seems way more powerful with a server-side REST api (and that’s why laravel dev like Vue so much), I like the idea of doing this "all" in Vue. When I started with this idea, I just discovered Phenomic, but I don‘t really like React (specially their "html-like-but-not-plain-html" markup syntax). But maybe you‘ll find some stuff interesting in the webpack config?
You can see an example for the code here github/putaindecode.io (and the working website here — by the way, there are some really cool posts on this website — dunno if you can read french?). I couldn‘t determine for sure, but I think they render markdown on the fly too.

I‘ve also thought about using a static web cms (like Grav), I don‘t know what to think. I'd really like the idea of having it all in Vue, but if I can‘t get over all the problems (like the SEO point), I‘ll think about it.

Sorry for the long comment. 😄

@reverland
Copy link
Owner

@EmmanuelBeziat Really thanks for such a lot of information

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants