Permalink
Browse files

Added basic style template

  • Loading branch information...
1 parent 44d0db0 commit b63eef364b14f62f1511d2b58de16a1702fc3da0 @nickwynja committed Mar 18, 2012
Showing with 258 additions and 11 deletions.
  1. +18 −6 README.markdown
  2. +1 −1 config-files/crontab.example
  3. +232 −0 config-files/main.css
  4. +7 −4 deploysecondcrack.sh
View
@@ -2,7 +2,8 @@
**If you're new to this:** I'll be writing a post at [nickwynja.com/deploysecondcrack](http://nickwynja.com/deploysecondcrack) that will go into more detail about how you can get your hands on a server instance and control it with SSH and Vim.
-### 1. Create 'blog' user account
+1. Create 'blog' user account
+====
**Note:** For ease of setup, we will use the username 'blog'. Changing this to your name will break other deploy scripts.
@@ -11,7 +12,8 @@
Next switch to your new 'blog' user account with the command `su blog`.
-### 2. Install Environment, Dropbox, Second Crack, and deploysecondcrack
+2. Install Environment, Dropbox, Second Crack, and deploysecondcrack
+====
Paste the following command and press enter to make the magic happen. You'll be prompted for your password.
@@ -21,7 +23,14 @@ This script will install `httpd`, `php`, `git`, `inotify-tools` and update/insta
After everything is installed, `~/secondcrack/config.php` will be displayed where you need to set `$blog_title`, `$blog_url`, and the description of your blog. You can also enter a username and password here if you plan on using the bookmarklets.
-### 3. Initiate Dropbox
+Optional: If you want some basic styling out of the box, you'll have to include the stylesheet that was placed in `~/Dropbox/Blog/assets/main.css` into the `main.php` template file in `~/Dropbox/templates/`. To open it up in Vim use the command `sudo vi ~/Dropbox/Blog/templates/main.php` and add in the following code on line 8 (or anywhere in `<head>`:
+
+ <link href="http://YOURDOMAIN.com/assets/css/main.css" rel="stylesheet">
+
+We use a hardcoded URL here rather than a relative path so that our stylesheet can be found when you preview posts locally out of the `_previews` folder.
+
+3. Initiate Dropbox
+====
Dropbox mostly installed but you need to initiate it and link the server to your account. Enter this command:
@@ -33,16 +42,19 @@ You will be given a URL you need to copy and paste into your browser to link you
This will start up the Dropbox daemon that runs in the background.
-### 4. Start Apache
+
+4. Start Apache
+====
Fire up Apache and you're done!
sudo service httpd start
+
## Notes:
- See Marco's documentation on [Second Crack](https://github.com/marcoarment/secondcrack) for the basics of how to create new posts.
- It's a know bug right now that previews of drafts aren't being creating in `/drafts/_previews/`.
-- The default template is being used now. It's pretty boring. I plan to update this using [Bootstrap](http://twitter.github.com/bootstrap/) at some point.
- This configuration does not include much security. In fact, it completely disables the firewall. Maybe sometime in the future I'll add [APF](http://www.rfxn.com/projects/advanced-policy-firewall/) but for now, you're on your own.
-- I'm not a total neckbeard sysadmin. My implementation of the server environment is likely poor. Use it at your own risk.
+- I'm not a total neckbeard sysadmin. My implementation of the server environment is likely poor. Use it at your own risk (or fix my code if you know better).
+- Neither myself or Marco are responsible for anything that goes wrong. I'll try and help if I can but don't email him.
@@ -1,2 +1,2 @@
-* * * * * /home/blog/secondcrack/engine/update.sh /home/blog/Dropbox/Blog /home/blog/secondcrack
+* * * * * /home/blog/secondcrack/engine/update.sh /home/blog/Dropbox/Blog /home/blog/secondcrack
@reboot /home/blog/.dropbox-dist/dropboxd
View
@@ -0,0 +1,232 @@
+/* This stylesheet is based on the template from Marco.org. All credit goes to him. */
+
+body {
+ background-color: #fff;
+ color: #000;
+ margin: 0;
+ padding: 0;
+ font-size: 16px;
+ font-family: Helvetica, sans-serif;
+ word-wrap: break-word;
+}
+
+#mastheadbackground {
+ background-color: #fff;
+ height: 180px;
+ margin-bottom: -180px;
+}
+
+a, a:active, a:visited {
+ color: blue;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ color: #000000;
+}
+
+/* Site title */
+#masthead {
+ color: #000;
+}
+
+#masthead h1 {
+ font-weight: normal;
+ font-size: 2em;
+ margin-top: 0;
+ padding-top: 0.5em;
+}
+
+#masthead a,
+#masthead a:active,
+#masthead a:visited { color: blue; }
+
+#masthead h1 a,
+#masthead h1 a:active,
+#masthead h1 a:visited {
+ text-decoration: none;
+}
+
+#masthead p { margin: 0; padding: 0; }
+#masthead nav { display: block; margin: 0; padding: 1em 0; color: blue; }
+
+/* Posts */
+
+article {
+ display: block;
+ font-family: Helvetica, sans-serif;
+ line-height: 1.6;
+ margin-top: 3em;
+}
+
+ article header { color: #888; }
+ article header p { margin: 0; }
+ article header a { text-decoration: none; }
+
+/* Link posts */
+
+article.link header h2 { font-size: 1.25em; }
+
+article.link header h2 a,
+article.link header h2 a:active,
+article.link header h2 a:visited {
+ color: blue;
+ text-decoration: underline;
+}
+
+/* Block layout */
+
+#masthead {
+ width: 310px;
+ padding-top: 0;
+ margin-top: 0;
+}
+
+footer {
+ margin: 2em 0;
+ font-size: 13px;
+}
+
+ footer p { margin: 0.5em; }
+
+section#posts {
+ position: relative;
+ display: block;
+ width: 520px;
+ margin: 0 auto;
+}
+
+/* Post title */
+h2 {
+ font-weight: normal;
+ font-size: 1.5em;
+ margin-bottom: 0;
+ line-height: 1.25;
+}
+
+h2 a,
+h2 a:active,
+h2 a:visited {
+ color: #000;
+ text-decoration: none;
+}
+
+/* In posts */
+
+h3 {
+ font-size: 1em;
+}
+
+.fin {
+ text-align: center;
+ font-size: 1.5em;
+ color: #f4f4f4;
+ margin-top: 1em;
+}
+
+.linkarrow {
+ color: #aaa;
+}
+
+blockquote {
+ margin: 0 18px 18px 18px;
+ color:#666;
+ padding-left:10px;
+ border-left:4px solid #eee;
+}
+
+img, figure { max-width: 100%; }
+
+figure {
+ padding: 5px;
+ border: 1px solid #eee;
+ margin: 2em auto;
+ background-color: #f4f4f4;
+}
+ figure.right { float: right; margin-left: 2em; margin-right: 0; margin-top: 0; max-width: 50%; }
+figure img { border: 1px solid #ccc; }
+figcaption { text-align: center; font-size: 0.85em; color: #555; }
+
+li {
+ margin: 1em 0;
+}
+
+sup, sub {
+ padding: 0 0.2em;
+ height: 0;
+ line-height: 1;
+ vertical-align: baseline;
+ _vertical-align: bottom;
+ position: relative;
+}
+sup { bottom: 0.5ex; }
+sub { top: .5ex; }
+
+pre {
+ font-size: 11px;
+ background-color: #eee;
+ padding: 1em;
+ overflow: auto;
+}
+
+.noborder img, ._noborder img { border: 0 !important; padding: 0 !important; background-color: transparent; }
+.post img { max-width: 100%; }
+
+.footnotes {
+ margin-top: 3em;
+ font-size: 14px;
+}
+.footnotes hr { margin-bottom: 1em; }
+
+.footnotes a[rev=footnote] { text-decoration: none; }
+
+}
+
+.permalink { text-decoration: none; }
+
+/* 500-pixel layout for smaller screens */
+@media (max-width: 680px) {
+ section#posts { width: 500px; }
+
+ #deckad { width: 175px; }
+
+ #mastheadbackground {
+ height: 190px;
+ margin-bottom: -190px;
+ }
+
+ #masthead {
+ height: 190px;
+ }
+}
+
+/* 240-pixel layout for iPhone-sized screens */
+@media (max-width: 520px) {
+ section#posts { width: 300px; }
+
+ #masthead {
+ width: 100%;
+ }
+
+ body {
+ font-size: 14px;
+ }
+
+ #mastheadbackground {
+ height: 280px;
+ margin-bottom: -280px;
+ }
+
+ #masthead {
+ height: 280px;
+ }
+
+ #deckad {
+ font-size: 12px;
+ width: 100%;
+ left: 0px;
+ top: 150px;
+ }
+
+ figcaption { font-size: 1em; }
+ figure.right { float: none; width: 100%; margin-left: 0; margin-right: 0; text-align: center; }
+}
View
@@ -34,10 +34,11 @@ sudo git clone git://github.com/nickwynja/deploysecondcrack.git;
cd ~ && wget -O - http://www.dropbox.com/download?plat=lnx.x86_64 | tar xzf -
sudo mkdir -p ~/Dropbox;
-sudo chown -R $USER ~/Dropbox/;
+sudo chown -R blog ~/Dropbox;
sudo chmod -R u+rw ~/Dropbox;
-sudo chown -R $USER ~/.dropbox;
+sudo chown -R blog ~/.dropbox;
sudo chmod -R u+rw ~/.dropbox;
+sudo chmod -R o+x ~/Dropbox;
# Install Dropbox service
@@ -78,7 +79,9 @@ sudo git clone git://github.com/marcoarment/secondcrack.git;
sudo mkdir -p ~/Dropbox/Blog/templates/;
sudo cp ~/secondcrack/example-templates/main.php ~/Dropbox/Blog/templates/main.php;
sudo cp ~/secondcrack/example-templates/rss.php ~/Dropbox/Blog/templates/rss.php;
-sudo mkdir -p ~/Dropbox/Blog/drafts/_publish-now/;
-sudo cp ~/deploysecondcrack/config-files/hello-world.txt ~/Dropbox/Blog/drafts/_publish-now/;
+sudo mkdir -p ~/Dropbox/Blog/assets/css/;
+sudo cp ~/deploysecondcrack/config-files/main.css ~/Dropbox/Blog/assets/css/main.css;
+sudo ln -s ~/Dropbox/Blog/assets ~/secondcrack/www;
+sudo chmod -R o+x ~/Dropbox;
sudo cp ~/deploysecondcrack/config-files/config.php.example ~/secondcrack/config.php;
sudo vi ~/secondcrack/config.php;

0 comments on commit b63eef3

Please sign in to comment.