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 @@
1
+PELICAN_SITEURL=http://localhost:8045

+ 0
- 1
.gitignore View File

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

+ 37
- 6
README.md View File

@@ -1,13 +1,44 @@
1
-# CSS Development
1
+The source code for [sixohthree.com](https://sixohthree.com/).
2 2
 
3
-    gem install sass
4
-    npm install -g grunt grunt-init
5
-    npm install
6
-    vim assets/css/main.scss
7
-    grunt
3
+# Development
4
+
5
+Local development and deployment are assisted by Docker, Docker Compose, and
6
+Drone CI. The `.drone.yml` file is specific to my environment and private image
7
+repository, so if you're adapting my customizations to your environment, make
8
+sure you change the `image: settings.
9
+
10
+To develop locally:
11
+
12
+    $ docker-compose up
13
+
14
+This will start a persistent container for `nginx` (to serve content at
15
+[localhost:8045](http://localhost:8045) and `sass` (to compile changed SCSS
16
+files). It will also run `pelican` on your content dir.
17
+
18
+If you make content or theme changes and want to regenerate the site, re-run the
19
+`pelican` container:
20
+
21
+    $ docker-compose run pelican
22
+
23
+## Article Templates
24
+
25
+A template article exists in `content/pages/template.md`. If you use Vim, you
26
+can add an `autocmd` to inject this template into any new file in `content`.
27
+Example snippet for `.vimrc`:
28
+
29
+    if has("autocmd")
30
+        augroup templates
31
+            autocmd BufNewFile */blogdir/content/*.md 0r %:h/pages/template.md
32
+        augroup END
33
+    endif
8 34
 
9 35
 # Social embed images
10 36
 
37
+**tl;dr** Add two headers for embeds:
38
+
39
+    Meta-Image-Square: /media/2017/09/burrito/sniff.512x512.jpg
40
+    Meta-Image-FB: /media/2017/09/burrito/sniff.1200x630.jpg
41
+
11 42
 ## Twitter
12 43
 
13 44
 Code:

+ 0
- 33
bin/mkpost View File

@@ -1,33 +0,0 @@
1
-#!/bin/bash
2
-
3
-SLUG="$1"
4
-FILENAME="content/${SLUG}.md"
5
-TIMESTAMP=$(date "+%Y-%m-%d %H:%M")
6
-
7
-if [ -z "$SLUG" ] ; then
8
-    echo "Missing slug" 1>&2
9
-    exit 1
10
-fi
11
-
12
-if [ -f "$FILENAME" ] ; then
13
-    echo "Filename $FILENAME already exists" 1>&2
14
-    exit 1
15
-fi
16
-
17
-echo "Creating file $FILENAME..."
18
-
19
-cat >"$FILENAME" <<EOF
20
-Title: $SLUG
21
-Slug: $SLUG
22
-Summary: summary
23
-Date: $TIMESTAMP
24
-Category: Personal
25
-Tags: tags
26
-Status: draft
27
-
28
-
29
-EOF
30
-
31
-git add -N "$FILENAME"
32
-
33
-echo "Done."

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

@@ -0,0 +1,16 @@
1
+Title: Post title
2
+Slug: slug
3
+Summary: summary
4
+Date: 2018-06-16 11:15
5
+Category: Personal
6
+Tags: tags
7
+Status: draft
8
+
9
+
10
+
11
+<!-- links -->
12
+
13
+  []: 
14
+  []: 
15
+  []: 
16
+  []: 

Loading…
Cancel
Save