topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 9:34 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: NANY 2013: Carbon - website / blogging framework [alpha]  (Read 37216 times)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
NANY 2013: Carbon - website / blogging framework [alpha]
« on: September 28, 2012, 09:54 AM »
Carbon is a hackable performant (semi) static blogging system.. I intend this to be my NANY 2013 entry, however I'm getting too excited :) I've never build such a system from scratch but am familiar with PHP frameworks like CodeIgniter, SilverStripe etc so Carbon is class based, somewhat MVC and clearly written (I hope).

It should be considered early alpha, a first-look. There is no point using it in production yet, but you might want to have a sneak peak and give initial feedback.

Aims
* Easy to learn
* Easy to hack & extend
* Performant

There are many others. I find most of them too complex to extend, too fiddly to get running, or too hard to use. Because I wrote this one, I don't have these problems.



687474703a2f2f692e696d6d2e696f2f465636702e706e67.jpg


Source and information, issues etc on GitHub. Enthusiastic feedback welcome. Best way to start is to look at the index.php and follow the execution pipeline.
« Last Edit: November 05, 2012, 09:06 AM by justice »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #1 on: September 28, 2012, 09:57 AM »
Very cool!!

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Points: 1
  • Posts: 9,747
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #2 on: September 28, 2012, 10:47 AM »
Nice work, Justice!

40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,857
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #3 on: September 28, 2012, 11:33 AM »
Well done!  :Thmbsup:

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #4 on: October 01, 2012, 10:13 AM »
You can now link to individual posts,  articles can contain yaml (key value pairs), and we have a post loop (show last 10 on frontpage). Things are progressing.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #5 on: October 02, 2012, 12:26 PM »
New today: admin panel; static site generation; relative links; model & controller templates; bug fixes!

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #6 on: October 04, 2012, 07:24 AM »
Today you can post with images plus there's improvments to yesterday's work.

TaoPhoenix

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 4,642
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #7 on: October 04, 2012, 07:41 AM »
Is there a tutorial for not-so-bright humanities-type users?

It would be fun to try out a new blog system, but I'm totally lost. : (


40hz

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 11,857
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #8 on: October 04, 2012, 08:10 AM »
s there a tutorial for not-so-bright humanities-type users?


+1! And us humanities-systems types who don't have much experience with this type of software. :mrgreen:

I'd be more than willing to pay for a copy if it came with decent documentation. :)
« Last Edit: October 04, 2012, 08:20 AM by 40hz »

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Carbon - my web framework
« Reply #9 on: October 04, 2012, 09:44 AM »
Did you read the https://github.com/svandragt/carbon page? I made a "basic configuration" and "getting started" section with this in mind?

Hope this helps:

Installing Carbon in developer mode on a shared host
http://screencast.com/t/QgDYtKUFpG

Enable caching for production use
http://screencast.com/t/bRs6taeYUEQl

Generate a static site
http://screencast.com/t/KqP1GRhNTf

After the functionality is there, I will focus on making it easier to deploy content  / static site.
« Last Edit: October 04, 2012, 10:16 AM by justice »

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #10 on: October 04, 2012, 10:07 AM »
So... technical question.  It looks like you did your MVC work from scratch?  Is that right?  Just curious... I've been looking at CodeIgniter because I did an MVVM framework almost from scratch (using parts of Unity and Prism), and didn't want to go through that again, but love the approach.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #11 on: October 04, 2012, 10:29 AM »
Yes the MVC work is from scratch but inspired by CodeIgniter, I have used that in the past and can recommend it.
In the past I have found it difficult to neatly organise a project like this in the CI MVC model so I thought if I start from scratch I understand the foundations better.

It's won't be as robust as CI but then it won't have several years of little tweaks that make it harder to understand what's going on. :)

I'm trying to keep a separation between the mvc code and the system behind it so that people can just focus on their site structure and how it is generated.

Basically a request gets routed by Carbon::router to an appropriate
Application controller (based on content types).
The content gets filled in by the system's DataModel class which is passed through the application's Model (defines sections of content mostly). Once we have the content in the right structure it's sent to the application's View class that uses a very simple templater to generate the page.

Only using two models at the moment:
public static $page_model = array(
'markdown|html' => 'content',
);

public static $post_model = array(
'yaml' => 'metadata',
'markdown|html' => 'content',
);

I'm taking the controller and model that is used and then use that to choose the right template file (pages.php for pages, archive.php for archive etc).

But for example you might add a Portfolio controller and model that sends things through to a portfolio.php template.

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11,186
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #12 on: October 04, 2012, 01:32 PM »
That's really cool!  Having done my own framework, I know how much work is involved, and tip my hat to you- the code looks really solid for this stage of the game.  And if you're not using it for a wide variety of projects, having your own tailor made to what you need is great.  That's my problem with Unity and Prism and all of the Microsoft Enterprise libraries- they're too heavyweight.  Yours is functional and readable.

Great work!

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #13 on: October 30, 2012, 11:09 AM »
Just tagged 0.2.1.
I've rewritten the framework using instances instead of static classes, which will help to implement unit tests where required in the future.
I've also managed to simplify the code in the process, it should be much easier to understand now:

Posts are listed in the index page. Pages contain a section of YAML followed by Markdown, by default.
Pages just contain markdown content, by default. In the _basic_ theme, pages are linked from the footer.
Configuration settings override the defaults.
Manage your data models and theming logic using the MVC classes in the _public/application_ folder.


Request object:

-   Cache
-   Log
-   Environment
-   Security
-   Controller
   -   Records
   -   Model
   -   View


Controllers (based on path, created uniquely for site):

-   Home (posts) default homepage
-   Admin (no model) administration section
-   Archive (posts) post archive
-   Errors (page) custom error pages
-   Feeds (posts) feed of posts
-   Images (file) content images
-   Pages (page) individual pages
-   Posts (post) individual posts


Model types:

-   File (present bare file)
-   Page (structure for pages)
-   Post (structure for posts)


View types:

-   Html (templated content)
-   Feed (xml representation)
-   File (download)
« Last Edit: October 30, 2012, 11:18 AM by justice »

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #14 on: November 01, 2012, 05:46 AM »
Carbon now has a website. You can see what i'm planning for upcoming milesones. There's a wiki for tutorials / carbon powered sites. You can discuss Carbon via IRC (#carbonframework on freenode) and Google groups.

Feedback request: Being so directly involved, I'd love to know, if you have checked out Carbon but gave up, at what point that was so that I can focus my time on making it accessible.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #15 on: November 01, 2012, 05:55 AM »
Love the website, very clean.  :up:

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #16 on: November 01, 2012, 05:57 AM »
Can you talk a little bit about what you mean by the option to generate a static copy of the site?
It sounds like an awesome feature for people who want top speed or who want to be able to create a dynamic site locally but only upload static pages to a cloud-like host.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #17 on: November 01, 2012, 06:22 AM »
Sure, let me explain how caching works first using Carbon.

1. You want to develop with caching off (fully process every request). Carbon doesn't use a database, loads in content files and processes them according to your custom setup.
2. In production you can run carbon with caching on: static html get written to disk on first request and loaded in immediately on subsequent requests (this is about 5-10 times faster than Step 1):

$this->Cache = new Cache($this);
if ($this->Cache->has_existing_cachefile()) {
exit(readfile($this->Cache->cache_file_from_url()));
}

3. Instead of running it like step 2 in production, you can go to /admin/generate. This will call every page so your cache is a reflection of your complete site.
4. Now you can copy the contents of the cache folder as a complete static site, that way PHP is never used. (I've included a powershell script carbon.ps1 that will do this for you if you use sftp.
« Last Edit: November 01, 2012, 06:33 AM by justice »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #18 on: November 01, 2012, 06:30 AM »
So the static site is really self-contained html -- it does not use any php and is fully navigable? that's a pretty big win if so.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: Carbon - my new hackable performant (semi) static blogging system.
« Reply #19 on: November 01, 2012, 06:30 AM »
Yes, anything that you find otherwise is a bug and I will fix.

(I released 0.2.2 with bugfixes to the feed, will try and slow down a bit.)
« Last Edit: November 01, 2012, 07:02 AM by justice »

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: NANY 2013: Carbon - website / blogging framework [alpha]
« Reply #20 on: November 05, 2012, 09:13 AM »
0.2.3 - refinement and bugfixes:
    config: Admin password now needs to be manually enabled
    cache: Correctly generate htaccess
    deployment: only replace hostnames in text files
    cache: only write cache when caching is enabled.
    theme: remove older articles link (non functional)
    deployment: new feature - replace hostname from a to b before deploying cached site

https://github.com/s...on/archive/0.2.3.zip

I also broke a bunch of links by changing my main website to a almost empty carbon install. (old site still available)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: NANY 2013: Carbon - website / blogging framework [alpha]
« Reply #21 on: November 06, 2012, 03:30 AM »
Another screencast:
* Creating a new post using the admin interface
* Using the generate site feature to create a full static cache
* using the powershell deployment script to deploy to my host over sftp

In under 2 mins!
http://screencast.com/t/JRijwzqMA94

And:
carbon with better powershell support (in develop): http://screencast.com/t/ALcrjU7csKM
« Last Edit: November 06, 2012, 09:13 AM by justice »

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: NANY 2013: Carbon - website / blogging framework [alpha]
« Reply #22 on: November 12, 2012, 07:49 AM »
My own site is now carbonated (still adding content)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: NANY 2013: Carbon - website / blogging framework [alpha]
« Reply #23 on: November 12, 2012, 11:35 AM »
My own site is now carbonated (still adding content)

Congratulations, that is a serious accomplishment  :up:

Theme Comments:
I like the semi-transparent top banner look.. one comment though -- i am all in favor of minimal themes, but it feels a tiny bit too much just like its just all one big page of text without differentiation between elements..

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Re: NANY 2013: Carbon - website / blogging framework [alpha]
« Reply #24 on: November 13, 2012, 04:49 AM »
You sure you're looking at this?
http://screencast.com/t/GWPQ1E48g