Browse Source

Add a template.md and some docs

restyle-spring-2019
Annika Backstrom 1 year ago
parent
commit
50be528a93
5 changed files with 54 additions and 40 deletions
  1. 1
    0
      .env
  2. 0
    1
      .gitignore
  3. 37
    6
      README.md
  4. 0
    33
      bin/mkpost
  5. 16
    0
      content/pages/template.md

+ 1
- 0
.env View File

@@ -0,0 +1 @@
PELICAN_SITEURL=http://localhost:8045

+ 0
- 1
.gitignore View File

@@ -1,6 +1,5 @@
output/*
cache
*.pyc
.env
assets/css/main.css
assets/css/main.css.map

+ 37
- 6
README.md View File

@@ -1,13 +1,44 @@
# CSS Development
The source code for [sixohthree.com](https://sixohthree.com/).

gem install sass
npm install -g grunt grunt-init
npm install
vim assets/css/main.scss
grunt
# Development

Local development and deployment are assisted by Docker, Docker Compose, and
Drone CI. The `.drone.yml` file is specific to my environment and private image
repository, so if you're adapting my customizations to your environment, make
sure you change the `image: settings.

To develop locally:

$ docker-compose up

This will start a persistent container for `nginx` (to serve content at
[localhost:8045](http://localhost:8045) and `sass` (to compile changed SCSS
files). It will also run `pelican` on your content dir.

If you make content or theme changes and want to regenerate the site, re-run the
`pelican` container:

$ docker-compose run pelican

## Article Templates

A template article exists in `content/pages/template.md`. If you use Vim, you
can add an `autocmd` to inject this template into any new file in `content`.
Example snippet for `.vimrc`:

if has("autocmd")
augroup templates
autocmd BufNewFile */blogdir/content/*.md 0r %:h/pages/template.md
augroup END
endif

# Social embed images

**tl;dr** Add two headers for embeds:

Meta-Image-Square: /media/2017/09/burrito/sniff.512x512.jpg
Meta-Image-FB: /media/2017/09/burrito/sniff.1200x630.jpg

## Twitter

Code:

+ 0
- 33
bin/mkpost View File

@@ -1,33 +0,0 @@
#!/bin/bash

SLUG="$1"
FILENAME="content/${SLUG}.md"
TIMESTAMP=$(date "+%Y-%m-%d %H:%M")

if [ -z "$SLUG" ] ; then
echo "Missing slug" 1>&2
exit 1
fi

if [ -f "$FILENAME" ] ; then
echo "Filename $FILENAME already exists" 1>&2
exit 1
fi

echo "Creating file $FILENAME..."

cat >"$FILENAME" <<EOF
Title: $SLUG
Slug: $SLUG
Summary: summary
Date: $TIMESTAMP
Category: Personal
Tags: tags
Status: draft


EOF

git add -N "$FILENAME"

echo "Done."

+ 16
- 0
content/pages/template.md View File

@@ -0,0 +1,16 @@
Title: Post title
Slug: slug
Summary: summary
Date: 2018-06-16 11:15
Category: Personal
Tags: tags
Status: draft



<!-- links -->

[]:
[]:
[]:
[]:

Loading…
Cancel
Save