Comments (8)
Hey David! I wish this was that easy, but since it's a static site it has to be handled at the webserver level. If you use GitHub Pages, you can just create a 404.html
file in your root and it will work automatically, otherwise have to configure it in the webserver, and point whatever errors you want to whatever error pages 👍
For anyone else who finds this issue down the road, here's an example of how you might do it with nginx: https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-to-use-custom-error-pages-on-ubuntu-14-04
from jigsaw.
Duh. Was way over thinking this one. Thanks!
from jigsaw.
Hi i tried ot crate a 404.html in the source folder, but it is not copy over during the build process. Any idea on how to copy this file ?
thanks
EDIT: found it, pipe this line in your gulpfile.js
.copy( elixir.config.publicPath + '/404.html', 'build_github/404.html')
EDIT:
in the end, it does not copy anything :(
from jigsaw.
I think that's probably an issue of pretty URLs being enabled by default so your file is ending up at /build_github/404/index.html
Might be a way to disable that per page if you're clever 🤔
from jigsaw.
@chrisvidal Make sure that .copy
line in your gulpfile falls after the .exec
line, or else the file that gulp just copied will get deleted at the .exec
step. Otherwise, using .copy
as you have it should work.
One thing you might change is to append a _
before the filename in source
, if you don't need end up with a 404/index.html
file in build_github
:
.copy( elixir.config.publicPath + '/_404.html', 'build_github/404.html')
from jigsaw.
thank @damiani
yes I did this, but the file is not copied neither
whenI follow manually the content of the folder build_github/ I can see the 404.html first then it is removed.
and I have this
.exec('jigsaw build', ['./source/**/*', '!./source/_assets/**/*'])
.copy( elixir.config.publicPath + '/_404.html', 'build_github/404.html')
Is it because my command line is like this ?
gulp && jigsaw build github
from jigsaw.
Another way you can do it, if you have pretty URLs enabled, is to name your source
file 404.html.blade.php
. Jigsaw will process it as a normal Blade file (allowing you to use a parent template, for example, just like with any Jigsaw file) and output it to build_github/404.html/index.html
, which will be accessible in the browser at 404.html
.
from jigsaw.
Interesting idea, I am using github pages, let's see if it can support this
EDIT: not working for github pages.
Well i guess i will have to forget the idea of handling the 404 error
from jigsaw.
Related Issues (20)
- Installation Error, Docs Starter Template: Failed to open stream: Permission denied HOT 2
- Refactor container and bootstrapping
- Browsersync does not appear to be working by default HOT 1
- permalink doesn't update the path in $page->getUrl() HOT 1
- feature request: allow output extension to be changed from .html HOT 4
- Setting collection item data through config.php HOT 1
- `*.blade.php` files in collection folders break stuff HOT 7
- Unknown error being thrown after webpack compiling successfully HOT 3
- Collection items can't have same basename HOT 1
- Using starter template. HOT 3
- Allow formatting of pretty URL with trailing slash HOT 8
- Docs build process not working HOT 1
- Fresh install, error mix: command not found HOT 1
- Remote collection nested array returning null in page object HOT 6
- @include dynamic template from $page method in layout HOT 7
- Build process removes certain directories HOT 1
- Different build environment causing build error using Mix
- No share image defined
- Organize Posts By Year in Subdirectory
- Looping through collection items without site variables
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jigsaw.