Trying to create “auto-generating” component

So I’m trying to build this page in a very barebones geocities style server.
It lets me use some JS, so I was trying to build some component to do this idea I had, I have built this “blog” page, and inside the directory there is a posts folder I created so I could put the posts inside as .txt files.
My idea was to save time by while building the posts component it would run through the files on this folder and inject the each text into a post:

    class Posts extends HTMLElement {
    constructor() {
      super();
    }
  
    connectedCallback() {

      this.innerHTML += `
        <div class="card">
          <h2>TEST POST</h2>
          <h5>Title description, Dec 7, 2017</h5>
          <object data="posts/test.txt">
        </div>
      `;
    }
  }
 
  customElements.define('posts-component', Posts);

Is that possible in more vanilla JS?
If so, how?

Before anyone asks, I’m just doing this for fun, for a little “challenge”.