All Projects → justwriteclick → versions-jekyll

justwriteclick / versions-jekyll

Licence: MIT license
An example site and repo for controlling versions of content in a web site.

Programming Languages

shell
77523 projects
ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to versions-jekyll

presidium
Presidium user documentation
Stars: ✭ 25 (+38.89%)
Mutual labels:  github-page, documentation-tool
Jekyll Rtd Theme
Just another documentation theme compatible with GitHub Pages
Stars: ✭ 92 (+411.11%)
Mutual labels:  github-page, documentation-tool
Varadbhogayata.github.io
My Portfolio - Personal Website
Stars: ✭ 95 (+427.78%)
Mutual labels:  github-page
hugo-deploy
Easily deploy Hugo sites to Github Pages
Stars: ✭ 11 (-38.89%)
Mutual labels:  github-page
Leetcode Viewer
用无后台、纯前端的单页应用来分享、呈现你的leetcode源码吧!
Stars: ✭ 212 (+1077.78%)
Mutual labels:  github-page
Hanuman
A responsive, lightning-fast Jekyll theme built using AMP (Accelerated Mobile Pages) to speed up your blogs and websites.
Stars: ✭ 100 (+455.56%)
Mutual labels:  github-page
Bga issue blog
Flutter 或 Vue 全家桶(Vue + VueRouter + Vuex + Axios)抓取 GitHub 上的 Issues,结合 GitHub Pages 搭建个人博客站点,支持 GitHub 登录和评论
Stars: ✭ 249 (+1283.33%)
Mutual labels:  github-page
Github Pages Gallery
A zero dollar solution to host your photo/video gallery online using Github pages and GitHub Actions. No coding necessary.
Stars: ✭ 77 (+327.78%)
Mutual labels:  github-page
osmosfeed
Turn GitHub into an RSS reader
Stars: ✭ 839 (+4561.11%)
Mutual labels:  github-page
Godot Ci
Docker image to export Godot Engine games. Templates for Gitlab CI and GitHub Actions to deploy to GitLab Pages/GitHub Pages/Itch.io.
Stars: ✭ 168 (+833.33%)
Mutual labels:  github-page
bocco
Generate API documentation from Markdown
Stars: ✭ 39 (+116.67%)
Mutual labels:  documentation-tool
Kickster
Worry-free deploying to GitHub Pages using Jekyll
Stars: ✭ 151 (+738.89%)
Mutual labels:  github-page
Vblog
使用GitHub API 搭建一个可动态发布文章的博客
Stars: ✭ 1,375 (+7538.89%)
Mutual labels:  github-page
vue-d3-template
A template project for using Vue with D3.js (easy serve on github.io)
Stars: ✭ 16 (-11.11%)
Mutual labels:  github-page
Api-Doc
A Technology for Rest API Documentation 💻 📜 "Dockerized"
Stars: ✭ 14 (-22.22%)
Mutual labels:  documentation-tool
Paperclipfans
Hi~ 这里是 回形针 PaperClip 非官方的资料整理仓库,我们迫切的希望您的帮助整理,这将加速我们的网站维护每一期的文字稿及图片内容。
Stars: ✭ 85 (+372.22%)
Mutual labels:  github-page
Gatsby Docs Kit
📃Easy to Maintain Markdown/React Documentation Static Websites
Stars: ✭ 117 (+550%)
Mutual labels:  github-page
Pat
PAT OJ exercises in C language 浙江大学PAT纯C语言题解,欢迎改进建议
Stars: ✭ 245 (+1261.11%)
Mutual labels:  github-page
apihandyman.io
The apihandyman.io website
Stars: ✭ 14 (-22.22%)
Mutual labels:  github-page
RTFMbot
Discord bot for programming, runs code (600+ langs), queries/show docs and references
Stars: ✭ 184 (+922.22%)
Mutual labels:  documentation-tool

Test for versions

Fork me! This way you can see for yourself how versioning works on web sites where the source files are in GitHub, using Jekyll and collections.

Here are the general concepts:

  • 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.
  • The versions of the output are not semantically meaningful, and can have silly names if needed.
  • The collection settings in the _config.yml sets the destination folder at build time for the versions.
  • 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.
  • The master branch always reflects the current version.
  • Minimal Mistakes is the theme in use, which supports collections.
  • 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?

Source (files and folders under version control)

GitHub organization/repository:

_config.yml
index.html
_pages/release-notes.md
_installguide/introduction.md
_installguide/deployment.md

The _config.yml build configuration file contains collections for each deliverable, such as an install guide:

# Collections
collections:
  current:
    output: true
    permalink: /:collection/:path
    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.
    title: Latest Release
  "4.1": # quoting version number to avoid the error: undefined method `gsub' for 4.1:Float
    output: true
    permalink: /:collection/:path
    version: "4.1"
    title: Release 4.1 - Lord Chuggington
  "4.1.1":
    output: true
    permalink: /:collection/:path
    version: "4.1.1"
    title: Release 4.1.1 - Bunny Slippers

Previously, 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.

Build 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.

$ bundle exec jekyll build --config _config.yml,_config.x.y.yml --destination _site/x.y

Output (static site files and folders)

The 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.

This repo is considered to be a project page from GitHub Page's perspective, so the org name and repo name are both represented.

versions-jekyll/4.1/index.html
versions-jekyll/4.1/release-notes/index.html
versions-jekyll/4.1/install-guide/introduction/index.html
versions-jekyll/4.1/install-guide/deployment/index.html
versions-jekyll/latest/index.html
versions-jekyll/latest/release-notes/index.html
versions-jekyll/latest/install-guide/introduction/index.html
versions-jekyll/latest/install-guide/deployment/index.html

Concepts

I think that there's no way to have nested collections with Jekyll. So 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.

When 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.

When 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}}.

The 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.

Here'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.

Jekyll Variable Portion of URL Considerations
site.url https://orgname.github.io What happens when using a user repo or a custom domain name?
site.baseurl /repo-name Used with project repos only, set in _config.yml.
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?
site.collection /current or /4.1 Defined in _config.yml, would need to change
collection based on a stable/versionnumber branch or master branch, where /current maps to master branch.
page.collection installguide Defined in the _config.yml.
page.url /install-guide/introduction/index.html Defined in the permalink metadata in each .md file.
permalink: /install-guide/introduction/
Jekyll Variable Portion of URL
site.url https://orgname.github.io
site.baseurl /repo-name
base_path https://orgname.github.io/repo-name redirects to: http://docs.example.com
site.collection /current or /4.1
page.url /install-guide/introduction/index.html
permalink: /install-guide/introduction/

Search considerations

What 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.

Currently, however, there's no way to ignore certain files like main.css when building an index for content.

References

http://downtothewire.io/2015/08/15/configuring-jekyll-for-user-and-project-github-pages/

https://mademistakes.com/articles/using-jekyll-2016/

https://mademistakes.com/work/minimal-mistakes-jekyll-theme/

License

The MIT License (MIT)

Copyright (c) 2017 Michael Rose

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].