8000 Move inline styles to CSS by brianwarner · Pull Request #40 · boratanrikulu/eternity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jan 4, 2024. It is now read-only.

Move inline styles to CSS #40

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

brianwarner
Copy link
Contributor

Another minor contribution to increase the flexibility of the theme. The background image config was an inline style. This change migrates the style into a stylesheet in a backward-compatible way, which would make it easier to override in custom CSS.

The background image config was an inline style. This change migrates
the style into a stylesheet in a backward-compatible way, which would
make it easier to override in custom CSS.

Signed-off-by: Brian Warner <brian@bdwarner.com>
Copy link
Owner
@boratanrikulu boratanrikulu left a comment

Choose a reason for hiding this comment

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

We can not do that because of absURL part. Some users want to run whole site under a path, for example /portfolio. For this case, we use absURL, that's why we can not move to CSS.

@brianwarner
Copy link
Contributor Author

Thanks, that makes sense. Just repeating it back to make sure I'm getting it, my understanding is that absURL concatenates baseURL at build time so that /background.jpeg can be ://domain.com/background.jpeg or ://domain.com/arbitrary/subdomains/background.jpeg

In that case, could this be accomplished by using a relative URL in the stylesheet? I'm making assumptions that 1) the welcome page will always be at the root of the Hugo site, and 2) the welcome page is the only one to use this directive. If that's the case, whether at top level or nested, url("../background.jpeg") should always work. I've tested it and it works for me locally both at server root and in a subdirectory.

What do you think?

@boratanrikulu
Copy link
Owner

Hmm, seems you're correct. It's only used at the welcome page, but I need to check to be sure, I plan to check it this weekend.

The background image, by default, is one directory higher than the
stylesheets. Using a relative path will enable both root-level and
subdirectory installations.

Signed-off-by: Brian Warner <brian@bdwarner.com>
@brianwarner
Copy link
Contributor Author

It's a very small patch, but I just pushed it so you can try it directly from this branch.

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

Successfully merging this pull request may close these i 395A ssues.

2 participants
0