moj_template 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +34 -9
- data/lib/moj_template/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e798207d94a88fc8993897fbe6a0222a9c64a340
|
4
|
+
data.tar.gz: 64848fd216114cf62a7e9887aa9e3437c5f9111d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d258eca9a727d5de32aa3694781ab8d638cdfd160af7d18f014902605d5108b36bd140133b2cfe3a31fc55861e3f71fefb83772bdb7f2ae73cee9ee428f8f54
|
7
|
+
data.tar.gz: 692216f2b2ee4ffe6f2e683f23b3463b4392ebf40e43f57c586cf2e038acdb052c98a9246ff3a359facaae9256d6aa0265f413e226626c918dba6f8ee4901d38
|
data/README.md
CHANGED
@@ -25,11 +25,11 @@ At present this generates 5 output formats:
|
|
25
25
|
|
26
26
|
To use it, add this line to your application's Gemfile (change the tag to the version you would like to use):
|
27
27
|
|
28
|
-
gem 'moj_template',
|
28
|
+
gem 'moj_template', '~> 0.1.0'
|
29
29
|
|
30
30
|
And then execute:
|
31
31
|
|
32
|
-
|
32
|
+
bundle
|
33
33
|
|
34
34
|
You can then use the `moj_template` layout in your app. If you need to extend the layout you can use [nested layouts](http://guides.rubyonrails.org/layouts_and_rendering.html#using-nested-layouts).
|
35
35
|
|
@@ -56,21 +56,31 @@ In order for these files to work, you will need to set a number of variables in
|
|
56
56
|
|
57
57
|
### Django version
|
58
58
|
|
59
|
-
To use the django package, add
|
59
|
+
To use the django package, add the following package to `requirements.txt`:
|
60
60
|
|
61
|
-
|
61
|
+
django-moj-template==0.1.0
|
62
62
|
|
63
|
-
Then
|
63
|
+
Then run:
|
64
|
+
|
65
|
+
pip install -r requirements.txt
|
66
|
+
|
67
|
+
Add `moj_template` to your `INSTALLED_APPS` in your `settings.py` file. Eg:
|
68
|
+
|
69
|
+
INSTALLED_APPS = (
|
70
|
+
...
|
71
|
+
'moj_template',
|
72
|
+
...
|
73
|
+
)
|
74
|
+
|
75
|
+
Then to use the template in your application extend your base template from the `moj_template` using:
|
64
76
|
|
65
77
|
{% extends 'moj_template/base.html' %}
|
66
78
|
|
67
79
|
#### Django Config
|
68
80
|
|
69
|
-
You will be required to set up some additional config to use the package.
|
70
|
-
|
71
|
-
"{app_path}.apps.core.context_processors.globals"
|
81
|
+
You will be required to set up some additional config to use the package.
|
72
82
|
|
73
|
-
|
83
|
+
Create a new file called `{app_path}/context_processors.py` with the following contents:
|
74
84
|
|
75
85
|
def globals(request):
|
76
86
|
return {
|
@@ -82,6 +92,10 @@ Then include the following in a new file called `apps/core/context_processors.py
|
|
82
92
|
'ga_id': '' # Google Analytics ID (Tracking ID for the service)
|
83
93
|
}
|
84
94
|
|
95
|
+
Then add the following to your `TEMPLATE_CONTEXT_PROCESSORS` in `settings.py`:
|
96
|
+
|
97
|
+
"{app_path}.context_processors.globals"
|
98
|
+
|
85
99
|
### Play version
|
86
100
|
|
87
101
|
To generate the tarball of Play Framework templates run `bundle exec rake build:play`. This will produce a tarball in the `pkg` directory.
|
@@ -104,6 +118,17 @@ To generate the folder of Liquid templates run `bundle exec rake build:liquid`.
|
|
104
118
|
|
105
119
|
To generate the tarball, run the `bundle exec rake build:tar` rake task. This will produce a tarball in the `pkg` directory.
|
106
120
|
|
121
|
+
## Publishing
|
122
|
+
|
123
|
+
After an accepted contribution (pull request merged into master) you must checkout master and run the following command to publish the current versions:
|
124
|
+
|
125
|
+
bundle exec rake publish
|
126
|
+
|
127
|
+
This will trigger a build and on success publish the following packages:
|
128
|
+
|
129
|
+
* [A gem on RubyGems.org](https://rubygems.org/gems/moj_template)
|
130
|
+
* [A Django python package](https://pypi.python.org/pypi/django-moj-template)
|
131
|
+
|
107
132
|
## Development
|
108
133
|
|
109
134
|
The source files are in the `/source` directory. The `compile` rake task builds the `/app` contents from these sources. This process involves the following:
|
data/lib/moj_template/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moj_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dom Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|