Version 1.0 beta

This commit is contained in:
mmk2410 2015-02-21 21:04:03 +01:00
commit 63f63489bc
6 changed files with 1918 additions and 0 deletions

22
LICENSE Normal file
View File

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Marcel Kapfer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

24
README.md Normal file
View File

@ -0,0 +1,24 @@
# pBlog
This is a small php blog engine with **markdown support**
At the moment it doesn't contain much features, but more will follow.
## Goal
The goal is to create a simple blog engine. The blog posts should be written using (a) xml file(s) and the page should be prepared with a javascript program.
## Planned Features for Version 1.0
- Post writing in XML **DONE**
- Markdown support **DONE**
- Code support **DONE**
As you may guess: Version 1.0 will be released soon :D
## Planned Features
- special url actions (blog.html?xyz , blog.html#xyz)
- publishing on a set time
- Tags
## More information
- [Trello Board](https://trello.com/b/7qb5I6EQ/blog-engine)
- [Google+ Profile from Marcel Michael Kapfer](plus.google.com/+MarcelMichaelKapfer)
- [Twitter Profile from Marcel Michael Kapfer](twitter.com/MarcelKapfer)

95
index.php Normal file
View File

@ -0,0 +1,95 @@
<!DOCTYPE HTML>
<!-- pBlog https://github.com/mmk2410/pblog -->
<html>
<!-- For a good representation of the source code use an tab width which is not more than 4-->
<head>
<!--Replace pBlog with your Blogtitle-->
<title>pBlog</title>
<!--Metatags
You don't have to change here anything, but I recommend to add an author and description tag-->
<meta name="theme-color" content="#ac2900"/>
<meta http-equiv="CACHE-CONTROL" content="no-cache" />
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<!--CSS
no change needed-->
<link rel="stylesheet" type="text/css" href="res/blog.css" />
<link href='http://fonts.googleapis.com/css?family=Roboto:400,500,700,300,400italic,100,100italic,900' rel='stylesheet' type='text/css'>
<!-- Set here the link to your favicon-->
<link rel="shortcut icon" href="../images/favicons/deep_orange.png">
</head>
<body>
<div class="header">
<!--Replace 'index.php' with the link to this file
and 'Blog' with your Blogtitle-->
<nobr><a href="index.php" class="title">Blog</a></nobr>
<!--Set here the link to your Homepage or delete the following line-->
<a href="../" class="home">Home</a>
</div>
<!--DON'T CHANGE ANYTHING HERE!-->
<?php
require_once 'res/Parsedown.php';
$xml = simplexml_load_file('xml/posts.xml');
?>
<?php
foreach ($xml->post as $post){
?>
<section>
<p class="texttitle">
<?php
echo $post->title;
?>
</p>
<small>
<?php
echo $post->pubdate;
?>
</small>
<p class="text">
<?php
echo Parsedown::instance()
->setBreaksEnabled(true)
->text($post->content);
?>
</p>
<p align="right">
<?php
foreach ($post->otherlinks->otherlb as $olb){
?>
<a class="button_white" target="_blank" href="
<?php
echo $olb->otherurl;
?>
">
<?php
echo $olb->otherlink;
?>
</a>
<?php
}
foreach($post->mainlink as $mainlink){
?>
<a class="button_color" target="_blank" href="
<?php
echo $post->mainurl;
?>
">
<?php
echo $post->mainlink;
?>
</a>
<?php } ?>
</p>
</section>
<?php
}
?>
<div class="box_container">
<!--Set here your personal copyright info-->
<p class="cc">
pBlog <?php echo date("Y"); ?>
</p>
</div>
</body>
</html>

1528
res/Parsedown.php Normal file

File diff suppressed because it is too large Load Diff

187
res/blog.css Normal file
View File

@ -0,0 +1,187 @@
/* pBlog 0.2 */
body{
margin-right: 15%;
margin-left: 15%;
margin-bottom: 0px;
margin-top: 100px;
font-family: 'Roboto', sans-serif;
font-size: 14px;
line-height: 20px;
letter-spacing: 0.01px;
background-color: #ffffff;
color: rgba(0, 0, 0, 0.87);
}
img{
max-width: 100%;
max-height: 400px;
display: block;
margin-left: auto;
margin-right: auto;
}
.header{
position: absolute;
top: 0;
left: 0;
right: 0;
float: center;
z-index: 40;
background: #de3e0b;
width: 100%;
box-shadow: 0px 0px 4px 4px rgba(189, 189, 189, 0.5);
-moz-box-shadow: 0px 0px 4px 4px rgba(189, 189, 189, 0.5);
-webkit-box-shadow: 0px 0px 4px 4px rgba(189, 189, 189, 0.5);
height: 60px;
padding-right: 0px;
padding-top: 0px;
white-space: nowrap;
}
.text{
font-family: 'Roboto', sans-serif;
font-size: 14px;
line-height: 20px;
letter-spacing: 0.01px;
background-color: #ffffff;
z-index: 10;
color: rgba(0, 0, 0, 0.87);
}
.text a{
font-family: 'Roboto', sans-serif;
font-size: 14px;
line-height: 20px;
letter-spacing: 0.01px;
color: #de3e0b;
text-decoration: none;
}
section{
margin-bottom: 50px;
}
/*
Material design flat button
Usage: <a class=".text_button_flat">YOUR TEXT</a>
9th November 2014
*/
.button_white {
text-decoration: none;
color: #000000;
line-height: 40px;
min-width: 70px;
text-align: center;
height: 40px;
padding: 8px;
border-width: 1px;
border-style: solid;
border-color: #a2a2a2;
border-radius: 3px;
margin: 4px;
margin-bottom: 5px;
margin-left: 5px;
letter-spacing: 0.4px;
font-weight: 700;
font-size: 14px;
text-align: center;
}
/*
Material design flat button
Usage: <a class=".text_button_flat_colored">YOUR TEXT</a>
9th November 2014
*/
.button_color {
text-decoration: none;
line-height: 40px;
min-width: 70px;
text-align: center;
height: 40px;
padding: 8px;
color: #FFFFFF;
background-color: #de3e0b;
border-width: 1px;
border-style: solid;
border-color: #de3e0b;
border-radius: 3px;
margin: 4px;
margin-bottom: 5px;
margin-left: 5px;
letter-spacing: 0.4px;
font-weight: 700;
font-size: 14px;
}
.title{
padding-left:15%;
height: 60px;
line-height: 60px;
display:inline-block;
text-decoration: none;
color: #FFFFFF;
vertical-align: middle;
font-size: 24px;
overflow-x: hidden;
max-width: 35%;
}
.home{
float: right;
padding-right: 15%;
height: 60px;
line-height: 60px;
vertical-align: middle;
color: #fff;
overflow-x: hidden;
font-size: 20px;
display: inline-block;
text-decoration: none;
max-width: 35%;
}
.texttitle{
font-family: 'Roboto', sans-serif;
font-weight: 500;
font-size: 20px;
color: rgb(33, 33, 33);
line-height: 24px;
letter-spacing: 0.05px;
}
.cc{
font-family: 'Roboto', sans-serif;
font-size: 12px;
line-height: 14px;
letter-spacing: 0.01px;
}
.cc a{
font-family: 'Roboto', sans-serif;
font-size: 12px;
line-height: 14px;
letter-spacing: 0.01px;
color: rgba(0, 0, 0, 0.87);
text-decoration: none;
}
.cc a:hover{
text-decoration: underline;
}
@media screen and (max-width: 700px){
body {
margin-right: 40px;
margin-left: 20px;
}
.title{
padding-left: 10px;
max-width: 45%;
}
.home{
padding-right: 10px;
max-width: 45%;
}
}

62
xml/posts.xml Normal file
View File

@ -0,0 +1,62 @@
<?xml version='1.0' standalone='yes'?>
<posts>
<post>
<title>Version 0.3</title>
<pubdate>20th February 2015</pubdate>
<content>This is the Version *0.3* of pBlog. It comes with the following changes:
- Complete Markdown Support
- Design fixes
- a mainlink is no longer required
</content>
</post>
<post>
<title>Version 0.2</title>
<pubdate>20th February 2015</pubdate>
<content>
The following things are new in this version:
- Design
- Better structur
- cleaned up
More will come when it is ready!
This is the version *0.2*.
</content>
<mainurl>index.php</mainurl>
<mainlink>Reload</mainlink>
<otherlinks>
<otherlb>
<otherurl>http://marcel-kapfer.de</otherurl>
<otherlink>marcel-kapfer.de</otherlink>
</otherlb>
<otherlb>
<otherurl>https://github.com/mmk2410/pblog</otherurl>
<otherlink>GitHub</otherlink>
</otherlb>
</otherlinks>
</post>
<post>
<title>Blog (Experimental)</title>
<pubdate>13th February 2015</pubdate>
<content>
This is a test version in a early state of the new **blog engine**. By now it supports following things:
- Markdown
- Mainlink and various other links
More will come when it is ready!
This is the version *0.1*.
</content>
<mainurl>index.php</mainurl>
<mainlink>Reload</mainlink>
<otherlinks>
<otherlb>
<otherurl>http://marcel-kapfer.de</otherurl>
<otherlink>marcel-kapfer.de</otherlink>
</otherlb>
<otherlb>
<otherurl>https://github.com</otherurl>
<otherlink>GitHub</otherlink>
</otherlb>
</otherlinks>
</post>
</posts>