persona 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,91 @@
1
+ Persona
2
+ =======
3
+
4
+ Persona is a minimal personal content manager. It is designed for geeks: you need to have Ruby and Git installed in your machine, and know how to use it. However, you don't need to be a Ruby developer.
5
+
6
+ Principles:
7
+
8
+ * it's for geeks
9
+ * it's minimal (150 lines of code at the moment)
10
+ * leverage cloud services and infrastructure
11
+ * lets you create a website for free (no hosting fees)
12
+
13
+ In this stage it's a work in progress, without much documentation.
14
+
15
+ Prerequisites
16
+ -------------
17
+ You need to have
18
+
19
+ 1. Ruby (1.8.7 or 1.9.2)
20
+ 2. RubyGems
21
+ 3. git
22
+ 4. a Rack compatible HTTP Server
23
+
24
+ installed on your machine.
25
+
26
+ If you don't have a Rack server, or you don't know what is it, after you have installed Ruby and RubyGems just type
27
+
28
+ $ gem install thin
29
+
30
+ Notice: depending on your installation, you might see some problem with permissions while executing the previous command. In this case, try
31
+
32
+ $ sudo gem install thin
33
+
34
+
35
+ Create your site
36
+ ----------------
37
+
38
+ $ gem install persona
39
+ $ persona create_site myblog
40
+ $ cd myblog
41
+
42
+ done.
43
+
44
+ Test your website
45
+ -----------------
46
+
47
+ From the 'myblog' folder, start your Rack server. If you installed thin, type
48
+
49
+ $ thin start
50
+
51
+ and open your browser to [localhost:3000](http://localhost:3000/ "localhost:3000")
52
+
53
+ Add contents
54
+ ------------
55
+
56
+ Pages and blog posts are (at the moment, will likely change soon) specified in HTML-ish files inside the folders /contents/pages and /contents/posts.
57
+ Have a look at the sample provided in your website.
58
+
59
+ Every file specifies in the first 3 rows some metadata (title, author and date) and, after a blank line, the HTML content of the page/post.
60
+
61
+ To add a new page, just create another .txt file in the /contents/page folder. If the file is called myfile.txt, it will immediately be visible at http://localhost:3000/pages/myfile
62
+
63
+ To add a new blog post, create a .txt file with this naming convention:
64
+ <year>-<month>-<day>-<post_title>.txt
65
+ The blog post will be immediately visible under http://localhost:3000/year/month/date/post_title
66
+
67
+
68
+ Customize
69
+ ---------
70
+
71
+ The folders
72
+ public
73
+ views
74
+ config
75
+ contain files you can customize. Have a look!
76
+
77
+ What to do next
78
+ ---------------
79
+
80
+ A few things you might want to do next
81
+
82
+ 1. open a github account and project, and upload your website there
83
+ 2. open a Heroku account, and deploy your website there
84
+
85
+ Note that, since your website doesn't use a database, you can use the Heroku free plan!
86
+
87
+
88
+
89
+ (that's it for now, will post more details soon)
90
+
91
+
@@ -8,6 +8,10 @@ end
8
8
 
9
9
  if (ARGV.length == 2 and ARGV[0] == 'create_site')
10
10
  PersonaTasks.create_site Dir.new('.'), ARGV[1]
11
- p "site created"
11
+ puts "site #{ARGV[1]} created"
12
+ else
13
+ puts "\nUsage: \n\n"
14
+ puts "persona create_site <site_name>"
15
+ puts "\n"
12
16
  end
13
-
17
+
@@ -1,3 +1,3 @@
1
1
  module Persona
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  site:
2
- title: Filippo Diotalevi
3
- description: Startups, Technology and News
4
- url: 'http://diotalevi.com'
2
+ title: A sample website
3
+ description: ...powered by an awesome personal cms!
4
+ author: Myself
5
+ url: 'http://localhost'
@@ -2,4 +2,4 @@ title: about page
2
2
  author: John Doe
3
3
  date: 1900/01/01
4
4
 
5
- <h1>About John</h1>
5
+ <p>About John</p>
@@ -3,22 +3,34 @@ body {
3
3
  margin: 0 auto;
4
4
  font-family: Georgia, 'Baskerville', Times, serif;
5
5
  font-size: 18px;
6
- line-height: 27px;
7
6
  padding: 15px;
8
7
  width: 780px;
9
8
 
10
9
  }
11
- header, footer, section, article {
10
+ header, footer, section, article, logobar {
12
11
  display: block;
13
12
  }
14
13
 
15
14
  body > header {
16
15
  height: 30px;
17
16
  font-size: 16px;
17
+ vertical-align: top;
18
+ margin-bottom: 20px;
19
+ }
20
+
21
+ body > logobar {
18
22
  vertical-align: top;
19
23
  margin-bottom: 60px;
20
24
  }
21
25
 
26
+ body > logobar h1 {
27
+ font-size: 54px;
28
+ }
29
+
30
+ body > logobar h2 {
31
+ font-size: 20px;
32
+ }
33
+
22
34
  #content {
23
35
  }
24
36
  #by {
@@ -101,6 +113,7 @@ blockquote {
101
113
 
102
114
  body > footer {
103
115
  text-align: left;
116
+ margin-top:90px;
104
117
  margin-left: 10px;
105
118
  font-style: italic;
106
119
  font-size: 18px;
@@ -14,13 +14,13 @@
14
14
 
15
15
  <% end %>
16
16
 
17
- <h2>Older posts</h2>
18
- <ul>
19
17
  <% if @posts.size > 3%>
18
+ <h2>Older posts</h2>
19
+ <ul>
20
20
  <% @posts[3..-1].each do |post| %>
21
21
  <li>
22
22
  <a href="<%= post.url %>"><%= post.title %></a>, published on <%= post.date.strftime('%b %d, %Y') %>
23
23
  </li>
24
24
  <%end%>
25
+ </ul>
25
26
  <%end%>
26
- </ul>
@@ -4,36 +4,24 @@
4
4
  <link rel="stylesheet" type="text/css" href="/css/main.css">
5
5
  <link rel="alternate" type="application/atom+xml" title="feed" href="/feed/" />
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
7
- <title>Filippo Diotalevi</title>
8
- <meta name="keywords" content="startup,technology,java,ruby,rails,osgi">
9
- <meta name="author" content="Filippo Diotalevi">
10
-
11
- <script type="text/javascript">
12
-
13
- var _gaq = _gaq || [];
14
- _gaq.push(['_setAccount', 'UA-398358-5']);
15
- _gaq.push(['_trackPageview']);
16
-
17
- (function() {
18
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
19
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
20
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
21
- })();
22
-
23
- </script>
24
-
7
+ <title><%=$config['site']['title']%></title>
8
+ <meta name="keywords" content="<%=$config['site']['description']%>">
9
+ <meta name="author" content="<%=$config['site']['author']%>">
25
10
 
26
11
  </head>
27
12
  <body>
28
13
  <header>
29
14
  <a href='/'>Home</a> | <a href='/pages/about'>About</a>
30
15
  </header>
31
-
16
+ <logobar>
17
+ <h1><%=$config['site']['title']%></h1>
18
+ <h2><%=$config['site']['description']%></h2>
19
+ </logobar>
32
20
  <section>
33
21
  <%= yield %>
34
22
  </section>
35
23
  <footer>
36
- powered by Persona (unreleased yet), the minimal personal content manager
24
+ powered by <a href="https://github.com/fdiotalevi/persona-cms">Persona, the minimal personal content manager</a>
37
25
  </footer>
38
26
  </body>
39
27
  </html>
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Filippo Diotalevi
@@ -59,7 +59,7 @@ extra_rdoc_files: []
59
59
  files:
60
60
  - .gitignore
61
61
  - Gemfile
62
- - README.rdoc
62
+ - README.md
63
63
  - Rakefile
64
64
  - bin/persona
65
65
  - lib/persona.rb
@@ -1,15 +0,0 @@
1
- == Persona
2
-
3
- Persona is a minimal personal content manager.
4
- In this stage it's a work in progress, without much documentation.
5
-
6
-
7
- $ gem install persona
8
- $ persona create_site myblog
9
- $ cd myblog
10
-
11
- and then start any Rack compatible HTTP server
12
-
13
- done.
14
-
15
- (I'll post more details soon, promised)