{"id":20364457,"url":"https://github.com/justwriteclick/versions-jekyll","last_synced_at":"2025-04-12T04:44:52.377Z","repository":{"id":73642111,"uuid":"93699009","full_name":"justwriteclick/versions-jekyll","owner":"justwriteclick","description":"An example site and repo for controlling versions of content in a web site.","archived":false,"fork":false,"pushed_at":"2018-09-02T18:50:28.000Z","size":2481,"stargazers_count":20,"open_issues_count":0,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T04:44:46.416Z","etag":null,"topics":["docs-as-code","documentation","documentation-tool","github-page","jekyll"],"latest_commit_sha":null,"homepage":"https://justwriteclick.github.io/versions-jekyll/","language":"Shell","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/justwriteclick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"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}},"created_at":"2017-06-08T02:25:29.000Z","updated_at":"2025-01-05T14:06:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"9156f16f-ac44-4674-940a-0cdfcb35cac9","html_url":"https://github.com/justwriteclick/versions-jekyll","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justwriteclick%2Fversions-jekyll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justwriteclick%2Fversions-jekyll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justwriteclick%2Fversions-jekyll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justwriteclick%2Fversions-jekyll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justwriteclick","download_url":"https://codeload.github.com/justwriteclick/versions-jekyll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519473,"owners_count":21117757,"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":["docs-as-code","documentation","documentation-tool","github-page","jekyll"],"created_at":"2024-11-15T00:11:58.611Z","updated_at":"2025-04-12T04:44:52.371Z","avatar_url":"https://github.com/justwriteclick.png","language":"Shell","readme":"# [Test for versions](http://docslikecode.com)\n\nFork me! This way you can see for yourself how versioning works on web sites where the source files are in GitHub, using [Jekyll](https://jekyllrb.com) and [collections](https://jekyllrb.com/docs/collections/).\n\n- [Source (files and folders under version control)](#source-files-and-folders-under-version-control)\n- [Output (static site files and folders)](#output-static-site-files-and-folders)\n- [Concepts](#concepts)\n- [References](#references)\n- [License](#license)\n\nHere are the general concepts:\n\n- The version control of source is done with git through stable branches or tags, but the version control of output does not depend on stable branches.\n- The versions of the output are not semantically meaningful, and can have silly names if needed.\n- The collection settings in the `_config.yml` sets the destination folder at build time for the versions.\n- The output goes to GitHub Pages, in separate folders per release, so that the URL also reflects the version number the person is reading on a page.\n- The `master` branch always reflects the current version.\n- Minimal Mistakes is the theme in use, which supports collections.\n- On the front-end, you'd still need to design for scenarios such as \"What if the page I want to access on version 4.1.1 does not exist in version 4.1.1? Do you give a 404 error or a special \"not found\" page when navigating versions?\n\n## Source (files and folders under version control)\n\nGitHub organization/repository:\n\n```\n_config.yml\nindex.html\n_pages/release-notes.md\n_installguide/introduction.md\n_installguide/deployment.md\n```\n\nThe `_config.yml` build configuration file contains collections for each deliverable, such as an install guide:\n\n```\n# Collections\ncollections:\n  current:\n    output: true\n    permalink: /:collection/:path\n    version: current # Depending on your requirements, you may not need this variable. Also you may be able to default it using :collection, but I haven't tried that.\n    title: Latest Release\n  \"4.1\": # quoting version number to avoid the error: undefined method `gsub' for 4.1:Float\n    output: true\n    permalink: /:collection/:path\n    version: \"4.1\"\n    title: Release 4.1 - Lord Chuggington\n  \"4.1.1\":\n    output: true\n    permalink: /:collection/:path\n    version: \"4.1.1\"\n    title: Release 4.1.1 - Bunny Slippers\n```\n\nPreviously, the collection configuration  was used for publishing to a /releasenumber directory. Now, this repo uses `baseurl` set in the `_config.yml` file to indicate a version value.\n\nBuild with a script, writing the added release number collections into a new `_config.x.y.yml` file for each stable branch, where the `_config.x.y.yml` file has `baseurl: x.y`.\n\n```\n$ bundle exec jekyll build --config _config.yml,_config.x.y.yml --destination _site/x.y\n```\n\n## Output (static site files and folders)\n\nThe website's URL is this: `[https://justwriteclick.github.io/versions-jekyll/](https://justwriteclick.github.io/versions-jekyll/)` and then all the folders below are what are output.\n\nThis repo is considered to be a project page from GitHub Page's perspective, so the org name and repo name are both represented.\n\n\n```\nversions-jekyll/4.1/index.html\nversions-jekyll/4.1/release-notes/index.html\nversions-jekyll/4.1/install-guide/introduction/index.html\nversions-jekyll/4.1/install-guide/deployment/index.html\nversions-jekyll/latest/index.html\nversions-jekyll/latest/release-notes/index.html\nversions-jekyll/latest/install-guide/introduction/index.html\nversions-jekyll/latest/install-guide/deployment/index.html\n```\n\n## Concepts\n\nI think that there's no way to have nested collections with Jekyll.\nSo you either have to use collections for the versions, and permalink metadata for the guides, or put the version in the permalink metadata when using collections.\n\nWhen using permalink metadata per markdown file for version, you can search-and-replace at release time, replacing `/current` (which remains as the `master` branch permalink) with `/4.1` as the release value.\n\nWhen using `baseurl` from the `_confg.yml` file at build time, you can build to an x.y folder with the correct relative links for everything, as long as your cross-references use `{{site.baseurl}}`.\n\nThe website's URL is this: `[https://justwriteclick.github.io/versions-jekyll/](https://justwriteclick.github.io/versions-jekyll/)` and then all the folders below are what are output.\n\nHere's a mapping of what Jekyll data is represented in each portion of the URL. This repo is considered to be a project page from GitHub Page's perspective, so the org name and repo name are both represented.\n\n| Jekyll Variable    | Portion of URL | Considerations|\n|--------------------|----------------|---------------|\n| `site.url`         | https://orgname.github.io              | What happens when using a user repo or a custom domain name?                                         |\n| `site.baseurl`     | /repo-name                             | Used with project repos only, set in `_config.yml`.         |\n| `base_path`        | https://orgname.github.io/repo-name    | Currently used in cross references, but with a version representing site.collection, would cross-references always point to `/current`? Is `base_path` only defined in some themes?                                     |\n| `site.collection`  | /current or /4.1 | Defined in _config.yml, would need to change                |\n| `collection` | based on a `stable/versionnumber` branch or | `master` branch, where /current maps to master branch.      |\n| `page.collection`  | installguide | Defined in the _config.yml.                                 |\n| `page.url`         | /install-guide/introduction/index.html | Defined in the permalink metadata in each .md file.         | Need to have a version of each install guide.\n| `permalink: /install-guide/introduction/`                   |\n\n\n| Jekyll Variable    | Portion of URL                         |\n|--------------------|----------------------------------------|\n| `site.url`         | https://orgname.github.io              |\n| `site.baseurl`     | /repo-name                             |\n| `base_path`        | https://orgname.github.io/repo-name redirects to:  http://docs.example.com              |\n| `site.collection`  | /current or /4.1                       |\n| `page.url`         | /install-guide/introduction/index.html |\n| `permalink:`       | /install-guide/introduction/           |\n\n\n## Search considerations\n\nWhat I'm working on next is setting up a `search_data.json` file template so that the output for `versions-jekyll/latest` using Lunr.js.\n\nCurrently, however, there's no way to ignore certain files like `main.css` when building an index for content.\n\n## References\n\nhttp://downtothewire.io/2015/08/15/configuring-jekyll-for-user-and-project-github-pages/\n\nhttps://mademistakes.com/articles/using-jekyll-2016/\n\nhttps://mademistakes.com/work/minimal-mistakes-jekyll-theme/\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Michael Rose\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustwriteclick%2Fversions-jekyll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustwriteclick%2Fversions-jekyll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustwriteclick%2Fversions-jekyll/lists"}