How do I add a hidden subdirectory with a json file in it?

Hello forum,

I’m new to Jekyll and have setup a simple app showcase website using a jekyll theme and github hosting. I’m using this theme - GitHub - emilbaehr/automatic-app-landing-page: A Jekyll theme for automatically generating and deploying landing page sites for mobile apps.

For a requirement regarding setup for deep linking in my app, I need to place a json file in a hidden subdirectory like this -

https://appname.app/.well-known/assetlinks.json

How I can do this with Jekyll? Any pointers in the right direction will help. Thanks you!

1 Like

You’re going to have that file accessed by mobile apps and websites I assume, so it can be public then on your site and repo.

You can add a JSON file anywhere you like. If you use an underscore or dot at the start of the name you will have to add it to your config as

include:
  - ".well-known"

Sample structure:

.well-known/
  assetlinks.json
index.md
about.md

The JSON file can be plain JSON. Not markdown extension or frontmatter needed. Jekyll will find it and treat it like a .txt file, or a .js file etc. in assets.


If you want to you, you can use frontmatter and Liquid to process your JSON. Perhaps load from a file in _data directory.

Then follow my guide Render content for all Jekyll pages as a single JSON endpoint · GitHub

2 Likes

Hi @MichaelCurrin ,

Thank you so much for your reply and for replying so quickly. I got it to work and the linking is successful. This was basically needed to setup deep links in my app. Hence this config file was needed in order for Google to verify if the domain belongs to me or not.

About the placement of the .well-known folder, initially I was a little confused as to where it has to be placed. Tried the root folder which failed and then the _pages folder and it worked.

Thanks a lot!

1 Like