Updating Page Titles Dynamically in Loklak Search

Page titles are native in the web platform, and are prime ways to identify any page. The page titles have been in the web platform since ages. They tell the browsers, the web scrapers and search engines about the page content in 1-2 words. Since the titles are used for wide variety of things from presentation of the page, history references and most importantly by the search engines to categorise the pages, it becomes very important for any web application to update the title of the page appropriately. In earlier implementation of loklak search the page title was a constant and was not updated regularly and this was not a good from presentation and SEO perspective. Problem of page titles with SPA Since loklak search is a single page application, there are few differences in the page title implementation in comparison to a server served multi page application. In a server served multi page application, the whole application is divided into pages and the server knows what page it is serving thus can easily set the title of the page while rendering the template. A simple example will be a base django template which holds the place to have a title block for the application. <!-- base.html --> <title>{% block title %} Lokalk Search {% endblock %}</title> <!-- Other application blocks --> Now for any other page extending this base.html it is very simple to update the title block by simply replacing it with it’s own title. <!-- home.html --> {% extends ‘base.html’ %} {% block title %} Home Page - Loklak Search {% endblock %} <!-- Other page blocks --> When the above template is rendered by the templating engine it replaces the title block of the base.html with the updated title block specific to the page, thus for each page at the rendering time server is able to update the page title, appropriately. But in a SPA, the server just acts as REST endpoints, and all the templating is done at the client side. Thus in an SPA the page title never changes automatically, from the server, as only the client is in control of what page (route) it is showing. Thus it becomes the duty of the client side to update the title of the page, appropriately, and thus this issue of static non informative page titles is often overlooked. Updating page titles in Loklak Search Before being able to start solving the issue of updating the page titles it is certainly very important to understand what all are the points of change in the application where we need to update the page title. Whenever the route in the application changes. Whenever new query is fetched from the server. These two are the most important places where we definitely want to update the titles. The way we achieved is using the Angular Title Service. The title service is a platform-browser service by angular which abstracts the workflow to achieve the title updation. There are are two main…

Continue ReadingUpdating Page Titles Dynamically in Loklak Search

Search Engine Optimization and Meta Tags in Loklak Search

Ranking higher in search results is very important for any website’s, productivity and reach. These days modern search engines use algorithms and scrape the sites for relevant data points, then these data points are processed to result in a relevance number aka the page ranking. Though these days the algorithms which search engines use are very advanced and are able to generate the context of the page by the page content, but still there are some key points which should be followed by the developers to enable a higher page ranking on search results along with better presentation of search results on the pages. Loklak Search is also a web application thus it is very important to get these crucial points correct. So the first thing which search engines see on a website is their landing or index page, this page gives information to the search engine what the data is about in this site and then search engines follow links to to crawl the details of the page. So the landing page should be able to provide the exact context for the page. The page can provide the context using the meta tags which store the metadata information about the page, which can be used by the search engines and social sites Meta Charset The first and foremost important tag is the charset tag. It specifies the character set being used on the page and declares the page's character encoding which is used by browsers encoding algorithm. It very important to determine a correct and compatible charset for security and presentation reasons. Thus the most widely used charset UTF-8 is used in loklak search. <meta charset="utf-8"> Meta Viewport The mobile browsers often load the page in a representative viewport which is usually larger than the actual screen of the device so that the content of the screen is not crammed into small space. This makes the user to pan-zoom around the page to reach the desired content. But this approach often undesirable design for the most of the mobile websites. For this at loklak search we use <meta name="viewport" content="width=device-width, initial-scale=1">   This specifies the relation between CSS pixel and device pixel. Here the relationship is actually computed by the browser itself, but this meta tag says that the width for calculating that ratio should be equal to device width and the initial-scale should be 1 (or zoom should be 0). Meta Description The meta description tag is the most important tad for the SEO as this is the description which is used by search engines and social media sites while showing the description of the page <meta name="description"    content="Search social media on Loklak Search. Our mission is to make the world’s social media information openly accessible and useful generating open knowledge for all">   This is how this description tag is used by google on the Google Search Social Media meta tags The social media meta tags are important for the presentation of the content of the page…

Continue ReadingSearch Engine Optimization and Meta Tags in Loklak Search