Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modify automatically generated text #72

Closed
emmaehrlich opened this issue Jun 13, 2024 · 10 comments
Closed

How to modify automatically generated text #72

emmaehrlich opened this issue Jun 13, 2024 · 10 comments

Comments

@emmaehrlich
Copy link

Could you make a short set of instructions for how to modify the text that is generated by the theme? Specifically, I'd like to stop the paige-reading-time from being generated on every post every time I re-run the server.

@emmaehrlich emmaehrlich changed the title How to modify theme How to modify automatically generated text Jun 13, 2024
@willfaught
Copy link
Owner

The reading time is always included in the HTML content, along with categories, tags, series, authors, title, description, content, etc. CSS IDs and classes for each of these are documented for hiding/transforming each of these things as needed. See, for example, https://github.com/willfaught/paige?tab=readme-ov-file#minimal-look.

I'm not sure if I answered your question.

@willfaught
Copy link
Owner

The exampleSite uses the "minimal look" approach to hide the reading time, for example.

@emmaehrlich
Copy link
Author

Thank you for the response - it's much appreciated. I don't know CSS / I don't know how to use this nicely documented information. Here's what I've tried:

  • I did not have a style-first.css file in layouts/partials/paige, so I copied it from exampleSite
  • replaced the code in that file with the code suggested in the readme section "Minimal Look"
  • replaced the reading time line with "#paige-reading-time{display:none;},"
  • deleted the reading time in the html file for a page
  • restarted the server
    --> reading time was displayed

I also tried the same procedure but deleting the reading time line instead of trying to hide it.

@willfaught
Copy link
Owner

replaced the reading time line with "#paige-reading-time{display:none;},"

I'm not sure what this means. The minimal look CSS already sets display to none. Can you paste what you have here?

deleted the reading time in the html file for a page

I'm not sure what this means. Do you mean the reading time value in the HTML templates (layouts/partials/paige/metadata.html and layouts/partials/paige/page.html, if I remember correctly)?

@emmaehrlich
Copy link
Author

(1) I see - so, if I understand correctly, I have not successfully instituted the minimal look.

Here's a screenshot of my attempt to institute the minimal look. I'm working inside the exampleSite because that's the only place I can find a file called style-first.css.

image

(2) No, I haven't modified any files in the partials folder. I was deleting anything that referred to reading-time in [my site]>public>[name of my page, or it might be called a post]>index.html.

@willfaught
Copy link
Owner

willfaught commented Jun 18, 2024

Here's a screenshot of my attempt to institute the minimal look. I'm working inside the exampleSite because that's the only place I can find a file called style-first.css.

That looks correct. Does that not hide the reading time when you view the site with hugo server -D?

No, I haven't modified any files in the partials folder. I was deleting anything that referred to reading-time in [my site]>public>[name of my page, or it might be called a post]>index.html.

I see. You should never have to edit generated files in the public or resources directories. Instead, the templates (and the data they use as input) should be modified to generate what you want.

@emmaehrlich
Copy link
Author

I copied the style-first.css file from exampleSite into site>themes>paige>layouts>partials>paige.

I must have done something else differently, because now it displayed on all of the pages except for one.

image

image

@emmaehrlich
Copy link
Author

I tried the following:

  • deleted entire paige folder
  • deleted all other copies of the paige theme on this computer that I could find
  • searched computer for the word "paige" and found nothing
  • emptied recycle bin
  • cleared browser cache
  • deleted reading-time from html page in a public folder
  • restarted server
    and it still displays.

@emmaehrlich
Copy link
Author

I restarted site creation from a blank slate and it worked. Thanks for your time.

@willfaught
Copy link
Owner

Sorry for the delay replying.

style-first.css goes in your site, not in the theme. From https://github.com/willfaught/paige?tab=readme-ov-file#include:

If this file exists [yoursite/layouts/partials/paige/style-first.css] It is included at [The beginning of the style tag]

It looks like you've copied Paige into yoursite/themes/paige. So you would put style-first.css at yoursite/layouts/partials/paige/style-first.css, not yoursite/themes/paige/layouts/partials/paige/style-first.css.

Hope that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants