Code Monkey home page Code Monkey logo

nist-header-footer's Introduction

NIST Header and Footer Template

This repo can be used as a source for the NIST headers and footers that are required for use on public-facing sites. It is recommended that you DO NOT copy these files into your repo, but rather link to them in-place so that you will automatically receive any changes or updates.

EXCEPTION: If you expect high traffic volume or need it to be highly available, and it does not reside on pages.nist.gov, you should copy these files to your site and use the local copy. pages.nist.gov is not highly available.

To use this repo you do NOT have to copy any files; just insert the following into your pages' HEAD section:

  <link rel="stylesheet" href="https://pages.nist.gov/nist-header-footer/css/nist-combined.css">
  <script src="https://code.jquery.com/jquery-3.6.2.min.js" type="text/javascript" defer="defer"></script>
  <script src="https://pages.nist.gov/nist-header-footer/js/nist-header-footer.js" type="text/javascript" defer="defer"></script>

Requirements

  • Compatible with JQuery 3.0+. JQuery 1.9 is included in repo for legacy purposes but should not be used. Users are advised to switch to using latest version of jQuery.

Tips

If you would like the footer to be pushed to the bottom of the browser window on short pages, add the nist-footer-bottom class to the top level html element. Also make sure to add ID selector #main to content body wrapper.

<html class="nist-footer-bottom">

nist-header-footer's People

Contributors

jonraedeke avatar mdsteveb avatar phernand42 avatar tzonghao avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nist-header-footer's Issues

Update background color of footer

The background color of NIST.gov footer is slightly darker than the background color of the footer in repo. Will want to update to keep consistent.

Hex values of background colors

NIST.gov footer - #2e2e2e
Footer repo - #333333

Footer

@mdsteveb We're adding a standard footer. Should I make a new repo or rename this one to 'nist-html-components' and add? Any preference?

Enable CORS

Has anyone had issues with this repo and CORS on a live site?

It would be nice to also have a workaround for local sites so they don't run into CORS issues.

Header issues

We noticed two issues with the NIST header as seen in the picture:
Capture

The header and footer do not have the same color, according to the inspector:

  • .nist-header: background #000
  • .nist-footer: background #333333

The arrow is not centered (seems to be due to top: -2px for .nist-header__logo-icon class).

Thanks!

Update documentation and HTML templates to use jQuery 3.x from CDN

jquery 1.x is ancient and I've seen it triggering some vulnerability scanners. I tested nist-header-footer with the latest jquery 3.x release and it works fine. (I had to update leaveNotice to work with it, but I did that so it is now happy with 3.x too.)

Anyway I'm of mixed feelings about having a copy of jquery in the repo at all since it will always be out of date and yet people will still be referencing it. I think it might be best to change the documentation to pull the latest 3.x jquery from the CDN by changing the script tag that loads it to this:

<script type="text/javascript" src="https://code.jquery.com/jquery-3.x-git.min.js" defer="defer"></script>

Leave the 1.9 version in the repo so we don't break anything, but don't mention it anymore.

Neither nist-header-footer nor leaveNotice do anything sophisticated so minor version changes are very unlikely to cause problems.

Then the HTML head template in the repo should be changed to match the documentation.

Sorry, I'm swamped with other stuff so haven't had time to try to put a pull request together, but ran into this today and wanted to get it filed in case you can do it.

Remove dynamic menu in header

Maintaining all the menu links from www.nist.gov in the header is a maintenance issue and is unnecessary. We have the approval of Public Affairs to simplify the header by removing the expandable menu and adding just a few static links.

This should appear similar to what we had before implementing the menu.
simplified_nist_header

No action should be necessary to update current implementations as they already load the header, css and js dynamically from the public boilerplate header.

Create modifier class for header logo to adjust alignment

Right now the header logo is positioned to the far left of the black banner.

Example 1

Screen Shot 2022-04-25 at 3 47 08 PM

When the USA Banner is added to a site as shown in example above the logo looks out of place. Creating an optional modifier class to help with alignment when the USA banner is added could help with logo placement.

Example 2

Screen Shot 2022-04-25 at 3 46 38 PM

Simplify this repo

This repo is too complicated. When this repo started, we had the main menu included so it made sense to update it dynamically. Now the only links are footer links, which rarely change.

Dynamically loading the markup is causing some issues:

  1. pages.nist.gov is not highly available
  2. Usage is confusing
  3. More maintenance
  4. Code too complicated - have to include jQuery etc.

A few options:

  1. Transition this repo to static assets
  2. Move this resource to https://wcm.ipages.nist.gov/nist-component-library/latest/styleguide/ and deprecate this repo

@phernand42

nist-footer-bottom not working

I have not tested this myself but I had a report that following the instructions to add the nist-footer-bottom class to the html element per the instructions in index.html did not result in the desired effect of having the footer stuck to the bottom of the window.

I believe that was with a short page. Possibly it works with scrollable pages but not with shorter-than-window-size pages?

JQuery version disallowed on NIST servers

In May of 2022 we (ITL/SSD/SIG) were informed that tenable scans were flagging all instances of JQuery < 3.5 as security vulnerabilities and we were told to scrub all references to JQuery < 3.5 (even in code that wasn't actually running). As such any web pages / web apps include your suggested version of JQ will likely not pass muster when subjected to security screening.

Adjust width of footer logo container

The logo area in footer seems to be full width, not the image but container of logo. This in turn is making the whole entire area clickable since the logo img is wrapped by an <a> inside of container. The logo img area itself should only be clickable not the container.

Current setup

Screen Shot 2022-04-19 at 10 12 37 AM

How it should be

Screen Shot 2022-04-19 at 10 15 21 AM

Add new footer link

On second line, we need to add Vote.gov to the end of the list of links and link out to that site.

Create a nist-pages branch to expose the templates for other projects to link to

It would be potentially very useful if this repo were exposed on the pages server via a nist-pages branch so that other projects can link to the actual template files rather than having to copy them locally where they will become obsolete. I haven't checked whether this repo is constructed in a way to enable that, but it might be as simple as moving the code into a nist-pages branch and setting up the web hook.

Legacy logo images being linked to

Some sites hard-coded links to legacy images in this repo. To minimize error messages and facilitate a smooth transition into using the code properly, I'm going to add legacy images back to this repo since they are still valid NIST logos to use in general.

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.