Right now, I am working on building my own custom theme for my company’s new website. Everything was working fine, and I accidentally modified/deleted files and now am getting this error: Screen Shot 2015-05-20 at 4 I have these files in the right place and calling the right ways, but still gives me this error message. Anyone have any idea what it could be?
Are you sure default.html.twig is supposed to be prefixed by
._ in the filename? I could imagine all sorts of errors caused by that.
That’s what I thought too! I don’t understand why you need the as the prefix before it, I didn’t use that before and it worked perfectly fine?
In earnest it should not be there unless some IDE or the like uses it for backup purposes. It will generally cause filesystem problems and, as you’ve noticed, quite possibly problems with Twig too. Did you try renaming it and dropping those two characters?
Yeah, I dropped that prefix and still gave me the same error. But if I put the prefix back on, it works fine.
Do you have a file called
._default.md in your pages folder somewhere? In case you’re following convention and you twig file is probably called
default.html.twig and then your page should be
Yah look like you have a hidden file, most likely created by an editor as a backup or ‘working copy’ file. Weird, because I thought we fixed this by having Grav ignore ‘dot’ files. What version of Grav are you running? If it’s not latest, can you upgrade?
This addresses the issue. Basically dot files are created as temporary files and should be ignored. regular pages should not be prefixed by a period, or they will end up as 404 File Not Found.
I redid the custom theme template folder again. It seemed to do the trick and works like it should be, still am not sure what was the issue but I appreciate all the input and help!
Glad you got it sorted, but it was a legitimate edge-case that could arise with certain editors and IDEs, so good to get it sorted. FYI, the resulting code is actually marginally faster than before