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

Port to Boostrap 4 #246

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

Conversation

varnerac
Copy link
Contributor

@varnerac varnerac commented Dec 2, 2019

Do you have an appetite to move to the Bootstrap 4 version or hold it as a dev branch? We want to loosely track the upstream version.

There's a known issue this port. Highlighting of active tags does not work. I cannot find the CSS class to do this in the new Boostrapious Universal distribution.

@varnerac
Copy link
Contributor Author

varnerac commented Dec 5, 2019

Just following up to see if you’d be interested in this PR or if it’s better for us to maintain the Bootstrap 4 version as a fork.

I know the eslint task failed. As best I can tell, the JavaScript files it complains about are basically the same ones already in the repo. Also, I tested this using the example site. Was anyone else able to test the branch on their machine?

@salim-b
Copy link
Collaborator

salim-b commented Dec 5, 2019

Just following up to see if you’d be interested in this PR or if it’s better for us to maintain the Bootstrap 4 version as a fork.

I'm not a maintainer of this theme but I strongly assume that your efforts to move it to bootstrap 4 are welcome... @ryanfox1985 ?

Was anyone else able to test the branch on their machine?

I'll have a look at it in the next few days!

<li{{ if eq $current.RelPermalink ($name | urlize | lower | printf "/tags/%s/") }} class="active"{{ end }}>
<a href="{{ "tags/" | relURL }}{{ $name | urlize | lower }}"><i class="fas fa-tags"></i> {{ $name }}</a>
<li class="list-inline-item">
<a{{ if eq $current.RelPermalink ($name | urlize | lower | printf "/tags/%s/") }} class="active"{{ end }} href="{{ $.Site.BaseURL }}tags/{{ $name | urlize | lower }}"><i class="fas fa-tags"></i> {{ $name }}</a>
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's a known issue this port. Highlighting of active tags does not work.

I didn't test your PR and only briefly looked at the changes you made, but I think broken highlighting could be due to the fact that you don't assign the class active to the <li> element anymore (you chose to assign it to the <a> element instead). What's your reason to change this?

(same applies to the categories partial layouts/partials/widgets/categories.html)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not a frontend developer, so I am feeling my way through this. However, active category highlighting works. You'll see that once you test the example site.

screenie

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This also won't be the first time I've written code that works and I am not sure why it works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is how it's handled on the upstream Boostrapious demo site here: https://demo.bootstrapious.com/universal/2-0-2/blog-medium.html

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've run your code in Hugo and it turns out you could just add the following CSS to the static/css/style.*.css files to enable proper tag highlighting (example for style.default.css):

.tag-cloud a.active {
  color: #ffffff;
  background-color: #4fbfa8;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don’t plan on making this change for this PR. I’ll look at what they do upstream.

@@ -127,11 +127,8 @@ paginate = 10
# Enable or disable top bar with social icons
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ line 85 you should update the comment about the default theme color (now turquoise instead of light-blue)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@salim-b
Copy link
Collaborator

salim-b commented Dec 6, 2019

(...) if it’s better for us to maintain the Bootstrap 4 version as a fork

Basically, I think the changes are so extensive that it would be appropriate to have this bootstrap 4 port in a separate repository (at least for the time being). But I wonder what the maintainers here think, @ryanfox1985 @GeorgeWL @adrianmo ?

<i class="{{ .icon }}"></i>
</div>
{{ with $element.url }}
</a>
{{ end }}
<h3>{{ $element.name | markdownify }}</h3>
<h3 class="h4">{{ $element.name | markdownify }}</h3>
Copy link
Contributor

Choose a reason for hiding this comment

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

it sounds weird h3 and class h4.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. I just ripped this off from the Boostrapious live demo/raw distro. We download the raw distro from them and pay for a non-attribution license.

Copy link
Contributor

Choose a reason for hiding this comment

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

I leave the comment opened to remember this on the final check

@ryanfox1985
Copy link
Contributor

ryanfox1985 commented Dec 11, 2019

I'm not sure about this feature, how to manage it, what is the best.

Time ago I realized the authors from Universal theme have updated the theme and it's not easy to apply the new updates to the current theme.

Perhaps a new main branch or directly a new project.

@ryanfox1985
Copy link
Contributor

The new Universal version is already using Bootstrap v4 (v4.3.1)

@varnerac
Copy link
Contributor Author

varnerac commented Dec 11, 2019

So, I’m happy to put this in a new repo. What I didn’t want to do is fork this without the consent of current maintainers. My preference is to fork it to hugo-universal-theme-2/hugo-universal-theme-2 rather than under our company. I’d also like to make some changes suggested in the current issue backlog, like shortcodes and managing images as resources rather than bare links. If there are no objections I’ll start the fork.

@ryanfox1985
Copy link
Contributor

ryanfox1985 commented Dec 12, 2019

I think the best is create a master_v2 in the same repository. And the release names use:

  • 1.X.X to refer to version v1
  • 2.X.X to refer to version v2

etc...

@salim-b
Copy link
Collaborator

salim-b commented Dec 12, 2019

I'd recommend to create a fresh repo as proposed by @varnerac (like hugo-universal-theme-2/hugo-universal-theme-2). Too much stale stuff around here (like open PRs from mid-2017...), therefore a fresh start seems appropriate to me. Just my 5 cents :)

@ryanfox1985
Copy link
Contributor

I'm not agree, if you take a look to other public repositories the different versions are in the same repository.

example jquery:

image

@salim-b
Copy link
Collaborator

salim-b commented Dec 12, 2019

I'm not agree (...)

No offence, but during the last two years there were periods during which almost no maintaining was done here. Which causes people to regularly place comments like this one.

But if you give appropriate write access to @varnerac , putting the bootstap 4 port into a master_v2 branch inside this repo seems fine to me, too. 😉

@ryanfox1985
Copy link
Contributor

@salim-b ,
sadly you are right, during the last two years this repository was no longer maintained but things can change.

Last months this repository was very active:

So let's see if we can maintain the repository in a good direction.

@salim-b
Copy link
Collaborator

salim-b commented Dec 13, 2019

I send a invitation to two new maintainers.

Ok, thank you! I can't promise anything but as long as I'll be using this theme myself I'll try to help here :)

@ryanfox1985 ryanfox1985 changed the base branch from master to master_v2 December 13, 2019 10:30
@ryanfox1985
Copy link
Contributor

I changed the based branch to master_v2

@@ -143,35 +140,35 @@ paginate = 10
enable = true
# All carousel items are defined in their own files. You can find example items
# at 'exampleSite/data/carousel'.
# For more informtion take a look at the README.
# For more information take a look at the README.
Copy link
Contributor

Choose a reason for hiding this comment

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

@varnerac I would appreciate misspelling words to be in another PR directly to master branch.

<input id="gmap-marker" value="{{ "img/marker.png" | relURL }}" />
<input type="hidden" id="gmap-lat" value="{{ .Site.Params.latitude }}" />
<input type="hidden" id="gmap-lng" value="{{ .Site.Params.longitude }}" />
<input type="hidden" id="gmap-marker" value="{{ .Site.BaseURL }}img/marker.png" />
Copy link
Contributor

Choose a reason for hiding this comment

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

is this change needed ? {{ "img/marker.png" | relURL }}

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd strongly suggest to stick with {{ "img/marker.png" | relURL }} instead of {{ .Site.BaseURL }}img/marker.png. The latter results in an absolute URL which can cause portability issues (which one can work around using Hugo's --baseURL option; but if we can avoid the hassle from the beginning... 😉 )

<script src="{{ "js/hpneo.gmaps.js" | relURL }}"></script>
<script src="{{ "js/gmaps.init.js" | relURL }}"></script>
<script src="{{ "js/front.js" | relURL }}"></script>
<script src="{{ .Site.BaseURL }}js/hpneo.gmaps.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

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

same here {{ "js/gmaps.init.js" | relURL }} is this needed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, same here, pls use relative URLs!

@varnerac
Copy link
Contributor Author

Let me know if this works. I do not intend to change the CSS for .tag-cloud a.active at the moment. I will go back to Ondrej and see if he wants to fix it upstream. If so, I'll imitate how he fixes it upstream.

@GeorgeWL
Copy link
Contributor

Error: add site dependencies: load resources: loading templates: "/Users/travis/build/devcows/hugo-universal-theme/layouts/partials/footer.html:65:1": parse failed: template: partials/footer.html:65: unexpected {{end}}

on the latest Travis Build of this.

@varnerac
Copy link
Contributor Author

@GeorgeWL I just fixed that in my branch here

I am not sure why this PR hasn't picked it up and re-run Travis on it. My merge commits, which I lazily did on GitHub UI, botched the footers.

@varnerac
Copy link
Contributor Author

@GeorgeWL Okay, if you click on "Details" on the TravisCI check, you'll see my latest commit passes. Unsure why it's not showing in the GitHub UI.

@varnerac
Copy link
Contributor Author

Please don't merge this yet. While porting our site to the Bootstrap 4 version, we found some errors in the carousel.

@simonsan
Copy link

Any news about this?

@varnerac
Copy link
Contributor Author

So, it depends on the definition of done. This works for the example Hugo project. However, it needs improvements for features not tested in the example app. Is the definition of done working with the example app, or works with everything?

@rvoortman
Copy link

This has been stale for some time now; is this going to be picked up again by someone? I'm not too familiar with the bootstrap upgrade, but I do know that version 5 is out and version 3.3.7 has has some CVE's at the moment that are not going to be fixed: https://security.snyk.io/package/npm/bootstrap. It might be useful to get this PR ongoing

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.

None yet

6 participants