I am using Polymer. In my index file i have some php script that gets commented after I vulcanize it.
Is it possible to prevent vulcanize from commenting my php script?
I have tried:
searching in vulcanize's githup repository for relevant options.
searching in the same place for related
with no avail...
Any help greatly appreciated.
Put your polymer components in a separate directory, and serve them as static content. Vulcanize only those files and serve the vulcanized version as a static file.
import the static polymer files from the html your php scripts creates.
Related
I am generating a component application in Polymer .. as a template I used the following: https://github.com/PolymerLabs/start-polymer3. Everything works excellent, I uploaded it to firebase, the point is that I want to make 'polymer build' generate the structure of folders: build / s6-unbundled, along with other folders like node_modules and my custom script, if you know some way to compress all the scripts generated in the build into a single file. Since the components I want to insert in third-party sites but I want to load only one js file and not have to load all what the polymer generates. I've done this with vue-custom.component but I do not know how to Polymer. I appreciate your help.
I have created a new repository and and included all files necessary to host a website on github, see (https://github.com/tonystaark/tonystaark.github.io/tree/master)
However, I received a 404 error when I visited my own website at tonystaark.github.io. The error says that 'For root URLs (like http://example.com/) you must provide an index.html file.'
How do I convert my .pug format into a html (or .postcss into a .css) file then?
You can easily generate html from pug file using command line option,
pug -O '{"doctype": "html"}' index.pug
It's automatically generate index.html file for you.You can check other options from here
Pug files need to be compiled onto the server before being served as an HTML file. There aren't many great ways to compile Pug in the client. If you have a strong need to use Pug as a templating engine, GitHub Pages will not be able to do that. You will need to host your site somewhere that supports Node.js engines (Heroku, DigitalOcean, Amazon S3, etc.)
I didn't see any Pug files in your GitHub repo, though, so I don't know if you figured out another solution or tried to do something else.
I'm starting to experiment with Polymer 1.0, and I noticed that the some of files included via Bower are broken up into the following three:
polymer-micro.html
polymer-mini.html
polymer.html
And each file is imported via HTML Imports within the next one down the list. Then, the rest of the file is just JavaScript.
Perhaps, it's my lack of knowledge regarding HTML Imports, but is this a clever way to utilize dependency management for JavaScript without having to add a third-party library like Browserify for example?
Does jekyll build provide a hook which I can use to gzip each .html file in the _site directory? I'd like to have a corresponding example.html.gz file to an example.html file.
I would write a wrapper script in case there is no hook. I just want to be sure to make it in the cleanest way possible.
There is no hook in jekyll build.
The only way to generate additional content is to write a generator plugin.
If your goal is to serve the gzipped version of you pages, you must know that github pages already serves gzipped html, css and js.
I just want to get an opinion on my workflow. I am aware of Yeoman and have on purpose decided not to use it. My workflow goes like this:
Run bower install to install all project assets dependencies.
Run grunt which copies all js files from the bower components folder to a new js folder and all css files to a new css folder.
Further use grunt task to concatenate and minify all js and css files from the new folders and put them in a dist folder.
Refer to the final minified css and js in dist folder from HTML.
One thing i certainly don't want to do in my grunt task is to perform dependency specific task e.g. grab all js file from bootstrap folder into the new js folder, then grab all js file from prettyphoto folder into the new js folder. I want the grunt task to be as generic as possible so that i can use the same gruntfile in any project no matter what the bower dependencies might look like. The reason is if i should spend all those time writing my gruntfile for each project, why would i not just grab the source codes for all the dependencies in conventional way.
So there is a grunt-contrib-copy plugin to copy files from one place to another which i use to grab all js files from inside the bower's components folder. The problem is most of the bower components come with regular js and minified version of it. So, i am copying both of them and concatenating and uglifying them. So duplicate code!
Does my workflow makes sense? Is so, how can I get rid of the problem I mentioned in the paragraph above?
If I'm understanding correctly, you should take a look at grunt-usemin. You can wrap your js tags in <!-- build:js js/foo.js -->. The useminPrepare task that's included in the package will cycle through any scripts (or css, or images, etc.) that are there and dynamically add them to the concat or uglify task.
The one downside I've found is that the usemin task is fairly slow but hopefully if this pull request is implemented, things will get much, much faster.