Code Monkey home page Code Monkey logo

cms-theme-boilerplate's Introduction

HubSpot CMS Boilerplate

A straight-forward starting point for building a great website on the HubSpot CMS.

Documentation | Demo website | Contributing

Current version Latest commit Contributors GitHub watchers GitHub stars GitHub forks HubSpot website grader score Google Lighthouse desktop performance score Google Lighthouse SEO score Google Lighthouse accessibility score License

Purpose

The HubSpot CMS Boilerplate is designed to offer developers a head start in the website building process. While the HubSpot CMS Boilerplate represents HubSpot's opinionated best practices, we intend to learn from similar projects and feedback. We hope it offers inspiration and utility for all website projects!

Getting started

To download the HubSpot CMS Boilerplate using the HubSpot CMS CLI:

Before getting started, you will need to have Node.js installed, the HubSpot CMS CLI installed, and we strongly suggest that you set up a HubSpot CMS Developer Sandbox for your QA/testing environment.

  1. Navigate to the directory that you want to use for your project
  2. Run hs create website-theme <directory> to create a project from the HubSpot CMS Boilerplate
  3. Configure the local development tools for the portal(s) you'd like to use for your project.
  4. Run hs watch --portal=<portal> src <directory> --initial-upload to upload all the files in the project and watch for changes to files in the src directory

Please reference our Quick start guide to developing on the HubSpot CMS and our Getting started with local development articles for more information.

To use version control in your project using GitHub and GitHub Actions:

  1. Fork the HubSpot CMS Boilerplate repository and clone your forked repository to your computer
  2. Set up GitHub secrets in your forked repository to encrypt sensitive information from showing publically for HUBSPOT_PORTAL_ID and HUBSPOT_PERSONAL_ACCESS_KEY
  3. Update the name of the directory that you'll be deploying to in your Design Manager in the .github/workflows/deploy.yml file (the current default dest_dir is cms-theme-boilerplate)
  4. Deploy changes to your Design Manager by pushing to the main branch of your forked repository

Please reference our HubSpot CMS deploy GitHub action page and Setting up continuous integration with a GitHub repository using GitHub Actions article for more information.

Style guide

For details about the HubSpot CMS Boilerplate's recommended best practices and code formatting, please reference our style guide.

Contributing

If you’re interested in contributing to the HubSpot CMS Boilerplate, please read CONTRIBUTING.md and STYLEGUIDE.md to see how you can report an issue, make a feature request, or make a pull request.

Versioning

Previous releases and their documentation are available for download. To provide transparency into future releases, we create a project board that documents our planning in preparation for each upcoming major and minor version.

Community

You can stay up to date with HubSpot CMS Boilerplate updates and discussions in the #hs-cms-boilerplate channel in the HubSpot Developer Slack.

License

The code is available under the Apache License, Version 2.0

cms-theme-boilerplate's People

Contributors

acdefranco avatar anthmatic avatar axellabs avatar baezor avatar bgoodies avatar bran-van-d avatar chaffeqa avatar ckconant avatar dependabot[bot] avatar dperolio avatar gcorne avatar gkemp94 avatar jasonnrosa avatar jazzyclimber avatar joeyblake avatar johnsfuller avatar jsines avatar katzmitch avatar levinkeo avatar mattcoley avatar mtndan avatar scottrw93 avatar stefenphelps avatar svarmahubspot avatar tanyascales avatar thewebtech avatar williamspiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cms-theme-boilerplate's Issues

Remove usage of `hs-` classnames

We should not leverage classnames like hs-button in modules and template code, so that they can be reserved for use in product-provided forms markup.

See src/templates/system/404.html and src/modules/Customizable button.module/module.html.

Add a project wiki

Add a wiki with consolidated information on what boilerplate includes, what opinionated best practices were included (and why), how to keep track of updates, and more as we continue the project.

Update password prompt template

The template needs to be updated with:

  • Verbiage explaining the template purpose (why there's a password prompt)
  • Input style

Email Subscriptions module no longer deactivates existing subscriptions with unsubscribe

In the themes boilerplate, the email subscription module has different functionality than the old vast templates. When you select "unsubscribe from all emails" in the vast template, the existing options are greyed out and unable to be selected. In the new templates these remain selected and unchanged.

Screen Shot 2020-05-01 at 10 59 37 AM
Screen Shot 2020-05-01 at 10 59 24 AM

Here is the code that I have used to fix this in case you would like to use it:

This is added to the systems_pages.css
.email-prefs .item.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.email-prefs .item.disabled input:disabled {
  cursor: not-allowed;
}
This is added to the main.js file
$('input[name="globalunsub"]').change(function () {
    if ($(this).is(':checked')) {
      $('.item').addClass('disabled')
      $('.item input').attr('disabled', 'disabled')
      $('.item input').removeAttr('checked')
    }
    else {
      $('.item').removeClass('disabled')
      $('.item input').removeAttr('disabled')
    }
  });

Add max width to footer container

Currently footer__container is being centered via text-align and doesn't have a max-width. This should be updated to use a max-width and set horizontal margin to auto.

Update font field sizing value to use size_unit

Currently the font is being passed incorrectly in theme settings:

"size": {
    "units": "px",
    "value": 24
}

Instead it should be set up like this:

"default": {
    "size": 24,
    "size_unit": "px"
}

Fix blog pagination

The < and > characters aren't aligned well, especially on mobile, which we should fix:
image

Also, it makes sense to hide the pagination if there is only one page of blog posts.

Menu module missing linkTarget variable

The menu module is currently missing the linkTarget variable therefore if a user chooses that a menu link opens in a new window, that change wouldn't reflect in the menu currently:
OpenInNewWindow

Account for image max-width where necessary

Problem

Historically we've used img {max-width: 100%} in the migrations boilerplate. Since updating the image module's options to give customers more control over their images, we've had to remove the max-width so that the module can work freely. In doing so, we're not accounting for other modules allow image insertion.

Possible ways to add images

  • Image module
  • Logo module
  • Rich text module
  • Blog content module (Rich text)
  • Blog listings (if included above the 'Read more'
  • Blog author image
  • Featured images
  • Rss listing
  • Custom modules using an image field

Possible solutions

There are several ways that we can account for max-width on images where we need it applied. Initially, my thought was to use a not:() pseudo selector for the image module, but we need to also account for any custom modules using an image field to omit the max-width from them as well. Since there isn't a good way to account for the image field, we may need to think through all of the possible ways to add images and use a class from each.

fix landing page menu logic

  • move all of the landing page logic into the main header file
  • figure out how to reliable retrieve the template type
  • hide the menu when the template is a landing page

Search bar's height is extremely large in Safari

Search bar's height is extremely large in Safari. It looks like it has to do with the line-height that is being set there. Going to work on a fix for this today and will make a patch release later in the day with a couple of resolved fixes.

Screen Shot 2020-05-08 at 10 20 23 AM

Fix form selectors in forms.css

Right now boilerplate is targeting .hs-input vs the input element. This means form styles don't pull through to system page form which are formatted slightly differently or on other HTML based forms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.