Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin gh-pages can't work well #69

Open
ghost opened this issue Dec 1, 2014 · 17 comments
Open

plugin gh-pages can't work well #69

ghost opened this issue Dec 1, 2014 · 17 comments

Comments

@ghost
Copy link

ghost commented Dec 1, 2014

SBCL show

Failed to find the TRUENAME of /home/xxxx/blog/.curr

I changed

(defmethod deploy :after (staging)
  (let ((blog (truename (rel-path (deploy-dir *config*) ".curr"))))
    (delete-file (rel-path blog "index.html"))
    (cl-fad:copy-file (rel-path blog "1.html") (rel-path blog "index.html"))
    (with-open-file (out (rel-path blog "CNAME")
                     :direction :output
                     :if-exists :supersede
                     :if-does-not-exist :create)
      (format out "~A~%" *cname*))))

to

(defmethod deploy :after (staging)
  (let ((blog (truename (rel-path (deploy-dir *config*) ""))))
    (delete-file (rel-path blog "index.html"))
    (cl-fad:copy-file (rel-path blog "1.html") (rel-path blog "index.html"))
    (with-open-file (out (rel-path blog "CNAME")
                     :direction :output
                     :if-exists :supersede
                     :if-does-not-exist :create)
      (format out "~A~%" *cname*))))

It can work well now, I don't learn common lisp much and don't understand why. Maybe I do something wrong.

Sorry for my poor English :-(

@ghost
Copy link
Author

ghost commented Dec 1, 2014

sorry....

I know, gh-pages should work with versioned.

@ghost ghost closed this as completed Dec 1, 2014
@kingcons
Copy link
Collaborator

kingcons commented Dec 1, 2014

@eriFelaP Did you get this working? I'll be in #lisp on Freenode IRC tomorrow morning around 10am EST. I did originally write this plugin to work with the versioned plugin. If not working otherwise is a bug. I'll reopen this and get a fix out in the next few days. Thanks!

@kingcons kingcons reopened this Dec 1, 2014
@ghost
Copy link
Author

ghost commented Dec 5, 2014

Yes,It can work well with versioned plugin. Thank you for your reply very much and sorry I did not reply in a timely manner.

But I find another program. I can't use chinese in title of post because

(defmethod initialize-instance :after ((object post) &key)
  (with-slots (url title author format text) object
    (setf url (compute-url object (slugify title))
          format (make-keyword (string-upcase format))
          text (render-text text format)
          author (or author (author *config*)))))

If the title is all chinese, then (slugify title) will be "".I find the function about Slugs

(defun slug-char-p (char)
  "Determine if CHAR is a valid slug (i.e. URL) character."
  (or (char<= #\0 char #\9)
      (char<= #\a char #\z)
      (char<= #\A char #\Z)
      (member char '(#\_ #\-))))

(defun slugify (string)
  "Return a version of STRING suitable for use as a URL."
  (remove-if-not #'slug-char-p (substitute #\- #\Space string)))

All chinese will be remove in title.

@ghost
Copy link
Author

ghost commented Dec 5, 2014

oh,you have know that.

#36

I was too careless hasty. :-(

@kingcons
Copy link
Collaborator

kingcons commented Dec 5, 2014

No, thank you for mentioning it. I've been aware of this issue but I think you are the first user to hit it in a real installation.

It seems like next steps are to add a dependency on cl-unicode and start updating the slug handling. I'll try to work on this in the next week or so but I'm also starting a new job so I'll be busy. Sorry for the delay.

@sternenseemann
Copy link
Contributor

@redline6561 If you give me some hints I could try to implement correct unicode handling in slugify.

@PuercoPop
Copy link
Collaborator

@lukasepple I can't speak for @redline6561 but IIUC it means making slugify IRI (See RFC 3987) aware. Stuff I am not clear about is should all IRI's be normalized? if so according to which algorithm. From section 6 of the RFC 3987 I got to RFC 3491 which suggests prohibiting characters in some tables and applying kc normalization.

Hope the info is of some use, although I'm not clear if that would be enough or correct though, I can live without the ñ :D

@kingcons
Copy link
Collaborator

kingcons commented Dec 6, 2014

Hey ya'll. Sorry I'm late to the thread. I'm happy for you to take point on this since I'm busy with other stuff, @lukasepple. As usual, @PuercoPop has some good suggestions. :)

We need to support genuine IRIs. International users shouldn't have to deal with an ASCII only slug system. I trust you all to do a better job testing this than me, quite frankly. :)

Two interesting links from a little digging:

@ghost
Copy link
Author

ghost commented Dec 9, 2014

Oh, I find versioned and gh-pages have some warning today.It can work but have some warning.

When I juist use versioned without gh-pages, SBCL show:

STYLE-WARNING:
   redefining COLESLAW:DEPLOY (#<SB-PCL:SYSTEM-CLASS T>) in DEFMETHOD

When I use gh-pages with versioned, SBCL show:

STYLE-WARNING:
   redefining COLESLAW:DEPLOY (#<SB-PCL:SYSTEM-CLASS T>) in DEFMETHOD
To load "puri":
  Load 1 ASDF system:
    puri
; Loading "puri"


; file: /home/qwfwq/quicklisp/dists/quicklisp/software/coleslaw-20141106-git/plugins/gh-pages.lisp
; in: DEFUN ENABLE
;     (ERROR "Not a valid CNAME: ~A" COLESLAW-GH-PAGES::CNAME)
; ==>
;   "Not a valid CNAME: ~A"
; 
; note: deleting unreachable code

My .coleslawrc is

(:author "Brit Butler"
 :deploy-dir "/home/qwfwq/blog/www/"
 :domain "http://localhost:8080"
 :feeds ("lisp")
 :plugins (
           ; (incremental)  ;; *Remove comment to enable incremental builds.
           (mathjax)
           (sitemap)
           (static-pages)
           (versioned)    ;; *Remove comment to enable symlinked, timestamped deploys.
           (gh-pages :cname t)
          )
 :routing ((:post           "posts/~a")
           (:tag-index      "tag/~a")
           (:month-index    "date/~a")
           (:numeric-index  "~d")
           (:feed           "~a.xml")
           (:tag-feed       "tag/~a.xml"))
 :sitenav ((:url "http://localhost:8080" :name "Home"))
 :staging-dir "/tmp/coleslaw/"
 :title "Qwfwq"
 :theme "readable")

;; * Prerequisites described in plugin docs.

I use the latest version git clone from github. And I can find the new post and cname in deploy-dir/.curr(Everything is right in .curr) but I can't find the new post in deploy-dir/post.

@sternenseemann
Copy link
Contributor

I use the latest version git clone from github.

Did you install it with ql:quickload? If yes try git cloning it into ~/quicklisp/local-projects

@ghost
Copy link
Author

ghost commented Dec 9, 2014

@lukasepple I replace all files in quicklisp/dists/quicklisp/software/coleslaw-20141106-git with files git clone from github.

@sternenseemann
Copy link
Contributor

I think it's better to clone it into a directory in ~/quicklisp/local-projects then always the fresh clone will be loaded. You're solution might work but this is the way quicklisp suggests it :)

Am 09.12.2014 um 07:04 schrieb PaleFire [email protected]:

@lukasepple I replace all files in quicklisp/dists/quicklisp/software/coleslaw-20141106-git with files git clone from github.


Reply to this email directly or view it on GitHub.

@ghost
Copy link
Author

ghost commented Dec 9, 2014

@lukasepple Thanks for your suggestion :-)

@sternenseemann
Copy link
Contributor

@eriFelaP Does it work now?

@ghost
Copy link
Author

ghost commented Dec 9, 2014

It still doesn't work. I rm quicklisp/dists/quicklisp/software/coleslaw and git clone coleslaw into ~/quicklisp/local-projects. @lukasepple

@sternenseemann
Copy link
Contributor

ok, then it wasn't caused by an outdated version. Just keep it like that. Then there's some other problem :/=

@douglarek
Copy link
Contributor

@eriFelaP I got gh-pages warnings too. Would you like to have a look ? @redline6561

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants