I'm importing a external web template I found in bootstrap to build a intro page. It has it's own js, css , html files.
However I found it is troublesome to transfer the beautiful external web to meteor format by hand. How you deal it smartly?
Now I only can figure out that replacing the html() when the intro is created. (although I still don't know how to do it exactly )
Template.intro.onCreated(function(){
$('html').html('the external code');
});
The simple and dirty way is to put all js, css, and html into public\ directory of your meteor app since this directoy is served "as is"
After that you can start converting your js files (taking into account local and global namespaces) and convert html files into Handlebars templates. Converted files you should move to client folder. Css files you can put in client folder to allow its minification and remove references to css files from Handlebars templates of html pages.
/public folder is usually used for static files like images. I suggest putting everything in a client folder. Usually there will be a lot of redundant js files coming with the template (bootstrap, jquery, fontawesome, etc). Best thing to do is use http://atmospherejs.com/ packages for those libraries and you will most likely be left with the templatename.js file which deals with the html within that template which you'll have to "meteorise"
Related
Created a PHP project in Sublime Text 3 that holds PHP, CSS, JS, HTML, and some other files and folders. Other files may be .md, .txt, .ico, images and fonts (.woff, .ttf, ...).
Actually project is WordPress, but the solution should be for all PHP based projects, and specifically I am interested only to check specific folders inside of project (liek theme and plugin files). WordPress core is no interest for me to check.
I would like to detect Files with extensions (.php, .css, .js) that are unused. Is there a smart solution do detect these?
For instance CSS file is not used if no other files references it. The reference may came from another CSS file or from some PHP file, or even JS file.
I am not searching for a perfect solution, but for something that is close to detect these or even for an idea how I may think about these.
In WordPress (PHP) there are require and include instructions, and also wp_enqueue_script/styles that represent the mechanism how to reference files for instance.
So we could create a list of all PHP, CSS, JS files, and then based on file names search for these in the content of all other files. This would be a good start.
I am new to bootstrap. I downloaded a wrapbootstrap theme and is trying to include that in my website. In the downloaded theme, there are several folders under a folder called assets, like bootstrap, css, js, icons, img. Under bootstrap folder there are again subfolders called css, fonts and js. Can anyone please tell me where exactly in the project should i add these files? In case of a simple theme, I know we need to add the bootstrap css under Content folder and the bootstrap js under Scripts folder and we need to add it in BundleConfig.cs. But here, since there are different css files and js files, where can I include them?
Thanks in advance.
Where the files are located is really irrelevant so far as your application is concerned. The ~/Scripts and ~/Content folders are just a default convention that Visual Studio uses with the templates.
However, nothing is preventing you from moving them. When working with a template, you have one of two choices.
Leave the files as they are, and simply reference them, or include them into bundles in the paths they are located in.
Determine which CSS and JS files you need, and re-shuffle everything to suit your particular projects needs.
The first option makes it easier to upgrade the template in the future, while the second option makes your project files more coherent because they follow a similar structure.
At the end of the day though... it's all just a resource location for you web server to resolve. Do whatever makes sense for your project.
We got a wrap bootstrap theme call ace admin. We are trying to integrate the theme into meteorjs.
The structure of the ace admin files folder is:
assets
avatars
css
fonts
images
img
js
build
demo
files
lib
several javascript files here (*.js)
dist
avatars
css
fonts
images
img
js
By following the tutorial here
I moved all the static content such as images, fonts, etc to client folder, javascript related folders - (assets, build, dist and all the related content) to public folder.
The problem that I am facing it - Meteor is not loading the javascript files inside the public folder.
Could someone help? Thanks.
Edit:
Ok. Finally. Thanks to #Ethaan. After spending almost 2 days figuring out what the problem- its with the javascript loading dependencies. If anyone is facing similar problems - make sure you load all the dependencies first and then load other files.
Do everything in the link provided in the above url that I mentioned and then move all the js folder files to client.
You should know some things about meteor structure, You can read docs
/lib folder its where you put the code you want to share between server/client, code like Routes,Collectios or other code ho is available on server/client(if you put code which use "window" object you will have issues, since windows objects its undefined to the server.)
/publicfolder here is where you put the images, logos, fonts, etc (you get the idea)
/client folder here is where you put the code which will be available only to the client
/server here is where you put the code only available on the server
I recommend you to read the docs, this was just a quickly explanation.
In my webdesign process i use jade, sass, coffe etc. to generate static files via a GruntJS watch task into a dev folder. And most of the times after the build process is done, a cms comes along and want some templates to work. Thats usually html files with some php/ruby/python tags in it. Let´s say it´s a Wordpress Theme.
The Problem is:
i have to modify my generated files in the dev folder directly
when im modifing my source jade, html, coffee - files, the dev folder would be overwritten
if i clone the static files and move them into the theme folder, i have to apply manually every change i made to the src/dev folder to the cloned theme template files.
that´s very odd. So i´am in need of a grunt task that maybe...
generate the templates for me out of the static files (via a json mapping file)
generate the templates directly from the src files via special attributes, comments or something similar
There´s just one thread i found where the user tries to accomplish the same with jsdom.
Can someone help me to find a existing tool that accomplish such a task or do i have to build it on my own?
Thanks, Robert
Check out grunt-usemin
Replaces references to non-optimized scripts or stylesheets into a set of HTML files (or any templates/views)
I'd like to create a class library project where embed resources like js, css and maybe image files.
I would compile it and copy the dll into the bin folder of my web site to include the resources into my pages with GetWebResourceUrl.
I tried with an assembly that have no .cs files, but it doesn't seem to work, I can't see the namespace of the assembly in the web project.
Is it possible doing this?
Someone could provide a small tutorial?
Thanks
the best way to embed the files like js , css and ... to dll is to select the embedded resources in build action of file property. take a look at this:
http://hasantechno.blogspot.com/2011/04/aspnet-embedding-resources-image-css.html
by the way if you want to forbid any kind of unknown requests(out of you web site) to navigate the contents.
If you want to reduce the loading time, serve the media files as static content, as example over nginx.