{"id":19960096,"url":"https://github.com/born2net/gulp-header-footer-gen","last_synced_at":"2026-06-05T13:32:06.567Z","repository":{"id":26748057,"uuid":"30205824","full_name":"born2net/gulp-header-footer-gen","owner":"born2net","description":"a gulp plugin to share html footer and header among multiple html pages","archived":false,"fork":false,"pushed_at":"2015-02-02T22:10:44.000Z","size":320,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T14:09:28.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/born2net.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-02T20:04:52.000Z","updated_at":"2015-02-02T22:10:44.000Z","dependencies_parsed_at":"2022-08-31T17:02:22.908Z","dependency_job_id":null,"html_url":"https://github.com/born2net/gulp-header-footer-gen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/born2net%2Fgulp-header-footer-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/born2net%2Fgulp-header-footer-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/born2net%2Fgulp-header-footer-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/born2net%2Fgulp-header-footer-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/born2net","download_url":"https://codeload.github.com/born2net/gulp-header-footer-gen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241391149,"owners_count":19955479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T01:53:42.950Z","updated_at":"2025-03-01T16:24:27.277Z","avatar_url":"https://github.com/born2net.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"gulp-header-footer-gen\n==========================\n\nMost web sites share a common HTML header and footer throughout a web site.\nThis Plugin attempts to solve a simple problem, the ability to share a single page template that includes both a header and footer with the entire web site (all html pages).\n\nIf you know DreamWeaver, it's the same idea as Web Template (DWT)\n\nEasier to explain with an example.\n\nSite structure:\n\nbefore gulp execution:\n\n\u003cpre\u003e\nindex.html\n|\n   _source -\n      file1.html\n      file2.html\n      file3.html\n|\n   _js\n   _css\n   ...\n\u003c/pre\u003e\n\n\nafter gulp execution:\n\n\u003cpre\u003e\nindex.html\n|\n   _source -\n      file1.html\n      file2.html\n      file3.html\n|\n   _js\n   _html\n      file1.html\n      file2.html\n      file3.html\n   _css\n   ...\n\n\u003c/pre\u003e\n\nwith all references to ./ changed to ../\n\nso gulp-header-footer-gen will generate the HTML pages for us.\n\n\nHow to setup:\n==============\n\nIn index.html (or whatever template file you choose that resides at the root of the project) put your content between the tags of:\n\n```\n\u003c!-- MAIN_CONTENT_START --\u003e\n\n\u003c!-- MAIN_CONTENT_END --\u003e\n```\n\nso a typical index.html will look like:\n\n\nHTML template sample:\n==============\n\n```\n\n\u003c!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"\u003e\n\u003chtml xmlns=\"http://www.w3.org/1999/xhtml\"\u003e\u003c!-- InstanceBegin template=\"/Templates/Template.dwt\" codeOutsideHTMLIsLocked=\"false\" --\u003e\n\u003chead\u003e\n    \u003cmeta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/\u003e\n    \u003ctitle\u003eMediasignage\u003c/title\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n    \u003cmeta name=\"description\" content=\"Mediasignage\"/\u003e\n    \u003cmeta name=\"keywords\" content=\"Mediasignage\"/\u003e\n    \u003cmeta name=\"publisher\" content=\"Mediasignage\"/\u003e\n    \u003clink rel=\"icon\" href=\"images/favicon.ico\" type=\"image/x-icon\"\u003e\n    \u003clink rel=\"shortcut icon\" href=\"images/favicon.ico\" type=\"image/x-icon\"/\u003e\n    \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"http://fonts.googleapis.com/css?family=Leckerli+One\" media=\"screen\"\u003e\n    \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"http://fonts.googleapis.com/css?family=Pacifico\" media=\"screen\"\u003e\n    \u003clink href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'\u003e\n    \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"./css/layout.css\" media=\"screen\"\u003e\n    \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"./css/bootstrap.css\" media=\"screen\"\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n\u003cdiv class=\"MyHeader\"\u003e\n   ...\n\u003c/div\n\n\u003c!-- MAIN_CONTENT_START --\u003e\n\n\u003csection id=\"myContentForIndex\"\u003e\n\u003c/section\u003e\n\n\u003c!-- MAIN_CONTENT_END --\u003e\n\n\u003cfooter\u003e\n    \u003cdiv class=\"container\"\u003e\n    \u003c/div\u003e\n\u003c/footer\u003e\n\n\u003cscript src=\"./js/jquery-1.4.2.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript src=\"./js/sliding.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript src=\"./js/jquery.easing.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript src=\"./js/jquery-1.7.1.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript src=\"./js/bootstrap.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"./html5lightbox/jquery.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"./html5lightbox/html5lightbox.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n\n\n```\n\nPlugin responsibility:\n==============\n\n- remove index.html content (between the MAIN_CONTENT START and END).\n- use the rest of the page as a template\n- replace the content of all _html/* pages with the index.html template and replace all './' paths with '../' so we can still load up images, CSS, scripts etc from proper path.\n\nremember, in your _html/file1.html etc you also need to use the same pattern, i.e.: put all page content between the opening and closing tags of\n\n```\n\u003c!-- MAIN_CONTENT_START --\u003e\n...\n\u003c!-- MAIN_CONTENT_END --\u003e\n```\n\nTo execute:\n==============\n\n```\ngulp.task('headerFooterGan', function () {\n    gulp.src('./_source/*')\n        .pipe(headerfootergen('./index.html')).on('error', handleError)\n        .pipe(gulp.dest('./_html/'))\n});\n\nfunction handleError(err) {\n    console.log(err.toString());\n    this.emit('end');\n}\n```\n\nDemo:\n==============\nhttps://github.com/born2net/webSiteBoilerplate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborn2net%2Fgulp-header-footer-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborn2net%2Fgulp-header-footer-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborn2net%2Fgulp-header-footer-gen/lists"}