jsoma / bottlejack

MIT License
1 stars 1 forks source link

Support HTML please! #3

Closed biancapallaro closed 3 years ago

jsoma commented 3 years ago

Seems like it could be useful, but how do you want to use HTML?

It might be useful to start from thinking about how we could adjust the gdoc type, which currently looks like this:

  - type: gdoc
    title: this is the first project
    slug: first-project
    url: https://docs.google.com/document/d/....

Some questions for this proposal might be:

It's probably useful to think about it in connection to #1 , too. Should they operate the same way?

fazilkhan commented 3 years ago

As I understand, We can't have locally existing files show up on the internet. They have to exist on some server on the internet. So, I think if it were possible to have even the HTML files located in our Google Drives (not as gdocs but html) but still connected to bottlejack in a way that if you insert the drive link in yaml it processes it as an HTML file.

It should pull the 'title' for the yaml from an <h1> tag and 'slug' (which makes the URL for the article) from the <title> tag within the of the HTML.

jsoma commented 3 years ago

I don't think local files would be a problem! I think we just need someone to lay out what the yaml might look like for adding an html file as a page. We'll just have bottlejack take that HTML and turn it into a "real" page just like it does with the google docs.

I'm open to automatically pulling title/slug from the html file itself, but am wondering about the tradeoff between the flexibility of specifying it in the yaml vs. the ease-of-use of making it pull from the html. If anyone else has thoughts I'm open to hearing them!

hc3188 commented 3 years ago

"Where would the HTML files live? Can they be anywhere on my computer? In a specific folder?"

As far this goes, I think it should be in the same directory as .hbs and .yaml files?

jsoma commented 3 years ago

As far this goes, I think it should be in the same directory as .hbs and .yaml files?

Sure! Makes more sense than anywhere else on your comp, I guess. Can someone hit me with an example of what the yaml would look like, based on the gdoc version above?

fazilkhan commented 3 years ago

Something like this maybe?

    type: html/ipynb
    title: this is the first project
    slug: first-project
    url: file-path
jsoma commented 3 years ago

I was thinking of just having the type be HTML and plugging it right into an html.hbs, but your type: html/ipynb makes me think: maybe not all HTML pages should be the same! Since you might have some HTML that's from a notebook, some HTML from a scrollytelling piece, some HTML that's from something else, maybe there should be the option for them to get different templates. I might move that into a template: variable, though.

Let me throw something together and we'll see how well it works!

jsoma commented 3 years ago

Give it a try, although there are a few changes you'll need to make to your content:

I'll upload a new example.zip on Slack, or you can look in the example folder to see the new templates. Also, might need to npm install -g bottlejack@0.0.2