TikhonJelvis / website

My website.
http://jelv.is
4 stars 1 forks source link

build failure,how to fix it? #1

Open luckypoem opened 8 years ago

luckypoem commented 8 years ago

hi.

root@AR:/usr/local/jelv.is-site# ghc --make hakyll.hs [1 of 1] Compiling Main ( hakyll.hs, hakyll.o ) Linking hakyll ... root@AR:/usr/local/jelv.is-site# ls atdp-demo cow fonts img projects simulation blog css frp index.md projects.md talks blog-post.el default.nix hakyll js README.md templates blog-post.hs deploy hakyll.hi maze scheme tpl cards drafts hakyll.hs misc Setup.hs website chess draw hakyll.o mtg shell.nix website.cabal root@AR:/usr/local/jelv.is-site# ./hakyll build Initialising... Creating store... Creating provider... hakyll: ./website: getFileStatus: does not exist (No such file or directory) root@AR:/usr/local/jelv.is-site# ./website build -bash: ./website: no such file or directory root@AR:/usr/local/jelv.is-site#

thank u

TikhonJelvis commented 8 years ago

I think the problem is that ./website is a symlink that expects the executable to be in ./dist/build/website/website, which is where it's put by cabal. More generally, I always build my website code with cabal rather than ghc --make, so I suggest doing the same.

You can do this by making a cabal sandbox and then just calling cabal install:

> cabal sandbox init
> cabal install

Then you can use the website link as an executable, passing in Hakyll commands:

> ./website watch
Listening on http://127.0.0.1:8000
Initialising...
  Creating store...
  Creating provider...
  Running rules...
Checking for out-of-date items
Compiling
Success

You can also use the Nix package manager, but I wouldn't suggest it unless you're already familiar with it.

luckypoem commented 8 years ago

hi.

root@AR:/usr/local/jelv.is-site# cabal sandbox init root@AR:/usr/local/jelv.is-site# cabal install root@AR:/usr/local/jelv.is-site# dist/dist-sandbox-d5e9a6b0/build/website/website build Initialising... Creating store... Creating provider... Running rules... Checking for out-of-date items Compiling updated blog/atom.xml [ERROR] No teaser defined for blog/test-1/index.md!

root@AR:/usr/local/jelv.is-site# cat blog/test-1/index.md

title: test1 author: brite

published: 2016-08-22 15:38:44

this is test1. root@AR:/usr/local/jelv.is-site#

what does " No teaser defined" mean?how to fix this error? thank u

TikhonJelvis commented 8 years ago

I have the blog script set up to generate a shorter version of the post for the index page—a "teaser". To mark how much of the blog post to put on the front page, you need to add an HTML comment to it:

---
title: test1
author: brite
---

Some text.

<!--more-->

More text.

Here Some text. will be part of the teaser and put on the blog's front page and More text. will only show up if you click on the post to read more.

The HTML comment has to be exactly <!--more--> with that capitalization and spacing.