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

Issue12 #16

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

Issue12 #16

wants to merge 2 commits into from

Conversation

mmt456
Copy link
Collaborator

@mmt456 mmt456 commented Dec 6, 2024

Problem:
Website not modular, specifically header, navbar, and footer code are repetitive. If changes are desired of these features, every page that the feature appeared on must be edited. This is a problem as it can be time consuming and easy to make mistakes.

Solution:
Use HTML Templates to create a custom header. Two javascript files were created in the “js folder defining the header/navbar code and the footer code: headerTemplate.js & footerTemplate.js.

On each of the pages these feature need to occur on (almost all of them), add to the head tag

<script src="js/headerTemplate.js" type="text/javascript" defer></script>
<script src="js/footerTemplate.js" type="text/javascript" defer></script>

And add the new custom tag where the header/footer should be on the page

<header-component></header-component>
<footer-component></footer-component>

Moving on:

  • Update any changes to the headerTemplate.js and footerTemplate.js files to update the header and footer, respectively.
  • Add the new custom tags onto any new pages that need a header and/or footer on them.

Sources:

@mmt456 mmt456 requested a review from infrared0 December 6, 2024 00:10
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.

1 participant