Getting text content from a standard directory layout (Fastlane)

I’m currently working on making Hugo automatically generate a simple website based on the app store description files as stored in the app’s source repo. I’m starting with the fastlane supply layout but also would like to support the Triple-T Gradle Play Publisher layout. Both of these work by organizing text and graphic files in a standard directory layout with standard naming:

- fastlane/
  └── metadata/
      └── android/
          └── <locale>/
              ├── full_description.txt
              ├── short_description.txt
              ├── title.txt
              ├── video.txt
              ├── changelogs/
              │   ├── <version-code>.txt
              │   └── <version-code>.txt
              └── images/
                  ├── featureGraphic.png
                  ├── icon.png
                  ├── promoGraphic.png
                  ├── tvBanner.png
                  ├── phoneScreenshots/
                  │   └── *.png
                  ├── sevenInchScreenshots/
                  │   └── *.png
                  ├── tenInchScreenshots/
                  │   └── *.png
                  ├── tvScreenshots/
                  │   └── *.png
                  └── wearScreenshots/
                      └── *.png

I can include the root dir as a staticDir but then I can’t resize the images as they are used, since they’d have to be in contentDir for that to work. If I set it to contentDir it seems likely there will be conflicts between Hugo and Fastlane/Triple-T. If it was possible to set the root as a data dir and if Hugo loaded .txt files as data, then it would make handling the text easy.

My plan is to make this into a Hugo theme, so it is really easy for people to generate website for apps, and keep them in sync with the app store materials.

Hi,

I’m not sure what the question is? Also, if you have a sample repo to play around with, that makes it easier for us to help.

The question is how to get all those .txt files and .png files into a
Hugo website without changing anything about those files or the layout.

Here are some example projects:

I would personally probably put it all in static, unless you needed Hugo’s image processing feature.

Then use readDir / readFile : Local file templates | Hugo


If you do need the image processing, nest your project files inside a page bundle, eg:

content/appinfo/
├── index.md
└── your-project-files
    └── ...

and then the Page Resources methods: Page resources | Hugo

here’s what I came up with for this, I got it working so that it loads
the screenshots, icon, “feature graphic”, and description from the
Fastlane files, but it does require some redundant configuration:

For example:

staticDir:
  - app/src/main/res
  - fastlane/metadata/android

params:
  icLauncher: app/src/main/res/mipmap-xhdpi/ic_launcher.png
  fastlaneDir: fastlane/metadata/android

If it was possible to include some items in staticDir in the theme’s
config.yaml, that would help, since all those defaults could be set as
part of the theme. Also, it would be quite helpful if I could set the
values of staticDir in templates and shortcodes. All of those paths
are standard paths in Android app projects setup with Fastlane.