Skip to content

Instantly share code, notes, and snippets.

View hrtovey's full-sized avatar
🎉

Heather Tovey hrtovey

🎉
View GitHub Profile
@hrtovey
hrtovey / read-more-code.txt
Created April 2, 2018 03:56
Manually inject Read More link using button styles after blog post excerpt.
Small Button
<div class="sqs-block button-block sqs-block-button BlogList-item-excerpt"><div class="sqs-block-content">
<div class="sqs-block-button-container--center" data-alignment="center" data-button-size="small">
<a href="{permalink}" class="sqs-block-button-element--small sqs-block-button-element" data-initialized="true">Read More</a>
</div></div></div>
-----------
Under Design > Style Editor > Blog: List > Read More Link, choose Hide to hide the default Read More link.
/* CSS */
#about {
overflow:visible;
}
.cute-kitten-image {
margin-top: -330px !important; /* Otherwise margin-top is overwritten by Squarespace template */
}
@hrtovey
hrtovey / squarespace-index-navigation
Last active June 14, 2018 19:15
Add this to the Index Page's Page Header Code Injection
<script>
function makeIndexNav() {
var indexSections = Array.from(document.getElementsByClassName('index-section')).map(section => section.id);
document.getElementById('content').appendChild(makeUL(indexSections));
window.onscroll = function changeNav(){
var indexSectionList = [];
@hrtovey
hrtovey / blog-pagination-text-change
Created June 27, 2018 13:57
Change Older and Newer Text on Blog Pagination
<script>
Y.on('domready', function() {
Y.all('.BlogList-pagination-link-label').each(function() {
if(this.getHTML() == 'Older') {
this.setHTML('More');
}
if(this.getHTML() == 'Newer') {
this.setHTML('Back');
}
@hrtovey
hrtovey / fade-in-button-on-scroll
Last active July 12, 2018 18:20
A button in the bottom-right corner that fades in as the user scrolls down the page. Place inside Squarespace page code injection. Technique found here: https://www.choosewonder.com/ - Converted from jQuery to Vanilla JS
<style>
/* CSS Code to style the button. Change background-color and color to match your brand colors. */
.sf-back-to-top {
background-color: #d52d8e;
color: #fff;
opacity: 0;
transition: opacity .6s ease-in-out;
-moz-transition: opacity .6s ease-in-out;
{
"firstName": "Jane",
"lastName": "Smith",
"address": {
"streetAddress": "425 2nd Street",
"city": "San Francisco",
"state": "CA",
"postalCode": 94107
},
"phoneNumbers": [
body {
background: linear-gradient(270deg, #4fcee3, #ce00ab);
}
.Index-page {
background-color: transparent;
}
@hrtovey
hrtovey / heading-paragraph-selectors.less
Last active April 11, 2020 18:50
Some code to help you style headings and paragraphs in 7.1. Check out the fundamentals for more help with specific styling needs: https://developer.mozilla.org/en-US/docs/Learn/CSS/Styling_text/Fundamentals
h1 {
line-height: 1;
letter-spacing: 0;
font-weight: bold;
}
h2 {
line-height: 1;
letter-spacing: 0;
font-weight: bold;