jekyll directory structure / changing index.html to different page -
i'm new jekyll , having trouble setting way want. have site standard directory structure: css, img , js directories , and index , page html files on same level. far normal.
if run jekyll new blog
, sets files needs in subdir blog. when go directory change basic layout files , jekyll serve
, builds fine, can't find css files valid whole site - because can't "see" in directory further up. i've tried messing path css, don't seem able make show up. tried moving subdir "blog" 1 level, _layoutsb folder etc on same level css , img directories, have problem jekyll builds "index.html" file - don't want that, have index file, , it's .php, not .html.
how can either: a.) jekyll running in subdir use css styles, images etc main css dir
or
b.) jekyll live on top level dir build not "index.html"??
thanks help. keep building, deleting , tweaking , making no progress @ all.
well, jekyll static website generator , not support php. can liquid templating language, includes
, can use tons of functions, filters , other features allow write dynamically , publish static pages.
good news, though: i've found workaround include php files! ;)
create folder in site
root
. let's it's namephp
(without underscore). add there many php files want. let's assume have includedindex.php
insidephp
dir.in
_config.yml
, add line:keep_files: [php]
this let folder php
untouched when jekyll build site.
run
jekyll serve
would.when add link stylesheets (and other links), don't forget folder containing php files @ same level css folder, in
index.php
:<link rel="stylesheet" href="../css/main.css">
to see php files taking effect, you'll need build site in
localhost
root. example, if use xampp, inside ofhtdocs
. see files, you'll need turnapache
on , type in browser:http://localhost/test/_site/php/
-test
project root folder - , you'll seeindex.php
working should. other files available via_site
, vialocalhost:4000
.upload web server
_site
content only, unless server builds jekyll automatically.
open _site
folder check how website build.
don't forget: you won't allowed host site on github pages it's doesn't offer support php. i'd recommend host site in full-featured hosting provider.
hope have helped!
Comments
Post a Comment