{"id":6044,"date":"2017-10-07T11:42:35","date_gmt":"2017-10-07T10:42:35","guid":{"rendered":"http:\/\/johnjohnston.info\/blog\/?p=6044"},"modified":"2017-10-07T11:43:13","modified_gmt":"2017-10-07T10:43:13","slug":"fixing-the-links","status":"publish","type":"post","link":"https:\/\/johnjohnston.info\/blog\/fixing-the-links\/","title":{"rendered":"Fixing the Links"},"content":{"rendered":"<p>I love the record of thinking and linking that now stretches back 12 years, 5 months, 4 days on this blog.<\/p>\n<p>I don&#8217;t like the breakages.<\/p>\n<p>A lot of the links on this blog are to the blogs of the school I used to work in in Glasgow, Sandaig Primary. The site is now gone. A lot of it is in the internet archive. I had hoped that the Amber plugin would sort that, but since the domain is now up for sale, the links lead to the sale page.<\/p>\n<p>I could go through the posts and fix all the links. I guess someone with more understanding than me could do it in the database. I&#8217;ve opted for a cruder solution. I&#8217;ve added a bit of JavaScript to the blog which changes all links to Sandaig to the archive.<\/p>\n<p><code>jQuery(document).ready(function() {<br \/>\n    \/\/ Stuff to do as soon as the DOM is ready;<\/p>\n<p>jQuery( \"a[href^='http:\/\/www.sandaigprimary.co.uk']\" )<br \/>\n   .each(function()<br \/>\n   {<br \/>\n      this.href = this.href.replace(\/^http:\\\/\\\/www&#46;sandaigprimary&#46;co&#46;uk\/, \"https:\/\/web.archive.org\/web\/http:\/\/www.sandaigprimary.co.uk\/\");<br \/>\n   });<\/p>\n<p>});<\/code><\/p>\n<p>This has probably broken something else and certainly is adding to the pile of oddities that I&#8217;ve added to the blog. But hopefully It means that links on posts like this: <a href=\"http:\/\/johnjohnston.info\/blog\/impermanence-and-comments\/\">Impermanence\u00a0and\u00a0Comments<\/a> will work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I love the record of thinking and linking that now stretches back 12 years, 5 months, 4 days on this blog. I don&#8217;t like the breakages. A lot of the links on this blog are to the blogs of the school I used to work in in Glasgow, Sandaig Primary. The site is now gone. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"mf2_syndication":[],"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"webmentions_disabled_pings":false,"webmentions_disabled":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[10,38,30],"post_format":[],"class_list":{"0":"post-6044","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-wwwd","7":"tag-blogging","8":"tag-javascript","9":"tag-links","10":"kind-article","12":"h-entry","13":"hentry"},"better_featured_image":null,"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p57zFQ-1zu","jetpack_likes_enabled":false,"jetpack_sharing_enabled":true,"kind":false,"_links":{"self":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/6044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/comments?post=6044"}],"version-history":[{"count":1,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/6044\/revisions"}],"predecessor-version":[{"id":6045,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/6044\/revisions\/6045"}],"wp:attachment":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/media?parent=6044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/categories?post=6044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/tags?post=6044"},{"taxonomy":"post_format","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/post_format?post=6044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}