CSS-стили и ссылки не работают при развертывании jekyll с помощью gitlab CI - PullRequest
0 голосов
/ 16 октября 2019

Этот вопрос был началом проблем, но это было решено, и теперь у меня есть еще один.

После того, как возникли проблемы, сказав, что тема не может быть найдена, когда япроблема решена, теперь веб-страница развернута, но стили и ссылки CSS не работают. Я знаю, что это развертывание может быть выполнено, в моем локальном vm оно работало, и это действительно простая страница с основной темой (не по умолчанию, но все же базовая).

Если вы хотите увидеть код, выможете посмотреть мой репо здесь . Если вы хотите проверить сайт, вы можете сделать это здесь .

Редактировать

Здесь у вас есть весь вывод задания в gitlab, который развернул веб

Running with gitlab-runner 12.3.0 (a8a019e0)
  on docker-auto-scale ed2dce3a
Using Docker executor with image ruby:2.5 ...
Pulling docker image ruby:2.5 ...
Using docker image sha256:092689b795107d1b2eadb82494acf4764191baa0aa5bf4673b8ee2a50f70ba97 for ruby:2.5 ...
Running on runner-ed2dce3a-project-14628881-concurrent-0 via runner-ed2dce3a-srm-1571224453-869b1d6e...
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/unveiled_adri/jekyll_project/.git/
Created fresh repository.
From https://gitlab.com/unveiled_adri/jekyll_project
 * [new ref]         refs/pipelines/89187526 -> refs/pipelines/89187526
 * [new branch]      master                  -> origin/master
Checking out 94a836f5 as master...

Skipping Git submodules setup
$ gem install jekyll
Successfully installed public_suffix-4.0.1
Successfully installed addressable-2.7.0
Successfully installed colorator-1.1.0
Building native extensions. This could take a while...
Successfully installed http_parser.rb-0.6.0
Building native extensions. This could take a while...
Successfully installed eventmachine-1.2.7
Successfully installed em-websocket-0.5.1
Successfully installed concurrent-ruby-1.1.5

HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.

For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0

Successfully installed i18n-1.7.0
Building native extensions. This could take a while...
Successfully installed ffi-1.11.1
Building native extensions. This could take a while...
Successfully installed sassc-2.2.1
Successfully installed jekyll-sass-converter-2.0.1
Successfully installed rb-fsevent-0.10.3
Successfully installed rb-inotify-0.10.0
Successfully installed listen-3.2.0
Successfully installed jekyll-watch-2.2.1
Successfully installed kramdown-2.1.0
Successfully installed kramdown-parser-gfm-1.1.0
Successfully installed liquid-4.0.3
Successfully installed mercenary-0.3.6
Successfully installed forwardable-extended-2.6.0
Successfully installed pathutil-0.16.2
Successfully installed rouge-3.12.0
Successfully installed safe_yaml-1.0.5
Successfully installed unicode-display_width-1.6.0
Successfully installed terminal-table-1.8.0
-------------------------------------------------------------------------------------
Jekyll 4.0 comes with some major changes, notably:

  * Our `link` tag now comes with the `relative_url` filter incorporated into it.
    You should no longer prepend `{{ site.baseurl }}` to `{% link foo.md %}`
    For further details: https://github.com/jekyll/jekyll/pull/6727

  * Our `post_url` tag now comes with the `relative_url` filter incorporated into it.
    You shouldn't prepend `{{ site.baseurl }}` to `{% post_url 2019-03-27-hello %}`
    For further details: https://github.com/jekyll/jekyll/pull/7589

  * Support for deprecated configuration options has been removed. We will no longer
    output a warning and gracefully assign their values to the newer counterparts
    internally.
-------------------------------------------------------------------------------------
Successfully installed jekyll-4.0.0
26 gems installed
$ gem install jekyll-theme-basically-basic -v 1.4.1
Successfully installed i18n-0.9.5
Successfully installed sass-listen-4.0.0

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

Successfully installed sass-3.7.4
Successfully installed jekyll-sass-converter-1.5.2
Successfully installed kramdown-1.17.0
Successfully installed jekyll-3.8.6
Successfully installed jekyll-sitemap-1.3.1
Successfully installed jekyll-seo-tag-2.6.1
Successfully installed jekyll-paginate-1.1.0
Successfully installed jekyll-feed-0.12.1
Successfully installed jekyll-theme-basically-basic-1.4.1
11 gems installed
$ gem install tzinfo -v 1.2.2
Successfully installed thread_safe-0.3.6
Successfully installed tzinfo-1.2.2
2 gems installed
$ gem install tzinfo-data
Successfully installed tzinfo-data-1.2019.3
1 gem installed
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using public_suffix 4.0.1
Using addressable 2.7.0
Using bundler 1.17.3
Using colorator 1.1.0
Using concurrent-ruby 1.1.5
Using eventmachine 1.2.7
Using http_parser.rb 0.6.0
Using em-websocket 0.5.1
Using ffi 1.11.1
Using forwardable-extended 2.6.0
Using i18n 1.7.0
Using sassc 2.2.1
Using jekyll-sass-converter 2.0.1
Using rb-fsevent 0.10.3
Using rb-inotify 0.10.0
Using listen 3.2.0
Using jekyll-watch 2.2.1
Using kramdown 2.1.0
Using kramdown-parser-gfm 1.1.0
Using liquid 4.0.3
Using mercenary 0.3.6
Using pathutil 0.16.2
Using rouge 3.12.0
Using safe_yaml 1.0.5
Using unicode-display_width 1.6.0
Using terminal-table 1.8.0
Using jekyll 4.0.0
Using jekyll-feed 0.12.1
Using jekyll-paginate 1.1.0
Using jekyll-seo-tag 2.6.1
Using jekyll-sitemap 1.3.1
Fetching jekyll-theme-basically-basic 1.4.4
Installing jekyll-theme-basically-basic 1.4.4
Fetching minima 2.5.1
Installing minima 2.5.1
Bundle complete! 4 Gemfile dependencies, 33 gems now installed.
Bundled gems are installed into `/usr/local/bundle`
$ jekyll build --trace -d public/
Configuration file: /builds/unveiled_adri/jekyll_project/_config.yml
            Source: /builds/unveiled_adri/jekyll_project
       Destination: /builds/unveiled_adri/jekyll_project/public
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.442 seconds.
 Auto-regeneration: disabled. Use --watch to enable.
Uploading artifacts...
public: found 52 matching files                    
Uploading artifacts to coordinator... ok            id=322520499 responseStatus=201 Created token=PxjpDi2z
Job succeeded

Сайт развернут, но, как я уже сказал, ошибок нет, но css и ссылки не работают

1 Ответ

1 голос
/ 16 октября 2019

SOLUTION

Мне просто нужно было изменить это в _config.yml

baseurl: "/jekyll_project" # the subpath of your site, e.g. /blog
url: "https://unveiled_adri.gitlab.io/" # the base hostname & protocol for your site, e.g. http://example.com

Когда я впервые тестировал это локально, мне не нужно было заполнять эти поля, но с тех пор яРазмещаю сайт на хостинге страниц gitlab, тогда мне нужно было заполнить поля. Я нашел это решение благодаря этому сообщению https://gitlab.com/pages/jekyll/issues/22

Наконец, да, это работает, но я не очень понимаю, почему это работает. Если бы кто-то мог прокомментировать этот ответ и объяснить мне, что произошло, я был бы очень рад, я всегда хочу узнать, что происходит и почему! <3 </p>

...