baseline icon indicating copy to clipboard operation
baseline copied to clipboard

i met error when trying to publish a post.how to fix it?

Open luckypoem opened this issue 11 years ago • 13 comments

hi.

as3:~/baseline-site# cd blog as3:~/baseline-site/blog# ls _blog.jade _data.json sample-blog-post.md text-only-blog-post.md code-in-a-post.md rss.xml.jade test1.md video-blog-post.md as3:~/baseline-site/blog# nano _data.json as3:~/baseline-site/blog# cd .. as3:~/baseline-site# harp compile { "source": "Data", "dest": "Globals", "filename": "/root/baseline-site/blog/_data.json", "lineno": -1, "name": "SyntaxError", "message": "Unexpected token \r", "stack": "{\r\n "rss": {\r\n "layout": false\r\n },\r\n "test1": {\r\n "title": "test1",\r\n "date": "January 15, 2014",\r\n "author": "ym",\r\n "description": "Etiam porta sem malesuada magna mollis euismod. Cum sociis $\r\n },\r\n "sample-blog-post": {\r\n "title": "Sample Blog Post",\r\n "date": "October 29, 2013",\r\n "author": "ross-howard-jones",\r\n "description": "Etiam porta sem malesuada magna mollis euismod. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus sagittis lacus vel augue laoreet."\r\n },\r\n "video-blog-post": {\r\n "title": "Video Blog Post",\r\n "date": "October 10, 2013",\r\n "author": "ross-howard-jones",\r\n "description": "Vestibulum id ligula porta felis euismod semper. Aenean lacinia bibendum nulla sed consectetur. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec sed odio dui."\r\n },\r\n "text-only-blog-post": {\r\n "title": "Text Only Blog Post",\r\n "date": "September 16, 2013",\r\n "author": "brock-whitten",\r\n "description": "Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cras mattis consectetur purus sit amet."\r\n },\r\n "code-in-a-post": {\r\n "title": "Code in a Post",\r\n "date": "August 9, 2013",\r\n "author": "rob-ellis",\r\n "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Curabitur blandit tempus porttitor."\r\n }\r\n}\r\n" } as3:~/baseline-site#

my site: http://as3.brite.biz:34255/

luckypoem avatar Jan 15 '14 03:01 luckypoem

Sorry you’re having troubles! If you’d like, you can ask for help in the Harp chat room, otherwise I’ll see if I can take a look at it tomorrow.

kennethormandy avatar Jan 15 '14 04:01 kennethormandy

This looks like an (system) platform issue. /r/n is the Windows EOL Linefeed.

Can you share some of your environment setup?

silentrob avatar Jan 15 '14 04:01 silentrob

I re-read the trace, and I suspect you copied the files from your windows system and are running it on Unix. Im surprised this hasn't come up before.

silentrob avatar Jan 15 '14 04:01 silentrob

hi. as3:~/baseline-site/blog# cat test1.md 这是测试1. as3:~/baseline-site/blog#

as3:~/baseline-site/blog# cat _data.json { "rss": { "layout": false }, "test1": { "title": "test1", "date": "January 15, 2014", "author": "ym", "description": "Etiam porta sem malesuada magna mollis euismod. Cum sociis $ }, "sample-blog-post": { "title": "Sample Blog Post", "date": "October 29, 2013", "author": "ross-howard-jones", "description": "Etiam porta sem malesuada magna mollis euismod. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus sagittis lacus vel augue laoreet." }, "video-blog-post": { "title": "Video Blog Post", "date": "October 10, 2013", "author": "ross-howard-jones", "description": "Vestibulum id ligula porta felis euismod semper. Aenean lacinia bibendum nulla sed consectetur. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec sed odio dui." }, "text-only-blog-post": { "title": "Text Only Blog Post", "date": "September 16, 2013", "author": "brock-whitten", "description": "Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula ut id elit. Cras mattis consectetur purus sit amet." }, "code-in-a-post": { "title": "Code in a Post", "date": "August 9, 2013", "author": "rob-ellis", "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Curabitur blandit tempus porttitor." } } as3:~/baseline-site/blog# cd .. as3:~/baseline-site# harp compile ...(here is the error shown in the above)

is that i edited _data.json wrong?

luckypoem avatar Jan 16 '14 04:01 luckypoem

@luckypoem I believe so, I think there are some errors in the one you posted. But I’ll check, it’s possible there’s an error in the original. Try this fixed up one:

{
    "rss": {
        "layout": false
    },
    "test1": {
        "title": "test1",
        "date": "January 15, 2014",
        "author": "ym",
        "description": "Etiam porta sem malesuada magna mollis euismod. Cum sociis $"
    },
    "sample-blog-post": {
        "title": "SampleBlogPost",
        "date": "October29, 2013",
        "author": "ross-howard-jones",
        "description": "Etiamportasemmalesuadamagnamolliseuismod. nasceturridiculusmus.Vivamussagittislacusvelauguelaoreet."
    },
    "video-blog-post": {
        "title": "VideoBlogPost",
        "date": "October10, 2013",
        "author": "ross-howard-jones",
        "description": "Vestibulumidligulaportafeliseuismodsemper.Aeneanlaciniabibendumnullasedconsectetur.Crasjustoodio, dapibusacfacilisisin, egestasegetquam.Donecsedodiodui."
    },
    "text-only-blog-post": {
        "title": "TextOnlyBlogPost",
        "date": "September16, 2013",
        "author": "brock-whitten",
        "description": "Cumsociisnatoquepenatibusetmagnisdisparturientmontes, nasceturridiculusmus.Nullamiddoloridnibhultriciesvehiculautidelit.Crasmattisconsecteturpurussitamet."
    },
    "code-in-a-post": {
        "title": "CodeinaPost",
        "date": "August9, 2013",
        "author": "rob-ellis",
        "description": "Loremipsumdolorsitamet, consecteturadipiscingelit.Aeneaneuleoquam.Pellentesqueornaresemlaciniaquamvenenatisvestibulum.Curabiturblandittempusporttitor."
    }
}

kennethormandy avatar Jan 16 '14 04:01 kennethormandy

hi. still not ok.it's very weird.i don't know where the cause is.

luckypoem avatar Jan 16 '14 10:01 luckypoem

Was Rob correct in https://github.com/rosshj/baseline/issues/5#issuecomment-32333389? If you re-clone Baseline from your current environment, does the same thing happen? Or are you well underway on the project now?

kennethormandy avatar Jan 16 '14 11:01 kennethormandy

hi.

i don't understand what "I suspect you copied the files from your windows system and are running it on Unix" means. i do all the stuff in linux vps only.

luckypoem avatar Jan 16 '14 13:01 luckypoem

i login linux vps thru putty in windows

luckypoem avatar Jan 16 '14 13:01 luckypoem

hi. i cloned ur blog: https://github.com/kennethormandy/my-harp-blog,this time it's ok.

http://as3.brite.biz:34256/

but http://as3.brite.biz:34256/articles/test1, http://as3.brite.biz:34256/articles/test2 cannot open,why?

luckypoem avatar Jan 16 '14 14:01 luckypoem

Oh! Both those blogs are setup to work when Harp is in production mode, so they all have absolute links that go directly to /.

If you visit http://as3.brite.biz:34256/articles/test1.html, you’ll see that it’s there. If you’re using harp compile and FTPing your site or something like that, then you’ll want to update the links so they have .html at the end.

If you want clean URLs, you can either move the article into a folder and rename it index, like /test1/index.md, or run the blog on the Harp Platform, or by using Harp in production mode on Heroku, for example.

kennethormandy avatar Jan 16 '14 18:01 kennethormandy

hi. "you can either move the article into a folder and rename it index, like /test1/index.md"-this is too cumbersome.i use .htaccess to solve it. but about https://github.com/rosshj/baseline,i still feel very strange,why i met that error above? u are the author:rosshj?can u try the baseline app?

luckypoem avatar Jan 17 '14 08:01 luckypoem

Yes, if you’re using Apache, .htaccess is another way. I’m glad that worked for you.

I’m not sure about the other error. I just cloned Baseline and ran it without any problems, I’m not sure if it’s specific to Baseline.

i login linux vps thru putty in windows

Can you walk me through this part? We can at least see if we can recreate the issue then

kennethormandy avatar Jan 17 '14 18:01 kennethormandy