nesta-plugin-linkable 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.mdown +49 -0
- data/Rakefile +1 -0
- data/lib/nesta-plugin-linkable.rb +3 -0
- data/lib/nesta-plugin-linkable/init.rb +25 -0
- data/lib/nesta-plugin-linkable/version.rb +7 -0
- data/nesta-plugin-linkable.gemspec +22 -0
- metadata +81 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.mdown
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Linkable posts for Nesta CMS
|
2
|
+
|
3
|
+
This plugin makes it simple to do [Daring Fireball](http://daringfireball.net) style posts for remote links in [Nesta](http://nestacms.com). Simply add the `url` to your article [metadata](http://nestacms.com/docs/creating-content/metadata-reference):
|
4
|
+
|
5
|
+
date: 2011-09-22 11:34:07 -0500
|
6
|
+
categories: linked
|
7
|
+
url: http://nestacms.com/docs/design/making-an-art-directed-blogazine
|
8
|
+
slug: making-blogazine-with-nesta
|
9
|
+
|
10
|
+
# Making a blogazine with NestaCMS
|
11
|
+
|
12
|
+
...
|
13
|
+
|
14
|
+
### Installation
|
15
|
+
|
16
|
+
To install add the plugin to your Nesta Gemfile
|
17
|
+
|
18
|
+
In your views, be sure to use the `url_for` helper to link to the remote URL as needed in pages:
|
19
|
+
|
20
|
+
- if @page.is_linked?
|
21
|
+
%a.permalink{:href => url_for(@page)}
|
22
|
+
→
|
23
|
+
|
24
|
+
... or by default in your atom feed:
|
25
|
+
|
26
|
+
...
|
27
|
+
- @articles.each do |article|
|
28
|
+
%entry
|
29
|
+
%title= article.heading
|
30
|
+
%link{ :href => url_for(article), :type => 'text/html', :rel => 'alternate' }
|
31
|
+
%id= atom_id(article)
|
32
|
+
...
|
33
|
+
|
34
|
+
The plugin works nicely with the [Sluggable](https://github.com/pengwynn/nesta-plugin-sluggable) which allows you to add descriptive slugs to your link post URLs.
|
35
|
+
|
36
|
+
## Note on Patches/Pull Requests
|
37
|
+
|
38
|
+
* Fork the project.
|
39
|
+
* Make your feature addition or bug fix.
|
40
|
+
* Add tests for it. This is important so I don't break it in a
|
41
|
+
future version unintentionally.
|
42
|
+
* Commit, do not mess with rakefile, version, or history.
|
43
|
+
(if you want to have your own version, that is fine but
|
44
|
+
bump version in a commit by itself I can ignore when I pull)
|
45
|
+
* Send me a pull request. Bonus points for topic branches.
|
46
|
+
|
47
|
+
## Copyright
|
48
|
+
|
49
|
+
Copyright (c) 2011 Wynn Netherland. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Nesta
|
2
|
+
module Plugin
|
3
|
+
module Linkable
|
4
|
+
module Helpers
|
5
|
+
end
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class App
|
10
|
+
helpers Nesta::Plugin::Linkable::Helpers
|
11
|
+
|
12
|
+
def url_for(page)
|
13
|
+
page.is_linked? ? page.metadata('url') : File.join(base_url, page.path)
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
class Page
|
19
|
+
|
20
|
+
def is_linked?
|
21
|
+
not self.metadata('url').nil?
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "nesta-plugin-linkable/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "nesta-plugin-linkable"
|
7
|
+
s.version = Nesta::Plugin::Linkable::VERSION
|
8
|
+
s.authors = ["Wynn Netherland"]
|
9
|
+
s.email = ["wynn.netherland@gmail.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{Link posts for Nesta}
|
12
|
+
s.description = %q{Link posts for Nesta CMS}
|
13
|
+
|
14
|
+
s.rubyforge_project = "nesta-plugin-linkable"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
s.add_dependency("nesta", ">= 0.9.11")
|
21
|
+
s.add_development_dependency("rake")
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nesta-plugin-linkable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Wynn Netherland
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-09-25 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nesta
|
16
|
+
requirement: &70325665264660 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.9.11
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70325665264660
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
requirement: &70325665264240 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70325665264240
|
36
|
+
description: Link posts for Nesta CMS
|
37
|
+
email:
|
38
|
+
- wynn.netherland@gmail.com
|
39
|
+
executables: []
|
40
|
+
extensions: []
|
41
|
+
extra_rdoc_files: []
|
42
|
+
files:
|
43
|
+
- .gitignore
|
44
|
+
- Gemfile
|
45
|
+
- README.mdown
|
46
|
+
- Rakefile
|
47
|
+
- lib/nesta-plugin-linkable.rb
|
48
|
+
- lib/nesta-plugin-linkable/init.rb
|
49
|
+
- lib/nesta-plugin-linkable/version.rb
|
50
|
+
- nesta-plugin-linkable.gemspec
|
51
|
+
homepage: ''
|
52
|
+
licenses: []
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
hash: -3749787902472280503
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
hash: -3749787902472280503
|
75
|
+
requirements: []
|
76
|
+
rubyforge_project: nesta-plugin-linkable
|
77
|
+
rubygems_version: 1.8.6
|
78
|
+
signing_key:
|
79
|
+
specification_version: 3
|
80
|
+
summary: Link posts for Nesta
|
81
|
+
test_files: []
|