As previously discussed in detail, this site is created as a Jekyll site, with content being submitted to an Azure DevOps repository where it is built and released as Static website, the content of which is stored in an Azure Blob storage. Time for a few small updates.

The site creation is documented in this Category page. There have been a couple of updates.

  • Category listings are in chronologic order
  • Redirection of http -> https has been refined.

Category listings

Generally where posts are listed such as in the index and the side bar, they are in reverse chronlogical order (newest first). It was recently decide though that it makes more sense for the Category pages that they be listed in order that they were written. This way a topic can be viewed in logicakl order.

The metainfo for a blog post, with the Category: web

The listings in Catgegory pages are dynamically generated as required. The code below generates a link to each page in a Category. Note that the change here is to use reverse to reverse the list so that it is displayed in chronolical order.

<h1><i>Category:</i> </h1>
<h5>Posts in that Category:</h5>
<ul>
    
</ul>
<br>
<a href="/cats/">Site Index of Categories</a>

label was previously generated on the page, from the site’s sections.yml page.

http->http Redirection

It is generally desirable now to use https links rather than http so that connections are secure. This site supports both with redirection from http to https. Historically, the site was first launched as http://www.sportronics.com.au but the https version https://davidjones.sportronics.com.au was then handled in the storage account as a CDN Endpoint. It became desirable to redirect everything to https as this is was Google Analytics has been setup to track. Recently it was noticed that not all content was being redirected so some tweaks were made.

Blog posts on the site have a template postpage.html. This is based upon page.html. The postpage template enforces the redirection:

<script>   
    var loc = location.href;
    if(loc.includes('http://'))
    {
         
        
        var url = 'https://davidjones.sportronics.com.au/web/Jekyll-Blog_Site_Updates-web.html'
        window.location = url;
        
    }
</script>

To this was inserted (after the first line):

     if(loc.includes(http://localhost:))
    {

    }
    else 

…so that when running locally there is no redirection.

The main problem as it turned out was that the index page wasn’t using the postpage template so the script as above was addedd to index.html and the problem was solved.


 TopicSubtopic
  Next: > RPI-Pico-Arduino-AzSDK
<  Prev:   RPI-Pico-Arduino-AzSDK
   
 This Category Links 
Category:Web Sites Index:Web Sites
  Next: > Jekyll
<  Prev:   Jekyll