Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt McManus committed Aug 21, 2018
0 parents commit ec3e37c
Show file tree
Hide file tree
Showing 78 changed files with 23,989 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .gitignore
@@ -0,0 +1,57 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

*~
/venv
.sass-cache/
__pycache__/
*.pyc
.vscode/
/output
develop_server.sh
blog.code-workspace


# Compiled source #
###################
*.class
*.dll
*.exe
*.o
*.so
plugins/category_order
Empty file added README.md
Empty file.
Binary file added category-page.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions content/a-simple-post.md
@@ -0,0 +1,15 @@
title: A simple post
date: 2018-08-21
summary: This a simple post that shows some of the various building blocks that make up the theme such as headers, paragraphs, and lists.

## HEADER
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quis erat imperdiet, sollicitudin ligula id, sollicitudin mauris. Praesent malesuada lorem sed lectus lacinia, nec elementum nunc fermentum. Mauris quis mollis velit. Etiam tempus porta felis, sed vulputate nisi efficitur a. Quisque efficitur neque non enim venenatis, a porttitor felis tristique. Aenean et bibendum lorem. Quisque eget leo ut neque tristique aliquam id ut justo. Maecenas iaculis nulla vel tellus tristique blandit.

In sollicitudin lorem ex, ac sodales leo accumsan at. Cras interdum augue iaculis, sagittis odio ut, semper nulla. Pellentesque id rutrum dolor, gravida imperdiet velit. Fusce ut felis massa. Nam non viverra mi. Pellentesque at velit id nisl venenatis tempus. Morbi in maximus nisl, vitae placerat tellus. Integer eget nunc est. Nunc ultricies arcu blandit lorem laoreet, sed convallis ante tempor. Vestibulum auctor consequat enim, eget tristique sem congue nec. Phasellus ultrices dolor id mauris fermentum tincidunt. Morbi ligula odio, sodales nec purus sit amet, accumsan euismod libero. Nunc interdum mollis felis, non imperdiet ligula efficitur in. Praesent varius euismod magna non dignissim. Maecenas feugiat est eu lacus hendrerit faucibus. Maecenas ornare nisi mollis sagittis tincidunt.

### LIST
* Nullam at felis sagittis nisl ultricies dapibus eget sit amet dui.
* Donec rutrum nisl ut nibh mattis consequat.
* Sed ultricies nisi vitae urna lacinia, non rhoncus urna pharetra.
* Mauris a ex sit amet mi cursus vestibulum.
* Curabitur non dolor quis ipsum pharetra cursus sed et nulla.
38 changes: 38 additions & 0 deletions content/category/post-with-code.md
@@ -0,0 +1,38 @@
title: A post with code blocks
date: 2018-08-21
summary: This a simple post that shows how code blocks will appear. Code blocks word wrap at smaller breakpoints. Syntax highlighting is supported via Pygments. Happy coding!
tags: code

## Python Code block

```python
def my_handler(event, context):
print("Received event: " + json.dumps(event, indent=2))
handle(event['message'])
```

## JSON code block

```json
{
"update_id": 8888,
"message": {
"chat": {
"first_name": "Matt",
"id": put_your_id_here,
"last_name": "McManus",
"type": "private",
"rolename": "mcman_s"
},
"date": 1453851465,
"from": {
"first_name": "Matt",
"id": put_your_id_here,
"last_name": "McManus",
"rolename": "mcman_s"
},
"message_id": 2,
"text": "/start"
}
}
```
8 changes: 8 additions & 0 deletions content/extra-post.md
@@ -0,0 +1,8 @@
title: An extra post
date: 2018-08-21
summary: This a post containing gibberish. Only used to show what pagination looks like.

## HEADER
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quis erat imperdiet, sollicitudin ligula id, sollicitudin mauris. Praesent malesuada lorem sed lectus lacinia, nec elementum nunc fermentum. Mauris quis mollis velit. Etiam tempus porta felis, sed vulputate nisi efficitur a. Quisque efficitur neque non enim venenatis, a porttitor felis tristique. Aenean et bibendum lorem. Quisque eget leo ut neque tristique aliquam id ut justo. Maecenas iaculis nulla vel tellus tristique blandit.

In sollicitudin lorem ex, ac sodales leo accumsan at. Cras interdum augue iaculis, sagittis odio ut, semper nulla. Pellentesque id rutrum dolor, gravida imperdiet velit. Fusce ut felis massa. Nam non viverra mi. Pellentesque at velit id nisl venenatis tempus. Morbi in maximus nisl, vitae placerat tellus. Integer eget nunc est. Nunc ultricies arcu blandit lorem laoreet, sed convallis ante tempor. Vestibulum auctor consequat enim, eget tristique sem congue nec. Phasellus ultrices dolor id mauris fermentum tincidunt. Morbi ligula odio, sodales nec purus sit amet, accumsan euismod libero. Nunc interdum mollis felis, non imperdiet ligula efficitur in. Praesent varius euismod magna non dignissim. Maecenas feugiat est eu lacus hendrerit faucibus. Maecenas ornare nisi mollis sagittis tincidunt.
Binary file added content/images/pelly.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/site-cover.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/images/wilderness.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions content/pages/page1.md
@@ -0,0 +1,4 @@
title: page1

## A SINGLE PAGE
Pages show up in the menu unless you set `DISPLAY_PAGES_ON_MENU = False` in settings.
10 changes: 10 additions & 0 deletions content/post-with-images.md
@@ -0,0 +1,10 @@
title: A post with images
date: 2018-08-21
summary: This a simple post that shows how images with appear if you use this theme.
tags: images

## HEADER

![Unsplash Wilderness photo]({filename}/images/wilderness.jpg "Wilderness")

I highly recommended using the [optimize_images]("https://github.com/getpelican/pelican-plugins/tree/master/optimize_images") plugin.
119 changes: 119 additions & 0 deletions content/releases/version-one.md
@@ -0,0 +1,119 @@
title: Version 1.0 of 'Brutalist' released!
date: 2018-08-22
summary: I'm excited to release the first version of the Pelican theme I've been working on. This post contains all the details you need to get up and running. For those interested, I also listed some of the tools I used to build the theme along with some of my design rationale, which may be helpful if you are looking to extend the theme and make it your own.
cover_image: images/site-cover.jpg

![Brutalist Pelican Theme]({filename}/images/site-cover.jpg "Brutalist Pelican Theme")

## Background and Inspiration
When I decided to get back into blogging, I knew that wanted a site that was super simple and readable. There are many great Pelican themes out there but I couldn't quite find what I was looking for. After reading David Bryant Copeland's [Brutalist Web Design]("https://brutalist-web.design/") a few weeks ago, I was inspired to try and apply those design principles to a Pelican theme. The goal of this theme is to be feature-rich while also accessible and fast. This release is just 1.0. I'll be adding more features as I shake off the front-end coding rust.

## Features
* Clean, readable, accessible, and fast theme
* W3C validates
* Clean slugified URLs
* Easy to extend and customize to your liking
* SEO optimized w/ OG tags and Twitter Card support
* Google Analytics support
* Gravatar support
* Disqus support
* Pygments syntax highlighting for code blocks
* Display Twitter, Github, Facebook, Instagram, Strava, Untappd, Telegram, Foursquare, and Goodreads icons in footer if configured

## Template support
### Supported
* archives.html
* period_archives.html
* article.html
* categories.html
* category.html
* index.html
* page.html
* tag.html
* tags.html

### Not supported
* author.html
* authors.html


## Configuration
Here is a list of theme settings you can configure to alter aspects of the theme. The theme also supports most of the general settings that Pelican offers so I won't go into those here.

```python
# Theme Settings
THEME = 'themes/brutalist'
## used for OG tags and Twitter Card data on index page
SITEIMAGE = 'site-cover.jpg'
## used for OG tags and Twitter Card data of index page
SITEDESCRIPTION = 'A simple, accessible, content-first Pelican theme inspired by David Bryant Copeland\'s https://brutalist-web.design/'
## path to favicon
FAVICON = 'pelly.png'
## path to logo for nav menu (optional)
LOGO = 'pelly.png'
## first name for nav menu if logo isn't provided
FIRST_NAME = 'Brutalist'
## google analytics (fake code commented out)
# GOOGLE_ANALYTICS = 'UA-0011001-1'
## Twitter username for Twitter Card data
TWITTER_USERNAME = '@mcman_s'
## Toggle display of theme attribution in the footer (scroll down and see)
## Attribution is appreciated but totally fine to turn off!
ATTRIBUTION = True
## Add a link to the tags page to the menu
## Other links can be added following the same tuple pattern
MENUITEMS = [('tags', '/tags')]
## Social icons for footer
## Set these to whatever your unique public URL is for that platform
## I've left mine here as a example
STRAVA = 'https://www.strava.com/athletes/27234301'
TWITTER = 'https://twitter.com/mcman_s'
INSTAGRAM = 'https://instagram.com/mcman_s'
GITHUB = 'https://github.com/mamcmanus'
TELEGRAM = 'https://t.me/mcman_s'
GOODREADS = 'https://www.goodreads.com/user/show/48849158-matthew-mcmanus'
FOURSQUARE = 'https://foursquare.com/mcman_s'
UNTAPPD = 'https://untappd.com/user/mcman_s'
## Disqus Sitename for comments on posts
## Commenting mine out for this theme site
# DISQUS_SITENAME = 'mamcmanus'
## Gravatar
## Commenting mine out so you can see how the theme looks without one
## See https://mamcmanus.com to see what it looks like with a Gravatar
# GRAVATAR = 'https://www.gravatar.com/avatar/a5544bcae63c5d56c0b7a3fa0ab5b295?s=256'
```

## Plugins
I use this theme on [my site]("https://mamcmanus.com") with the following plugin configuration.

```python
# PLUGINS
PLUGIN_PATHS = ['plugins']
PLUGINS = ['sitemap', 'category_order', 'w3c_validate', 'optimize_images', 'gzip_cache']

## SITEMAP PLUGIN
SITEMAP = {
'format': 'xml',
'priorities': {
'articles': .99,
'pages': .75,
'indexes': .5
},
'changefreqs': {
'articles': 'daily',
'pages': 'daily',
'indexes': 'daily'
},
}
```

## Design and tooling choices
Some design and tooling choices I made while building this theme. Feedback welcome.

* I kept the site in a single column for now. Research shows that the optimal character count is 66 and the single column design usually lands between 50-75.
* I chose the Lato font face and only 3 font weights because I like the way it looks. I have received feedback that it may be too hard to read so I may add some weights or change it. Instead of using the google font API urls, each font weight was translated to its raw Data URI and packaged with the theme to improve loading performance.
* Same thing for the footer icons. I used one of my favorite tools, [Grumpicon]("http://www.grumpicon.com/"), to properly package the fonts. I did not introduce the entire Grumpicon JS toolchain since it seems complex and I really just needed a handful of icons.
* I designed in SASS instead of CSS, mostly for the same reasons I [outlined a few years ago]("https://mamcmanus.com/2016/01/14/switching-from-css-to-sass/").
* For date and time display I am using [moment.js]("https://momentjs.com/"). I've been using this script for years because it is easy to get the dates and times looking exactly how you want.

Contributions, ideas, and general chat welcome. Feel free to reach out on Twitter or Telegram. I'll be working to add more features over the coming months.
Binary file added index.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 111 additions & 0 deletions pelicanconf.py
@@ -0,0 +1,111 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals

AUTHOR = 'Matt McManus'
SITENAME = 'Brutalist Pelican Theme'
SITEURL = ''

# Categories
USE_FOLDER_AS_CATEGORY = True
DISPLAY_CATEGORIES_ON_MENU = True

# Pages
DISPLAY_PAGES_ON_MENU = True

PATH = 'content'
STATIC_PATHS = ['images']
TIMEZONE = 'America/Denver'
DEFAULT_LANG = 'en'

# Will change this to 10 when publishing; 3 is easier to do theme dev with
DEFAULT_PAGINATION = 4

# Period Archive formats
YEAR_ARCHIVE_SAVE_AS = '{date:%Y}/index.html'
MONTH_ARCHIVE_SAVE_AS = '{date:%Y}/{date:%m}/index.html'
DAY_ARCHIVE_SAVE_AS = '{date:%Y}/{date:%m}/{date:%d}/index.html'

# URL settings -- leads to clean slug urls instead of having .html after everything
ARTICLE_URL = '{date:%Y}/{date:%m}/{date:%d}/{slug}/'
ARTICLE_SAVE_AS = '{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html'
TAG_URL = 'tag/{slug}/'
TAG_SAVE_AS = 'tag/{slug}/index.html'
DRAFT_URL = 'drafts/{slug}'
DRAFT_SAVE_AS = 'drafts/{slug}/index.html'
CATEGORY_URL = 'category/{slug}'
CATEGORY_SAVE_AS = 'category/{slug}/index.html'
AUTHOR_URL = ''
AUTHOR_SAVE_AS = ''
AUTHORS_SAVE_AS = ''
PAGE_URL = 'pages/{slug}/'
PAGE_SAVE_AS = 'pages/{slug}/index.html'
PAGINATION_PATTERNS = (
(1, '{base_name}/', '{base_name}/index.html'),
(2, '{base_name}/{number}/', '{base_name}/{number}/index.html'),
)

# Theme Settings
THEME = 'themes/brutalist'
## used for OG tags and Twitter Card data on index page
SITEIMAGE = 'site-cover.jpg'
## used for OG tags and Twitter Card data of index page
SITEDESCRIPTION = 'A simple, accessible, content-first Pelican theme inspired by David Bryant Copeland\'s https://brutalist-web.design/'
## path to favicon
FAVICON = 'pelly.png'
## path to logo for nav menu (optional)
LOGO = 'pelly.png'
## first name for nav menu if logo isn't provided
FIRST_NAME = 'Brutalist'
## google analytics (fake code commented out)
# GOOGLE_ANALYTICS = 'UA-0011001-1'
## Twitter username for Twitter Card data
TWITTER_USERNAME = '@mcman_s'
## Toggle display of theme attribution in the footer (scroll down and see)
## Attribution is appreciated but totally fine to turn off!
ATTRIBUTION = True
## Add a link to the tags page to the menu
## Other links can be added following the same tuple pattern
MENUITEMS = [('tags', '/tags')]
## Social icons for footer
## Set these to whatever your unique public URL is for that platform
## I've left mine here as a example
STRAVA = 'https://www.strava.com/athletes/27234301'
TWITTER = 'https://twitter.com/mcman_s'
INSTAGRAM = 'https://instagram.com/mcman_s'
GITHUB = 'https://github.com/mamcmanus'
TELEGRAM = 'https://t.me/mcman_s'
GOODREADS = 'https://www.goodreads.com/user/show/48849158-matthew-mcmanus'
FOURSQUARE = 'https://foursquare.com/mcman_s'
UNTAPPD = 'https://untappd.com/user/mcman_s'
## Disqus Sitename for comments on posts
## Commenting mine out for this theme site
# DISQUS_SITENAME = 'mamcmanus'
## Gravatar
## Commenting mine out so you can see how the theme looks without one
## See https://mamcmanus.com to see what it looks like with a Gravatar
# GRAVATAR = 'https://www.gravatar.com/avatar/a5544bcae63c5d56c0b7a3fa0ab5b295?s=256'


# PLUGINS
PLUGIN_PATHS = ['plugins']
PLUGINS = ['sitemap', 'category_order', 'w3c_validate', 'optimize_images', 'gzip_cache']

## SITEMAP PLUGIN
SITEMAP = {
'format': 'xml',
'priorities': {
'articles': .99,
'pages': .75,
'indexes': .5
},
'changefreqs': {
'articles': 'daily',
'pages': 'daily',
'indexes': 'daily'
},
}

## Github URL for fork ribbon
## Only used on theme site, not personal blog
GITHUB_URL = 'https://github.com/mamcmanus'
17 changes: 17 additions & 0 deletions plugins/gzip_cache/Readme.rst
@@ -0,0 +1,17 @@
Gzip cache
----------

Certain web servers (e.g., Nginx) can use a static cache of gzip-compressed
files to prevent the server from compressing files during an HTTP call. Since
compression occurs at another time, these compressed files can be compressed
at a higher compression level for increased optimization.

The ``gzip_cache`` plugin compresses all common text type files into a ``.gz``
file within the same directory as the original file.

Settings
--------

* `GZIP_CACHE_OVERWRITE`
If True, the original files will be replaced by the gzip-compressed files.
This is useful for static hosting services (e.g S3). Defaults to False.
1 change: 1 addition & 0 deletions plugins/gzip_cache/__init__.py
@@ -0,0 +1 @@
from .gzip_cache import *

0 comments on commit ec3e37c

Please sign in to comment.