Independent resource for creating external style sheets? - css

Is there any independent resource, where I can place CSS code, to use it's URL in <link> tag?

Yep. You can use Amazon web services to host images and css files. It will provide you a url to put with in a tag and it will also give you a url to put within image tags if thats something you are interested in. There are also other places.
Here is an example image hosted on aws: https://s3.amazonaws.com/pr-otp/email_folder3/OTP_021518_01.jpg
Here is an example of css hosted on aws: https://s3.amazonaws.com/dgpr/About-Us/css/styles.css
AWS link: https://aws.amazon.com/free/
You can also use drop box.
Here is a guide you can use: https://feed.mikle.com/support/using-dropbox-host-css-files/
You can also use google drive.
Here is a guide for google drive:
https://thenextweb.com/google/2013/02/05/google-drive-now-lets-developers-share-hosted-websites-by-storing-html-javascript-and-css-files/

Related

How to get the normal theme uri when using WP_CONTENT_URL?

I have a Wordpress install and I'm using a cookieless domain for all my resources. One of those resources is an svg sprite file that I'm referencing using the <svg><use> tags.
This creates a problem whereby I can't use the static domain as this breaks the <svg><use> in many browsers due to a limitation placed on domains.
So all I need to do is get the normal uri for example( http://example.com/wp-content/theme/image/ ) but what I currently get is( http://static.example.com/wp-content/theme/image/ )
How can I get the normal domain based theme uri?
On which domain is your site running? The URL to your theme can be found using
get_stylesheet_directory_uri();

Google mod_pagespeed for ajax loaded content

I`m trying to optimze and convert images using mod_pagespeed and it works very good for all tags in html files. But how could it process images that loaded with js? For example images in slideshows and etc.
Thanks!
mod_pagespeed normally optimizes images and other resources by detecting their URL in the HTML and then replacing the URL with a link to the optimized version. As of mod_pagespeed 1.4.26.1 however, mod_pagespeed includes a feature called In-Place Resource Optimization, which allows resources requested with their original URL to be optimized. This can be used in cases like yours where images are being requested through AJAX. It can be enabled by setting ModPagespeedInPlaceResourceOptimization on in your config file, and have a look at the documentation linked above for more details.
Google's mod_pagespeed module only parses HTML files for images, and then optimizes them. You would have to have the images loaded via the HTML file, and then referenced/shown to the client via javascript. (Have the images hidden by default).

Django on heroku serves static but HTML templates don't not use them.

I am making a small recipe website for a friend of mine in django. Currently, I am in the process of deploying it to Heroku. I am using Amazon S3 for static content.
Here is the website: https://chiryaroti.herokuapp.com/
It seems S3 itself is working fine as it downloads css, and js. But, when I "inspect elements" in firebug, it says no style attached.
Why is not HTML making use of the css stylesheets ?
Thanks in advance.
You are requesting insecure resources(http) in a secure page(https), those resources are blocked by browsers.
You should use protocol-relative paths.
e.g.
<link href="//chiryaroti.s3.amazonaws.com/css/main.css" rel="stylesheet" />

Add css style sheet to app_offline

Well, I'm trying to make custom app_offline.htm and want to add links to my css files in project. But next code doesn't work
<link href="/Content/Themes/screen.css" rel="stylesheet" type="text/css" />
In console I've got error
GET mySite/Content/Themes/screen.css 503 (Service Unavailable)
Please, give me advise how to make a link to css file in app_ofline.htm. Any help will greatly appriciated!
The idea of the app_offline.htm is that it indicates that the app is, well, offline. So, no resources are available from the site when the site is offline. Either put the relevant rules into the page or host the stylesheet on a separate domain.
You have to use inline css style for this instead of referring to external CSS file.
<style type="text/css">
/* write your css code here */
</style>
App_Offline.htm
Basically, if you place a file with this name in the root of a web application directory, ASP.NET will shut-down the application, unload the application domain from the server, and stop processing any new incoming requests for that application. ASP.NET will also then respond to all requests for dynamic pages in the application by sending back the content of the app_offline.htm file (for example: you might want to have a “site under construction” or “down for maintenance” message).
You can add it as base64 in the img tag... like this:
<img src="data:image/png;base64,<64-bit string goes here> alt=""/>
This works at least for an image that says the site is under construction.
You can't link to it. It's offline. Unless you're using a remote css file that you can guarantee will be in a functioning server the css file will not be allowed to be served because the .Net Framework restrictions have been put in place to forbid the serving of any file except app_offline.htm. You can either put your css inline with the page or host it on a separate site (which is a choice some companies make anyway to keep design elements in a common location for enterprise applications).

How do I embed the share in another website?

I have a website in which I would like to embed the share using an iframe. The problem is how do prevent the user having to login (in the iframe). They are already authenticated at this point.
The parent application which is generating the iframe is on the same server/domain as the Alfresco install.
The parent application has its own authentication, but instead of storing its own passwords it queries Alfresco via REST.
There are two ways, i think:
The first is to provide token (you shoud have one in your parent app) to Share in iFrame, so use some javascript;
The second one is to use portlets, have a look for example at liferay wiki, at least document library should be accessible.
If you are using php, (Wordpress, joomla, etc) then this can be useful.
First of all you need to configure the share-security-config to allow put share content into an iframe configure iframe.
<config evaluator="string-compare" condition="SecurityHeadersPolicy">
<headers>
<header>
<name>X-Frame-Options</name>
<value>ALLOW-FROM https://www.x.com</value>
<!--or just allow all-->
<!--<enabled>false</enabled>-->
</header>
Then Configuring external authentication and last pass the header using that Configuring Alfresco Share to use an external SSO.

Resources