Embedding other HTML resources in page

Hello, I am new to Meteor and I would like to embed a page in my app which is basically html with its own material like images etc. and reveal.js in it. Now as far as my reading goes I get the impression that the best way to host this page in my app is to create and add it in import folder and then use add it on my main.js code using import() is that the best way to do that, I wonder.

EDIT: I am using the git submodule way, after reading splitting apps tutorial in Meteor docs. However, after trying to load the HTML from the other app (using reveal.js) I get these errors:

While processing files with templating-compiler (for target web.browser.legacy): ipsos-website/reveal.js/plugin/markdown/example.html:1: Can't set DOCTYPE here. (Meteor sets <!DOCTYPE html> for you) ipsos-website/reveal.js/plugin/notes/notes.html:1: Can't set DOCTYPE here. (Meteor sets <!DOCTYPE html> for you) ipsos-website/reveal.js/plugin/notes-server/notes.html:1: Can't set DOCTYPE here. (Meteor sets <!DOCTYPE html> for you) ipsos-website/reveal.js/test/examples/barebones.html:1: Can't set DOCTYPE here. (Meteor sets <!DOCTYPE html> for you) => Your application has errors. Waiting for file change.

You are trying to import a whole HTML page, which Meteor is complaining about, because it contains a <DOCTYPE> directive.

Meteor is mainly built for creating so-called “single-page apps” (SPAs). This means, that the app uses one single HTML page, but replaces parts of it as needed. This leads to a way better user experience, because only parts of the page are swapped out. Another benefit is that you can build your app in a very modular fashion, e.g. you will have a navigation bar only once, although it appears on several “pages” (from the users’ perspective; in fact, it’s only one web page, as said above).

This is why Meteor sets up the “framework” of a HTML page (doctype, meta tags, head) itself (but there are ways to tweak these). Imports are also not meant to import web-pages, by the way. They are used to import resources (mainly JavaScript code, though you can also import CSS files if you like).

To make the “swap only parts of the page out” stuff work, you need a so-called “router”. The router analyses changes in the URL and responds to them - all without unnecessary “roundtrips” to the server, what an (old-fashioned) “multi-page app” would do.

I recommend that you work through Meteor’s Blaze tutorial, since this is the closest you can get to a “regular” web page you seem to be used to:


Hello thanks for the reply. I started using routers and I have created a mock example of my app, using three paths, at this stage I am a bit confused now. Can’t I have another HTML inside the one of the three paths, like in one page page to add my main app, and on another page to have an “about” page with info of the app, as normal fashion.

For example, I have made this below:
So the website part will host the info of the app and whatnot.