{"id":18832362,"url":"https://github.com/brainpoint/gulp-copy-content","last_synced_at":"2026-01-25T09:30:16.300Z","repository":{"id":57257175,"uuid":"110563988","full_name":"brainpoint/gulp-copy-content","owner":"brainpoint","description":"copy file content to html","archived":false,"fork":false,"pushed_at":"2017-11-13T15:18:21.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T07:38:09.817Z","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/brainpoint.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":"2017-11-13T15:15:14.000Z","updated_at":"2017-11-13T15:18:22.000Z","dependencies_parsed_at":"2022-09-02T19:23:53.416Z","dependency_job_id":null,"html_url":"https://github.com/brainpoint/gulp-copy-content","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/brainpoint%2Fgulp-copy-content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainpoint%2Fgulp-copy-content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainpoint%2Fgulp-copy-content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainpoint%2Fgulp-copy-content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brainpoint","download_url":"https://codeload.github.com/brainpoint/gulp-copy-content/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239768935,"owners_count":19693763,"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-08T01:57:39.309Z","updated_at":"2026-01-25T09:30:16.268Z","avatar_url":"https://github.com/brainpoint.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## Installation\n\n```bash\nnpm install gulp --save-dev\nnpm install gulp-copy-content --save-dev\n```\n\n## Usage\n\n文件目录结构如下：\n\n```\n├── gulpfile.js              # gulpfile文件\n├── src/                     # 源文件目录\n\t└── index.html          \t # index.html\n  └── template/      \t   \t   # 模板目录\n      └── header.html   \t\t # 模板文件\n└── dist/                    # 编译目录\n```\n\nhtml文件，代码如下\n\n```html\n\t\u003c!--copyContent \"src/template/header.html\"--\u003e\n```\n\n在根目录创建gulpfile.js，代码如下\n\n```js\nvar gulp = require('gulp');\nvar precompile = require('gulp-copy-content');\n\ngulp.task('copy', function(){\n    return gulp.src('src/*.html')\n       .pipe(precompile({\n              reg: /\u003c!\\-\\-copyContent\\s+\"([^\"]+)\"\\s+\\-\\-\u003e/g,  // 匹配的文件正则.\n              baseSrc: \"\", // 设置根目录之后不需要编写完整的路径.\n        }))\n       .pipe(gulp.dest('dist/'))\n});\n\n```\n\n执行\n\n```bash\n\tgulp copy\n```\n\ntask结束后会将制定的文件内容复制到注释的位置.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainpoint%2Fgulp-copy-content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainpoint%2Fgulp-copy-content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainpoint%2Fgulp-copy-content/lists"}