turanct / bogl-me

:newspaper: Bogl is a simple static site (blog) generator in php.
0 stars 0 forks source link

how to fix the error i met? #4

Open luckypoem opened 10 years ago

luckypoem commented 10 years ago

hi.

as3:~/bogl-me# cd - /root/bogl-me/content/posts as3:~/bogl-me/content/posts# php ~/bogl-me/bogl.php -i=~/bogl-me/content/ -t=~/bogl-me/theme/ -o=~/bogl-me/output/ Bogl PHP Warning: mkdir(): No such file or directory in /root/bogl-me/bogl.php on line 280

--> Rendering posts... PHP Warning: Invalid argument supplied for foreach() in /root/bogl-me/src/Blog/Blog.php on line 28 Rendering index file... PHP Notice: Undefined offset: 0 in /root/bogl-me/src/Blog/FileIterator.php on line 102 PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /root/bogl-me/src/Blog/Post.php on line 71 PHP Fatal error: Uncaught exception 'Twig_Error_Loader' with message 'There are no registered paths for namespace "main".' in /root/bogl-me/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:191 Stack trace:

0 /root/bogl-me/vendor/twig/twig/lib/Twig/Loader/Filesystem.php(138): Twig_Loader_Filesystem->findTemplate('archive.html')

1 /root/bogl-me/vendor/twig/twig/lib/Twig/Environment.php(265): Twig_Loader_Filesystem->getCacheKey('archive.html')

2 /root/bogl-me/vendor/twig/twig/lib/Twig/Environment.php(323): Twig_Environment->getTemplateClass('archive.html', NULL)

3 /root/bogl-me/vendor/twig/twig/lib/Twig/Environment.php(292): Twig_Environment->loadTemplate('archive.html')

4 /root/bogl-me/src/Blog/Archive.php(50): Twig_Environment->render('archive.html', Array)

5 /root/bogl-me/bogl.php(195): Blog\Archive->render()

6 /root/bogl-me/bogl.php(284): {closure}()

7 /root/bogl-me/bogl.php(292): {closure}()

8 {main}

thrown in /root/bogl-me/vendor/twig/twig/lib/Twig/Loader/Filesystem.php on line 191 as3:~/bogl-me/content/posts#

turanct commented 10 years ago

it looks to me like one of these issues:

you should also set your default timezone in php.ini

regards turanct

luckypoemster commented 10 years ago

hi. i do as per ur instruction: git clone https://github.com/turanct/bogl-me.git /usr/local/bogl && cd /usr/local/bogl && curl -sS https://getcomposer.org/installer | php && php composer.phar install && ln -s /usr/local/bogl/bogl.php /usr/local/bin/bogl && cd -

as3:/usr/local/bogl# bogl PHP Fatal error: Call to undefined method Pimple\Container::share() in /usr/local/bogl/bogl.php on line 17 as3:/usr/local/bogl# nano ~/.boglrc as3:/usr/local/bogl# ls bogl.php composer.lock content src vendor composer.json composer.phar README.md theme as3:/usr/local/bogl# mkdir html as3:/usr/local/bogl# ls bogl.php composer.lock content README.md theme composer.json composer.phar html src vendor as3:/usr/local/bogl# bogl PHP Fatal error: Call to undefined method Pimple\Container::share() in /usr/local/bogl/bogl.php on line 17 as3:/usr/local/bogl# as3:/usr/local/bogl# cat ~/.boglrc { "{ym bogl blog}": { "input": "{/usr/local/bogl/content/}", "theme": "{/usr/local/bogl/theme/}", "output": "{/usr/local/bogl/html/}" } } as3:/usr/local/bogl#

how to fix it? tks a lot

turanct commented 10 years ago

Two things:

1. it looks like your .boglrc file is incorrect

it should look like this:

{
    "test": {
        "input": "/usr/local/bogl/content/",
        "theme": "/usr/local/bogl/theme/",
        "output": "/usr/local/bogl/html/"
    }
}

2. it looks like you're calling bogl without command line arguments.

if you're using the .boglrc file like i showed you in 1, above, try this:

bogl --site=test

3. it looks like your composer ignored the pimple version in the lock file.

You can try two things to solve this:

3.1. try to remove your vendors, and install them again

cd /usr/local/bogl
rm -rf vendor
php composer.phar install

now try to run the bogl --site=test command again, and see if it does something. If it fails, go to 3.2

3.2. put the correct pimple version in there yourself

open /usr/local/bogl/composer.json and change this line:

"pimple/pimple": "dev-master",

to

"pimple/pimple": "1.1.x-dev",

then run composer update:

cd /usr/local/bogl
php composer.phar update

and try to run bogl --site=test again

Please report back if this fails.

luckypoem commented 10 years ago

hi. i use 3.2 and succeed: http://bg.surmount.biz.wf ,but how to paginate?i checked /usr/local/bogl/content/config.json,found nowhere to set it. tks

luckypoem commented 10 years ago

and how to modify the content of the homepage: " Welcome. This is a static front-page for the blog."

which file to modify? tks

turanct commented 10 years ago

hello,

1. pagination

Pagination is not possible in bogl-me. Links to all blog posts and pages will be available in the default theme, but there is no pagination.

2. homepage

i suggest you read about the home page in the README.md file at https://github.com/turanct/bogl-me#the-configjson-file You can use a static home page, which is the one you're seeing right now, but you can also use a specific post or page, or even display the latest x posts on the home page. These settings go in the config.json file.

good luck