How to let robots parse our custom html elements? [duplicate] - html

This question already has answers here:
How do search engines deal with AngularJS applications?
(15 answers)
Closed 6 years ago.
I have a website containing custom elements (i use angular 2), and google fails to parse them correctly :
It only sees
<my-app></my-app>
It seems that the value of this component is not retrieved at all by google robots.
Is there a best practice / workaround ?
Thanks for your help.

This has been asked a million times. Please refer to this question and this specific page by google.
Times have changed. Today, as long as you're not blocking Googlebot from crawling your JavaScript or CSS files, we are generally able to render and understand your web pages like modern browsers. To reflect this improvement, we recently updated our technical Webmaster Guidelines to recommend against disallowing Googlebot from crawling your site's CSS or JS files.

What you can do is getting the HTML of your rendered page and inserting it into the <my-app></my-app> tags without user information or the like.
This will get replaced anyway after Angular has booted up, this means you can even put something completely different in there.

Related

how to toggle between a multiple English and Arabic in my website? [duplicate]

This question already has answers here:
How to make a Multilanguage website [closed]
(3 answers)
Closed 2 years ago.
I'm a junior front-end developer based in Egypt, so most of what I work on will be in Arabic but I will also need to support English since it is the standard website language used.
I'm looking for a solution to help my clients toggle between multiple languages. Should I build an entire project twice or what is their a better solution to switch languages on a wbeite?
Please keep in mind that I'm still a junior developer with just 2 years of experience.
You can declare the language of websites in the <html> tag, e.g. <html lang="en">. Therefore, you should be able to save your original website/project in one language and then save another copy of your website/project with the other language you'd like to show.
Read more about declaring languages in HTML
If you want to do all of this on one page only, you can use JavaScript to change the page's language using an onclick function. MDN has a good tutorial using onclick here. However, this is more complicated since you'll need to use a dictionary, such as Google's Cloud Translation API.

How to embed PDF in a web page without javascript [duplicate]

This question already has answers here:
Recommended way to embed PDF in HTML?
(30 answers)
Closed 9 years ago.
I want to show pdfs in certain pages on my site. I've experimented with google's viewer api and it works great but I dont want to depend on a third party api call. I also want it to be as robust and reliable as possible, so I'm trying to avoid javascript. I see some indication that it can be done with just HTML using either or tags, but there appears to be disagreement as to the browser support: Recommended way to embed PDF in HTML?
Is there a definitive way to do this?
I need to support IE8+ and the site will be responsive, so the solution has to be able to accommodate smaller screen sizes.
Attention duplicate police: The entire basis for this question is to figure out what is specifically NOT answered in the other question. I even linked to that question in my ow
If you don't want to use JavaScript -- no, there is not.
Even if there is a good enough solution for some OS with something like Acrobat Reader installed (maybe you get lucky with Windows), all the other OSes still don't support it.
So, if you want your site to be seen more or less the same way by everybody, you'll have to go with Javascript base things and their not so robust and reliable support -- they are pretty portable, that's a great thing on the web.
Related:
Open Source Javascript PDF viewer
Why Use a Javascript PDF Viewer

Images in a mySQL database [duplicate]

This question already has answers here:
Storing Images in DB - Yea or Nay?
(56 answers)
Closed 8 years ago.
I'm making a website for my brother's webcomic, which was previously hosted on Tumblr. What is the most efficient/logical option for storing the pictures?
Downloading and putting the path in the Db
Storing them in the database, base64-encoded
linking directly to the pictures on Tumblr
wat do?
If the tumblr site is going to remain active I would lean towards using the Tumblr API to get at the photos. You could then just write some javascript/jquery functions to display the images however you want.
I've done something similar in the past with Google Picasa Albums and it worked out pretty well.
http://www.tumblr.com/docs/en/api/v2#photo-posts
Just a little additional info, in the past I've found using jquery plugins sometimes makes it a bit mor simple to get at the data I'm looking for.
Never used this one in particular but just a quick search and found this as an example of one that might be helpful.
https://github.com/Iaaan/jQuery-plugin-for-Tumblr-API

Chrome extension, how to Modify page content (add something) [duplicate]

This question already has answers here:
Modify HTML of loaded pages using chrome extensions
(2 answers)
Closed 6 years ago.
I'm new to Chrome extension development, my first project (to learn) is to create an extension that adds some html to another website's existing page.
I plan on creating a 'page' action which fires for a page with a certain URL...
Has anyone seen a tutorial like this, or do you know of an API for adding html to a page?
You can find some example at Google Sample Extension page, however your question seems better answered on this other question.
There are a number of sample extensions on the Chrome extension API site. There are a couple of browserAction examples that will be almost identical to using pageAction.

How to convert HTML to PDF using Perl? [duplicate]

This question already has answers here:
Closed 13 years ago.
Possible Duplicate:
How can I convert HTML to PDF using Perl?
Does anyone know best way to convert HTML to PDF using Perl?
Is there any module available that can be used for this?
My HTML contains few images and charts which should be converted properly to PDF.
"Convert HTML to PDF" presumes there is One Right Way to render HTML. There isn't. You have to consider dozens of variables (CSS vs none, Javascript vs none, width of the "virtual browser", etc).
My company wanted to do that once (in Perl), and it turned out to be painfully difficult (enough so that we stopped bothering). I believe the most realistic proposal was to embed a copy of a web browser somewhere and have it render the HTML and print it to a PDF driver. Of course, we wanted to preserve the formatting pretty exactly.
You might visit this CPAN search for 'html pdf' for some options, though. PDF::FromHTML might suffice for your needs.