0

I am hosting a new blog on Gitlab Pages using the middleman-blog gem. On my local machine I have absolutely no issues. In production everything seems to work fine at first, but then after about five minutes it begins serving me a 404 error when I click through the blog article permalink.

I've fiddled around with the config.rb file, but nothing has suggested I've made any progress in solving my problem.


page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false

activate :blog do |blog|
  # This will add a prefix to all links, template references and source paths

  blog.permalink = "secondaryreview/{year}/{month}/{day}/{title}.html"
  blog.tag_template = "tag.html"
  blog.calendar_template = "calendar.html"
end

page "/feed.xml", layout: false

configure :build do
  set :build_dir, 'public'
  set :base_url, "/middleman"
  activate :relative_assets
end

I expect the permalink to exhibit typical behavior, showing the full article upon permalink clickthrough, as it does for the first five minutes of deploy. You can visit the site giving me the issue at the following URL: https://elicash82.gitlab.io/secondaryreview/

This may reflect limitations of Gitlab Pages, or I may need to do some further configuration to ensure the landing page continues serving the individual blog pages.

EliCash
  • 95
  • 1
  • 9
  • Just to extend this question -- no changes to the config file, but when I add the `blog.permalink = "secondaryreview/{year}-{month}-{day}-{title}.html` I realized that I can pull an individual article up with a URL like: `https://elicash82.gitlab.io/secondaryreview/secondaryreview/2019/04/23/building.html` BUT my permalink goes to `https://elicash82.gitlab.io/secondaryreview/2019/04/23/building.html` which doesn't exist. However if I comment out `blog.permalink` the permalinks will not prepend the `secondaryreview` to the URL. – EliCash Apr 25 '19 at 12:31

1 Answers1

0

I "fixed" this by moving from the default GitLab URL to a custom domain name. Once the custom domain is initiated, the described issue just goes away. Therefore, even if the issue CAN be fixed in the way initially described, if you plan to use middleman-blog with a custom domain eventually, I'd suggest you don't make too many changes to the config.rb file.

EliCash
  • 95
  • 1
  • 9