ghost on raspberry pi

first install node.js. use my tutorial or another

then download the latest version of ghost and unzip the file (info from here)

  unzip -d ghost [Name-of-Ghost-zip].zip

then execute the following commands

  cd ghost/
  sudo npm install –production

  cp config.example.js config.js

then edit the config.js file:

in the development-section and in the production-section edit the url to your IP/DOMAIN and the server host to your local IP and port. for development and production use different ports!

go to your installation directory and start ghost with
  npm start

to auto-start ghost i found this tutorial using forever (and others)
Forever (https://npmjs.org/package/forever)
You can use forever to run Ghost as a background task. forever will also take care of your Ghost installation and it will restart the node process if it crashes.
To install forever type

  npm install forever -g
To start Ghost using forever from the Ghost installation directory type
  NODE_ENV=production forever start index.js
To stop Ghost type
  forever stop index.js
To check if Ghost is currently running type

  forever list

to edit/make themes read this

images/photos

are stored in content/images/YYYY/mmm

update (from here)

Warning: Do NOT copy and paste the entire Ghost folder over the top of an existing installation on mac. Do NOT choose REPLACE if uploading with Transmit or other FTP software, choose MERGE.
  1. Update/upgrade pi
  2. Download the latest version of Ghost from Ghost.org
  3. Extract the zip file to a temporary location
  4. Delete existing index.js and package.json then copy new index.js and package.json files to the same directory.
  5. Next, delete the old core directory completely, and then put the new core directory in its place.
  6. For releases which include update to Casper (the default theme), delete the old content/themes/casper directory and put the new one its place
  7. Run sudo npm install –production
  8. Finally, Restart Ghost so that the changes take effect

edit html

to add custom elements (js, css, …) to your post/site edit the following file – don’t forget to restart ghost after editing this file!
ghost/content/themes/<yourTheme>/default.hbs

call the js-function eg with on-load-method

<body class="{{body_class}}" onload='testfkt();'>

get the text of a post

document.getElementsByClassName("post-content")[0].innerText

add new fonts

1. add font to default.hbs

<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic|Open+Sans:700,400|UnifrakturMaguntia&subset=all" />

2. add font to css

@font-face { font-family: "myFont"; src: local("myFont"), url("https://dl.dropboxusercontent.com/u/123456/myFont.ttf") format("TrueType") }

solve performance problems for login

this discussion gives a nice hint…
go to your root-dir of ghost and then:

sudo npm install bcrypt

This takes a while…
Then in core/server/models/user.js, change

bcrypt         = require('bcryptjs')

to

bcrypt         = require('bcrypt')

then restart ghost and 🙂

edit first page / homepage

the first page lists the latest blog-posts. to edit eg the number of words for each blog-post that should be displayed here, edit the file ghost/content/themes/<theme>/partials/loop.hbs and change the attribute excerpt words.

see doc

<section class="post-excerpt">
 <p>{{excerpt words="10"}} <a class="read-more" href="{{url}}">&raquo;</a></p>
 </section>

remove this block from your screen.css to delete the circle between posts on the start-page

.post:after {
 display: block;
 content: "";
 width: 7px;
 height: 7px;
 border: #E7EEF2 1px solid;
 position: absolute;
 bottom: -5px;
 left: 50%;
 margin-left: -5px;
 background: #FFF;
 -webkit-border-radius: 100%;
 -moz-border-radius: 100%;
 border-radius: 100%;
 box-shadow: #FFF 0 0 0 5px;
}

links

upgrade ghost
ghost config
ghost forum

 

Advertisements

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s