{"id":14156565,"url":"https://github.com/contentz-tech/contentz","last_synced_at":"2025-08-06T03:30:38.155Z","repository":{"id":44843504,"uuid":"171311160","full_name":"contentz-tech/contentz","owner":"contentz-tech","description":"Create Content, Get a Highly Optimized Website","archived":true,"fork":false,"pushed_at":"2024-04-18T22:03:37.000Z","size":958,"stargazers_count":55,"open_issues_count":5,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-17T08:07:29.172Z","etag":null,"topics":["dark-mode","frontmatter","mdx","offline-first","react","ssg","static-site","static-site-generator"],"latest_commit_sha":null,"homepage":"https://contentz.tech","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contentz-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"sergiodxa","custom":"https://www.paypal.me/sergiodxa"}},"created_at":"2019-02-18T15:46:42.000Z","updated_at":"2024-08-17T08:07:41.345Z","dependencies_parsed_at":"2024-08-17T08:17:38.250Z","dependency_job_id":null,"html_url":"https://github.com/contentz-tech/contentz","commit_stats":null,"previous_names":["sergiodxa/contentz"],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentz-tech%2Fcontentz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentz-tech%2Fcontentz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentz-tech%2Fcontentz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentz-tech%2Fcontentz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contentz-tech","download_url":"https://codeload.github.com/contentz-tech/contentz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228835538,"owners_count":17979162,"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":["dark-mode","frontmatter","mdx","offline-first","react","ssg","static-site","static-site-generator"],"created_at":"2024-08-17T08:06:26.759Z","updated_at":"2024-12-09T04:30:38.707Z","avatar_url":"https://github.com/contentz-tech.png","language":"JavaScript","funding_links":["https://patreon.com/sergiodxa","https://www.paypal.me/sergiodxa","https://www.patreon.com/sergiodxa"],"categories":["static-site-generator"],"sub_categories":[],"readme":"# Contentz\n\n![license](https://badgen.net/github/license/sergiodxa/contentz)\n![releases](https://badgen.net/github/releases/sergiodxa/contentz)\n![npm version](https://badgen.net/npm/v/contentz)\n![dependencies](https://badgen.net/david/dep/sergiodxa/contentz)\n\nCreate Content, Get a Highly Optimized Website\n\n\u003ca href=\"https://www.patreon.com/sergiodxa\"\u003e\n\t\u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\" width=\"160\"\u003e\n\u003c/a\u003e\n\n- Use **MDX** to write articles and pages\n- Support **Incremental Build**\n- **Offline First**\n- Use **Frontmatter** to define metadata for your articles and pages\n- **Prefetch** every internal link used in your content\n- Get an archive page with linked and prefetched articles\n- Get a homepage with links to social networks\n- Good Looking **Responsive Design**\n- Automatic **Dark Mode** (in Safari)\n- Apply **CSS in MDX** using the `css` prop and the `css` template tag\n- **Internationalization**\n- Generate **social images** (Open Graph) in a single command\n- Automatically generate **table of contents**\n\n## Install it\n\nInstall it using npm or yarn with a simple command\n\n```bash\nyarn add contentz\n# npm install contentz\n```\n\n## Use it\n\nAfter you have installed Contentz you could use it with a simple command.\n\n```bash\ncontentz build\n```\n\nThat will read your files and generate your website for you.\n\n## Create configuration\n\nCreate a configuration file called `config.yml`\n\n```yml\n---\ntitle: Sergio Xalambrí\ndescription: Senior Software Engineer and Technical Writer\ndomain: https://sergiodxa.com\nlanguage: en\nrepository: https://github.com/sergiodxa/personal-site/\nemail: hello@sergiodxa.com\npatreon: sergiodxa\nanalytics: UA-XXXXXXXXX-2\nsocial:\n  twitter: sergiodxa\n  github: sergiodxa\n  npm: sergiodxa\n  linkedin: sergiodxa\n  dev: sergiodxa\n  meetup: 182915204\nnavigation:\n  - name: About\n    path: /about\n  - name: Services\n    path: /services\n```\n\n### Table of options\n\n| Option      | Description                                                                         | Required                                   |\n| ----------- | ----------------------------------------------------------------------------------- | ------------------------------------------ |\n| title       | The title of the website, used in the `\u003ctitle\u003e` and in the homepage                 | No (default: `Just another Contentz site`) |\n| description | The description of the website, used in the `\u003cmeta\u003e` and in the homepage            | No (default: empty description)            |\n| domain      | The domain you are going to use to host the website, used in the RSS feed           | Yes                                        |\n| language    | The main language of the website, used as fallback for articles and pages           | No (default: en)                           |\n| repository  | The GitHub repository hosting the website, used in the footer of articles and pages | No (default: hide link to edit)            |\n| email       | Your email address, used on the Email icon in the homepage                          | No (default: hide icon)                    |\n| patreon     | Your Patreon username, used in the homepage and the footer                          | No (default: hiden patreon message)        |\n| analytics   | Your Analytics UA                                                                   | No (default: hide analytics)               |\n| social      | A list of your social networks, used to link them in the homepage                   | No (default: hide social icons)            |\n| navigation  | A list of pages to link in the header                                               | No (default: don't add extra links)        |\n| sw          | Set it as `false` if you want to disable SW generation                              | No (default: true)                         |\n| incremental | Set it as `false` if you want to disable incremental build                          | No (default: true)                         |\n| icon        | Set the path of the favicon of the website                                          | No (default: `/static/favicon.png`)        |\n\n#### Possible social networks\n\n- [Twitter](https://twitter.com/)\n- [GitHub](https://github.com/)\n- [npm](https://twitter.com/)\n- [LinkedIn](https://www.linkedin.com/)\n- [Dev](https://dev.to/)\n- [Meetup](https://www.meetup.com/)\n\nFor other Social Networks send a PR with a new [icon](https://github.com/sergiodxa/contentz/tree/master/src/components/icons) and add a way to [format the URL](https://github.com/sergiodxa/contentz/blob/master/src/components/home.js#L8-L27) for that icon.\n\n## Start Writing\n\nCreate a folder `/articles` and put your `.mdx` files there, here's an example post.\n\n```markdown\n---\ntitle: My super cool article\ndescription: This is the description of the article\ndate: 2018-01-01T00:00:00.000Z\npublished: true\n---\n\nThis is my content, here I could use markdown or import a component and render it.\n```\n\nNow run `contentz` and it will create a `/public` directory with your homepage, archive page and article. You could access your archive at `/articles/` and each article as `/articles/:article/`, in the example you may see it at `/articles/my-super-cool-article`.\n\n## Custom Pages\n\nFor custom pages create a `/pages` folder and put your `.mdx` files there, here's an example page.\n\n```markdown\n---\ntitle: About me\n---\n\nHi! I'm an example page.\n```\n\nNow run `contentz` and it will create a `/public` directory with your homepage and pages. Each page will be put at the base level of `public`, that mean your `/pages/about.mdx` could be accessed as `/about/` in your browser and not `/pages/about`.\n\n## Link Sharing\n\nIn case you want to have a page to share interesting links you could create a `link.yml` file at the root of your project. Then run `contentz` and it will automatically generate a `/link/` page for you with a list of all your links. Each link should have `url`, `title`, `comment` and `date` key. Example file:\n\n```yml\n---\n- url: https://sergiodxa.com/\n  title: Sergio Xalambrí\n  comment: The website of the creator of Contentz\n  date: 2019-01-28T19:44:10.945Z\n- url: https://sergiodxa.dev/\n  title: sergiodxa.dev\n  comment: The alias of the website of the creator of Contentz\n  date: 2019-01-28T19:44:10.945Z\n```\n\n## Error Page\n\nContentz will automatically generate an error page on `/404.html`, when deploying you could redirect not found pages to `/404.html`.\n\nIf you deploy to Netlify it will pick up that file automatically.\n\n## Service Worker and Offline Mode\n\nContentz generate a SW automatically for you, this SW will cache every request to your own website (using `location.origin`). It will not cache request to another domain.\n\nThis behavior could be disabled adding `sw: false` to your `config.yml` file. Adding this will also delete de `sw.js` and `load-sw.js` to avoid cached access to the and create the `unload-sw.js` file.\n\n## RSS Feed\n\nContentz will generate a valid RSS Atom feed automatically with your list of articles, it will be placed in `/atom.xml` and a `\u003cmeta\u003e` tag will be automatically added for you in each page to make it discoverable.\n\n## Static Files\n\nIf you want to link to static files like images, videos, etc. create a `/static` folder and put all your files there. When running `content` they will be automatically copied to `/public/static`\n\n## Style in MDX\n\nIn case you want to add an HTML tag with custom styles directly in your MDX content you could use the [`css` prop](https://emotion.sh/docs/css-prop) and the [`css` template tag](https://emotion.sh/docs/css-prop#string-styles) of [Emotion](https://emotion.sh/).\n\nExample:\n\n```js\n\u003cdiv css={{ color: \"red\" }}\u003eThis is red\u003c/div\u003e\n\u003cdiv css={css`color: blue`}\u003eThis is blue\u003c/div\u003e\n```\n\n## Incremental Build\n\nContentz will detect what files changed and only update the related files. This mean if you add a new link only `/link/` will be regenerated, but if you change an article the article pages, the list of articles and the RSS feed will be regenerated.\n\nIn the case you update the configuration or you update Contentz version all pages will be regenerated.\n\nIf you want to opt-out of this feature set `incremental: false` in your `config.yml`. This will automatically invalidate previous caches and always generate all pages.\n\n## Social Image\n\nContentz could also automatically generate social images (aka Open Graph) for you to use in your articles and pages. To use it run the command:\n\n```bash\ncontentz social [path]\n```\n\nWhere `[path]` is the file to use to generate the social image. It could also be more than one file adding an space between them.\n\n```bash\ncontentz social [path1] [path2]\n```\n\nA path could be a path for an article, a post or one of the auto generated pages.\n\n- home\n- archive/articles\n- links\n- error\n\nIf you want to generate them initially run\n\n```bash\ncontentz social home articles links error\n```\n\nAfter generating the social images you will see a folder `/static/_social` with your images, pages will be placed in `/static/_social/pages` and articles in `/static/_social/article`, special pages will be at the root of `_social`.\n\n## Internationalization\n\nContentz support i18n out of the box for the fixed texts of the website, text like the Patreon support or edit on GitHub. To change the main language of your website set the key `language` or the key `lang` (language is prefered) to the language code.\n\nSupported languages are `es` for Spanish and `en` for English (default to English in case of invalid language code).\n\nIf your language is not supported [add a JSON with the messages](https://github.com/sergiodxa/contentz/tree/master/src/messages) and [load it in the i18n lib](https://github.com/sergiodxa/contentz/blob/master/src/lib/i18n.js). Then send a PR to add it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentz-tech%2Fcontentz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontentz-tech%2Fcontentz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentz-tech%2Fcontentz/lists"}