Jump to content

Jorinde

Circle Member
  • Posts

    4
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Jorinde reacted to jcweaver in Show complete publication dates for blog posts   
    Squarespace actually puts the full blog post publication date on every blog page in a meta element with an itemprop='datePublished'. If you search for this item and get the content attribute, you can use this to inject into the published date element.
     
    <script> //only run the code after the dom has loaded document.addEventListener('DOMContentLoaded', function() { //get the blog post html item so that we can later replace this with the full published date var pubdate = document.getElementsByClassName("blog-meta-item--date"); //get the published info from the meta property on the page var datePublishedMeta = document.querySelector('meta[itemprop="datePublished"]'); for (var i = 0; i < pubdate.length; i++) { if (datePublishedMeta){ //turn the meta date into a Date item so we can restyle it var d = new Date(datePublishedMeta.getAttribute('content')); //Set the dateStyle. I prefer 'long' to display the full month like March instead of Mar pubdate[i].innerText = d.toLocaleString('default', {dateStyle: 'long'}); } } }); </script>  
  2. Like
    Jorinde reacted to tuanphan in Align the "Additional Info" text with the "Product Description" text on a product page   
    Almost any script code can be inserted via Markdown. However, there is some code that will need a bit trick to run in Markdown. 😆
  3. Like
    Jorinde reacted to tuanphan in Align the "Additional Info" text with the "Product Description" text on a product page   
    Edit your site Footer > Add a Block > Choose Markdown > Paste the code.
    In case you can't make it work, let me know, I will give another approach
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.