Skip to content
Permalink
Browse files

Add Flask-Assets support

Utilises Sass to compile to CSS
Includes use of Bower to download Bourbon for mixins and JQuery for future use
  • Loading branch information...
Smashman committed Jun 18, 2014
1 parent 7a4f0d2 commit 2b412a1b958f183e81f250daf35fcbed3d868d87
@@ -0,0 +1,3 @@
{
"directory": "app/assets/lib"
}
@@ -1,3 +1,6 @@
instance/
.idea/
*.py[cod]
*.py[cod]
app/assets/lib
app/assets/cache
app/static/*
@@ -1,4 +1,12 @@
mods.tf
=======
# mods.tf

The website source for mods.tf, powered by Flask - currently in the development stages
The website source for mods.tf, powered by Flask - currently in the development stages

## Requirements

* Bower
* Sass

## Set-up

* ```bower install```
@@ -9,4 +9,6 @@
from flask.ext.debugtoolbar import DebugToolbarExtension
toolbar = DebugToolbarExtension(app)

import views
import views

from assets import assets
No changes.
@@ -0,0 +1,25 @@
from flask.ext.assets import Bundle, Environment
from .. import app
from os.path import abspath, join

bundles = {
'main_css': Bundle(
'sass/main.sass',
filters='sass',
output='../static/css/main.css'
),
'main_js': Bundle(
'lib/jquery/dist/jquery.min.js',
Bundle(
'js/main.js',
filters='jsmin'
),
output='../static/js/main.js'
)
}

assets = Environment(app)
assets.load_path = [abspath(join(app.root_path, 'assets'))]
assets.cache = abspath(join(app.root_path, 'assets/cache'))

assets.register(bundles)
No changes.
@@ -0,0 +1,45 @@
@import ../lib/bourbon/dist/_bourbon

$text-color: #f5e7de
$background-color: #2e2a28

+font-face("TF2 Secondary", "http://i1.theportalwiki.net/fonts/tf2secondary-webfont")
+font-face("TF2 Build", "http://i1.theportalwiki.net/fonts/tf2build-webfont")

html, body
margin: 0
padding: 0
height: 100%

body
color: $text-color
background: $background-color

a
color: $text-color

&:hover
color: darken($text-color,15%)

#tron
width: 100%
min-width: 350px
max-width: 800px
margin: auto
position: relative
top: 20%

.main, .soon
width: 100%
text-align: center

.main
font-family: "TF2 Build"
font-size: 5em
color: #ef9849
text-shadow: 4px 4px 2px rgba(55, 55, 55, 1)

.soon
font:
family: "TF2 Secondary"
size: 2em

This file was deleted.

@@ -1,7 +1,9 @@
<html>
<head>
<title>Mods.tf</title>
<link href="{{ url_for('static', filename='style/main.css') }}" rel="stylesheet">
{% assets "main_css" %}
<link href="{{ ASSET_URL }}" rel="stylesheet">
{% endassets %}
</head>
<body>
<div id="tron">
@@ -0,0 +1,8 @@
{
"name": "mods.tf",
"private": true,
"dependencies": {
"bourbon": ">4.0.0",
"jquery": "~1.11.1"
}
}
@@ -0,0 +1 @@
Place an instanced settings.py in this folder

0 comments on commit 2b412a1

Please sign in to comment.
You can’t perform that action at this time.