commit 9773c7c387c70ee71895dc88216a731457f151bc Author: Felipe Martín Date: Tue Sep 2 17:01:16 2014 +0200 Initial Commit (Zombiepress migration) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a4a76ad --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +*.pyc +.virtualenv +node_modules +**/bower +bower_components +**/CACHE/* +*.sublime-workspace +.sass-cache +db.sqlite3 diff --git a/README.md b/README.md new file mode 100644 index 0000000..8cd9658 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +fmartingr.com +=== + +My personal site codebase. + +http://fmartingr.com \ No newline at end of file diff --git a/fabfile.py b/fabfile.py new file mode 100644 index 0000000..d78d152 --- /dev/null +++ b/fabfile.py @@ -0,0 +1,119 @@ +from __future__ import with_statement, print_function +from os.path import dirname, abspath, join as join_path +from os import walk +from functools import wraps +from StringIO import StringIO + +from jinja2 import Environment, FileSystemLoader +from fabric.api import * +from fabric.context_managers import settings +from fabric.contrib.files import exists, upload_template +from fabric.colors import yellow, red, white, green + + +# +# GLOBALS +# +env.LOCAL_PATH = dirname(abspath(__file__)) + +if not env.hosts: + env.hosts = ['localhost'] + +# Doctor checkups +DOCTOR = { + 'apps': ['virtualenv', 'python', 'npm', 'grunt'] +} + +# +# CONTEXT MANAGERS +# +def virtualenv(): + """ + Activates virtualenv first + """ + return prefix('source {}/.virtualenv/bin/activate'.format(env.LOCAL_PATH)) + + +# +# TASKS +# +@task +def setup_environment(): + """ + Prepares environment for the application + """ + with cd(env.LOCAL_PATH): + execute(setup_virtualenv) + execute(setup_tools) + execute(setup_database) + + +@task +def setup_virtualenv(appenv='local'): + """ + Creates or updates a virtualenv + """ + if not exists('.virtualenv'): + print(yellow('Create virtualenv')) + run('virtualenv .virtualenv') + + with virtualenv(): + print(yellow('Installing requirements')) + run('pip install -r requirements-{}.txt'.format(appenv)) + + +@task +def setup_tools(): + # Setup frontend tools + print(yellow('Installing npm dependencies')) + run('npm install') + print(yellow('Installing bower dependencies')) + run('bower install') + + +@task +def setup_database(): + """ + Create or update the database + """ + with virtualenv(): + print(yellow('SyncDB')) + run('python manage.py syncdb') + print(yellow('Migrate')) + run('python manage.py migrate') + + +@task +def doctor(): + print(yellow('Checking for software:')) + for app in DOCTOR['apps']: + print(white('{}'.format(app)), end=': ') + check = run('which {}'.format(app), quiet=True) + if check.succeeded: + print(green('present')) + else: + print(red('not present')) + + +# +# LOCAL ONLY +# +@task +@hosts(['localhost']) +def runserver(): + """ + Executes local development server + """ + with cd(env.LOCAL_PATH): + with virtualenv(): + run('python manage.py runserver 0.0.0.0:8000') + + +@task +@hosts(['localhost']) +def rungrunt(): + """ + Executes grunt + """ + with cd(env.LOCAL_PATH): + run('grunt watch') diff --git a/fmartingrcom.sublime-project b/fmartingrcom.sublime-project new file mode 100644 index 0000000..14d5a5b --- /dev/null +++ b/fmartingrcom.sublime-project @@ -0,0 +1,14 @@ +{ + "folders": + [ + { + "follow_symlinks": true, + "path": ".", + "folder_exclude_patterns": [ + "node_modules", + ".virtualenv", + "**/CACHE/*" + ] + } + ] +} diff --git a/fmartingrcom/__init__.py b/fmartingrcom/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fmartingrcom/apps/__init__.py b/fmartingrcom/apps/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fmartingrcom/apps/homepage/__init__.py b/fmartingrcom/apps/homepage/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fmartingrcom/apps/homepage/models.py b/fmartingrcom/apps/homepage/models.py new file mode 100644 index 0000000..e69de29 diff --git a/fmartingrcom/apps/homepage/sitemap.py b/fmartingrcom/apps/homepage/sitemap.py new file mode 100644 index 0000000..43741c3 --- /dev/null +++ b/fmartingrcom/apps/homepage/sitemap.py @@ -0,0 +1,13 @@ +from django.contrib.sitemaps import Sitemap +from django.core.urlresolvers import reverse + + +class HomeSitemap(Sitemap): + priority = 0.5 + changefreq = 'weekly' + + def items(self): + return ['homepage'] + + def location(self, item): + return reverse(item) diff --git a/fmartingrcom/apps/homepage/urls.py b/fmartingrcom/apps/homepage/urls.py new file mode 100644 index 0000000..b5aed23 --- /dev/null +++ b/fmartingrcom/apps/homepage/urls.py @@ -0,0 +1,13 @@ +from django.conf.urls import patterns, url + +from .views import HomepageView + + +urlpatterns = patterns( + None, + url( + r'^$', + HomepageView.as_view(), + name='homepage' + ), +) diff --git a/fmartingrcom/apps/homepage/views.py b/fmartingrcom/apps/homepage/views.py new file mode 100644 index 0000000..8911f7c --- /dev/null +++ b/fmartingrcom/apps/homepage/views.py @@ -0,0 +1,22 @@ +from django.shortcuts import render_to_response +from django.template import RequestContext +from django.views.generic import View as DjangoView + + +class View(DjangoView): + section = None + data = {} + + def __init__(self, *args, **kwargs): + self.data['section'] = self.section + return super(View, self).__init__(*args, **kwargs) + + + +class HomepageView(View): + template = 'homepage.jinja' + section = 'homepage' + + def get(self, request): + context = RequestContext(request, self.data) + return render_to_response(self.template, context_instance=context) diff --git a/fmartingrcom/settings/__init__.py b/fmartingrcom/settings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fmartingrcom/settings/base.py b/fmartingrcom/settings/base.py new file mode 100644 index 0000000..94aee33 --- /dev/null +++ b/fmartingrcom/settings/base.py @@ -0,0 +1,130 @@ +""" +Django settings for fmartingrcom project. + +For more information on this file, see +https://docs.djangoproject.com/en/1.6/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.6/ref/settings/ +""" + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import os +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '0123456789' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +TEMPLATE_DEBUG = True + +ALLOWED_HOSTS = [] + + +# +# APPLICATIONS +# +INSTALLED_APPS = ( + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + + 'django_jinja', + + 'compressor', +) + + +# +# MIDDLEWARE +# +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +) + + + +ROOT_URLCONF = 'fmartingrcom.urls' + +WSGI_APPLICATION = 'fmartingrcom.wsgi.application' + + +# +# DATABASES +# + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + +# Internationalization +# https://docs.djangoproject.com/en/1.6/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# +# STATIC FILES +# + +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'compressor.finders.CompressorFinder', +) + +STATICFILES_DIRS = ( + '{}/themes/v1/static/'.format(BASE_DIR), +) + +STATIC_URL = '/static/' + +STATIC_ROOT = os.path.join(BASE_DIR, 'static') + +COMPRESS_PRECOMPILERS = ( + ('text/less', 'lessc {infile} {outfile}'), + ('text/x-sass', 'sass {infile} {outfile}'), + ('text/coffeescript', 'coffee --compile --stdio --no-header'), +) + +# +# TEMPLATES +# +TEMPLATE_LOADERS = ( + 'django_jinja.loaders.AppLoader', + 'django_jinja.loaders.FileSystemLoader', +) + + +TEMPLATE_DIRS = ( + '{}/themes/v1/templates/'.format(BASE_DIR), +) + +JINJA2_EXTENSIONS = [ + 'compressor.contrib.jinja2ext.CompressorExtension', +] diff --git a/fmartingrcom/settings/configfile.py b/fmartingrcom/settings/configfile.py new file mode 100644 index 0000000..646256f --- /dev/null +++ b/fmartingrcom/settings/configfile.py @@ -0,0 +1,46 @@ +import os +import sys +import dj_database_url +import toml +from .base import * + + +this_module = sys.modules[__name__] + +# Read configfile +with open(os.environ['APP_CONFIGFILE']) as conffile: + config = toml.loads(conffile.read()) + +# Installed Apps +INSTALLED_APPS += tuple(config['global']['installed_apps']) + +# Database +DATABASES = { + 'default': dj_database_url.parse(config['global']['database_url']) +} + +SECRET_KEY = open(config['global']['secret_key']).read().strip() + +# Overwrite values +for key, value in config['overwrite'].iteritems(): + setattr(this_module, key.upper(), value) + +# Logging +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'handlers': { + 'file': { + 'level': 'DEBUG', + 'class': 'logging.FileHandler', + 'filename': config['log']['logfile'], + }, + }, + 'loggers': { + 'django.request': { + 'handlers': ['file'], + 'level': 'DEBUG', + 'propagate': True, + }, + }, +} diff --git a/fmartingrcom/themes/v1/static/images/homepage/bg.png b/fmartingrcom/themes/v1/static/images/homepage/bg.png new file mode 100644 index 0000000..fc14318 Binary files /dev/null and b/fmartingrcom/themes/v1/static/images/homepage/bg.png differ diff --git a/fmartingrcom/themes/v1/static/sass/_blog.sass b/fmartingrcom/themes/v1/static/sass/_blog.sass new file mode 100644 index 0000000..d75eb8a --- /dev/null +++ b/fmartingrcom/themes/v1/static/sass/_blog.sass @@ -0,0 +1,131 @@ +body + &.blog + background-color: #fff + padding-bottom: 20px + + section.content + hr:last-child + display: none + +article.blog-entry + text-align: left + + &:after + clear: both + + h2 + margin: 16px 0 10px 0 + + a:hover + border: 0 + + h1 + border-right: #555 6px solid + margin-bottom: 0.5em + font-size: 2.2em + + &.draft + border: $warning-color 3px dashed + padding: 0 20px + + .info + + .content + line-height: 140% + padding-top: 15px + + img + box-shadow: $sidebar-bg 0 0 4px + max-width: 100% + + &.noshadow + box-shadow: none + + &.float-left + float: left + margin-right: 3% + + blockquote + border-left: 4px solid #dddddd + padding: 0 15px + color: #777777 + > :first-child + margin-top: 0 + > :last-child + margin-bottom: 0 + + code + display: inline-block + white-space: no-wrap + background: #fff + font-size: .8em + line-height: 1.5em + color: #555 + border: 1px solid #ddd + -webkit-border-radius: 0.4em + -moz-border-radius: 0.4em + -ms-border-radius: 0.4em + -o-border-radius: 0.4em + border-radius: 0.4em + padding: 0 .3em + margin: -1px 0 + + hr + width: 50% + + table + padding: 0 + margin: 0 auto + + tr + border-top: 1px solid #cccccc + background-color: white + margin: 0 + padding: 0 + + &:nth-child(2n) + background-color: #f8f8f8 + + th + font-weight: bold + border: 1px solid #cccccc + text-align: left + margin: 0 + padding: 6px 13px + td + border: 1px solid #cccccc + text-align: left + margin: 0 + padding: 6px 13px + + th :first-child, td :first-child + margin-top: 0 + + th :last-child, td :last-child + margin-bottom: 0 + + a.readmore + background: $warning-color + border: none + color: white + font-family: helvetica, sans-serif + font-weight: bold + padding: 10px + font-size: 90% + + .draft-warning + background-color: $warning-color + color: $warning-text-color + margin: 5px 0 5px 0 + padding: 8px 0 8px 0 + + pre.prettyprint + line-height: 120% + +.search-field + border: none + font-size: 0.8em + font-weight: bold + height: 1.2em + padding: 2% + width: 86% diff --git a/fmartingrcom/themes/v1/static/sass/_homepage.sass b/fmartingrcom/themes/v1/static/sass/_homepage.sass new file mode 100644 index 0000000..f2191b0 --- /dev/null +++ b/fmartingrcom/themes/v1/static/sass/_homepage.sass @@ -0,0 +1,49 @@ +body + &.homepage + background-color: #eee + background-image: url('/static/images/homepage/bg.png') + background-attachment: fixed + +section.content + // http://www.sitepoint.com/css3-shuffled-paper/ + .papers + background: #fff + box-shadow: 0 0 10px rgba(0,0,0,0.3) + margin: 26px auto 0 + //max-width: 700px + max-width: 600px + padding: 24px + position: relative + width: 80% + + .papers:before, .papers:after + content: "" + height: 98% + position: absolute + width: 100% + z-index: -1 + + .papers:before + background: #fafafa + box-shadow: 0 0 8px rgba(0,0,0,0.2) + left: -5px + top: 4px + @include rotate(-2.5) + + .papers:after + background: #f6f6f6 + box-shadow: 0 0 3px rgba(0,0,0,0.2) + right: -3px + top: 1px + @include rotate(1.4) + + .picture + background-color: white + padding: 8px + padding-bottom: 30px + margin-left: 40px + margin-bottom: 12px + box-shadow: 0 0 3px rgba(0,0,0,0.2) + @include rotate(10) + margin-top: -10px + margin-right: -50px diff --git a/fmartingrcom/themes/v1/static/sass/_layout.sass b/fmartingrcom/themes/v1/static/sass/_layout.sass new file mode 100644 index 0000000..b2e7e60 --- /dev/null +++ b/fmartingrcom/themes/v1/static/sass/_layout.sass @@ -0,0 +1,197 @@ +html, body + color: $text-color + font-family: $font-family + font-size: $font-size + //font-weight: 400 + margin: 0 + min-height: 100% + text-align: justify + +body + padding-bottom: 40px + +h1, h2, h3, h4, h5, h6 + font-family: $headers-font-family + font-weight: normal + text-shadow: 1px 1px 3px rgb(221, 221, 221) + +h1 + font-size: 200% + +h2 + font-size: 175% + +h3 + font-size: 150% + +h4 + font-size: 125% + +strong + color: $strong-text-color + +a + color: $anchor-text-color + text-decoration: none + + &.dark + color: $text-color + //text-shadow: $text-color $text-shadow-properties + + &.bright + color: $text-shadow-color + + &:hover + border-bottom: 1px dotted + +figure + margin: 0 + text-align: center + + img + margin: 14px + + &.pull-left + margin-left: 0 + + &.pull-right + margin-right: 0 + + &.padding + padding: 6px + + &.shadow + box-shadow: $text-color $box-shadow-properties + +hr + background: none + border: 0 + border-bottom: #aaa 1px dotted + width: 90% + + &.big + border-bottom-width: 3px + margin: 30px auto + + +.sidebar + background-color: $sidebar-bg + color: $sidebar-text-color + min-height: 100% + position: fixed + top: 0 + width: $sidebar-width + + &> button.menu + display: none + + &> header + height: 220px + + .logo + color: #fff + font-family: Verdana + font-size: 200% + font-weight: 800 + padding: 20px + + footer + bottom: 0 + position: absolute + left: 0 + padding: $footer-padding + width: $sidebar-width - ($footer-padding*2) + + .zombiepress + font-family: $headers-font-family + font-size: 80% + text-shadow: #333 1px 1px 3px + a + color: #fff + + .zone-menu + + .buttons + @extend .text-center + + header + font-size: 170% + margin-bottom: 10px + + &.social + margin-bottom: 20px + button + width: 31% + font-size: 75% + font-family: helvetica, sans-serif + + button + background-color: rgb(192, 192, 192) + border: none + cursor: pointer + font-size: 90% + margin-top: 5px + padding: 8px 0 8px 0 + font-weight: bold + width: 90% + + transition: 0.3s all + + &.half + width: 38% + + &.gap + &.pull-right + margin-right: 5% + + &.pull-left + margin-left: 5% + + &:hover + //margin-left: 10px + + &.rss + background-color: $rss-color + color: $rss-text-color + + &:hover + background-color: darken($rss-color, 12%) + + &.email + background-color: $email-color + color: $email-text-color + + &:hover + background-color: darken($email-color, 12%) + + &.twitter + background-color: $twitter-color + color: $twitter-text-color + + &:hover + background-color: darken($twitter-color, 12%) + + &.github + background-color: $github-color + color: $github-text-color + + &:hover + background-color: darken($github-color, 12%) + + &.blog + background-color: $blog-color + color: $blog-text-color + + &:hover + background-color: darken($blog-color, 12%) + + &.projects + background-color: $projects-color + color: $projects-text-color + + &:hover + background-color: darken($projects-color, 12%) + +section.content + margin-left: $sidebar-width + $content-sidebar-gap + width: 60% diff --git a/fmartingrcom/themes/v1/static/sass/_oocss.sass b/fmartingrcom/themes/v1/static/sass/_oocss.sass new file mode 100644 index 0000000..8b689e6 --- /dev/null +++ b/fmartingrcom/themes/v1/static/sass/_oocss.sass @@ -0,0 +1,92 @@ +.pull-left + float: left + +.pull-right + float: right + +.text-center + text-align: center + +.text-right + text-align: right + +.text-left + text-align: left + +.clearfix + *zoom: 1 + + &:before, &:after + content: " " + display: table + + &:after + clear: both + +.small + font-size: 50% + line-height: 50% + +.alt-font + font-family: $headers-font-family + +.hacker-icon + $size: 22px + display: inline-block + position: relative + height: $size + width: $size + + -moz-transition: all 0.5s + -webkit-transition: all 0.5s + transition: all 0.5s + + &:hover + vertical-align: top + width: 22px + &:before + content: "a" + div + display: none + + div:nth-child(1) + position: absolute + left: $size/3 + top: 0 + + div:nth-child(2) + position: absolute + left: ($size/3)*2 + top: $size/3 + + div:nth-child(3) + position: absolute + left: ($size/3)*2 + top: ($size/3)*2 + + div:nth-child(4) + position: absolute + left: $size/3 + top: ($size/3)*2 + + div:nth-child(5) + position: absolute + left: 0 + top: ($size/3)*2 + + div + background-color: #fff + width: $size/3 + height: $size/3 + +/* Mix-ins */ +@mixin rotate($degrees) + -webkit-transform: rotate(#{$degrees}deg) + -moz-transform: rotate(#{$degrees}deg) + -ms-transform: rotate(#{$degrees}deg) + -o-transform: rotate(#{$degrees}deg) + transform: rotate(#{$degrees}deg) + + filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=-#{sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)}) + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=-#{sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)})" + zoom: 1 diff --git a/fmartingrcom/themes/v1/static/sass/_reset.sass b/fmartingrcom/themes/v1/static/sass/_reset.sass new file mode 100644 index 0000000..14e3c8c --- /dev/null +++ b/fmartingrcom/themes/v1/static/sass/_reset.sass @@ -0,0 +1,3 @@ +button + margin: 0 + padding: 0 diff --git a/fmartingrcom/themes/v1/static/sass/_responsive.sass b/fmartingrcom/themes/v1/static/sass/_responsive.sass new file mode 100644 index 0000000..2e36a0f --- /dev/null +++ b/fmartingrcom/themes/v1/static/sass/_responsive.sass @@ -0,0 +1,93 @@ +/* Landspace tablet and Large desktop */ +@media (min-width: 980px) + + +/* From portrait tablet and down */ +@media (max-width: 979px) + .hacker-icon + $size: 12px + + body + font-size: 85% + + button.menu + background-color: $sidebar-bg + border: lighten($sidebar-bg, 20%) 1px solid + color: white + display: block + font-size: 16px + height: 32px + left: 8px + padding: 0 5px 0 5px + position: fixed + text-align: center + top: 8px + z-index: 900 + + -moz-border-radius: 4px + -webkit-border-radius: 4px + border-radius: 4px + + -moz-transition: left 0.3s + -webkit-transition: left 0.3s + transition: left 0.3s + + span + display: block + + -moz-transition: all 0.3s + -webkit-transition: all 0.3s + transition: all 0.3s + + &.menu-shown + left: $sidebar-width + 8px + + span + -moz-transform: rotate(180deg) + -webkit-transform: rotate(180deg) + transform: rotate(180deg) + + .sidebar + margin-left: -1*$sidebar-width + z-index: 999 + + -moz-transition: margin-left 0.3s + -webkit-transition: margin-left 0.3s + transition: margin-left 0.3s + + &.shown + margin-left: 0 + + &> header + height: auto + + table + font-size: 60% + + th + padding: 1px 2px + + td + padding: 1px 2px + + + section.content + margin-left: 0 + padding: 4% + width: auto + + .papers + width: auto + +/* Portrait tablet to desktop*/ +@media (min-width: 767px) and (max-width: 979px) + + +/* Landscape phone to portrait tablet */ +@media (max-width: 767px) + .hide-mobile + display: none + +/* Landscape phones and down */ +@media (max-width: 480px) + diff --git a/fmartingrcom/themes/v1/static/sass/_variables.sass b/fmartingrcom/themes/v1/static/sass/_variables.sass new file mode 100644 index 0000000..bb53622 --- /dev/null +++ b/fmartingrcom/themes/v1/static/sass/_variables.sass @@ -0,0 +1,54 @@ +// General +$text-color: #242424 +$font-family: "Georgia", "Open Sans", OpenSansRegular, sans-serif +$font-size: 18px + +$anchor-text-color: #2277bb +$anchor-text-shadow-color: #004b6b + +$headers-font-family: 'Antic Slab', serif + +$text-shadow-color: #fff +$text-shadow-properties: 1px 1px 1px + +$strong-text-color: #3e4349 + +$box-shadow-properties: 0px 0px 5px + +// Sidebar +$sidebar-bg: #242424 +$sidebar-text-color: #fff +$sidebar-width: 260px + +$footer-padding: 10px + +// Content +$content-sidebar-gap: 40px + +// Buttons +$twitter-color: #46c0fb +$twitter-text-color: #fff + +$email-color: #f0f0eb +$email-text-color: #312c2a + +$github-color: #fbfbfb +$github-text-color: #050505 + +$rss-color: #ff7f25 +$rss-text-color: #eee + +$blog-color: #ff3617 +$blog-text-color: #fff + +$projects-color: #ee5a22 +$projects-text-color: #efefef + +// Colors +$warning-color: #f39c12 +$warning-text-color: #fff + +// font +@font-face + font-family: fmartingr + src: url('/static/fmartingr.ttf') diff --git a/fmartingrcom/themes/v1/static/sass/style.sass b/fmartingrcom/themes/v1/static/sass/style.sass new file mode 100644 index 0000000..ae3b9f0 --- /dev/null +++ b/fmartingrcom/themes/v1/static/sass/style.sass @@ -0,0 +1,8 @@ +@import "reset" +@import "variables" +@import "oocss" +@import "layout" +@import "homepage" +@import "blog" + +@import "responsive" diff --git a/fmartingrcom/themes/v1/templates/_layout.jinja b/fmartingrcom/themes/v1/templates/_layout.jinja new file mode 100644 index 0000000..18dd433 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/_layout.jinja @@ -0,0 +1,105 @@ + + + + + + + + {% compress css %} + + {% endcompress %} + {% block head %}{% endblock %} + + + + + + + Felipe Martin | {% block page_title %} Homepage{% endblock %} + + + + +
+ {% block content %}{% endblock %} +
+ {% block footer %} + {% endblock %} + {# TODO preferences app + {% if config.GOOGLE_ANALYTICS %} + + {% endif %} + #} + + diff --git a/fmartingrcom/themes/v1/templates/_macros.jinja b/fmartingrcom/themes/v1/templates/_macros.jinja new file mode 100644 index 0000000..da6d1ab --- /dev/null +++ b/fmartingrcom/themes/v1/templates/_macros.jinja @@ -0,0 +1,10 @@ +{% macro disqus(shortname) -%} + +{%- endmacro %} diff --git a/fmartingrcom/themes/v1/templates/blog/entry.jinja b/fmartingrcom/themes/v1/templates/blog/entry.jinja new file mode 100644 index 0000000..91d0b42 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/blog/entry.jinja @@ -0,0 +1,75 @@ +{% extends "blog/layout.jinja" %} + +{% block page_title %} +{{ super() }} | {{ item.title }} +{% endblock %} + +{% block menu %} +
+ + Blog + +
+ {% if item.status() == 'Published' %} + {% if page.number > 1 %} + + {% else %} + + {% endif %} + + + {% endif %} + + + +{% endblock %} + +{% block content %} +
+

+ {{ item.title }} +

+ +
+ {# {{ item.author.first_name }} +  #} + + + {% if config.DISQUS_SHORTNAME %} +   + 0 Comments + {% endif %} + {# +   + Tags + #} +
+
{{ item.content|safe }}
+
+ {% if config.TWITTER_SHARE == "y" %} + +
+ {% endif %} + {% if config.DISQUS_SHORTNAME %} +
+
+ {% endif %} +
+{% endblock %} + +{% block footer %} + {{ super() }} + {% if config.DISQUS_SHORTNAME %} + {% from '_macros.jinja' import disqus with context %} + {{ disqus() }} + {% endif %} +{% endblock %} diff --git a/fmartingrcom/themes/v1/templates/blog/layout.jinja b/fmartingrcom/themes/v1/templates/blog/layout.jinja new file mode 100644 index 0000000..64188b1 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/blog/layout.jinja @@ -0,0 +1,25 @@ +{% extends "_layout.jinja" %} + +{% block page_title %}Blog{% endblock %} + +{% block head %} + + + +{% endblock %} + +{% block menu %} +
+ + Blog + +
+
+ {% csrf_token %} + +
+{% endblock %} diff --git a/fmartingrcom/themes/v1/templates/blog/list.jinja b/fmartingrcom/themes/v1/templates/blog/list.jinja new file mode 100644 index 0000000..cde4b17 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/blog/list.jinja @@ -0,0 +1,93 @@ +{% extends "blog/layout.jinja" %} + +{% block page_title %} +{{ super() }}{% if page.number > 1 %} page {{ page_number }}{% endif %} +{% endblock %} + +{% block menu %} + {{ super() }} + {% if page.has_next() %} + + + + + {% endif %} + + {% if page.has_previous() %} + {% if page.previous_page_number() == 1 %} + + {% else %} + + {% endif %} + + + {% endif %} + + + + +{% endblock %} + +{% block content %} + {% for item in page.object_list %} +
+

{{ item.title }}

+
+ {# {{ item.author.first_name }} +  #} + + + {% if config.DISQUS_SHORTNAME %} +   + 0 Comments + {% endif %} +
+
+ {% if config.READMORE_TAG in item.content %} + {{ item.content|readmore|safe }} + {% else %} + {{ item.content|safe }} + {% endif %} +
+ {% if config.READMORE_TAG in item.content %} + + Read more » + + {% endif %} +
+
+
+ {% else %} +
No results found!
+ {% endfor %} + {# + {% if paginator.num_pages > 1 %} + + {% endif %} + #} +{% endblock %} + +{% block footer %} + {{ super() }} + {% if config.DISQUS_SHORTNAME %} + {% from '_macros.jinja' import disqus with context %} + {{ disqus() }} + {% endif %} +{% endblock %} + diff --git a/fmartingrcom/themes/v1/templates/blog/rss.jinja b/fmartingrcom/themes/v1/templates/blog/rss.jinja new file mode 100644 index 0000000..3944353 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/blog/rss.jinja @@ -0,0 +1,18 @@ + + + + {{ config.BLOG_TITLE }} + {{ config.BLOG_DESCRIPTION }} + {{ config.BLOG_LINK }} + + {% for item in items %} + + <![CDATA[{{ item.title }}]]> + + {{ config.SITE_URL }}{{ item.get_absolute_url() }} + {{ item.date|dt('%a, %d %b %Y %H:%M:%S %z') }} + + {% endfor %} + + + diff --git a/fmartingrcom/themes/v1/templates/blog/search.jinja b/fmartingrcom/themes/v1/templates/blog/search.jinja new file mode 100644 index 0000000..caa395b --- /dev/null +++ b/fmartingrcom/themes/v1/templates/blog/search.jinja @@ -0,0 +1,7 @@ +{% extends "blog/list.jinja" %} + +{% block content %} +

Searching for... {{ search_query }}

+
+ {{ super() }} +{% endblock %} diff --git a/fmartingrcom/themes/v1/templates/homepage.jinja b/fmartingrcom/themes/v1/templates/homepage.jinja new file mode 100644 index 0000000..5b9a17d --- /dev/null +++ b/fmartingrcom/themes/v1/templates/homepage.jinja @@ -0,0 +1,17 @@ +{% extends "_layout.jinja" %} + +{% block menu %}{% endblock %} + +{% block content %} +
+
+ +
+

Hi there!

+

My name is Felipe Martín, and I'm a developer.

+

I've been playing with code for a while now, but I also enjoy geeking around with computers, algorithms and stuff; the less I know about it, the better. Learning new things everyday is my way of life.

+

Currently I'm a web developer, but I like to learn from new areas on my spare time, like networking, security or game development, I want to create some cool stuff for everyone to see.

+

If I'm not in front of my computer, you'll probably find me walking around the city with my headphones or having a beer with my friends.

+

You can access my blog and projects from the left. My contact details are around there too so feel free to drop me a line if you want!

+
+{% endblock %} diff --git a/fmartingrcom/themes/v1/templates/static/coffee/mobile.coffee b/fmartingrcom/themes/v1/templates/static/coffee/mobile.coffee new file mode 100644 index 0000000..c1d6341 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/coffee/mobile.coffee @@ -0,0 +1,14 @@ +toggleMenu = -> + sidebar = document.querySelector '.sidebar' + button = document.querySelector 'button.menu' + + if 'menu-shown' in button.classList + sidebar.classList.remove 'shown' + button.classList.remove 'menu-shown' + else + sidebar.classList.add 'shown' + button.classList.add 'menu-shown' + +window.onload = -> + button = document.querySelector 'button.menu' + button.onclick = toggleMenu diff --git a/fmartingrcom/themes/v1/templates/static/css/style.css b/fmartingrcom/themes/v1/templates/static/css/style.css new file mode 100644 index 0000000..2b1731e --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/css/style.css @@ -0,0 +1,467 @@ +button { + margin: 0; + padding: 0; } + +@font-face { + font-family: fmartingr; + src: url("/static/fmartingr.ttf"); } + +.pull-left { + float: left; } + +.pull-right { + float: right; } + +.text-center, .sidebar .buttons { + text-align: center; } + +.text-right { + text-align: right; } + +.text-left { + text-align: left; } + +.clearfix { + *zoom: 1; } + .clearfix:before, .clearfix:after { + content: " "; + display: table; } + .clearfix:after { + clear: both; } + +.small { + font-size: 50%; + line-height: 50%; } + +.alt-font { + font-family: "Antic Slab", serif; } + +.hacker-icon { + display: inline-block; + position: relative; + height: 22px; + width: 22px; + -moz-transition: all 0.5s; + -webkit-transition: all 0.5s; + transition: all 0.5s; } + .hacker-icon:hover { + vertical-align: top; + width: 22px; } + .hacker-icon:hover:before { + content: "a"; } + .hacker-icon:hover div { + display: none; } + .hacker-icon div:nth-child(1) { + position: absolute; + left: 7.33333px; + top: 0; } + .hacker-icon div:nth-child(2) { + position: absolute; + left: 14.66667px; + top: 7.33333px; } + .hacker-icon div:nth-child(3) { + position: absolute; + left: 14.66667px; + top: 14.66667px; } + .hacker-icon div:nth-child(4) { + position: absolute; + left: 7.33333px; + top: 14.66667px; } + .hacker-icon div:nth-child(5) { + position: absolute; + left: 0; + top: 14.66667px; } + .hacker-icon div { + background-color: white; + width: 7.33333px; + height: 7.33333px; } + +/* Mix-ins */ +html, body { + color: #242424; + font-family: "Georgia", "Open Sans", OpenSansRegular, sans-serif; + font-size: 18px; + margin: 0; + min-height: 100%; + text-align: justify; } + +body { + padding-bottom: 40px; } + +h1, h2, h3, h4, h5, h6 { + font-family: "Antic Slab", serif; + font-weight: normal; + text-shadow: 1px 1px 3px #dddddd; } + +h1 { + font-size: 200%; } + +h2 { + font-size: 175%; } + +h3 { + font-size: 150%; } + +h4 { + font-size: 125%; } + +strong { + color: #3e4349; } + +a { + color: #2277bb; + text-decoration: none; } + a.dark { + color: #242424; } + a.bright { + color: white; } + a:hover { + border-bottom: 1px dotted; } + +figure { + margin: 0; + text-align: center; } + figure img { + margin: 14px; } + figure img.pull-left { + margin-left: 0; } + figure img.pull-right { + margin-right: 0; } + figure img.padding { + padding: 6px; } + figure img.shadow { + box-shadow: #242424 0px 0px 5px; } + +hr { + background: none; + border: 0; + border-bottom: #aaaaaa 1px dotted; + width: 90%; } + hr.big { + border-bottom-width: 3px; + margin: 30px auto; } + +.sidebar { + background-color: #242424; + color: white; + min-height: 100%; + position: fixed; + top: 0; + width: 260px; } + .sidebar > button.menu { + display: none; } + .sidebar > header { + height: 220px; } + .sidebar > header .logo { + color: white; + font-family: Verdana; + font-size: 200%; + font-weight: 800; + padding: 20px; } + .sidebar footer { + bottom: 0; + position: absolute; + left: 0; + padding: 10px; + width: 240px; } + .sidebar footer .zombiepress { + font-family: "Antic Slab", serif; + font-size: 80%; + text-shadow: #333333 1px 1px 3px; } + .sidebar footer .zombiepress a { + color: white; } + .sidebar .buttons header { + font-size: 170%; + margin-bottom: 10px; } + .sidebar .buttons.social { + margin-bottom: 20px; } + .sidebar .buttons.social button { + width: 31%; + font-size: 75%; + font-family: helvetica, sans-serif; } + .sidebar .buttons button { + background-color: silver; + border: none; + cursor: pointer; + font-size: 90%; + margin-top: 5px; + padding: 8px 0 8px 0; + font-weight: bold; + width: 90%; + transition: 0.3s all; } + .sidebar .buttons button.half { + width: 38%; } + .sidebar .buttons button.gap.pull-right { + margin-right: 5%; } + .sidebar .buttons button.gap.pull-left { + margin-left: 5%; } + .sidebar .buttons button.rss { + background-color: #ff7f25; + color: #eeeeee; } + .sidebar .buttons button.rss:hover { + background-color: #e75f00; } + .sidebar .buttons button.email { + background-color: #f0f0eb; + color: #312c2a; } + .sidebar .buttons button.email:hover { + background-color: #d6d6c8; } + .sidebar .buttons button.twitter { + background-color: #46c0fb; + color: white; } + .sidebar .buttons button.twitter:hover { + background-color: #0aacfa; } + .sidebar .buttons button.github { + background-color: #fbfbfb; + color: #050505; } + .sidebar .buttons button.github:hover { + background-color: gainsboro; } + .sidebar .buttons button.blog { + background-color: #ff3617; + color: white; } + .sidebar .buttons button.blog:hover { + background-color: #d91d00; } + .sidebar .buttons button.projects { + background-color: #ee5a22; + color: #efefef; } + .sidebar .buttons button.projects:hover { + background-color: #c4410f; } + +section.content { + margin-left: 300px; + width: 60%; } + +body.homepage { + background-color: #eeeeee; + background-image: url("/static/images/homepage/bg.png"); + background-attachment: fixed; } + +section.content .papers { + background: white; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); + margin: 26px auto 0; + max-width: 600px; + padding: 24px; + position: relative; + width: 80%; } +section.content .papers:before, section.content .papers:after { + content: ""; + height: 98%; + position: absolute; + width: 100%; + z-index: -1; } +section.content .papers:before { + background: #fafafa; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.2); + left: -5px; + top: 4px; + -webkit-transform: rotate(-2.5deg); + -moz-transform: rotate(-2.5deg); + -ms-transform: rotate(-2.5deg); + -o-transform: rotate(-2.5deg); + transform: rotate(-2.5deg); + filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(-2.5), M12=-sin(-2.5), M21=sin(-2.5), M22=cos(-2.5)); + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(-2.5), M12=-sin(-2.5), M21=sin(-2.5), M22=cos(-2.5))"; + zoom: 1; } +section.content .papers:after { + background: #f6f6f6; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); + right: -3px; + top: 1px; + -webkit-transform: rotate(1.4deg); + -moz-transform: rotate(1.4deg); + -ms-transform: rotate(1.4deg); + -o-transform: rotate(1.4deg); + transform: rotate(1.4deg); + filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(1.4), M12=-sin(1.4), M21=sin(1.4), M22=cos(1.4)); + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(1.4), M12=-sin(1.4), M21=sin(1.4), M22=cos(1.4))"; + zoom: 1; } +section.content .picture { + background-color: white; + padding: 8px; + padding-bottom: 30px; + margin-left: 40px; + margin-bottom: 12px; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); + -webkit-transform: rotate(10deg); + -moz-transform: rotate(10deg); + -ms-transform: rotate(10deg); + -o-transform: rotate(10deg); + transform: rotate(10deg); + filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(10), M12=-sin(10), M21=sin(10), M22=cos(10)); + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=cos(10), M12=-sin(10), M21=sin(10), M22=cos(10))"; + zoom: 1; + margin-top: -10px; + margin-right: -50px; } + +body.blog { + background-color: white; + padding-bottom: 20px; } + body.blog section.content hr:last-child { + display: none; } + +article.blog-entry { + text-align: left; } + article.blog-entry:after { + clear: both; } + article.blog-entry h2 { + margin: 16px 0 10px 0; } + article.blog-entry h2 a:hover { + border: 0; } + article.blog-entry h1 { + border-right: #555555 6px solid; + margin-bottom: 0.5em; + font-size: 2.2em; } + article.blog-entry.draft { + border: #f39c12 3px dashed; + padding: 0 20px; } + article.blog-entry .content { + line-height: 140%; + padding-top: 15px; } + article.blog-entry .content img { + box-shadow: #242424 0 0 4px; + max-width: 100%; } + article.blog-entry .content img.noshadow { + box-shadow: none; } + article.blog-entry .content img.float-left { + float: left; + margin-right: 3%; } + article.blog-entry .content blockquote { + border-left: 4px solid #dddddd; + padding: 0 15px; + color: #777777; } + article.blog-entry .content blockquote > :first-child { + margin-top: 0; } + article.blog-entry .content blockquote > :last-child { + margin-bottom: 0; } + article.blog-entry .content code { + display: inline-block; + white-space: no-wrap; + background: white; + font-size: 0.8em; + line-height: 1.5em; + color: #555555; + border: 1px solid #dddddd; + -webkit-border-radius: 0.4em; + -moz-border-radius: 0.4em; + -ms-border-radius: 0.4em; + -o-border-radius: 0.4em; + border-radius: 0.4em; + padding: 0 0.3em; + margin: -1px 0; } + article.blog-entry .content hr { + width: 50%; } + article.blog-entry .content table { + padding: 0; + margin: 0 auto; } + article.blog-entry .content table tr { + border-top: 1px solid #cccccc; + background-color: white; + margin: 0; + padding: 0; } + article.blog-entry .content table tr:nth-child(2n) { + background-color: #f8f8f8; } + article.blog-entry .content table tr th { + font-weight: bold; + border: 1px solid #cccccc; + text-align: left; + margin: 0; + padding: 6px 13px; } + article.blog-entry .content table tr td { + border: 1px solid #cccccc; + text-align: left; + margin: 0; + padding: 6px 13px; } + article.blog-entry .content table tr th :first-child, article.blog-entry .content table tr td :first-child { + margin-top: 0; } + article.blog-entry .content table tr th :last-child, article.blog-entry .content table tr td :last-child { + margin-bottom: 0; } + article.blog-entry a.readmore { + background: #f39c12; + border: none; + color: white; + font-family: helvetica, sans-serif; + font-weight: bold; + padding: 10px; + font-size: 90%; } + article.blog-entry .draft-warning { + background-color: #f39c12; + color: white; + margin: 5px 0 5px 0; + padding: 8px 0 8px 0; } + article.blog-entry pre.prettyprint { + line-height: 120%; } + +.search-field { + border: none; + font-size: 0.8em; + font-weight: bold; + height: 1.2em; + padding: 2%; + width: 86%; } + +/* Landspace tablet and Large desktop */ +/* From portrait tablet and down */ +@media (max-width: 979px) { + body { + font-size: 85%; } + body button.menu { + background-color: #242424; + border: #575757 1px solid; + color: white; + display: block; + font-size: 16px; + height: 32px; + left: 8px; + padding: 0 5px 0 5px; + position: fixed; + text-align: center; + top: 8px; + z-index: 900; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-transition: left 0.3s; + -webkit-transition: left 0.3s; + transition: left 0.3s; } + body button.menu span { + display: block; + -moz-transition: all 0.3s; + -webkit-transition: all 0.3s; + transition: all 0.3s; } + body button.menu.menu-shown { + left: 268px; } + body button.menu.menu-shown span { + -moz-transform: rotate(180deg); + -webkit-transform: rotate(180deg); + transform: rotate(180deg); } + + .sidebar { + margin-left: -260px; + z-index: 999; + -moz-transition: margin-left 0.3s; + -webkit-transition: margin-left 0.3s; + transition: margin-left 0.3s; } + .sidebar.shown { + margin-left: 0; } + .sidebar > header { + height: auto; } + + table { + font-size: 60%; } + table th { + padding: 1px 2px; } + table td { + padding: 1px 2px; } + + section.content { + margin-left: 0; + padding: 4%; + width: auto; } + section.content .papers { + width: auto; } } +/* Portrait tablet to desktop */ +/* Landscape phone to portrait tablet */ +@media (max-width: 767px) { + .hide-mobile { + display: none; } } +/* Landscape phones and down */ diff --git a/fmartingrcom/themes/v1/templates/static/css/syntax.css b/fmartingrcom/themes/v1/templates/static/css/syntax.css new file mode 100644 index 0000000..8542313 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/css/syntax.css @@ -0,0 +1,52 @@ +/* Pretty printing styles. Used with prettify.js. */ +/* Vim sunburst theme by David Leibovic */ + +pre .str, code .str { color: #65B042; } /* string - green */ +pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */ +pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */ +pre .typ, code .typ { color: #89bdff; } /* type - light blue */ +pre .lit, code .lit { color: #3387CC; } /* literal - blue */ +pre .pun, code .pun { color: #fff; } /* punctuation - white */ +pre .pln, code .pln { color: #fff; } /* plaintext - white */ +pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */ +pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */ +pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */ +pre .dec, code .dec { color: #3387CC; } /* decimal - blue */ + +pre.prettyprint, code.prettyprint { + background-color: #242424; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + -o-border-radius: 8px; + -ms-border-radius: 8px; + -khtml-border-radius: 8px; + border-radius: 8px; +} + +pre.prettyprint { + width: auto; + margin: 1em auto; + padding: 12px !important; + white-space: pre-wrap; + font-size: 86%; +} + + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */ +li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1,li.L3,li.L5,li.L7,li.L9 { } + +@media print { + pre .str, code .str { color: #060; } + pre .kwd, code .kwd { color: #006; font-weight: bold; } + pre .com, code .com { color: #600; font-style: italic; } + pre .typ, code .typ { color: #404; font-weight: bold; } + pre .lit, code .lit { color: #044; } + pre .pun, code .pun { color: #440; } + pre .pln, code .pln { color: #000; } + pre .tag, code .tag { color: #006; font-weight: bold; } + pre .atn, code .atn { color: #404; } + pre .atv, code .atv { color: #060; } +} diff --git a/fmartingrcom/themes/v1/templates/static/css/syntax.min.css b/fmartingrcom/themes/v1/templates/static/css/syntax.min.css new file mode 100644 index 0000000..b7a58dd --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/css/syntax.min.css @@ -0,0 +1 @@ +pre .str,code .str{color:#65b042}pre .kwd,code .kwd{color:#e28964}pre .com,code .com{color:#aeaeae;font-style:italic}pre .typ,code .typ{color:#89bdff}pre .lit,code .lit{color:#3387cc}pre .pun,code .pun{color:#fff}pre .pln,code .pln{color:#fff}pre .tag,code .tag{color:#89bdff}pre .atn,code .atn{color:#bdb76b}pre .atv,code .atv{color:#65b042}pre .dec,code .dec{color:#3387cc}pre.prettyprint,code.prettyprint{background-color:#242424;-moz-border-radius:8px;-webkit-border-radius:8px;-o-border-radius:8px;-ms-border-radius:8px;-khtml-border-radius:8px;border-radius:8px}pre.prettyprint{width:auto;margin:1em auto;padding:12px !important;white-space:pre-wrap;font-size:86%}ol.linenums{margin-top:0;margin-bottom:0;color:#aeaeae}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}@media print{pre .str,code .str{color:#060}pre .kwd,code .kwd{color:#006;font-weight:bold}pre .com,code .com{color:#600;font-style:italic}pre .typ,code .typ{color:#404;font-weight:bold}pre .lit,code .lit{color:#044}pre .pun,code .pun{color:#440}pre .pln,code .pln{color:#000}pre .tag,code .tag{color:#006;font-weight:bold}pre .atn,code .atn{color:#404}pre .atv,code .atv{color:#060}} diff --git a/fmartingrcom/themes/v1/templates/static/images/homepage/bg.png b/fmartingrcom/themes/v1/templates/static/images/homepage/bg.png new file mode 100644 index 0000000..fc14318 Binary files /dev/null and b/fmartingrcom/themes/v1/templates/static/images/homepage/bg.png differ diff --git a/fmartingrcom/themes/v1/templates/static/js/mobile.js b/fmartingrcom/themes/v1/templates/static/js/mobile.js new file mode 100644 index 0000000..89a0b85 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/js/mobile.js @@ -0,0 +1,27 @@ +// Generated by CoffeeScript 1.6.2 +(function() { + var toggleMenu, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; + + toggleMenu = function() { + var button, sidebar; + + sidebar = document.querySelector('.sidebar'); + button = document.querySelector('button.menu'); + if (__indexOf.call(button.classList, 'menu-shown') >= 0) { + sidebar.classList.remove('shown'); + return button.classList.remove('menu-shown'); + } else { + sidebar.classList.add('shown'); + return button.classList.add('menu-shown'); + } + }; + + window.onload = function() { + var button; + + button = document.querySelector('button.menu'); + return button.onclick = toggleMenu; + }; + +}).call(this); diff --git a/fmartingrcom/themes/v1/templates/static/sass/_blog.sass b/fmartingrcom/themes/v1/templates/static/sass/_blog.sass new file mode 100644 index 0000000..d75eb8a --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/sass/_blog.sass @@ -0,0 +1,131 @@ +body + &.blog + background-color: #fff + padding-bottom: 20px + + section.content + hr:last-child + display: none + +article.blog-entry + text-align: left + + &:after + clear: both + + h2 + margin: 16px 0 10px 0 + + a:hover + border: 0 + + h1 + border-right: #555 6px solid + margin-bottom: 0.5em + font-size: 2.2em + + &.draft + border: $warning-color 3px dashed + padding: 0 20px + + .info + + .content + line-height: 140% + padding-top: 15px + + img + box-shadow: $sidebar-bg 0 0 4px + max-width: 100% + + &.noshadow + box-shadow: none + + &.float-left + float: left + margin-right: 3% + + blockquote + border-left: 4px solid #dddddd + padding: 0 15px + color: #777777 + > :first-child + margin-top: 0 + > :last-child + margin-bottom: 0 + + code + display: inline-block + white-space: no-wrap + background: #fff + font-size: .8em + line-height: 1.5em + color: #555 + border: 1px solid #ddd + -webkit-border-radius: 0.4em + -moz-border-radius: 0.4em + -ms-border-radius: 0.4em + -o-border-radius: 0.4em + border-radius: 0.4em + padding: 0 .3em + margin: -1px 0 + + hr + width: 50% + + table + padding: 0 + margin: 0 auto + + tr + border-top: 1px solid #cccccc + background-color: white + margin: 0 + padding: 0 + + &:nth-child(2n) + background-color: #f8f8f8 + + th + font-weight: bold + border: 1px solid #cccccc + text-align: left + margin: 0 + padding: 6px 13px + td + border: 1px solid #cccccc + text-align: left + margin: 0 + padding: 6px 13px + + th :first-child, td :first-child + margin-top: 0 + + th :last-child, td :last-child + margin-bottom: 0 + + a.readmore + background: $warning-color + border: none + color: white + font-family: helvetica, sans-serif + font-weight: bold + padding: 10px + font-size: 90% + + .draft-warning + background-color: $warning-color + color: $warning-text-color + margin: 5px 0 5px 0 + padding: 8px 0 8px 0 + + pre.prettyprint + line-height: 120% + +.search-field + border: none + font-size: 0.8em + font-weight: bold + height: 1.2em + padding: 2% + width: 86% diff --git a/fmartingrcom/themes/v1/templates/static/sass/_homepage.sass b/fmartingrcom/themes/v1/templates/static/sass/_homepage.sass new file mode 100644 index 0000000..f2191b0 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/sass/_homepage.sass @@ -0,0 +1,49 @@ +body + &.homepage + background-color: #eee + background-image: url('/static/images/homepage/bg.png') + background-attachment: fixed + +section.content + // http://www.sitepoint.com/css3-shuffled-paper/ + .papers + background: #fff + box-shadow: 0 0 10px rgba(0,0,0,0.3) + margin: 26px auto 0 + //max-width: 700px + max-width: 600px + padding: 24px + position: relative + width: 80% + + .papers:before, .papers:after + content: "" + height: 98% + position: absolute + width: 100% + z-index: -1 + + .papers:before + background: #fafafa + box-shadow: 0 0 8px rgba(0,0,0,0.2) + left: -5px + top: 4px + @include rotate(-2.5) + + .papers:after + background: #f6f6f6 + box-shadow: 0 0 3px rgba(0,0,0,0.2) + right: -3px + top: 1px + @include rotate(1.4) + + .picture + background-color: white + padding: 8px + padding-bottom: 30px + margin-left: 40px + margin-bottom: 12px + box-shadow: 0 0 3px rgba(0,0,0,0.2) + @include rotate(10) + margin-top: -10px + margin-right: -50px diff --git a/fmartingrcom/themes/v1/templates/static/sass/_layout.sass b/fmartingrcom/themes/v1/templates/static/sass/_layout.sass new file mode 100644 index 0000000..b2e7e60 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/sass/_layout.sass @@ -0,0 +1,197 @@ +html, body + color: $text-color + font-family: $font-family + font-size: $font-size + //font-weight: 400 + margin: 0 + min-height: 100% + text-align: justify + +body + padding-bottom: 40px + +h1, h2, h3, h4, h5, h6 + font-family: $headers-font-family + font-weight: normal + text-shadow: 1px 1px 3px rgb(221, 221, 221) + +h1 + font-size: 200% + +h2 + font-size: 175% + +h3 + font-size: 150% + +h4 + font-size: 125% + +strong + color: $strong-text-color + +a + color: $anchor-text-color + text-decoration: none + + &.dark + color: $text-color + //text-shadow: $text-color $text-shadow-properties + + &.bright + color: $text-shadow-color + + &:hover + border-bottom: 1px dotted + +figure + margin: 0 + text-align: center + + img + margin: 14px + + &.pull-left + margin-left: 0 + + &.pull-right + margin-right: 0 + + &.padding + padding: 6px + + &.shadow + box-shadow: $text-color $box-shadow-properties + +hr + background: none + border: 0 + border-bottom: #aaa 1px dotted + width: 90% + + &.big + border-bottom-width: 3px + margin: 30px auto + + +.sidebar + background-color: $sidebar-bg + color: $sidebar-text-color + min-height: 100% + position: fixed + top: 0 + width: $sidebar-width + + &> button.menu + display: none + + &> header + height: 220px + + .logo + color: #fff + font-family: Verdana + font-size: 200% + font-weight: 800 + padding: 20px + + footer + bottom: 0 + position: absolute + left: 0 + padding: $footer-padding + width: $sidebar-width - ($footer-padding*2) + + .zombiepress + font-family: $headers-font-family + font-size: 80% + text-shadow: #333 1px 1px 3px + a + color: #fff + + .zone-menu + + .buttons + @extend .text-center + + header + font-size: 170% + margin-bottom: 10px + + &.social + margin-bottom: 20px + button + width: 31% + font-size: 75% + font-family: helvetica, sans-serif + + button + background-color: rgb(192, 192, 192) + border: none + cursor: pointer + font-size: 90% + margin-top: 5px + padding: 8px 0 8px 0 + font-weight: bold + width: 90% + + transition: 0.3s all + + &.half + width: 38% + + &.gap + &.pull-right + margin-right: 5% + + &.pull-left + margin-left: 5% + + &:hover + //margin-left: 10px + + &.rss + background-color: $rss-color + color: $rss-text-color + + &:hover + background-color: darken($rss-color, 12%) + + &.email + background-color: $email-color + color: $email-text-color + + &:hover + background-color: darken($email-color, 12%) + + &.twitter + background-color: $twitter-color + color: $twitter-text-color + + &:hover + background-color: darken($twitter-color, 12%) + + &.github + background-color: $github-color + color: $github-text-color + + &:hover + background-color: darken($github-color, 12%) + + &.blog + background-color: $blog-color + color: $blog-text-color + + &:hover + background-color: darken($blog-color, 12%) + + &.projects + background-color: $projects-color + color: $projects-text-color + + &:hover + background-color: darken($projects-color, 12%) + +section.content + margin-left: $sidebar-width + $content-sidebar-gap + width: 60% diff --git a/fmartingrcom/themes/v1/templates/static/sass/_oocss.sass b/fmartingrcom/themes/v1/templates/static/sass/_oocss.sass new file mode 100644 index 0000000..8b689e6 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/sass/_oocss.sass @@ -0,0 +1,92 @@ +.pull-left + float: left + +.pull-right + float: right + +.text-center + text-align: center + +.text-right + text-align: right + +.text-left + text-align: left + +.clearfix + *zoom: 1 + + &:before, &:after + content: " " + display: table + + &:after + clear: both + +.small + font-size: 50% + line-height: 50% + +.alt-font + font-family: $headers-font-family + +.hacker-icon + $size: 22px + display: inline-block + position: relative + height: $size + width: $size + + -moz-transition: all 0.5s + -webkit-transition: all 0.5s + transition: all 0.5s + + &:hover + vertical-align: top + width: 22px + &:before + content: "a" + div + display: none + + div:nth-child(1) + position: absolute + left: $size/3 + top: 0 + + div:nth-child(2) + position: absolute + left: ($size/3)*2 + top: $size/3 + + div:nth-child(3) + position: absolute + left: ($size/3)*2 + top: ($size/3)*2 + + div:nth-child(4) + position: absolute + left: $size/3 + top: ($size/3)*2 + + div:nth-child(5) + position: absolute + left: 0 + top: ($size/3)*2 + + div + background-color: #fff + width: $size/3 + height: $size/3 + +/* Mix-ins */ +@mixin rotate($degrees) + -webkit-transform: rotate(#{$degrees}deg) + -moz-transform: rotate(#{$degrees}deg) + -ms-transform: rotate(#{$degrees}deg) + -o-transform: rotate(#{$degrees}deg) + transform: rotate(#{$degrees}deg) + + filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=-#{sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)}) + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=#{cos($degrees)}, M12=-#{sin($degrees)}, M21=#{sin($degrees)}, M22=#{cos($degrees)})" + zoom: 1 diff --git a/fmartingrcom/themes/v1/templates/static/sass/_reset.sass b/fmartingrcom/themes/v1/templates/static/sass/_reset.sass new file mode 100644 index 0000000..14e3c8c --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/sass/_reset.sass @@ -0,0 +1,3 @@ +button + margin: 0 + padding: 0 diff --git a/fmartingrcom/themes/v1/templates/static/sass/_responsive.sass b/fmartingrcom/themes/v1/templates/static/sass/_responsive.sass new file mode 100644 index 0000000..2e36a0f --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/sass/_responsive.sass @@ -0,0 +1,93 @@ +/* Landspace tablet and Large desktop */ +@media (min-width: 980px) + + +/* From portrait tablet and down */ +@media (max-width: 979px) + .hacker-icon + $size: 12px + + body + font-size: 85% + + button.menu + background-color: $sidebar-bg + border: lighten($sidebar-bg, 20%) 1px solid + color: white + display: block + font-size: 16px + height: 32px + left: 8px + padding: 0 5px 0 5px + position: fixed + text-align: center + top: 8px + z-index: 900 + + -moz-border-radius: 4px + -webkit-border-radius: 4px + border-radius: 4px + + -moz-transition: left 0.3s + -webkit-transition: left 0.3s + transition: left 0.3s + + span + display: block + + -moz-transition: all 0.3s + -webkit-transition: all 0.3s + transition: all 0.3s + + &.menu-shown + left: $sidebar-width + 8px + + span + -moz-transform: rotate(180deg) + -webkit-transform: rotate(180deg) + transform: rotate(180deg) + + .sidebar + margin-left: -1*$sidebar-width + z-index: 999 + + -moz-transition: margin-left 0.3s + -webkit-transition: margin-left 0.3s + transition: margin-left 0.3s + + &.shown + margin-left: 0 + + &> header + height: auto + + table + font-size: 60% + + th + padding: 1px 2px + + td + padding: 1px 2px + + + section.content + margin-left: 0 + padding: 4% + width: auto + + .papers + width: auto + +/* Portrait tablet to desktop*/ +@media (min-width: 767px) and (max-width: 979px) + + +/* Landscape phone to portrait tablet */ +@media (max-width: 767px) + .hide-mobile + display: none + +/* Landscape phones and down */ +@media (max-width: 480px) + diff --git a/fmartingrcom/themes/v1/templates/static/sass/_variables.sass b/fmartingrcom/themes/v1/templates/static/sass/_variables.sass new file mode 100644 index 0000000..bb53622 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/sass/_variables.sass @@ -0,0 +1,54 @@ +// General +$text-color: #242424 +$font-family: "Georgia", "Open Sans", OpenSansRegular, sans-serif +$font-size: 18px + +$anchor-text-color: #2277bb +$anchor-text-shadow-color: #004b6b + +$headers-font-family: 'Antic Slab', serif + +$text-shadow-color: #fff +$text-shadow-properties: 1px 1px 1px + +$strong-text-color: #3e4349 + +$box-shadow-properties: 0px 0px 5px + +// Sidebar +$sidebar-bg: #242424 +$sidebar-text-color: #fff +$sidebar-width: 260px + +$footer-padding: 10px + +// Content +$content-sidebar-gap: 40px + +// Buttons +$twitter-color: #46c0fb +$twitter-text-color: #fff + +$email-color: #f0f0eb +$email-text-color: #312c2a + +$github-color: #fbfbfb +$github-text-color: #050505 + +$rss-color: #ff7f25 +$rss-text-color: #eee + +$blog-color: #ff3617 +$blog-text-color: #fff + +$projects-color: #ee5a22 +$projects-text-color: #efefef + +// Colors +$warning-color: #f39c12 +$warning-text-color: #fff + +// font +@font-face + font-family: fmartingr + src: url('/static/fmartingr.ttf') diff --git a/fmartingrcom/themes/v1/templates/static/sass/style.sass b/fmartingrcom/themes/v1/templates/static/sass/style.sass new file mode 100644 index 0000000..ae3b9f0 --- /dev/null +++ b/fmartingrcom/themes/v1/templates/static/sass/style.sass @@ -0,0 +1,8 @@ +@import "reset" +@import "variables" +@import "oocss" +@import "layout" +@import "homepage" +@import "blog" + +@import "responsive" diff --git a/fmartingrcom/urls.py b/fmartingrcom/urls.py new file mode 100644 index 0000000..842d417 --- /dev/null +++ b/fmartingrcom/urls.py @@ -0,0 +1,17 @@ +from django.conf.urls import patterns, include, url +from django.contrib import admin + +from .apps.homepage.sitemap import HomeSitemap + +# Sitemap +sitemaps = { + 'home': HomeSitemap, + # 'blog': BlogSitemap, +} + +admin.autodiscover() + +urlpatterns = patterns('', + url(r'^admin/', include(admin.site.urls)), + url(r'^$', include('fmartingrcom.apps.homepage.urls')), +) diff --git a/fmartingrcom/wsgi.py b/fmartingrcom/wsgi.py new file mode 100644 index 0000000..6a37c6b --- /dev/null +++ b/fmartingrcom/wsgi.py @@ -0,0 +1,15 @@ +""" +WSGI config for fmartingrcom project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ +""" + +import os +os.environ.setdefault("DJANGO_SETTINGS_MODULE", + "fmartingrcom.settings.configfile") + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..1fb5425 --- /dev/null +++ b/manage.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", + "fmartingrcom.settings.base") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/requirements-local.txt b/requirements-local.txt new file mode 100644 index 0000000..bc04b49 --- /dev/null +++ b/requirements-local.txt @@ -0,0 +1 @@ +-r requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..afa2274 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,13 @@ +Django==1.6.6 + +Jinja2==2.7.3 +django-jinja==1.0.4 + +psycopg2==2.5.4 +South==1.0 +dj-database-url==0.3.0 + +django-suit==0.2.9 +django-reversion==1.8.2 + +pytz==2014.7