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

Begin fixing landing customization #148

Open
wants to merge 4 commits into
base: release
Choose a base branch
from

Conversation

indrora
Copy link

@indrora indrora commented Dec 26, 2023

There is a surprising amount of content that depends on $.Site.Data.landing. This is bad and should be removed or made to use something default-but-changeable This changeset does exactly that. I've also reworked the way that iamge compare is checked for, which makes it possible to use it in the body content as well later as a shortcode.

This also begins the process of making all scripts fingerprintable for SRI.

TODO:

  • Reduce uneccesary calls to $.Page.Scratch.Get and related.
  • add a way to set the default configuration for image comparisons (simple now)
  • Move the script at the end into app.js (w/a check that we have indeed added the script)
  • Pet the dog & drink eggnog.

Changes

  • Move around template logic for the Image Comparison script inclusion. Adding to the end is the right way to do it.
  • Rename landing.yaml to landing_default.yaml -> This should actually be in data/lotusdocs to namespace it away but I didn't want to make any sudden movements.
  • Fixed up references to $.Site.Data.landing to one.
  • Made templates relative to their config data. This allows for multiple instances of each that do not interfere with one another.

fixes #143 and future-proofs it a bit.

There is a surprising amount of content that depends on `$.Site.Data.landing`.
This is bad and should be removed or made to use something default-but-changeable
This changeset does exactly that. I've also reworked the way that iamge compare
is checked for, which makes it possible to use it in the body content as well
later as a shortcode.

This also begins the process of making all scripts fingerprintable for SRI.
Copy link

netlify bot commented Dec 26, 2023

👷 Deploy request for hugo-lotusdocs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit f090b4d

since we include it with context!
@chapimenge3
Copy link

When is this PR get reviewed potentially merged?

i had to update couple of things by manually to make the landing page works.

Kudos to the creator. 👏 I love this theme.

@IzzyMusa
Copy link

Nice to see this! It was driving me crazy and then decided to check the issues and prs. Looking forward to it getting merged.

@indrora indrora mentioned this pull request Jan 29, 2024
8 tasks
@indrora
Copy link
Author

indrora commented Feb 11, 2024

I'm pretty confident that this is ready for at least an initial review.

Things that should be considered for a future change:

  • Default image comparison options
  • Unify the CSS into one single set of scss instead of weird duplication.

@indrora indrora marked this pull request as ready for review February 11, 2024 00:33
@indrora
Copy link
Author

indrora commented Mar 12, 2024

knock knock: Any chance of getting this merged?

@ManuelLevi
Copy link

Would be great to see this merged. @colinwilson any chance you can have a look at this?

@import "custom/components/buttons";
@import "custom/components/badge";
@import "custom/components/backgrounds";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, this should not be removed. This breaks the background-color of the nav-pills of the image-comparer and maybe other things as well

{{- $imgviewjs := resources.Get "/js/image-compare-viewer.min.js" -}}
{{- $appjs := resources.Get "/js/app.js" -}}
{{- $bsjs := resources.Get "js/bootstrap.js" -}}
{{- $js := slice $bsjs $imgviewjs $appjs | resources.Concat "/js/bundle.js"}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my tests show that the image-compare-viewer sources are not properly embedded:

Uncaught ReferenceError: ImageCompare is not defined
    at bundle.js:1489:20
    at NodeList.forEach (<anonymous>)
    at bundle.js:1488:15

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

Successfully merging this pull request may close these issues.

Cant edit landing page
5 participants