How do you add an SVG with no loc to an xml sitemap? - xml-sitemap

I'm trying to add an xml sitemap to my site via Google instructions at https://support.google.com/webmasters/answer/183668?hl=en&ref_topic=4581190. My primary goal is to include metadata about several SVGs on my page. These SVGs are defined without a url, and then used later as containers for NVD3 charts like so:
<div id='chart'>
<svg style='height:600px; width:100%'> </svg>
</div>
However, the sitemap process appears to identify images based on their location. How can I add these svgs to my sitemap, or is this not possible?

Related

How do I remove footer/watermark from Google Data Studio in an embedded report?

I'm redisplaying a Google Data Studio report on my wordpress site via the html embed box. For this particular report I don't want viewers to know the backend is data studio. I've tried readjusting the viewing size to be smaller than that of the report in hopes it would trim out the footer but have had no luck.
Below is the code placed in the html embed box:
<iframe width="2000" height="1600" src="https://datastudio.google.com/embed/reporting/12EqvlygNlYq0D2zpHyNFe3CbswPAC_fT/page/xV>>>>DLB" frameborder="none" style="border:none" allowfullscreen=""></iframe>
Does anyone know how I could remove the google data studio report footer/watermark from my website?
You can’t remove the data studio watermark without violating the Data Studio terms of service
You need to find the following line in HTML.
<div ng-if="reportViewCtrl.isReportEmbedding()">
when a page is loaded use JS to add the following attribute:
style="display:none"
All together will look as follows
<div ng-if="reportViewCtrl.isReportEmbedding()" style="display:none">
3 easy steps:
Disable with ajax/jquery/... the right click function to prevent them from being able to inspect the element embedded and get the url anyway
With CSS, load anything that you can use to overlay it on embedded datastudio footer.
That same element, make it transparent to avoid google penalties

Can I display a G Suite User Photo with the just the thumbnailPhotoUrl?

Question
Can a web app display a G Suite user's profile image using just the thumbnailPhotoUrl, or is it necessary to save and serve the image?
Context
This Guide describes how to get the image from the Directory API. But I'm not sure how to move from the get request to an image file I can display. There is mention of the Closure Library to use for Base64 encoding/decoding.
I'd like to use a link to the image, to use as the src of an img element.
What I've Tried
A firebase cloud function using a service account with domain-wide delegation is retrieving user data via https://www.googleapis.com/admin/directory/v1/users. This returns the thumbnailPhotoUrl, and I'm able to paste the URL into chrome and view the image. If I share the thumbnailPhotoUrl with someone else, they do not see the image but see the silhouette placeholder instead.
Note: the thumbnailPhotoUrl includes /private like this:
https://www.google.com/s2/photos/private/xyz123...
Is that a clue that this URL will not work in the web app to display the image?
You can embed the contents of the URL directly into your HTML document. It looks like this:
<img width="16" height="16" alt="star" src="data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" />
The magic part is taking the image binary data and base-64 encoding it for the img tag.
The format of the above example:
data:[<mime type>][;charset=<charset>][;base64],<encoded data>
This link provides more details and shows how to do this.

How to get absolute file system path to an image Symfony2/Twig

I am using Symfony2 with twig to generate HTML, however the HTML I am generating is not intended for a web browser, instead it will be passed to a library that converts HTML to a PDF document.
There are two related issues I am facing.
Issue 1. This PDF will have images included, I don't want these images to be visible directly from the internet (e.g. I don’t want these images to appear under webroot). Usually I put assets in “site/src/path-to-bundle/Resources/public/assets” however, I don't want this image to be visible on the web. Can anyone suggest a good folder to put “assets” in that are not meant to be accessible via the web. (Just trying to be consistent with Symfony2 naming techniques and how other programmers would usually do this)
Issue 2. Since the HTML I am generating is intended for the HTML to PDF generator, it is most practical to refer to images with absolute paths on the file system (web paths or URLs are not suitable in this situation).
For example
<!-- This is the correct HTML code that is needed in this situation -->
<img src="/home/user/absoulte-file-system-path-to/image.png" />
<!-- These are actually incorrect in this situation -->
<img src="assets/image.png" />
<img src="http://www.somedomain.com/assets/image.png" />
I would like to know how to get the absolute path to the image mentioned above (I don’t mind if this is done in the Twig template or in the controller)
in you app/config/config.yml
twig:
globals:
root_path: %kernel.root_dir%
and you can refer to asset with relative path to your root project
<img src="{{ root_path }}/../secret-folder/image.png" />

Umbraco css vs images path

I creating new website using Umbraco(version 6.1.1 with razor) and I am new to Umbraco. My settings panel is like this.
In my Master template I am using my css styling and JavaScripts are like this. And their paths are ok.
<link rel="stylesheet" href="/css/mobile.css"/>
<script src="/scripts/jquery-2.0.2.js"></script>
CSS and scripts path are working. So that's ok.
Now my problem is I want images for my site. I don't know where to put images and what should be the path.
For example:
I tried to upload pictures to Media
In my Master template I tried
<img src="/media/A.jpg" alt="Smiley face" height="42" width="42">
<img src="/media/images/A.jpg" alt="Smiley face" height="42" width="42">
Also in the CSS file
background-image:url('/media/images/A.jpg');
But these are not working. I just trialing them. Actually I don't know the correct way of doing it :(
So where should I store images in Umbraco and how should I locate the path in CSS files and template files ?
Please help!
Thanks in Advance ....
Items stored in the media section will have a path like:
/media/<row_id>/filename.ext
Where <row_id> is literally the id of the row in the database where the media item's information is stored.
One way you can determine the path of the media item is to click on the thumbnail (if it's an image) and copy what is in the address bar.
You can also access the file by id via a macro using xslt or razor. Here's a razor example:
#{
int imageId = 1069;
var media = Library.MediaById(imageId);
<img src="#media.umbracoFile" alt="" />
}
However, this is a content management system, and you will no doubt have end-users managing the content and, therefore, it wouldn't make sense to place design specific images in the media section. A more full-proof approach would be to simply place them in an images folder in the root of your site and use them from there.
Should be as simple as this on your css:
.style { background-image: url(/media/1006530/A.jpg); }
The path you get from the media url with row id (e.g.1006530) in it

Output html that's transparent

My site supports exporting data in a few ways, and one way i via iframe.
<iframe src ="http://www.conanstats.com/Feeds/IFrame.aspx?Guild=30&EventCount=15" width="270" height="400">
<p>Your browser does not support iframes.</p>
</iframe>
Currently the problem is that when it's shown in a web site it's going to have its own style, is there any ways for it to inherit the style from the page it's being shown in. Or do I need to make url arguments to make this happen
An iframe is technically a different browser window with its own DOM and associated CSS imports. If you want to style the iframe's content put the CSS you would like to use in the file the src property is pointing to.
If it is pointing towards an ASP file change it in there.
You could have your page take a parameter which it then uses to decide which local style sheet to load...

Resources