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

Not working on Gitlab pages #169

Closed
alanmarazzi opened this issue Jun 24, 2018 · 5 comments
Closed

Not working on Gitlab pages #169

alanmarazzi opened this issue Jun 24, 2018 · 5 comments

Comments

@alanmarazzi
Copy link

alanmarazzi commented Jun 24, 2018

Hi, everyone, I really like Cryogen, but I can't make it work on Gitlab pages.
The issue is that the content should live in public folder at the root of the project, which of course is not what Cryogen does. Not too bad: I simply move the resources/public folder into a root public one in the job configuration. Cool up to this point.

Now I can actually go to the homepage domain/project-name and the content is there, but as soon as I try to click any internal link I get 404. The issue is that the uris are pointing to domain/uri, while it should be domain/project-name/uri and I can't seem to make it work.

This is my config.edn:

{:site-url             "https://username.gitlab.io/"
 :post-root            "posts"
 :page-root            "pages"
 :post-root-uri        "posts-output"
 :page-root-uri        "pages-output"
 :tag-root-uri         "tags-output"
 :author-root-uri      "authors-output"
 :blog-prefix          "blog/"
 :rss-name             "feed.xml"
 :rss-filters          ["cryogen"]
 :recent-posts         3
 :post-date-format     "yyyy-MM-dd"
 :archive-group-format "yyyy MMMM"
 :sass-src             []
 :sass-path            "sass"
 :compass-path         "compass"
 :theme                "nucleus"
 :resources            ["img"]
 :keep-files           [".git"]
 :disqus?              false
 :disqus-shortname     ""
 :ignored-files        [#"\.#.*" #".*\.swp$"]
 :previews?            false
 :posts-per-page       5
 :blocks-per-preview   2
 :clean-urls?          true
 :collapse-subdirs?    false
 :hide-future-posts?   true
 :klipse               {}
 :debug?               false}
@lacarmen
Copy link
Member

Gitlab pages setup should be very similar to Github pages setup. It sounds like you need to set your blog-prefix to your project-name.

@alanmarazzi
Copy link
Author

I already tried that, it is blog indeed, but the issue is that Gitlab looks for content in the public folder and that's going to be already shown at username.gitlab.io/blog, so if I don't use the prefix I will see the homepage and nothing else (uris point at the root), while if I use the prefix I don't get anything (it goes under username.gitlab.io/blog/blog).

Here as a reference: https://docs.gitlab.com/ee/user/project/pages/getting_started_part_two.html#urls-and-baseurls

P.S.: I tried with other SSGs (Jekyll, Pelican) and they are working, but I would really like to use Cryogen

@lacarmen
Copy link
Member

I think what you want to do is use the prefix, but copy the contents inside the blog folder to your public folder instead of the blog folder itself. This way your links will point to domain/project-name/uri but you avoid the /blog/blog issue.

Let me know how that works out. :)

@alanmarazzi
Copy link
Author

You're right!!! Now I feel really bad 😞 I always have issues with paths!!!

Anyway, for further memory if someone wants to deploy to Gitlab pages this is the config.edn parts you have to be careful to:

{:site-url             "https://username.gitlab.io/"
 :blog-prefix          "blog/"}

And this is my .gitlab-ci.yml:

image: clojure:lein-2.8.1

pages:
  script:
  - lein run
  - mkdir public
  - mv resources/public/blog/* public
  artifacts:
    paths:
    - public
  only:
  - master

P.S.: on a side note, I might be interested to try working on #74, is someone already working on it? Is there still interest to have a recommender system implemented in Cryogen? (You can move the discussion about this on the proper issue if you feel like it and close this issue, otherwise if you answer here I'll close the issue myself 😃)

@lacarmen
Copy link
Member

No worries, I'm glad you got it working!

I don't think anyone is working on #74 so if you're interested then go for it! And don't hesitate to reach out if you have questions. :)

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

2 participants