I'm a bit confused about what you mean with "each index.html"? Your angular App as only one single index.html for the all app
Anyway I wrote that blog post a while ago, so it might be that the SSR workaround isn't valid anymore or maybe even not needed anymore. I developed that hack in that way as, back at that time, it was not possible to use fs in Angular 6 but according this post on Stackoverflow it is now possible. Therefore maybe that by allowing your app to use fs you will be able to fetch the markdown content on the server side
With regard to "each index.html" I meant the ones that are created by the prerender.ts script. That is, the way that Angular Universal has worked for me is that it creates separate index.html files for each prerendered url. For instance I have dist/browser/about/index.html -- and that file contains the html that would be seen by Google for instance.
But the index.html files that are made in this case simply have an empty div (with markdown="" ) where the pulled-in markdown content should be. So Google wouldn't actually see the content in question.
In any event, thank you for pointing me toward the fs option. I will look into that!
Oh cool super interesting, back then I wasn't able to get Prerendering up-and-running that's why I ended up using SSR. Really cool to hear it work out (if we omit the bug related to the blog).
I hope fs will solve the issue, would be interested to hear you voice once you solve the issue, keep me posted!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm a bit confused about what you mean with "each index.html"? Your angular App as only one single index.html for the all app
Anyway I wrote that blog post a while ago, so it might be that the SSR workaround isn't valid anymore or maybe even not needed anymore. I developed that hack in that way as, back at that time, it was not possible to use
fs
in Angular 6 but according this post on Stackoverflow it is now possible. Therefore maybe that by allowing your app to use fs you will be able to fetch the markdown content on the server sideThank you, David.
With regard to "each index.html" I meant the ones that are created by the prerender.ts script. That is, the way that Angular Universal has worked for me is that it creates separate index.html files for each prerendered url. For instance I have dist/browser/about/index.html -- and that file contains the html that would be seen by Google for instance.
But the index.html files that are made in this case simply have an empty div (with markdown="" ) where the pulled-in markdown content should be. So Google wouldn't actually see the content in question.
In any event, thank you for pointing me toward the fs option. I will look into that!
Oh cool super interesting, back then I wasn't able to get Prerendering up-and-running that's why I ended up using SSR. Really cool to hear it work out (if we omit the bug related to the blog).
I hope fs will solve the issue, would be interested to hear you voice once you solve the issue, keep me posted!