avillafiorita / jekyll-datapage_gen

Generate one page per yaml record in Jekyll sites.
369 stars 80 forks source link

pages rendered, but not written to the _site #71

Open mfortini opened 4 years ago

mfortini commented 4 years ago

I've been using datapage gen for a long time now, and it's always been working easily. I've created some pages based on a YAML array. They are rendered by jekyll, but in the end they are not written to the website. I could not find any reason. Using jekyll 4.0.0

avillafiorita commented 4 years ago

Hi, I have tried and have difficulties reproducing your error. I am using the .rb file in the _plugins directory and everything seems to be working fine with Jekyll 4.0.0 (page generated in _site). Can you provide more details or sample code to try and reproduce the issue? thanks in advance! -a

avillafiorita commented 4 years ago

Sorry, I spoke too soon. I can reproduce the error. I will look into it.

avillafiorita commented 4 years ago

Tried again: it seems to be working now. If you still have the issue, if you let me have an example, I can try and have a look.

mfortini commented 4 years ago

Thank you for your help, the site we're working on is this https://github.com/emergenzeHack/covid19italia there are other datapages that are rendered correctly (and thank you a lot for saving us so much time and complexity!)

if I add

-
    index_files: false
    data: cfg.issuecategories
    template: issuelist_category
    name: displayname
    dir: /categorie/

then with bundle exec jekyll serve --verbose I can see in the output: Rendering: categorie/raccolte-fondi.html Pre-Render Hooks: categorie/raccolte-fondi.html Rendering Markup: categorie/raccolte-fondi.html Rendering Layout: categorie/raccolte-fondi.html Layout source: site

But in the final “writing” page they don’t get written to the output I’m using jekyll 4.0.0 with ruby 2.5.0

avillafiorita commented 4 years ago

Hi, I had a look at the repo... it seems like it uses various plugins; I tried but I couldn't isolate the datapage generation issue. Can you provide a stripped-down example demonstrating the issue?

jvanulde commented 4 years ago

I have a similar issue in this repo: https://github.com/OpenDRR/jekyll-info-viz

Locally, the pages get written as expected but in GitHub Pages they are not.

JustinWoodring commented 4 years ago

I have exactly the same issue. I found a kind of annoying workaround though. https://github.com/Booglejr/osmwebsite

  1. Create a workflow that compiles it all in github actions and then deploys to a different branch in the repo

  2. point github pages at the compiled branch.

Here is the workflow file:

name: Build and Deploy GIT Update
on: [push]
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout 🛎️
        uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
        with:
          persist-credentials: false

      - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
        run: |
          export PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"
          gem install --user-install jekyll bundler 
          bundle install
          bundle exec jekyll build --trace -V
      - name: Install SSH Client 🔑
        uses: webfactory/ssh-agent@v0.2.0
        with:
          ssh-private-key: ${{ secrets.DEPLOY_KEY }}

      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@releases/v3
        with:
          SSH: true
          BRANCH: gh-pages # The branch the action should deploy to.
          FOLDER: _site # The folder the action should deploy.
avillafiorita commented 4 years ago

If I get it right, the issue is related to execution of datapage-generator on Github.

Github, however, allows the execution of a limited set of plugins on their websites, namely, those they trust and rightly so, since a plugin could do pretty nasty stuff. The list of allowed plugins is: https://pages.github.com/versions/.

If this is the case, there is not much I can do on the matter.

Did I get it right?

pn11 commented 2 years ago

Hi, thanks for your information. I spent some time to find out the plugin does not work with Github Pages. If there is that information somewhere on README together with this comment, it will help😄

avillafiorita commented 2 years ago

Hi, thanks for pointing out. I'll add it to the documentation!

Btw, you can still publish on Github pages even if plugins are not supported, as suggested here: https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/about-github-pages-and-jekyll#plugins

GitHub Pages cannot build sites using unsupported plugins. If you want to use unsupported plugins, generate your site locally and then push your site's static files to GitHub.

pn11 commented 2 years ago

Thanks for your reply. I'll check that!