Skip to content

Instantly share code, notes, and snippets.

View drewsberry's full-sized avatar

Drew - Account Moved drewsberry

View GitHub Profile
@drewsberry
drewsberry / jekyll-excerpt.html
Created July 30, 2014 15:23
Jekyll excerpts, split by <!--more--> by default. If not found, default to the first 500 words.
{% if post.content contains '<!--more-->' %}
{{ post.content | split:'<!--more-->' | first %}}
<p><a class="btn btn-primary btn-lg" href="{{ post.url }}">Continue reading...</a></p>
{% else %}
{{ post.content | truncate: 500 }}
<p><a class="btn btn-primary btn-lg" href="{{ post.url }}">Continue reading...</a></p>
{% endif %}
@drewsberry
drewsberry / gitjekgit.sh
Last active December 14, 2020 03:03
Useful Jekyll + Git Bash scripts
#!/bin/bash
# Run this scrript in the root directory of your Jekyll source
# repository for your GitHub page, and it will commit and push
# the source to origin/source, then build, commit and push the
# resuling HTML to your origin/master, i.e. your website. The
# commit message for both commits is given by the first
# argument.
if [[ -z "$1" ]]; then