why this error?
Closed this issue · 14 comments
hi.
i installed ur app in my 2 vps.but i met a error:
http://tf2.brite.biz/ and http://tf.brite.biz/ is ok
but when i visit http://tf2.brite.biz/test3,and http://tf.brite.biz/my-test-1 ,it just shows some html code.why?how to fix it?
tks
I'm afraid that's too little information to help you out. What's the logging output? My guess is that it serves one of your html files as a static (text/plain) asset instead of a template, maybe your file is not in the right directory. If you can send me the listing of your trofaf directories and the log output, It would help.
—
Sent from Mailbox for iPad
On Fri, Nov 15, 2013 at 3:44 AM, luckypoem notifications@github.com
wrote:
hi.
i installed ur app in my 2 vps.but i met a error:
http://tf2.brite.biz/ and http://tf.brite.biz/ is ok
but when i visit http://tf2.brite.biz/test3,and http://tf.brite.biz/my-test-1 ,it just shows some html code.why?how to fix it?tks
Reply to this email directly or view it on GitHub:
#7
hi.
as3:/mygo/src/github.com/PuerkitoBio/trofaf# ls/mygo/src/github.com/PuerkitoBio/trofaf#
examples gen_test.go main.go rss.go tpldata.go
gen.go LICENSE README.md server.go watch.go
as3:
as3:/mygo/src/github.com/PuerkitoBio/trofaf# cd examples/mygo/src/github.com/PuerkitoBio/trofaf/examples# ls
as3:
amber native
as3:/mygo/src/github.com/PuerkitoBio/trofaf/examples# cd native/mygo/src/github.com/PuerkitoBio/trofaf/examples/native# ls
as3:
posts public templates
as3:/mygo/src/github.com/PuerkitoBio/trofaf/examples/native# ls posts/mygo/src/github.com/PuerkitoBio/trofaf/examples/native# ls public
test2.md test3.md test4.md test.md
as3:
index.html rss test test2 test3 test4
as3:/mygo/src/github.com/PuerkitoBio/trofaf/examples/native# ls templates/mygo/src/github.com/PuerkitoBio/trofaf/examples/native#
content.html post.html
as3:
pls check the above.i don't understand where the log output is?
tks
You sent me the directory listings of trofaf, I meant the listing of your website that is in error.
The log output should be visible from the command-line by default (stdout/stderr), when you run trofaf and try to access the URL in error.
Also, you should not run trofaf as root (not saying you are, but I see the # sign in your comment).
hi.
as3:/mygo/src/github.com/PuerkitoBio/trofaf# git clone https://github.com/PuerkitoBio/0value/mygo/src/github.com/PuerkitoBio/trofaf# mv 0value/* ./
as3:
as3:/mygo/src/github.com/PuerkitoBio/trofaf# ls/mygo/src/github.com/PuerkitoBio/trofaf# cd posts
examples gen_test.go main.go public rss.go server.go tpldata.go
gen.go LICENSE posts README.md sass templates watch.go
as3:
as3:/mygo/src/github.com/PuerkitoBio/trofaf/posts# nano test1.md/mygo/src/github.com/PuerkitoBio/trofaf/posts# cd ..
as3:
as3:/mygo/src/github.com/PuerkitoBio/trofaf# trofaf -g/mygo/src/github.com/PuerkitoBio/trofaf#
as3:
as3:/mygo/src/github.com/PuerkitoBio/trofaf# ls public/mygo/src/github.com/PuerkitoBio/trofaf#
agora-v0-2--closures--coroutines-and-for--range
build-a-blog-engine-in-Go
build-a-restful-API-with-Martini
css
favicon.ico
font
img
implementing-lua-coroutines-in-Go
index.html
introducing-agora--a-dynamic--embeddable-programming-language-built-with-Go
my-Go-centric-Vim-setup
rss
test1
as3:
this is my site: http://as3.brite.biz:35825/,but when i visit http://as3.brite.biz:35825/test1,it shows a download dialog box,how to fix it?
i visit http://as3.brite.biz:35825/my-Go-centric-Vim-setup,it's also the same case.
actually i want the url like this: http://as3.brite.biz:35825/test1.html,
http://as3.brite.biz:35825/my-Go-centric-Vim-setup.html
how to achieve this goal?
how do you run the trofaf command (options and all)? From what directory? Please read the readme doc for command-line options and check the examples folders for working examples. You don't have to clone the 0value repo, this is my blog that uses trofaf, but it is not needed to run.
the trofaf command i run is "trofaf -g",from this dir:/mygo/src/github.com/PuerkitoBio/trofaf//mygo/src/github.com/PuerkitoBio/trofaf# trofaf -g
u can see from above message:
as3:
as for ur 0value repo,don't worry,i will delete ur posts,just want to use ur site's theme.
actually i want the url like this: http://as3.brite.biz:35825/test1.html,
how to achieve this goal?i checked the dir:~/mygo/src/github.com/PuerkitoBio/trofaf/public/,
the things in it such as "my-Go-centric-Vim-setup,test1" are html files actually.
trofaf -g
simply generates the static files (the html from the templates). That doesn't tell me how you actually serve the site over http (what web server do you use? Do you use trofaf for this too, and if so, what command-line options, from what current directory, log output, etc.)?
hi.
can u tell me which command to use to generate the complete site?
and i bind a domain to the dir:~/mygo/src/github.com/PuerkitoBio/trofaf/public/,my webserver is apache.now when i visit http://tf.brite.biz/build-a-restful-API-with-Martini,it didn't pop out a download dialog
box,but shows the build-a-restful-API-with-Martini(a html file)'s content,how to fix it?
Ok, trofaf can serve the website itself (it is a web server), so you can run e.g. ./trofaf
in your root directory (the directory that contains the public/, templates/ and posts/ subdirectories) and it will run your site on http://localhost:9000/, so you can try it out and see if it all works.
Now you can of course do what you did, just generate the static html files and serve the site with a general-purpose web server such as Apache, but I'm afraid I won't be able help you out with this, there are many, many configurations possible with Apache. A likely one in your case is that it doesn't serve the posts as text/html.
hi.
i added DefaultType text/html into my virtualhost section of the apache config file,now it's ok: http://tf.brite.biz/ , but the order of posts is not as per the published time.for example,the post http://tf.brite.biz/chinese-economy is published after the post http://tf.brite.biz/test3,but the post
http://tf.brite.biz/chinese-economy is put under the post http://tf.brite.biz/test3, how to correct it?
You can see the sort logic in gen.go, it sorts by Published date, and the recognized formats are listed in the readme:
Valid date formats are 2006-01-02, 2006-01-02 15h (or 2006-01-02 8h), 2006-01-02 15:04 (or 2006-01-02 8:17) or the RCF3339 format (2013-08-06T17:48:01-05:00).
I see you have a bunch of posts on the same day, so make sure you use a format with the hour.
hi.
i use the format: 2006-01-02 15:04,now it's normal.thank u!
cool, you're welcome.