How to link your own articles on a Pelican blog? - relative-path

I tried to link with the html file name, but it works because they are on the same folder.
[Title](./this-is-the-file.html)
But it is possible that another article would appear on another folder because of the ARTICLE_URL pattern. Examples:
[Title 1](/2014/02/article1.html)
[Title 2](/2014/01/25/article2.html)
Is it possible to link your own articles with a reference to the slug ? Any other better solution than the generated HTML file name ?

As noted in the documentation, you can link to other source content files via:
[a link relative to content root]({filename}/this-is-the-source-file.md)
... or ...
[a link relative to current file]({filename}../this-is-the-source-file.md)
Pelican will incorporate your chosen URL scheme and automatically determine the proper way to link to the other article.

The way I do this is by specifying my own sluglines using the save_as metadata tag. So if I have a blog post called my_post.md, it'll look like this:
Title: My Blog Post
save_as: myblogpost.html
This is the world's most boring blog post.
That ensures I can link to it at /myblogpost.html. Then in some other blog post, I can say:
Title: My Second Blog Post
save_as: mysecondblogpost.html
This is the world's second most boring blog post. The most boring blog post is [here]({{ SITEURL }}/myblogpost.html).
It's a more flexible and elegant solution that gives you finer-grained control. And if you're not using Pelican for a blog site, it's pretty essential.

To deal with link in rst / restructured text.
Say you want to have link from your second post to first. Here is piece of context from that second post:
If you wish to see my first blog post click `here`_
.. _here: first-blog-post
And first blog post should have proper slug:
First blog post
########################################
:date: 2019-02-18 20:31
:category: entry
:tags: python, blog, first
:slug: first-blog-post
I have configuration:
ARTICLE_URL = '{date:%Y}/{date:%m}/{slug}.html'
and it deals with additional stuff like year, and month. Most probably you can stick with slug instead of having to track HTMLs.

Related

How to replace links on blog posts Shopify

I recently created a copy of my website from here https://www.thecolorkind.com/ to here: https://colorkindstudio.com/ and I moved all the blogs to this last domain but they have some links that still redirect to the old domain.
We have more than 200 posts and it will take sometime to update/replace each link on each post. So, is there a way to replace all the links on my blog posts https://colorkindstudio.com/blogs/news to have the new domain?
I have two approach to solve this.
You redirect/forward all the request from https://www.thecolorkind.com/ to https://colorkindstudio.com/
If you are using GoDaddy then this might help - https://in.godaddy.com/help/forward-my-domain-12123
Second approach is to use some JavaScript to see if an anchor tag have thecolorkind.com in it's href attribute and if it does then replace the link with colorkindstudio.com.
Let me know if tis helps or if you need more insights.

Editing the head element on an old blog platform on a post-by-post basis. Is this impossible or am I missing something?

Sorry for being a total rookie.
I am trying to help my professor implement this advice:
Either as a courtesy to Forbes or a favor to yourself, you may want to include the rel="canonical" link element on your cross-posts. To do this, on the content you want to take the backseat in search engines, you add in the head of the page. The URL should be for the content you want to be favored by search engines. Otherwise, search engines see duplicate content, grow confused, and then get upset. You can read more about the canonical tag here: http://www.mattcutts.com/blog/canonical-link-tag/. Have a great day!
The problem is I am having trouble figuring out how to edit the head element on a post-by-post basis. We are currently on a super old blogging platform (Movable Type 3.2 from 2005), so maybe it is not possible. But I'd like to know if that is likely the reason, so I'm not missing out on a workaround.
If anyone could point me in the right direction, I would greatly appreciate it!
Without knowing much about your installation, I'll give a general description, and hopefully it matches what you see and helps.
In Movable Type, each blog has a "Design" section where you can see and edit the templates for the blog. On this page, the templates that are published once are listed under "Index Templates," and the templates published multiple times, once per entry, per category, etc., are listed under "Archive Templates."
There probably is an archive template called "Entry" (could be renamed) publishing to a path like category/sub-category/entry-basename.php. This is the main template that publishes each entry. Click on this to open the template editor.
This template could be an entire HTML document, or it might have "includes" that look like <MTInclude module=""> or <$mt:Include module=""$> (MT supports varying tag styles.).
You may find there is an included module that contains the <head> content, or it might just be right in that template. To "follow" the includes and see those templates, there should be links on the side of the included templates.
Once you find the <head> content, you can add a canonical link tag like this:
<mt:IfArchiveType type="Individual">
<mt:If tag="EntryPermalink">
<link rel="canonical" href="<$mt:EntryPermalink$>" />
</mt:If>
</mt:IfArchiveType>
Depending on your needs, you might want to customize this to output a specific URL structure for other types of content, like category listings. The above will just take care of telling search engines the preferred URL for each entry.
#Charlie: may be I'm missing something, but your solution basically places a canonical link on each entry to… itself, which is a no-no for search engines (the link should point to another page that's considered the canonical one).
#user2359284 you need a way to define the canonical entry for those which need this link. As Shmuel suggested, either reuse an unused field or a custom field plugin. Then you simply add that link in the header in the proper archive template that outputs your notes. In the hypothesis that the Entry template includes the same header as other templates, and, say, you're using the Keywords field to set the URL, then the following code should work (the mt:IfArchiveType test simply ensures it's output in the proper context, which you don't need if your Entry template has its own code for the header):
<mt:IfArchiveType type="Individual">
<link rel="canonical" href="<$mt:EntryKeywords$>" />
</mt:IfArchiveType>

Use of canonical tag in HTML

I read about canonical tags in HTML and from what I understood it is used to help search engines to realize which is the original content. I have articles in my recently created blog, which I have pasted in certain other popular websites. In those websites I gave back a link to my original blog post with the canonical tag. But yet my blog page is not visible in search engines (other websites do show my article). Before I had pasted onto other websites, my articles were indexed on google and could be seen on the 1st page. So I guess, there is no problem on my SEO part.
Can someone please suggest a method where my original blog gets higher preference for the content?
You can use cross domain canonical tags.
So if you have duplicated content on other domains you can use the canonical tag on those pages pointing back to the original page on your site.
This a great way to deal with syndicated content; of course you would need code level access on these other websites so you can implement the canonical tag.
More info below
http://googlewebmastercentral.blogspot.com/2009/12/handling-legitimate-cross-domain.html
Don't just copy paste your articles on every place on the internet, that will not do you any good. After writing a good article go to other sites and write something else about your articles like what your article is about, how it is helpful to someone, something like that so that people and websites come to your website to read your article. For this you don't need "canonical"
If you copy paste articles to other websites, it will only create duplicate content issues and will only harm your SEO efforts.
No, it is not required for your Blog section to do canonical issue.
Canonical means Google displays same pages with different URL.
The first thing is not submitting your article in different websites I will not give you any benefit in your ranking. If you write a good and quality content you should post in only one website if you post in different sited google will consider as a duplicate content. So it's better for you you can share your approved blog link in social media sites and also do social bookmarking, microblogging. And after you don't need canonical tag.
As #moobot said you can indeed use a cross-domain canonical tag to let Google know about the original source of the content. How exactly are you adding the canonical on other domains?
The canonical link should be in the head section of the html code. If you're adding it yourself somewhere in the body tag that's not going to do you any good.
Check out this article for some other common mistakes with the canonical tag
http://googlewebmastercentral.blogspot.nl/2013/04/5-common-mistakes-with-relcanonical.html
#metadice mentioned that copying your content all over the web isn't good for your SEO and i agree completely. If you do this for some extra backlinks or something i would recommend you to stop doing this.
Hope my answer will help someone who has this same question.

simple wiki and reference tracking

I'm trying to wrap my head around designing a simple Wiki style app. In a traditional wiki, say wikipedia, are 'links' referenced in any kind of backend/complex way? Ie HABTM... or are links simply links?
I'm trying to decide myself what to do, a bit different but similar. I have pages written by individuals which they can attribute to themselves or credit a.. say a famous author. Should I save this attribution as merely a tag? The tag would create a reference to the famous person, which may or may not exist, but could also be created, but nothing more than a link. OR, do I dive deep and create a real data relationship (HABTM) ?
Thoughts?
A SQL-style Has And Belongs To Many mapping table is never necessary in Mongo.
If you'd like to provide, for example, a "what links here" view for a page, then I would do something like this for each page in your Wiki. I'll give an example of a page about pandas:
{
_id: "Panda",
text: "Page's contents go here",
links: ["Raccoon", "Weasel"]
}
You're using the page's title as its _id. To find titles of pages that link to "Raccoon", you can query like:
db.pages.find({"links": "Raccoon"})
Obviously, you should make an index on "links".

Does a rel=canonical link remove all SEO value from the page?

Here'y the story: I have a website for a local company that publishes quality content to an on-site blog. We're expanding to a new geographic region, and I'm in the process of building another website targeting the new region.
I'd like to include a blog on the new website, which will pull in any content/posts from our existing blog. I primarily want to do this for the added SEO benefit of having fresh, relevant content that's frequently updated on your website. However, I would of course need to add a rel=canonical link back to the original blog in order to ensure I don't get any duplicate content penalties from posting the same content across two separate domains.
My question is whether adding that rel=canonical link will eliminate the SEO value of that content being posted to the new website?
I'm not really talking about which blog post would show up in SERPs, as I understand that the point of the rel=canonical tag is to provide attribution to the primary source of the content. I'm more concerned about whether using a rel=canonical on the content would eliminate the secondary SEO benefit of having relevant, frequently updated content on your website, due to Google being essentially "blind" to the duplicate content.
In most cases the answer on your question is "yes". With regard to Google - GoogleAnswers (see the last question).
Other search engines can not maintain this attribute.
Regards.
If you pull content from somewhere else to post, it isn't "fresh". Fresh content is newly written. You won't get any credit for fresh content whether or not you use rel=canonical
The canonical tag behaves in a similar way to a 301 redirect. That is, ranking that the page with the canonical tag has will mostly get transferred to the page it points it.