How to make some of my web pages searchable in my project - search-engine

In my website i am including user to add blogs. How can i make those blogs searchable in google. I want to make only the blogs searchable. But i don't want to make remaining pages searchable. How can i do this.
Regards

On all pages except the blog pages, add the following to your HTML <head> element:
<meta name="robots" content="noindex">
This will prevent search engines from indexing the page.
Using javascript/jquery isn't an option as this is client scripting, which the bots won't read.

Related

How to write w3c-conform Angular-Material applications?

I am writing a web application using AngularJS and Angular Material. I'd like to write valid HTML code (according to the w3c-validator).
I already know that I can write valid AngularJS directives like this:
<body data-ng-app="myApplication" data-ng-cloak>
However, AngularJS uses a lot of custom tags, such as:
<md-content></md-content>
I already tried several search queries on Duckduckgo, Google, and Stackoverflow but I can't find an answer on how to rewrite these tags in order to create valid HTML code.

make sitemap page for many pages in rails

I just noticed that Google didn't crawl quite a lot of my web pages. When I searched for that reason, I thought sitemap could be a reason for some part of that missing crawling because I had no sitemap or robots.txt kind of thing.
I have a very simple structured website with index, QnA, login(no user's page yet) and search page. But Search page can result in many restaurants' pages, which are upto almost 160,000 like example.com/restaurants/1000001 to example.com/restaurants/1160000.
I just learned some concepts about sitemap and I think dynamic sitemap examples are quite a lot in google. But I saw that over 50,000 pages require some more sitemaps google sitemap help page.
My website has very very simple structure but would it make some burden for my server?(is it necessary?) And I have no clear standard to split those 160,000 pages, then what can be a good standard to split them for googlebot?
Any tips would be a huge help for me. Thanks!

Editable area on landing page for site admins

My Rails app has a landing page for visitors with welcome/contact info.
At the moment, this info/html lies in a template.
I want to make it editable for the admins of the application.
What options do I have to accomplish this? Should I create a model with a first_page attribute where I store the html submitted by the admins in a form? Or is there any other way?
You'll need some kind of content management system (CMS). There are lots of ready-made ones for Rails. see http://codecall.net/2014/02/10/best-ruby-on-rails-content-management-systems-cms/
You could just write your own, but you'll end up writing functionality around editing the pages, and then the admins will ask for the ability to upload images etc, and you'll think "gah, wish i'd just used an off the shelf CMS".

Best Way To "Drop In" Dynamic Content Into an Existing Static Site

A friend of mine has a static web site. She would like to add a registration form that would allow people to register for classes. Re-creating the web site using ROR or Wordpress or something like is not in scope. We also want the user to use the same domain, regardless of whether he or she is viewing a static or dynamic page.
The least intrusive way that I can think of doing this with CGI, preferably using Ruby. However, I really don't like writing CGI code and I am much more comfortable with frameworks such as Sinatra and ROR.
Is using an advanced framework really even possible for this type of situation? If so, then is it more trouble than it's worth?
Thanks in advance!
If I were you I would do it in Sinatra, and perhaps use a front end like Nginx to redirect to your Sinatra app. So something like:
location /myform{
proxy_pass myserver:6000;
}
Where your Sinatra is running on port 6000. Sinatra is very simple and you can probably do this in a short time. ROR I think is a bit heavy for this. We do things like this all the time for special needs/shared apps, even when they are already dynamic.
You can develop an app that injects the dynamic code into her static site via Javascript. I do that for one of my projects here at work and it seems to be an acceptable solution.
A quick HTML sample:
<!doctype html>
<html>
<head>
<title>Test</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="loader.js"></script>
</head>
<body>
<div id="customcontent" class="contentlib"></div>
</body>
loader.js:
$().ready(function () {
$('<style type="text/css"> ... </style>').appendTo('head');
$('.contentlib').each(function() {
$.getScript($(this).attr('id')+'.js');
});
});
customcontent.js:
$().ready(function () {
$('#customcontent').html(' ... ');
});
This is a bit more complicated than it has to be (the second script load based on the div's id) since I have to support multiple replacement on the same page.
Anyway, I could see you using this to inject your app from a 3rd-party website and, as long as you stuck to using AJAX form submissions, the average user would be none the wiser.

Ruby on Rails: Editor for backend of the web application

What editor can you suggest to integrate with the backend of the web app I'm currently developing? I want to allow my trusted users to add articles that would be visible on the
frontend. It should have some kind of markup language (to make basic customisation - lists, bold...) and if possible also the option to upload images.
look into restful_authentication (authentication), RedCloth (textile markup language), Hobo (admin interface), and paperclip (file uploads/attachments). You can piece together something with those.
If the editors of your site are not so technical, you might want to look into a Javascript markup editor instead, such as TinyMCE for editing articles - it looks similar to the gmail editor or the one here on S/O (bold / italics / etc), and you don't have to use textile markup.
You can also try routing to, say, admin/modelname, and create administrative controllers there. Hobo might be a way of doing it, but it is usually done manually.
I suggest using RedCloth for adding a textile style mark-up language to your articles.
I also suggest Paperclip for uploading & attaching images to your articles.
Do you mean "editor" in the sense of a component you present to end users in the browser, embedded in the Web page?
Stackoverflow uses the WMD editor. It's good. I'm using it in a current project. It took me about 20 minutes to read the docs and set it up. It's fast, lightweight, works in most browsers, and is easy to use both for you and the end users.
It uses the "Markdown" markup language.
Try Radiant CMS for a complete solution.

Resources