內容簡介
RevCanonical 外掛為您的網頁生成短網址,同時添加網址縮短發現。您可以在字元限制的網站(如Twitter)上使用此網址,在即時通訊中使用,或者在任何時候需要您的網頁的簡短鏈接時使用。發現功能意味著,其它網站和服務也可以使用短網址。此短網址屬於您的,並且不使用任何外部服務。
以下是添加到您的網頁中的內容。 href 中的鏈接是您可以使用的簡短版本:
<link rev="canonical" type="text/html" href="http://my-domain.me/p12p" />
這個標籤可以根據您自己的喜好進行自定義(風險由您自己承擔),例如:
<link rel="shortlink" href="http://my-mini.me/p12p" />
就這麼簡單!現在,您不僅可以在類似Twitter的網站上傳播此網址,而且數懂 rev=canonical 鏈接標籤的服務或人員都可以使用此縮短版本,而不使用較長的原始版本。這也意味著它的持久性取決於您,而不是第三方。
還有一個很棒的書籤程式按鈕,可以使在網頁上尋找現有短網址變得非常簡單。您可以在我的網站http://littl.me/p136 上閱讀有關此插件的更多信息。
注意:我使用 WordPress 中的 'Day and name' 樣式永久鏈接。如果您使用其他格式,我無法確定插件是否可以正常運行。
有哪些更改?請查看更改日誌。
高級
默認設置應該適合大多數人,但如果您希望可以更改幾個設置。同時,您還可以在自己的網頁中使用一些標籤。
如果您的域名有點長,並且您擁有一個更小的域名,您可以在設置頁面中添加此域名。然後,您只需要確保新域名通過 ProxyPass 設置指向原始域名即可。
網絡上已經有很多關於如何在 HTML 中描述短網址的討論。似乎沒有絕對正確的方法,因此默認情況下會使用 rev=canonical。如果您想使用其他方式,也可以通過設置頁面進行更改。
最後……您可以在自己的模板中使用一些標籤,以返回該頁面的短鏈接。您需要傳遞 post 的 ID。
<?php get_revcanonical_link($post->ID) ?> ===> 在屏幕上顯示短網址
<?php $url = revcanonical_link($post->ID) ?> ===> 將短網址分配給變量
外掛標籤
開發者團隊
原文外掛簡介
RevCanonical generates a short url for your pages, as well as adding link shortening discovery. You can use this url on character restricted sites like Twitter, in IM, or anytime you need a short link to your webpages. The discovery part means that other sites and services can also use the short url should they need it. Oh and this short url is yours, from your website. It does not use any external service.
Here’s what gets added to your pages. The link in the href is the short version you can use:
This tag can though be customised to suit your own preferences (at your own risk), for instance this:
That’s it! You can now, not only use this url to pass around, and in sites like Twitter without having to go via a url shortening service, but services or people that understand the rev=canonical link tag, will be able to use this shortened version over the longer canonical version. It also means that it’s persistence is down to you, and not to a 3rd party.
Oh and there’s a great bookmarklet that makes hunting for existing short urls on a page really simple. You can read more about this plugin at my website http://littl.me/p136
NOTE: I use the Day and name style permalinks in WordPress. I can’t be sure the plugin will work if you use other formats.
What’s changed? View the CHANGELOG
Advanced
The default settings should suit most people, but if there are a couple of things you can change should you wish. There are also a few tags you can use within your own pages.
If your domain name is a bit long and you own a smaller domain you would like to use as your shortened domain, you can add this in the settings page. You would then just need to make sure that the new domain pointed to the original via a ProxyPass setting.
There are many ongoing conversations on the web about how to describe shortened links in HTML. There appears to be no absolute right way, so by default if will be rev=canonical. Should you want to use another way, you can also change this via the settings page.
And finally… there are a couple of tags you can use in your own templates, that will return the short link for that page. You need to pass them the post ID.
ID) ?> ===> Echo the shorturl to the screen
ID) ?> ===> Assign the shorturl to a variable
