Code Monkey home page Code Monkey logo

framework's People

Contributors

davidhoffmann avatar gilbitron avatar maccath avatar maltekiefer avatar marksouthard avatar okdana avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

framework's Issues

Blog doesn't paginate correctly

Hi, I installed BaunCMS and planned on using if for a blog, but the pagination is not working for me. I tried to track down the error and it turns out that the GET variables are not being detected correctly. For debugging purposes, I added these lines to the beginning of the Baun.php __construct() function:

public function __construct()
{
       echo "<div style='display:none;'>\n";
       print_r($_GET);
       echo "</div>";
       ...

To be able to see the GET variables. Then I made some tests.

When I accessed:

http://www.oscarello.me/?page=2

This was added to beginning after the opening body tag:

<div style="display:none;">
Array
(
    [page] => 2
)
</div>

But when I accessed:

http://www.oscarello.me/blog?page=2

This was added instead:

<div style="display:none;">
Array
(
)
</div>

Without this variable, the pagination doesn't work and it always gets stuck on the first page. Do you know if this is a real bug or maybe just an erroneous nginx configuration?

I'm using:

server {
       listen 80 default_server;
       listen [::]:80 default_server ipv6only=on;

       # webpage location
       root ROOT_TO_MY_WEBSITE;
       index index.php index.html index.htm;

       # server name
       server_name MY_SITE_NAME;

           try_files $uri $uri/ /index.php$args;

       # log files
       access_log /var/log/nginx/pico_access.log;
       error_log /var/log/nginx/pico_error.log;

       location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                # With php5-fpm;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
                # limit_req zone=one burst=5;
       }


       location ~*\.(gif|jpg|png)$ {
                expires 30d;
       }

       location ~ /\.ht {
                deny all;
       }
}

Thanks!

Nav Improvements

  • Add an arg to baun_nav() to allow setting a subfolder to be the "top" folder. Allows you to show only a subset of the navigation.
  • Add an arg to allow hiding of folder names
  • If a page exists with the same name as a folder, make the folder a link to the page (ie don't show both the page link and the folder name)

Blog Config Structure

So I am beginning to use this framework for my personal site and was mapping it all out in my head before diving into it.

I was thinking that the config could probably be separated for ease of use? To config/app.php and config/blog.php? Also what if I want two blogs, for example a "Journal" and a "Projects", maybe it should be renamed to listings instead, then in the listings.php config you can define an array of folders and configuration for each folder. Possibly even going to the length of /config/listings/x.php.

Just writing this out as a general discussion. I feel like Baun could be really good as a quick & simple turnaround framework but also feel that the blog config is out of place in config/app.php

Allow access to posts outside of blog

Just now posts are only available on the blog page. Allow access on all pages so users can create templates to show a list of posts, on homepage for example.

Testing

Need to get some tests written.

"Missing events provider" after installing

I believe this is a Windows only issue due to a bug in the loadConfigs() function in Baun class.

foreach ($configFiles as $configFile) {
    $configKey = str_replace(BASE_PATH . 'config/', '', $configFile);
    $configKey = str_replace(DIRECTORY_SEPARATOR, '-', strtolower($configKey));
    $configKey = str_replace('.php', '', $configKey);
    $configData[$configKey] = require $configFile;
}

should be:

foreach ($configFiles as $configFile) {
    $configKey = str_replace(BASE_PATH . 'config'.DIRECTORY_SEPARATOR, '', $configFile);
    $configKey = str_replace(DIRECTORY_SEPARATOR, '-', strtolower($configKey));
    $configKey = str_replace('.php', '', $configKey);
    $configData[$configKey] = require $configFile;
}

or else config keys are created incorrectly and $this->config->get('providers.events') will return nothing and fail.

All args not being passed to event handler function

Bug only appears to happen when adding listener to event that has more than one arg. Example 'baun.beforePageRender'.

Baun emits event like this:

$this->events->emit('baun.beforePostRender', $template, $data);

But Baun events provider emit function only accepts 2 arguments:

public function emit($event, $args = [])
{
    $this->emitter->emit($event, $args);
}

Therefore $template gets passed through and $data does not.

This could be fixed by emitting events with multiple args in an array:

$this->events->emit('baun.beforePageRender', [$template, $data]);

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.