Jekyll hosting for Google App engine

Built a personal blog using jekyll. Everything works well on the local host. I don't want to deploy it on github. For some reason, I prefer hosting on the Google engine.

I followed a few instructions on the Internet and copied the _site folder generated in my Google engine project.

this is what it looks like app.yaml:

application: myblog
version: 1
runtime: python27
api_version: 1
threadsafe: yes

error_handlers:
- file: /404.html

handlers:

- url: /
  static_files: _site/index.html
  upload: _site/index.html

- url: /(.*)
  static_files: _site/\1
  upload: _site/(.*)


libraries:
- name: webapp2
  version: "2.5.2"

when I run it locally in the Google engine, only index.html files and some others are displayed. No other pages found. Is there something that I am implementing incorrectly?

+4
source share
1 answer

Well, I finally figured it out. In any case, this is a little trick.

First in _config.yaml fileadd:

permalink:         /posts/:title/index.html

jekyll serve, _site. post _site/ .

_config.yaml file :

permalink:         /posts/:title

jekyll serve, _site. posts _site/ .

app app app app.yaml :

application: myblog
version: 1
runtime: python27
api_version: 1
threadsafe: yes


handlers:
- url: /(.*\.js)
  mime_type: text/javascript
  static_files: _site/\1
  upload: _site/(.*\.js)

- url: /(.*\.(jpg|png|ico))
  static_files: _site/\1
  upload: _site/(.*\.img)

- url: /(.*\.css)
  mime_type: text/css
  static_files: _site/\1
  upload: _site/(.*\.css)

- url: /(.*\.(eot|svg|svgz|otf|ttf|woff|woff2))
  static_files: _site/\1
  upload: _site/(.*\.fonts)

- url: /
  static_files: _site/index.html
  upload: _site/index.html

- url: /(.+)/
  static_files: _site/\1/index.html
  upload: _site/(.+)/index.html
  expiration: "15m"

- url: /(.+)
  static_files: _site/\1/index.html
  upload: _site/(.+)/index.html
  expiration: "15m"

- url: /(.*)
  static_files: _site/\1
  upload: _site/(.*)

#- url: /((tags)|(archive)|(about)|(posts)|(fonts))/

libraries:
- name: webapp2
  version: "2.5.2"

.

+1

Source: https://habr.com/ru/post/1653591/


All Articles